Use uppercase for long literal suffix.
diff --git a/src/main/java/org/apache/commons/compress/archivers/sevenz/SevenZFile.java b/src/main/java/org/apache/commons/compress/archivers/sevenz/SevenZFile.java
index bbbca55..9b68457 100644
--- a/src/main/java/org/apache/commons/compress/archivers/sevenz/SevenZFile.java
+++ b/src/main/java/org/apache/commons/compress/archivers/sevenz/SevenZFile.java
@@ -476,7 +476,7 @@
private Archive tryToLocateEndHeader(final byte[] password) throws IOException {
final ByteBuffer nidBuf = ByteBuffer.allocate(1);
- final long searchLimit = 1024l * 1024 * 1;
+ final long searchLimit = 1024L * 1024 * 1;
// Main header, plus bytes that readStartHeader would read
final long previousDataSize = channel.position() + 20;
final long minPos;
diff --git a/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java b/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java
index 6b79f72..1f373c4 100644
--- a/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java
+++ b/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java
@@ -167,7 +167,7 @@
* mode an the archive contains illegal fields.
* @since 1.19
*/
- public static final long UNKNOWN = -1l;
+ public static final long UNKNOWN = -1L;
/** The entry's name. */
private String name = "";
diff --git a/src/main/java/org/apache/commons/compress/archivers/zip/BinaryTree.java b/src/main/java/org/apache/commons/compress/archivers/zip/BinaryTree.java
index b6a1667..6a746ed 100644
--- a/src/main/java/org/apache/commons/compress/archivers/zip/BinaryTree.java
+++ b/src/main/java/org/apache/commons/compress/archivers/zip/BinaryTree.java
@@ -51,7 +51,7 @@
throw new IllegalArgumentException("depth must be bigger than 0 and not bigger than 30"
+ " but is " + depth);
}
- tree = new int[(int) ((1l << (depth + 1)) - 1)];
+ tree = new int[(int) ((1L << (depth + 1)) - 1)];
Arrays.fill(tree, UNDEFINED);
}
diff --git a/src/test/java/org/apache/commons/compress/archivers/tar/BigFilesIT.java b/src/test/java/org/apache/commons/compress/archivers/tar/BigFilesIT.java
index 14cfe64..d9c50eb 100644
--- a/src/test/java/org/apache/commons/compress/archivers/tar/BigFilesIT.java
+++ b/src/test/java/org/apache/commons/compress/archivers/tar/BigFilesIT.java
@@ -79,7 +79,7 @@
tin = new TarArchiveInputStream(gzin);
final TarArchiveEntry e = tin.getNextTarEntry();
assertNotNull(e);
- assertEquals(8200l * 1024 * 1024, e.getSize());
+ assertEquals(8200L * 1024 * 1024, e.getSize());
long read = 0;
final Random r = new Random(System.currentTimeMillis());
@@ -94,7 +94,7 @@
}
read += readNow;
}
- assertEquals(8200l * 1024 * 1024, read);
+ assertEquals(8200L * 1024 * 1024, read);
assertNull(tin.getNextTarEntry());
} finally {
if (tin != null) {
diff --git a/src/test/java/org/apache/commons/compress/archivers/tar/TarArchiveInputStreamTest.java b/src/test/java/org/apache/commons/compress/archivers/tar/TarArchiveInputStreamTest.java
index d7b5396..69841d9 100644
--- a/src/test/java/org/apache/commons/compress/archivers/tar/TarArchiveInputStreamTest.java
+++ b/src/test/java/org/apache/commons/compress/archivers/tar/TarArchiveInputStreamTest.java
@@ -263,7 +263,7 @@
final TarArchiveOutputStream tos = new TarArchiveOutputStream(bos);
tos.setBigNumberMode(TarArchiveOutputStream.BIGNUMBER_POSIX);
TarArchiveEntry t = new TarArchiveEntry("name");
- t.setGroupId(4294967294l);
+ t.setGroupId(4294967294L);
t.setSize(1);
tos.putArchiveEntry(t);
tos.write(30);
@@ -274,7 +274,7 @@
final TarArchiveInputStream tis =
new TarArchiveInputStream(bis);
t = tis.getNextTarEntry();
- assertEquals(4294967294l, t.getLongGroupId());
+ assertEquals(4294967294L, t.getLongGroupId());
tis.close();
}
diff --git a/src/test/java/org/apache/commons/compress/archivers/tar/TarUtilsTest.java b/src/test/java/org/apache/commons/compress/archivers/tar/TarUtilsTest.java
index 9b47e32..893284b 100644
--- a/src/test/java/org/apache/commons/compress/archivers/tar/TarUtilsTest.java
+++ b/src/test/java/org/apache/commons/compress/archivers/tar/TarUtilsTest.java
@@ -165,8 +165,8 @@
checkRoundTripOctalOrBinary(1, length);
checkRoundTripOctalOrBinary(TarConstants.MAXSIZE, length); // will need binary format
checkRoundTripOctalOrBinary(-1, length); // will need binary format
- checkRoundTripOctalOrBinary(0xffffffffffffffl, length);
- checkRoundTripOctalOrBinary(-0xffffffffffffffl, length);
+ checkRoundTripOctalOrBinary(0xffffffffffffffL, length);
+ checkRoundTripOctalOrBinary(-0xffffffffffffffL, length);
}
// Check correct trailing bytes are generated
@@ -235,7 +235,7 @@
(byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
(byte) 0xff, (byte) 0xff, (byte) 0xf1, (byte) 0xef,
};
- assertEquals(-3601l, TarUtils.parseOctalOrBinary(b, 0, 8));
+ assertEquals(-3601L, TarUtils.parseOctalOrBinary(b, 0, 8));
}
@Test
@@ -245,7 +245,7 @@
(byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
(byte) 0xff, (byte) 0xff, (byte) 0xf1, (byte) 0xef,
};
- assertEquals(-3601l, TarUtils.parseOctalOrBinary(b, 0, 12));
+ assertEquals(-3601L, TarUtils.parseOctalOrBinary(b, 0, 12));
}
@@ -255,7 +255,7 @@
(byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
(byte) 0xff, (byte) 0xff, (byte) 0xf1, (byte) 0xef,
};
- assertEquals(-3601l, TarUtils.parseOctalOrBinary(b, 0, 8));
+ assertEquals(-3601L, TarUtils.parseOctalOrBinary(b, 0, 8));
}
// https://issues.apache.org/jira/browse/COMPRESS-191
diff --git a/src/test/java/org/apache/commons/compress/archivers/zip/X000A_NTFSTest.java b/src/test/java/org/apache/commons/compress/archivers/zip/X000A_NTFSTest.java
index 277d360..65ba934 100644
--- a/src/test/java/org/apache/commons/compress/archivers/zip/X000A_NTFSTest.java
+++ b/src/test/java/org/apache/commons/compress/archivers/zip/X000A_NTFSTest.java
@@ -30,14 +30,14 @@
final X000A_NTFS xf = new X000A_NTFS();
xf.setModifyJavaTime(new Date(0));
// one second past midnight
- xf.setAccessJavaTime(new Date(-11644473601000l));
+ xf.setAccessJavaTime(new Date(-11644473601000L));
xf.setCreateJavaTime(null);
final byte[] b = xf.getLocalFileDataData();
final X000A_NTFS xf2 = new X000A_NTFS();
xf2.parseFromLocalFileData(b, 0, b.length);
assertEquals(new Date(0), xf2.getModifyJavaTime());
- assertEquals(new Date(-11644473601000l), xf2.getAccessJavaTime());
+ assertEquals(new Date(-11644473601000L), xf2.getAccessJavaTime());
assertEquals(null, xf2.getCreateJavaTime());
}
}
diff --git a/src/test/java/org/apache/commons/compress/archivers/zip/Zip64ExtendedInformationExtraFieldTest.java b/src/test/java/org/apache/commons/compress/archivers/zip/Zip64ExtendedInformationExtraFieldTest.java
index e366ffa..e5ad2b1 100644
--- a/src/test/java/org/apache/commons/compress/archivers/zip/Zip64ExtendedInformationExtraFieldTest.java
+++ b/src/test/java/org/apache/commons/compress/archivers/zip/Zip64ExtendedInformationExtraFieldTest.java
@@ -32,7 +32,7 @@
private static final ZipEightByteInteger CSIZE =
new ZipEightByteInteger(0x9ABCDEF);
private static final ZipEightByteInteger OFF =
- new ZipEightByteInteger(BigInteger.valueOf(0xABCDEF091234567l)
+ new ZipEightByteInteger(BigInteger.valueOf(0xABCDEF091234567L)
.shiftLeft(4)
.setBit(3));
private static final ZipLong DISK = new ZipLong(0x12);
diff --git a/src/test/java/org/apache/commons/compress/archivers/zip/Zip64SupportIT.java b/src/test/java/org/apache/commons/compress/archivers/zip/Zip64SupportIT.java
index 3267e8e..729eeda 100644
--- a/src/test/java/org/apache/commons/compress/archivers/zip/Zip64SupportIT.java
+++ b/src/test/java/org/apache/commons/compress/archivers/zip/Zip64SupportIT.java
@@ -45,7 +45,7 @@
public class Zip64SupportIT {
- private static final long FIVE_BILLION = 5000000000l;
+ private static final long FIVE_BILLION = 5000000000L;
private static final int ONE_MILLION = 1000000;
private static final int ONE_HUNDRED_THOUSAND = 100000;
diff --git a/src/test/java/org/apache/commons/compress/archivers/zip/ZipEightByteIntegerTest.java b/src/test/java/org/apache/commons/compress/archivers/zip/ZipEightByteIntegerTest.java
index e38f819..af54c7a 100644
--- a/src/test/java/org/apache/commons/compress/archivers/zip/ZipEightByteIntegerTest.java
+++ b/src/test/java/org/apache/commons/compress/archivers/zip/ZipEightByteIntegerTest.java
@@ -35,7 +35,7 @@
*/
@Test
public void testLongToBytes() {
- final ZipEightByteInteger zl = new ZipEightByteInteger(0xAB12345678l);
+ final ZipEightByteInteger zl = new ZipEightByteInteger(0xAB12345678L);
final byte[] result = zl.getBytes();
assertEquals("length getBytes", 8, result.length);
assertEquals("first byte getBytes", 0x78, result[0]);
@@ -55,7 +55,7 @@
public void testLongFromBytes() {
final byte[] val = new byte[] {0x78, 0x56, 0x34, 0x12, (byte) 0xAB, 0x00, 0x00, 0x00};
final ZipEightByteInteger zl = new ZipEightByteInteger(val);
- assertEquals("longValue from bytes", 0xAB12345678l, zl.getLongValue());
+ assertEquals("longValue from bytes", 0xAB12345678L, zl.getLongValue());
}
/**
diff --git a/src/test/java/org/apache/commons/compress/archivers/zip/ZipFileTest.java b/src/test/java/org/apache/commons/compress/archivers/zip/ZipFileTest.java
index 1d43752..7423699 100644
--- a/src/test/java/org/apache/commons/compress/archivers/zip/ZipFileTest.java
+++ b/src/test/java/org/apache/commons/compress/archivers/zip/ZipFileTest.java
@@ -187,7 +187,7 @@
ZipArchiveEntry ze = new ZipArchiveEntry("foo");
ze.setMethod(ZipEntry.STORED);
ze.setSize(4);
- ze.setCrc(0xb63cfbcdl);
+ ze.setCrc(0xb63cfbcdL);
zo.putArchiveEntry(ze);
zo.write(new byte[] { 1, 2, 3, 4 });
zo.closeArchiveEntry();
@@ -800,7 +800,7 @@
ZipArchiveEntry ze = new ZipArchiveEntry(testEntryName);
ze.setMethod(ZipEntry.STORED);
ze.setSize(4);
- ze.setCrc(0xb63cfbcdl);
+ ze.setCrc(0xb63cfbcdL);
zo.putArchiveEntry(ze);
zo.write(testData);
zo.closeArchiveEntry();
diff --git a/src/test/java/org/apache/commons/compress/archivers/zip/ZipLongTest.java b/src/test/java/org/apache/commons/compress/archivers/zip/ZipLongTest.java
index 75709fd..cf7515f 100644
--- a/src/test/java/org/apache/commons/compress/archivers/zip/ZipLongTest.java
+++ b/src/test/java/org/apache/commons/compress/archivers/zip/ZipLongTest.java
@@ -91,11 +91,11 @@
@Test
public void testSign() {
ZipLong zl = new ZipLong(new byte[] {(byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF});
- assertEquals(0x00000000FFFFFFFFl, zl.getValue());
+ assertEquals(0x00000000FFFFFFFFL, zl.getValue());
assertEquals(-1,zl.getIntValue());
zl = new ZipLong(0xFFFF_FFFFL);
- assertEquals(0x00000000FFFFFFFFl, zl.getValue());
+ assertEquals(0x00000000FFFFFFFFL, zl.getValue());
zl = new ZipLong(0xFFFF_FFFF);
assertEquals(0xFFFF_FFFF_FFFF_FFFFL, zl.getValue());
diff --git a/src/test/java/org/apache/commons/compress/compressors/snappy/FramedSnappyCompressorInputStreamTest.java b/src/test/java/org/apache/commons/compress/compressors/snappy/FramedSnappyCompressorInputStreamTest.java
index 5673178..db985ba 100644
--- a/src/test/java/org/apache/commons/compress/compressors/snappy/FramedSnappyCompressorInputStreamTest.java
+++ b/src/test/java/org/apache/commons/compress/compressors/snappy/FramedSnappyCompressorInputStreamTest.java
@@ -142,8 +142,8 @@
@Test
public void testChecksumUnmasking() {
- testChecksumUnmasking(0xc757l);
- testChecksumUnmasking(0xffffc757l);
+ testChecksumUnmasking(0xc757L);
+ testChecksumUnmasking(0xffffc757L);
}
@Test
diff --git a/src/test/java/org/apache/commons/compress/utils/BitInputStreamTest.java b/src/test/java/org/apache/commons/compress/utils/BitInputStreamTest.java
index 7cdcd4b..ce996b3 100644
--- a/src/test/java/org/apache/commons/compress/utils/BitInputStreamTest.java
+++ b/src/test/java/org/apache/commons/compress/utils/BitInputStreamTest.java
@@ -138,7 +138,7 @@
try (final BitInputStream bin = new BitInputStream(in, ByteOrder.LITTLE_ENDIAN)) {
assertEquals(23, // 10111
bin.readBits(5));
- assertEquals(714595605644185962l, // 0001-00111101-01011000-00011101-01011010-00001111-01000010-00101101-010
+ assertEquals(714595605644185962L, // 0001-00111101-01011000-00011101-01011010-00001111-01000010-00101101-010
bin.readBits(63));
assertEquals(1186, // 01001010-0010
bin.readBits(12));
@@ -163,7 +163,7 @@
try (final BitInputStream bin = new BitInputStream(in, ByteOrder.BIG_ENDIAN)) {
assertEquals(10, // 01010
bin.readBits(5));
- assertEquals(8274274654740644818l, //111-00101101-01000010-00001111-01011010-00011101-01011000-00111101-0010
+ assertEquals(8274274654740644818L, //111-00101101-01000010-00001111-01011010-00011101-01011000-00111101-0010
bin.readBits(63));
assertEquals(330, // 0001-01001010
bin.readBits(12));
diff --git a/src/test/java/org/apache/commons/compress/utils/ByteUtilsTest.java b/src/test/java/org/apache/commons/compress/utils/ByteUtilsTest.java
index 24fa9f1..17c1236 100644
--- a/src/test/java/org/apache/commons/compress/utils/ByteUtilsTest.java
+++ b/src/test/java/org/apache/commons/compress/utils/ByteUtilsTest.java
@@ -44,7 +44,7 @@
@Test
public void fromLittleEndianFromArrayOneArgUnsignedInt32() {
final byte[] b = new byte[] { 2, 3, 4, (byte) 128 };
- assertEquals(2 + 3 * 256 + 4 * 256 * 256 + 128l * 256 * 256 * 256, fromLittleEndian(b));
+ assertEquals(2 + 3 * 256 + 4 * 256 * 256 + 128L * 256 * 256 * 256, fromLittleEndian(b));
}
@Test(expected = IllegalArgumentException.class)
@@ -61,7 +61,7 @@
@Test
public void fromLittleEndianFromArrayUnsignedInt32() {
final byte[] b = new byte[] { 1, 2, 3, 4, (byte) 128 };
- assertEquals(2 + 3 * 256 + 4 * 256 * 256 + 128l * 256 * 256 * 256, fromLittleEndian(b, 1, 4));
+ assertEquals(2 + 3 * 256 + 4 * 256 * 256 + 128L * 256 * 256 * 256, fromLittleEndian(b, 1, 4));
}
@Test(expected = IllegalArgumentException.class)
@@ -78,7 +78,7 @@
@Test
public void fromLittleEndianFromStreamUnsignedInt32() throws IOException {
final ByteArrayInputStream bin = new ByteArrayInputStream(new byte[] { 2, 3, 4, (byte) 128 });
- assertEquals(2 + 3 * 256 + 4 * 256 * 256 + 128l * 256 * 256 * 256, fromLittleEndian(bin, 4));
+ assertEquals(2 + 3 * 256 + 4 * 256 * 256 + 128L * 256 * 256 * 256, fromLittleEndian(bin, 4));
}
@Test(expected = IllegalArgumentException.class)
@@ -101,7 +101,7 @@
@Test
public void fromLittleEndianFromSupplierUnsignedInt32() throws IOException {
final ByteArrayInputStream bin = new ByteArrayInputStream(new byte[] { 2, 3, 4, (byte) 128 });
- assertEquals(2 + 3 * 256 + 4 * 256 * 256 + 128l * 256 * 256 * 256,
+ assertEquals(2 + 3 * 256 + 4 * 256 * 256 + 128L * 256 * 256 * 256,
fromLittleEndian(new InputStreamByteSupplier(bin), 4));
}
@@ -125,7 +125,7 @@
@Test
public void fromLittleEndianFromDataInputUnsignedInt32() throws IOException {
final DataInput din = new DataInputStream(new ByteArrayInputStream(new byte[] { 2, 3, 4, (byte) 128 }));
- assertEquals(2 + 3 * 256 + 4 * 256 * 256 + 128l * 256 * 256 * 256, fromLittleEndian(din, 4));
+ assertEquals(2 + 3 * 256 + 4 * 256 * 256 + 128L * 256 * 256 * 256, fromLittleEndian(din, 4));
}
@Test(expected = IllegalArgumentException.class)
@@ -151,7 +151,7 @@
@Test
public void toLittleEndianToStreamUnsignedInt32() throws IOException {
final ByteArrayOutputStream bos = new ByteArrayOutputStream();
- toLittleEndian(bos, 2 + 3 * 256 + 4 * 256 * 256 + 128l * 256 * 256 * 256, 4);
+ toLittleEndian(bos, 2 + 3 * 256 + 4 * 256 * 256 + 128L * 256 * 256 * 256, 4);
bos.close();
assertArrayEquals(new byte[] { 2, 3, 4, (byte) 128 }, bos.toByteArray());
}
@@ -167,7 +167,7 @@
@Test
public void toLittleEndianToConsumerUnsignedInt32() throws IOException {
final ByteArrayOutputStream bos = new ByteArrayOutputStream();
- toLittleEndian(new OutputStreamByteConsumer(bos), 2 + 3 * 256 + 4 * 256 * 256 + 128l * 256 * 256 * 256, 4);
+ toLittleEndian(new OutputStreamByteConsumer(bos), 2 + 3 * 256 + 4 * 256 * 256 + 128L * 256 * 256 * 256, 4);
bos.close();
assertArrayEquals(new byte[] { 2, 3, 4, (byte) 128 }, bos.toByteArray());
}
@@ -185,7 +185,7 @@
public void toLittleEndianToDataOutputUnsignedInt32() throws IOException {
final ByteArrayOutputStream bos = new ByteArrayOutputStream();
final DataOutput dos = new DataOutputStream(bos);
- toLittleEndian(dos, 2 + 3 * 256 + 4 * 256 * 256 + 128l * 256 * 256 * 256, 4);
+ toLittleEndian(dos, 2 + 3 * 256 + 4 * 256 * 256 + 128L * 256 * 256 * 256, 4);
bos.close();
assertArrayEquals(new byte[] { 2, 3, 4, (byte) 128 }, bos.toByteArray());
}
@@ -201,7 +201,7 @@
@Test
public void toLittleEndianToByteArrayUnsignedInt32() throws IOException {
final byte[] b = new byte[4];
- toLittleEndian(b, 2 + 3 * 256 + 4 * 256 * 256 + 128l * 256 * 256 * 256, 0, 4);
+ toLittleEndian(b, 2 + 3 * 256 + 4 * 256 * 256 + 128L * 256 * 256 * 256, 0, 4);
assertArrayEquals(new byte[] { 2, 3, 4, (byte) 128 }, b);
}
}