Permalink
Browse files

Implement more style checks around whitespace

  • Loading branch information...
1 parent ddfc0ca commit 08e5431d995a88d443c06406520e62e2e0d02034 @srowen srowen committed Jun 24, 2016
Showing with 186 additions and 163 deletions.
  1. +1 −1 android/src/com/google/zxing/client/android/DecodeFormatManager.java
  2. +1 −1 android/src/com/google/zxing/client/android/DecodeHintManager.java
  3. +1 −1 android/src/com/google/zxing/client/android/InactivityTimer.java
  4. +3 −3 core/src/main/java/com/google/zxing/client/result/ExpandedProductParsedResult.java
  5. +8 −8 core/src/main/java/com/google/zxing/client/result/VCardResultParser.java
  6. +3 −3 core/src/main/java/com/google/zxing/common/BitMatrix.java
  7. +1 −1 core/src/main/java/com/google/zxing/common/GlobalHistogramBinarizer.java
  8. +2 −2 core/src/main/java/com/google/zxing/common/reedsolomon/GenericGF.java
  9. +11 −11 core/src/main/java/com/google/zxing/datamatrix/decoder/BitMatrixParser.java
  10. +8 −8 core/src/main/java/com/google/zxing/datamatrix/detector/Detector.java
  11. +18 −6 core/src/main/java/com/google/zxing/maxicode/decoder/DecodedBitStreamParser.java
  12. +2 −2 core/src/main/java/com/google/zxing/oned/CodaBarReader.java
  13. +3 −3 core/src/main/java/com/google/zxing/oned/Code128Reader.java
  14. +1 −1 core/src/main/java/com/google/zxing/oned/ITFWriter.java
  15. +1 −1 core/src/main/java/com/google/zxing/oned/MultiFormatOneDReader.java
  16. +1 −1 core/src/main/java/com/google/zxing/oned/rss/DataCharacter.java
  17. +1 −1 core/src/main/java/com/google/zxing/oned/rss/FinderPattern.java
  18. +2 −2 core/src/main/java/com/google/zxing/oned/rss/RSS14Reader.java
  19. +5 −5 core/src/main/java/com/google/zxing/oned/rss/expanded/BitArrayBuilder.java
  20. +1 −1 core/src/main/java/com/google/zxing/oned/rss/expanded/ExpandedPair.java
  21. +18 −18 core/src/main/java/com/google/zxing/oned/rss/expanded/RSSExpandedReader.java
  22. +1 −1 core/src/main/java/com/google/zxing/oned/rss/expanded/decoders/AI01320xDecoder.java
  23. +3 −3 core/src/main/java/com/google/zxing/oned/rss/expanded/decoders/AI01393xDecoder.java
  24. +1 −1 core/src/main/java/com/google/zxing/oned/rss/expanded/decoders/AI013x0x1xDecoder.java
  25. +2 −2 core/src/main/java/com/google/zxing/oned/rss/expanded/decoders/AI01decoder.java
  26. +1 −1 core/src/main/java/com/google/zxing/oned/rss/expanded/decoders/AI01weightDecoder.java
  27. +5 −5 core/src/main/java/com/google/zxing/oned/rss/expanded/decoders/AbstractExpandedDecoder.java
  28. +3 −3 core/src/main/java/com/google/zxing/oned/rss/expanded/decoders/CurrentParsingState.java
  29. +2 −2 core/src/main/java/com/google/zxing/oned/rss/expanded/decoders/DecodedChar.java
  30. +5 −5 core/src/main/java/com/google/zxing/oned/rss/expanded/decoders/DecodedInformation.java
  31. +6 −6 core/src/main/java/com/google/zxing/oned/rss/expanded/decoders/DecodedNumeric.java
  32. +1 −1 core/src/main/java/com/google/zxing/oned/rss/expanded/decoders/DecodedObject.java
  33. +6 −6 core/src/main/java/com/google/zxing/oned/rss/expanded/decoders/FieldParser.java
  34. +23 −23 core/src/main/java/com/google/zxing/oned/rss/expanded/decoders/GeneralAppIdDecoder.java
  35. +1 −1 core/src/main/java/com/google/zxing/pdf417/decoder/ec/ModulusGF.java
  36. +1 −1 core/src/main/java/com/google/zxing/qrcode/decoder/DataMask.java
  37. +1 −1 core/src/main/java/com/google/zxing/qrcode/encoder/Encoder.java
  38. +2 −2 core/src/test/java/com/google/zxing/common/BitMatrixTestCase.java
  39. +1 −1 core/src/test/java/com/google/zxing/oned/rss/expanded/BinaryUtil.java
  40. +4 −4 core/src/test/java/com/google/zxing/oned/rss/expanded/BinaryUtilTest.java
  41. +4 −4 core/src/test/java/com/google/zxing/oned/rss/expanded/BitArrayBuilderTest.java
  42. +1 −1 core/src/test/java/com/google/zxing/oned/rss/expanded/RSSExpandedInternalTestCase.java
  43. +2 −2 javase/src/main/java/com/google/zxing/client/j2se/DecoderConfig.java
  44. +7 −0 pom.xml
  45. +9 −5 src/checkstyle/checkstyle.xml
  46. +2 −2 zxing.appspot.com/src/main/java/com/google/zxing/web/generator/client/Generator.java
@@ -78,7 +78,7 @@ private DecodeFormatManager() {}
static Set<BarcodeFormat> parseDecodeFormats(Uri inputUri) {
List<String> formats = inputUri.getQueryParameters(Intents.Scan.FORMATS);
- if (formats != null && formats.size() == 1 && formats.get(0) != null){
+ if (formats != null && formats.size() == 1 && formats.get(0) != null) {
formats = Arrays.asList(COMMA_PATTERN.split(formats.get(0)));
}
return parseDecodeFormats(formats, inputUri.getQueryParameter(Intents.Scan.MODE));
@@ -103,7 +103,7 @@ private DecodeHintManager() {}
String name = query.substring(pos, equ);
name = name.replace('+', ' '); // Preemptively decode +
name = Uri.decode(name);
- String text = query.substring(equ+1, amp);
+ String text = query.substring(equ + 1, amp);
text = text.replace('+', ' '); // Preemptively decode +
text = Uri.decode(text);
if (!map.containsKey(name)) {
@@ -86,7 +86,7 @@ void shutdown() {
private final class PowerStatusReceiver extends BroadcastReceiver {
@Override
- public void onReceive(Context context, Intent intent){
+ public void onReceive(Context context, Intent intent) {
if (Intent.ACTION_BATTERY_CHANGED.equals(intent.getAction())) {
// 0 indicates that we're on battery
boolean onBatteryNow = intent.getIntExtra(BatteryManager.EXTRA_PLUGGED, -1) <= 0;
@@ -91,12 +91,12 @@ public ExpandedProductParsedResult(String rawText,
}
@Override
- public boolean equals(Object o){
+ public boolean equals(Object o) {
if (!(o instanceof ExpandedProductParsedResult)) {
return false;
}
- ExpandedProductParsedResult other = (ExpandedProductParsedResult)o;
+ ExpandedProductParsedResult other = (ExpandedProductParsedResult) o;
return equalsOrNull(productID, other.productID)
&& equalsOrNull(sscc, other.sscc)
@@ -118,7 +118,7 @@ private static boolean equalsOrNull(Object o1, Object o2) {
}
@Override
- public int hashCode(){
+ public int hashCode() {
int hash = 0;
hash ^= hashNotNull(productID);
hash ^= hashNotNull(sscc);
@@ -146,14 +146,14 @@ public AddressBookParsedResult parse(Result result) {
int matchStart = i; // Found the start of a match here
- while ((i = rawText.indexOf((int) '\n', i)) >= 0) { // Really, end in \r\n
+ while ((i = rawText.indexOf('\n', i)) >= 0) { // Really, end in \r\n
if (i < rawText.length() - 1 && // But if followed by tab or space,
- (rawText.charAt(i+1) == ' ' || // this is only a continuation
- rawText.charAt(i+1) == '\t')) {
+ (rawText.charAt(i + 1) == ' ' || // this is only a continuation
+ rawText.charAt(i + 1) == '\t')) {
i += 2; // Skip \n and continutation whitespace
} else if (quotedPrintable && // If preceded by = in quoted printable
- ((i >= 1 && rawText.charAt(i-1) == '=') || // this is a continuation
- (i >= 2 && rawText.charAt(i-2) == '='))) {
+ ((i >= 1 && rawText.charAt(i - 1) == '=') || // this is a continuation
+ (i >= 2 && rawText.charAt(i - 2) == '='))) {
i++; // Skip \n
} else {
break;
@@ -168,7 +168,7 @@ public AddressBookParsedResult parse(Result result) {
if (matches == null) {
matches = new ArrayList<>(1); // lazy init
}
- if (i >= 1 && rawText.charAt(i-1) == '\r') {
+ if (i >= 1 && rawText.charAt(i - 1) == '\r') {
i--; // Back up over \r, which really should be there
}
String element = rawText.substring(matchStart, i);
@@ -218,9 +218,9 @@ private static String decodeQuotedPrintable(CharSequence value, String charset)
break;
case '=':
if (i < length - 2) {
- char nextChar = value.charAt(i+1);
+ char nextChar = value.charAt(i + 1);
if (nextChar != '\r' && nextChar != '\n') {
- char nextNextChar = value.charAt(i+2);
+ char nextNextChar = value.charAt(i + 2);
int firstDigit = parseHexDigit(nextChar);
int secondDigit = parseHexDigit(nextNextChar);
if (firstDigit >= 0 && secondDigit >= 0) {
@@ -102,7 +102,7 @@ public static BitMatrix parse(String stringRepresentation, String setString, Str
// no EOL at end?
if (bitsPos > rowStartPos) {
- if(rowLength == -1) {
+ if (rowLength == -1) {
rowLength = bitsPos - rowStartPos;
} else if (bitsPos - rowStartPos != rowLength) {
throw new IllegalArgumentException("row lengths do not match");
@@ -254,7 +254,7 @@ public void rotate180() {
int height = getHeight();
BitArray topRow = new BitArray(width);
BitArray bottomRow = new BitArray(width);
- for (int i = 0; i < (height+1) / 2; i++) {
+ for (int i = 0; i < (height + 1) / 2; i++) {
topRow = getRow(i, topRow);
bottomRow = getRow(height - 1 - i, bottomRow);
topRow.reverse();
@@ -335,7 +335,7 @@ public void rotate180() {
int theBits = bits[bitsOffset];
int bit = 0;
- while ((theBits << (31-bit)) == 0) {
+ while ((theBits << (31 - bit)) == 0) {
bit++;
}
x += bit;
@@ -118,7 +118,7 @@ public BitMatrix getBlackMatrix() throws NotFoundException {
byte[] localLuminances = source.getMatrix();
for (int y = 0; y < height; y++) {
int offset = y * width;
- for (int x = 0; x< width; x++) {
+ for (int x = 0; x < width; x++) {
int pixel = localLuminances[offset + x] & 0xff;
if (pixel < blackPoint) {
matrix.set(x, y);
@@ -70,10 +70,10 @@ public GenericGF(int primitive, int size, int b) {
x *= 2; // we're assuming the generator alpha is 2
if (x >= size) {
x ^= primitive;
- x &= size-1;
+ x &= size - 1;
}
}
- for (int i = 0; i < size-1; i++) {
+ for (int i = 0; i < size - 1; i++) {
logTable[expTable[i]] = i;
}
// logTable[0] == 0 but this should never be used
@@ -94,22 +94,22 @@ private static Version readVersion(BitMatrix bitMatrix) throws FormatException {
if ((row == numRows) && (column == 0) && !corner1Read) {
result[resultOffset++] = (byte) readCorner1(numRows, numColumns);
row -= 2;
- column +=2;
+ column += 2;
corner1Read = true;
- } else if ((row == numRows-2) && (column == 0) && ((numColumns & 0x03) != 0) && !corner2Read) {
+ } else if ((row == numRows - 2) && (column == 0) && ((numColumns & 0x03) != 0) && !corner2Read) {
result[resultOffset++] = (byte) readCorner2(numRows, numColumns);
row -= 2;
- column +=2;
+ column += 2;
corner2Read = true;
- } else if ((row == numRows+4) && (column == 2) && ((numColumns & 0x07) == 0) && !corner3Read) {
+ } else if ((row == numRows + 4) && (column == 2) && ((numColumns & 0x07) == 0) && !corner3Read) {
result[resultOffset++] = (byte) readCorner3(numRows, numColumns);
row -= 2;
- column +=2;
+ column += 2;
corner3Read = true;
- } else if ((row == numRows-2) && (column == 0) && ((numColumns & 0x07) == 4) && !corner4Read) {
+ } else if ((row == numRows - 2) && (column == 0) && ((numColumns & 0x07) == 4) && !corner4Read) {
result[resultOffset++] = (byte) readCorner4(numRows, numColumns);
row -= 2;
- column +=2;
+ column += 2;
corner4Read = true;
} else {
// Sweep upward diagonally to the right
@@ -118,21 +118,21 @@ private static Version readVersion(BitMatrix bitMatrix) throws FormatException {
result[resultOffset++] = (byte) readUtah(row, column, numRows, numColumns);
}
row -= 2;
- column +=2;
+ column += 2;
} while ((row >= 0) && (column < numColumns));
row += 1;
- column +=3;
+ column += 3;
// Sweep downward diagonally to the left
do {
if ((row >= 0) && (column < numColumns) && !readMappingMatrix.get(column, row)) {
result[resultOffset++] = (byte) readUtah(row, column, numRows, numColumns);
}
row += 2;
- column -=2;
+ column -= 2;
} while ((row < numRows) && (column >= 0));
row += 3;
- column +=1;
+ column += 1;
}
} while ((row < numRows) || (column < numColumns));
@@ -164,7 +164,7 @@ public DetectorResult detect() throws NotFoundException {
correctedTopRight =
correctTopRightRectangular(bottomLeft, bottomRight, topLeft, topRight, dimensionTop, dimensionRight);
- if (correctedTopRight == null){
+ if (correctedTopRight == null) {
correctedTopRight = topRight;
}
@@ -189,7 +189,7 @@ public DetectorResult detect() throws NotFoundException {
int dimension = Math.min(dimensionRight, dimensionTop);
// correct top right point to match the white module
correctedTopRight = correctTopRight(bottomLeft, bottomRight, topLeft, topRight, dimension);
- if (correctedTopRight == null){
+ if (correctedTopRight == null) {
correctedTopRight = topRight;
}
@@ -224,27 +224,27 @@ private ResultPoint correctTopRightRectangular(ResultPoint bottomLeft,
int dimensionTop,
int dimensionRight) {
- float corr = distance(bottomLeft, bottomRight) / (float)dimensionTop;
+ float corr = distance(bottomLeft, bottomRight) / (float) dimensionTop;
int norm = distance(topLeft, topRight);
float cos = (topRight.getX() - topLeft.getX()) / norm;
float sin = (topRight.getY() - topLeft.getY()) / norm;
- ResultPoint c1 = new ResultPoint(topRight.getX()+corr*cos, topRight.getY()+corr*sin);
+ ResultPoint c1 = new ResultPoint(topRight.getX() + corr * cos, topRight.getY() + corr * sin);
- corr = distance(bottomLeft, topLeft) / (float)dimensionRight;
+ corr = distance(bottomLeft, topLeft) / (float) dimensionRight;
norm = distance(bottomRight, topRight);
cos = (topRight.getX() - bottomRight.getX()) / norm;
sin = (topRight.getY() - bottomRight.getY()) / norm;
- ResultPoint c2 = new ResultPoint(topRight.getX()+corr*cos, topRight.getY()+corr*sin);
+ ResultPoint c2 = new ResultPoint(topRight.getX() + corr * cos, topRight.getY() + corr * sin);
if (!isValid(c1)) {
if (isValid(c2)) {
return c2;
}
return null;
}
- if (!isValid(c2)){
+ if (!isValid(c2)) {
return c1;
}
@@ -253,7 +253,7 @@ private ResultPoint correctTopRightRectangular(ResultPoint bottomLeft,
int l2 = Math.abs(dimensionTop - transitionsBetween(topLeft, c2).getTransitions()) +
Math.abs(dimensionRight - transitionsBetween(bottomRight, c2).getTransitions());
- if (l1 <= l2){
+ if (l1 <= l2) {
return c1;
}
@@ -47,11 +47,23 @@
private static final char RS = '\u001E';
private static final String[] SETS = {
- "\nABCDEFGHIJKLMNOPQRSTUVWXYZ"+ECI+FS+GS+RS+NS+' '+PAD+"\"#$%&'()*+,-./0123456789:"+SHIFTB+SHIFTC+SHIFTD+SHIFTE+LATCHB,
- "`abcdefghijklmnopqrstuvwxyz"+ECI+FS+GS+RS+NS+'{'+PAD+"}~\u007F;<=>?[\\]^_ ,./:@!|"+PAD+TWOSHIFTA+THREESHIFTA+PAD+SHIFTA+SHIFTC+SHIFTD+SHIFTE+LATCHA,
- "\u00C0\u00C1\u00C2\u00C3\u00C4\u00C5\u00C6\u00C7\u00C8\u00C9\u00CA\u00CB\u00CC\u00CD\u00CE\u00CF\u00D0\u00D1\u00D2\u00D3\u00D4\u00D5\u00D6\u00D7\u00D8\u00D9\u00DA"+ECI+FS+GS+RS+"\u00DB\u00DC\u00DD\u00DE\u00DF\u00AA\u00AC\u00B1\u00B2\u00B3\u00B5\u00B9\u00BA\u00BC\u00BD\u00BE\u0080\u0081\u0082\u0083\u0084\u0085\u0086\u0087\u0088\u0089"+LATCHA+' '+LOCK+SHIFTD+SHIFTE+LATCHB,
- "\u00E0\u00E1\u00E2\u00E3\u00E4\u00E5\u00E6\u00E7\u00E8\u00E9\u00EA\u00EB\u00EC\u00ED\u00EE\u00EF\u00F0\u00F1\u00F2\u00F3\u00F4\u00F5\u00F6\u00F7\u00F8\u00F9\u00FA"+ECI+FS+GS+RS+NS+"\u00FB\u00FC\u00FD\u00FE\u00FF\u00A1\u00A8\u00AB\u00AF\u00B0\u00B4\u00B7\u00B8\u00BB\u00BF\u008A\u008B\u008C\u008D\u008E\u008F\u0090\u0091\u0092\u0093\u0094"+LATCHA+' '+SHIFTC+LOCK+SHIFTE+LATCHB,
- "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\u0008\u0009\n\u000B\u000C\r\u000E\u000F\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001A"+ECI+PAD+PAD+'\u001B'+NS+FS+GS+RS+"\u001F\u009F\u00A0\u00A2\u00A3\u00A4\u00A5\u00A6\u00A7\u00A9\u00AD\u00AE\u00B6\u0095\u0096\u0097\u0098\u0099\u009A\u009B\u009C\u009D\u009E"+LATCHA+' '+SHIFTC+SHIFTD+LOCK+LATCHB,
+ "\nABCDEFGHIJKLMNOPQRSTUVWXYZ" + ECI + FS + GS + RS + NS + ' ' + PAD +
+ "\"#$%&'()*+,-./0123456789:" + SHIFTB + SHIFTC + SHIFTD + SHIFTE + LATCHB,
+ "`abcdefghijklmnopqrstuvwxyz" + ECI + FS + GS + RS + NS + '{' + PAD +
+ "}~\u007F;<=>?[\\]^_ ,./:@!|" + PAD + TWOSHIFTA + THREESHIFTA + PAD +
+ SHIFTA + SHIFTC + SHIFTD + SHIFTE + LATCHA,
+ "\u00C0\u00C1\u00C2\u00C3\u00C4\u00C5\u00C6\u00C7\u00C8\u00C9\u00CA\u00CB\u00CC\u00CD\u00CE\u00CF\u00D0\u00D1\u00D2\u00D3\u00D4\u00D5\u00D6\u00D7\u00D8\u00D9\u00DA" +
+ ECI + FS + GS + RS +
+ "\u00DB\u00DC\u00DD\u00DE\u00DF\u00AA\u00AC\u00B1\u00B2\u00B3\u00B5\u00B9\u00BA\u00BC\u00BD\u00BE\u0080\u0081\u0082\u0083\u0084\u0085\u0086\u0087\u0088\u0089" +
+ LATCHA + ' ' + LOCK + SHIFTD + SHIFTE + LATCHB,
+ "\u00E0\u00E1\u00E2\u00E3\u00E4\u00E5\u00E6\u00E7\u00E8\u00E9\u00EA\u00EB\u00EC\u00ED\u00EE\u00EF\u00F0\u00F1\u00F2\u00F3\u00F4\u00F5\u00F6\u00F7\u00F8\u00F9\u00FA" +
+ ECI + FS + GS + RS + NS +
+ "\u00FB\u00FC\u00FD\u00FE\u00FF\u00A1\u00A8\u00AB\u00AF\u00B0\u00B4\u00B7\u00B8\u00BB\u00BF\u008A\u008B\u008C\u008D\u008E\u008F\u0090\u0091\u0092\u0093\u0094" +
+ LATCHA + ' ' + SHIFTC + LOCK + SHIFTE + LATCHB,
+ "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\u0008\u0009\n\u000B\u000C\r\u000E\u000F\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001A" +
+ ECI + PAD + PAD + '\u001B' + NS + FS + GS + RS +
+ "\u001F\u009F\u00A0\u00A2\u00A3\u00A4\u00A5\u00A6\u00A7\u00A9\u00AD\u00AE\u00B6\u0095\u0096\u0097\u0098\u0099\u009A\u009B\u009C\u009D\u009E" +
+ LATCHA + ' ' + SHIFTC + SHIFTD + LOCK + LATCHB,
"\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\u0008\u0009\n\u000B\u000C\r\u000E\u000F\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001A\u001B\u001C\u001D\u001E\u001F\u0020\u0021\"\u0023\u0024\u0025\u0026\u0027\u0028\u0029\u002A\u002B\u002C\u002D\u002E\u002F\u0030\u0031\u0032\u0033\u0034\u0035\u0036\u0037\u0038\u0039\u003A\u003B\u003C\u003D\u003E\u003F"
};
@@ -75,7 +87,7 @@ static DecoderResult decode(byte[] bytes, int mode) {
String country = threeDigits.format(getCountry(bytes));
String service = threeDigits.format(getServiceClass(bytes));
result.append(getMessage(bytes, 10, 84));
- if (result.toString().startsWith("[)>"+RS+"01"+GS)) {
+ if (result.toString().startsWith("[)>" + RS + "01" + GS)) {
result.insert(9, postcode + GS + country + GS + service + GS);
} else {
result.insert(0, postcode + GS + country + GS + service + GS);
@@ -93,7 +93,7 @@ public Result decodeRow(int rowNumber, BitArray row, Map<DecodeHintType,?> hints
// Hack: We store the position in the alphabet table into a
// StringBuilder, so that we can access the decoded patterns in
// validatePattern. We'll translate to the actual characters later.
- decodeRowResult.append((char)charOffset);
+ decodeRowResult.append((char) charOffset);
nextStart += 8;
// Stop as soon as we see the end character.
if (decodeRowResult.length() > 1 &&
@@ -270,7 +270,7 @@ private int findStartPattern() throws NotFoundException {
for (int j = i; j < i + 7; j++) {
patternSize += counters[j];
}
- if (i == 1 || counters[i-1] >= patternSize / 2) {
+ if (i == 1 || counters[i - 1] >= patternSize / 2) {
return i;
}
}
@@ -340,7 +340,7 @@ public Result decodeRow(int rowNumber, BitArray row, Map<DecodeHintType,?> hints
switch (code) {
case CODE_FNC_1:
if (convertFNC1) {
- if (result.length() == 0){
+ if (result.length() == 0) {
// GS1 specification 5.4.3.7. and 5.4.6.4. If the first char after the start code
// is FNC1 then this is GS1-128. We add the symbology identifier.
result.append("]C1");
@@ -396,7 +396,7 @@ public Result decodeRow(int rowNumber, BitArray row, Map<DecodeHintType,?> hints
switch (code) {
case CODE_FNC_1:
if (convertFNC1) {
- if (result.length() == 0){
+ if (result.length() == 0) {
// GS1 specification 5.4.3.7. and 5.4.6.4. If the first char after the start code
// is FNC1 then this is GS1-128. We add the symbology identifier.
result.append("]C1");
@@ -450,7 +450,7 @@ public Result decodeRow(int rowNumber, BitArray row, Map<DecodeHintType,?> hints
switch (code) {
case CODE_FNC_1:
if (convertFNC1) {
- if (result.length() == 0){
+ if (result.length() == 0) {
// GS1 specification 5.4.3.7. and 5.4.6.4. If the first char after the start code
// is FNC1 then this is GS1-128. We add the symbology identifier.
result.append("]C1");
@@ -60,7 +60,7 @@ public BitMatrix encode(String contents,
int pos = appendPattern(result, 0, START_PATTERN, true);
for (int i = 0; i < length; i += 2) {
int one = Character.digit(contents.charAt(i), 10);
- int two = Character.digit(contents.charAt(i+1), 10);
+ int two = Character.digit(contents.charAt(i + 1), 10);
int[] encoding = new int[18];
for (int j = 0; j < 5; j++) {
encoding[2 * j] = ITFReader.PATTERNS[one][j];
@@ -70,7 +70,7 @@ public MultiFormatOneDReader(Map<DecodeHintType,?> hints) {
if (possibleFormats.contains(BarcodeFormat.RSS_14)) {
readers.add(new RSS14Reader());
}
- if (possibleFormats.contains(BarcodeFormat.RSS_EXPANDED)){
+ if (possibleFormats.contains(BarcodeFormat.RSS_EXPANDED)) {
readers.add(new RSSExpandedReader());
}
}
@@ -44,7 +44,7 @@ public final String toString() {
@Override
public final boolean equals(Object o) {
- if(!(o instanceof DataCharacter)) {
+ if (!(o instanceof DataCharacter)) {
return false;
}
DataCharacter that = (DataCharacter) o;
@@ -50,7 +50,7 @@ public int getValue() {
@Override
public boolean equals(Object o) {
- if(!(o instanceof FinderPattern)) {
+ if (!(o instanceof FinderPattern)) {
return false;
}
FinderPattern that = (FinderPattern) o;
@@ -251,7 +251,7 @@ private DataCharacter decodeDataCharacter(BitArray row, FinderPattern pattern, b
evenChecksumPortion += evenCounts[i];
evenSum += evenCounts[i];
}
- int checksumPortion = oddChecksumPortion + 3*evenChecksumPortion;
+ int checksumPortion = oddChecksumPortion + 3 * evenChecksumPortion;
if (outsideChar) {
if ((oddSum & 0x01) != 0 || oddSum > 12 || oddSum < 4) {
@@ -403,7 +403,7 @@ private void adjustOddEvenCounts(boolean outsideChar, int numModules) throws Not
}
incrementOdd = true;
incrementEven = true;
- } else */if (mismatch == 1) {
+ } else */ if (mismatch == 1) {
if (oddParityBad) {
if (evenParityBad) {
throw NotFoundException.getNotFoundInstance();
Oops, something went wrong.

0 comments on commit 08e5431

Please sign in to comment.