mirror of
https://github.com/zxing/zxing.git
synced 2025-03-05 20:48:51 -08:00
orw changes post tab to space chagnes
This commit is contained in:
parent
9598db91c7
commit
54e16e2188
2
.github/workflows/test_java_8.yml
vendored
2
.github/workflows/test_java_8.yml
vendored
|
@ -16,7 +16,7 @@ jobs:
|
||||||
- name: Set up JDK 8
|
- name: Set up JDK 8
|
||||||
uses: actions/setup-java@v4
|
uses: actions/setup-java@v4
|
||||||
with:
|
with:
|
||||||
java-version: '8'
|
java-version: '17'
|
||||||
distribution: 'temurin'
|
distribution: 'temurin'
|
||||||
cache: 'maven'
|
cache: 'maven'
|
||||||
- name: Build with Maven
|
- name: Build with Maven
|
||||||
|
|
|
@ -20,6 +20,9 @@
|
||||||
<artifactId>core</artifactId>
|
<artifactId>core</artifactId>
|
||||||
<version>3.5.4-SNAPSHOT</version>
|
<version>3.5.4-SNAPSHOT</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
<properties>
|
||||||
|
<java.version>17</java.version>
|
||||||
|
</properties>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|
|
@ -42,8 +42,7 @@ public final class Dimension {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object other) {
|
public boolean equals(Object other) {
|
||||||
if (other instanceof Dimension) {
|
if (other instanceof Dimension d) {
|
||||||
Dimension d = (Dimension) other;
|
|
||||||
return width == d.width && height == d.height;
|
return width == d.width && height == d.height;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -44,8 +44,7 @@ public class ResultPoint {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public final boolean equals(Object other) {
|
public final boolean equals(Object other) {
|
||||||
if (other instanceof ResultPoint) {
|
if (other instanceof ResultPoint otherPoint) {
|
||||||
ResultPoint otherPoint = (ResultPoint) other;
|
|
||||||
return x == otherPoint.x && y == otherPoint.y;
|
return x == otherPoint.x && y == otherPoint.y;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -85,7 +85,7 @@ public final class Decoder {
|
||||||
byte[] rawBytes = convertBoolArrayToByteArray(correctedBits.correctBits);
|
byte[] rawBytes = convertBoolArrayToByteArray(correctedBits.correctBits);
|
||||||
String result = getEncodedData(correctedBits.correctBits);
|
String result = getEncodedData(correctedBits.correctBits);
|
||||||
DecoderResult decoderResult =
|
DecoderResult decoderResult =
|
||||||
new DecoderResult(rawBytes, result, null, String.format("%d%%", correctedBits.ecLevel));
|
new DecoderResult(rawBytes, result, null, "%d%%".formatted(correctedBits.ecLevel));
|
||||||
decoderResult.setNumBits(correctedBits.correctBits.length);
|
decoderResult.setNumBits(correctedBits.correctBits.length);
|
||||||
decoderResult.setErrorsCorrected(correctedBits.errorsCorrected);
|
decoderResult.setErrorsCorrected(correctedBits.errorsCorrected);
|
||||||
return decoderResult;
|
return decoderResult;
|
||||||
|
|
|
@ -135,7 +135,7 @@ public final class Encoder {
|
||||||
layers = Math.abs(userSpecifiedLayers);
|
layers = Math.abs(userSpecifiedLayers);
|
||||||
if (layers > (compact ? MAX_NB_BITS_COMPACT : MAX_NB_BITS)) {
|
if (layers > (compact ? MAX_NB_BITS_COMPACT : MAX_NB_BITS)) {
|
||||||
throw new IllegalArgumentException(
|
throw new IllegalArgumentException(
|
||||||
String.format("Illegal value %s for layers", userSpecifiedLayers));
|
"Illegal value %s for layers".formatted(userSpecifiedLayers));
|
||||||
}
|
}
|
||||||
totalBitsInLayer = totalBitsInLayer(layers, compact);
|
totalBitsInLayer = totalBitsInLayer(layers, compact);
|
||||||
wordSize = WORD_SIZE[layers];
|
wordSize = WORD_SIZE[layers];
|
||||||
|
|
|
@ -176,7 +176,7 @@ final class State {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return String.format("%s bits=%d bytes=%d", HighLevelEncoder.MODE_NAMES[mode], bitCount, binaryShiftByteCount);
|
return "%s bits=%d bytes=%d".formatted(HighLevelEncoder.MODE_NAMES[mode], bitCount, binaryShiftByteCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static int calculateBinaryShiftCost(int binaryShiftByteCount) {
|
private static int calculateBinaryShiftCost(int binaryShiftByteCount) {
|
||||||
|
|
|
@ -367,10 +367,12 @@ public final class Code128Writer extends OneDimensionalCodeWriter {
|
||||||
private enum Charset { A, B, C, NONE }
|
private enum Charset { A, B, C, NONE }
|
||||||
private enum Latch { A, B, C, SHIFT, NONE }
|
private enum Latch { A, B, C, SHIFT, NONE }
|
||||||
|
|
||||||
static final String A = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\u0000\u0001\u0002" +
|
static final String A = """
|
||||||
"\u0003\u0004\u0005\u0006\u0007\u0008\u0009\n\u000B\u000C\r\u000E\u000F\u0010\u0011" +
|
!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_ |