Clean up whitespace (#800)

This commit is contained in:
David Sanders 2017-05-14 09:54:32 -07:00 committed by Sean Owen
parent 5a5237b4a8
commit 7df4aa6694
76 changed files with 262 additions and 264 deletions

View file

@ -64,7 +64,7 @@ public enum ResultMetadataType {
* For some products, indicates the suggested retail price in the barcode as a * For some products, indicates the suggested retail price in the barcode as a
* formatted {@link String}. * formatted {@link String}.
*/ */
SUGGESTED_PRICE , SUGGESTED_PRICE,
/** /**
* For some products, the possible country of manufacture as a {@link String} denoting the * For some products, the possible country of manufacture as a {@link String} denoting the

View file

@ -107,7 +107,6 @@ public class ResultPoint {
patterns[2] = pointC; patterns[2] = pointC;
} }
/** /**
* @param pattern1 first pattern * @param pattern1 first pattern
* @param pattern2 second pattern * @param pattern2 second pattern
@ -128,5 +127,4 @@ public class ResultPoint {
return ((pointC.x - bX) * (pointA.y - bY)) - ((pointC.y - bY) * (pointA.x - bX)); return ((pointC.x - bX) * (pointA.y - bY)) - ((pointC.y - bY) * (pointA.x - bX));
} }
} }

View file

@ -34,7 +34,7 @@ final class BinaryShiftToken extends Token {
@Override @Override
public void appendTo(BitArray bitArray, byte[] text) { public void appendTo(BitArray bitArray, byte[] text) {
for (int i = 0; i < binaryShiftByteCount; i++) { for (int i = 0; i < binaryShiftByteCount; i++) {
if (i == 0 || (i == 31 && binaryShiftByteCount <= 62)) { if (i == 0 || (i == 31 && binaryShiftByteCount <= 62)) {
// We need a header before the first character, and before // We need a header before the first character, and before
// character 31 when the total byte code is <= 62 // character 31 when the total byte code is <= 62
bitArray.appendBits(31, 5); // BINARY_SHIFT bitArray.appendBits(31, 5); // BINARY_SHIFT

View file

@ -167,7 +167,7 @@ public final class HighLevelEncoder {
pairCode = nextChar == '\n' ? 2 : 0; pairCode = nextChar == '\n' ? 2 : 0;
break; break;
case '.' : case '.' :
pairCode = nextChar == ' ' ? 3 : 0; pairCode = nextChar == ' ' ? 3 : 0;
break; break;
case ',' : case ',' :
pairCode = nextChar == ' ' ? 4 : 0; pairCode = nextChar == ' ' ? 4 : 0;

View file

@ -24,7 +24,7 @@ final class SimpleToken extends Token {
private final short value; private final short value;
private final short bitCount; private final short bitCount;
SimpleToken(Token previous, int value, int bitCount) { SimpleToken(Token previous, int value, int bitCount) {
super(previous); super(previous);
this.value = (short) value; this.value = (short) value;
this.bitCount = (short) bitCount; this.bitCount = (short) bitCount;

View file

@ -104,7 +104,7 @@ final class State {
Token token = this.token; Token token = this.token;
int mode = this.mode; int mode = this.mode;
int bitCount = this.bitCount; int bitCount = this.bitCount;
if (this.mode == HighLevelEncoder.MODE_PUNCT || this.mode == HighLevelEncoder.MODE_DIGIT) { if (this.mode == HighLevelEncoder.MODE_PUNCT || this.mode == HighLevelEncoder.MODE_DIGIT) {
//assert binaryShiftByteCount == 0; //assert binaryShiftByteCount == 0;
int latch = HighLevelEncoder.LATCH_TABLE[mode][HighLevelEncoder.MODE_UPPER]; int latch = HighLevelEncoder.LATCH_TABLE[mode][HighLevelEncoder.MODE_UPPER];
token = token.add(latch & 0xFFFF, latch >> 16); token = token.add(latch & 0xFFFF, latch >> 16);

View file

@ -85,7 +85,7 @@ public final class PerspectiveTransform {
public void transformPoints(float[] xValues, float[] yValues) { public void transformPoints(float[] xValues, float[] yValues) {
int n = xValues.length; int n = xValues.length;
for (int i = 0; i < n; i ++) { for (int i = 0; i < n; i++) {
float x = xValues[i]; float x = xValues[i];
float y = yValues[i]; float y = yValues[i];
float denominator = a13 * x + a23 * y + a33; float denominator = a13 * x + a23 * y + a33;

View file

@ -39,7 +39,7 @@ public final class StringUtils {
SHIFT_JIS.equalsIgnoreCase(PLATFORM_DEFAULT_ENCODING) || SHIFT_JIS.equalsIgnoreCase(PLATFORM_DEFAULT_ENCODING) ||
EUC_JP.equalsIgnoreCase(PLATFORM_DEFAULT_ENCODING); EUC_JP.equalsIgnoreCase(PLATFORM_DEFAULT_ENCODING);
private StringUtils() {} private StringUtils() { }
/** /**
* @param bytes bytes encoding a string, whose encoding should be guessed * @param bytes bytes encoding a string, whose encoding should be guessed

View file

@ -165,7 +165,7 @@ public final class WhiteRectangleDetector {
// . . // . .
// ..... // .....
boolean topBorderNotWhite = true; boolean topBorderNotWhite = true;
while ((topBorderNotWhite || !atLeastOneBlackPointFoundOnTop) && up >= 0) { while ((topBorderNotWhite || !atLeastOneBlackPointFoundOnTop) && up >= 0) {
topBorderNotWhite = containsBlackPoint(left, right, up, true); topBorderNotWhite = containsBlackPoint(left, right, up, true);
if (topBorderNotWhite) { if (topBorderNotWhite) {
up--; up--;

View file

@ -51,7 +51,7 @@ public final class ITFReader extends OneDReader {
private static final int N = 1; // Pixed width of a narrow line private static final int N = 1; // Pixed width of a narrow line
/** Valid ITF lengths. Anything longer than the largest value is also allowed. */ /** Valid ITF lengths. Anything longer than the largest value is also allowed. */
private static final int[] DEFAULT_ALLOWED_LENGTHS = { 6, 8, 10, 12, 14 }; private static final int[] DEFAULT_ALLOWED_LENGTHS = {6, 8, 10, 12, 14};
// Stores the actual narrow line width of the image being decoded. // Stores the actual narrow line width of the image being decoded.
private int narrowLineWidth = -1; private int narrowLineWidth = -1;
@ -126,8 +126,8 @@ public final class ITFReader extends OneDReader {
return new Result( return new Result(
resultString, resultString,
null, // no natural byte representation for these barcodes null, // no natural byte representation for these barcodes
new ResultPoint[] { new ResultPoint(startRange[1], rowNumber), new ResultPoint[] {new ResultPoint(startRange[1], rowNumber),
new ResultPoint(endRange[0], rowNumber)}, new ResultPoint(endRange[0], rowNumber)},
BarcodeFormat.ITF); BarcodeFormat.ITF);
} }

View file

@ -160,7 +160,7 @@ final class FieldParser {
{ "391", VARIABLE_LENGTH, 18}, { "391", VARIABLE_LENGTH, 18},
{ "392", VARIABLE_LENGTH, 15}, { "392", VARIABLE_LENGTH, 15},
{ "393", VARIABLE_LENGTH, 18}, { "393", VARIABLE_LENGTH, 18},
{ "703", VARIABLE_LENGTH, 30} { "703", VARIABLE_LENGTH, 30},
}; };
private static final Object [][] FOUR_DIGIT_DATA_LENGTH = { private static final Object [][] FOUR_DIGIT_DATA_LENGTH = {

View file

@ -31,7 +31,7 @@ final class MatrixUtil {
// do nothing // do nothing
} }
private static final int[][] POSITION_DETECTION_PATTERN = { private static final int[][] POSITION_DETECTION_PATTERN = {
{1, 1, 1, 1, 1, 1, 1}, {1, 1, 1, 1, 1, 1, 1},
{1, 0, 0, 0, 0, 0, 1}, {1, 0, 0, 0, 0, 0, 1},
{1, 0, 1, 1, 1, 0, 1}, {1, 0, 1, 1, 1, 0, 1},