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
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
java-version: '8'
|
||||
java-version: '17'
|
||||
distribution: 'temurin'
|
||||
cache: 'maven'
|
||||
- name: Build with Maven
|
||||
|
|
|
@ -20,6 +20,9 @@
|
|||
<artifactId>core</artifactId>
|
||||
<version>3.5.4-SNAPSHOT</version>
|
||||
<packaging>jar</packaging>
|
||||
<properties>
|
||||
<java.version>17</java.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
|
|
|
@ -42,8 +42,7 @@ public final class Dimension {
|
|||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
if (other instanceof Dimension) {
|
||||
Dimension d = (Dimension) other;
|
||||
if (other instanceof Dimension d) {
|
||||
return width == d.width && height == d.height;
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -44,8 +44,7 @@ public class ResultPoint {
|
|||
|
||||
@Override
|
||||
public final boolean equals(Object other) {
|
||||
if (other instanceof ResultPoint) {
|
||||
ResultPoint otherPoint = (ResultPoint) other;
|
||||
if (other instanceof ResultPoint otherPoint) {
|
||||
return x == otherPoint.x && y == otherPoint.y;
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -85,7 +85,7 @@ public final class Decoder {
|
|||
byte[] rawBytes = convertBoolArrayToByteArray(correctedBits.correctBits);
|
||||
String result = getEncodedData(correctedBits.correctBits);
|
||||
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.setErrorsCorrected(correctedBits.errorsCorrected);
|
||||
return decoderResult;
|
||||
|
|
|
@ -135,7 +135,7 @@ public final class Encoder {
|
|||
layers = Math.abs(userSpecifiedLayers);
|
||||
if (layers > (compact ? MAX_NB_BITS_COMPACT : MAX_NB_BITS)) {
|
||||
throw new IllegalArgumentException(
|
||||
String.format("Illegal value %s for layers", userSpecifiedLayers));
|
||||
"Illegal value %s for layers".formatted(userSpecifiedLayers));
|
||||
}
|
||||
totalBitsInLayer = totalBitsInLayer(layers, compact);
|
||||
wordSize = WORD_SIZE[layers];
|
||||
|
|
|
@ -176,7 +176,7 @@ final class State {
|
|||
|
||||
@Override
|
||||
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) {
|
||||
|
|
|
@ -367,10 +367,12 @@ public final class Code128Writer extends OneDimensionalCodeWriter {
|
|||
private enum Charset { A, B, C, NONE }
|
||||
private enum Latch { A, B, C, SHIFT, NONE }
|
||||
|
||||
static final String A = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\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" +
|
||||
"\u00FF";
|
||||
static final String A = """
|
||||
!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_ |