From fe9acd1011fd643e7fad63cd5beae7b423c540f7 Mon Sep 17 00:00:00 2001 From: svc-excavator-bot Date: Tue, 3 Dec 2024 07:10:06 +0000 Subject: [PATCH] Excavator: Upgrades Baseline to the latest version --- build.gradle | 3 ++- .../palantir/isofilereader/isofilereader/IsoFileReader.java | 2 ++ .../palantir/isofilereader/isofilereader/IsoInputStream.java | 4 +++- .../isofilereader/iso/TraditionalIsoReader.java | 1 + .../com/palantir/isofilereader/SpeedComparisonsTests.java | 5 +++++ 5 files changed, 13 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index fd7fc93..2f6d644 100644 --- a/build.gradle +++ b/build.gradle @@ -7,10 +7,11 @@ buildscript { dependencies { classpath 'com.palantir.gradle.jdks:gradle-jdks:0.58.0' classpath 'com.palantir.gradle.jdkslatest:gradle-jdks-latest:0.16.0' - classpath 'com.palantir.baseline:gradle-baseline-java:5.72.0' + classpath 'com.palantir.baseline:gradle-baseline-java:6.4.0' classpath 'com.palantir.gradle.externalpublish:gradle-external-publish-plugin:1.19.0' classpath 'com.palantir.gradle.failure-reports:gradle-failure-reports:1.13.0' classpath 'com.palantir.javaformat:gradle-palantir-java-format:2.50.0' + classpath 'com.palantir.suppressible-error-prone:gradle-suppressible-error-prone:1.6.0' classpath 'gradle.plugin.org.inferred:gradle-processors:3.7.0' } } diff --git a/src/main/java/com/palantir/isofilereader/isofilereader/IsoFileReader.java b/src/main/java/com/palantir/isofilereader/isofilereader/IsoFileReader.java index 9bd57f9..d3f2bb8 100644 --- a/src/main/java/com/palantir/isofilereader/isofilereader/IsoFileReader.java +++ b/src/main/java/com/palantir/isofilereader/isofilereader/IsoFileReader.java @@ -315,6 +315,7 @@ private void implementGivenSetting(String setting) { * @return byte array of the data * @throws IOException failed to read underlying ISO file */ + @SuppressWarnings("for-rollout:PreferSafeLoggableExceptions") public byte[] getFileBytes(GenericInternalIsoFile file) throws IOException { long dataSize = file.getSize(); byte[] data = new byte[(int) dataSize]; @@ -573,6 +574,7 @@ public static Optional getFileDataWithIVsFromFile(File file, String imag * @throws IOException Opening the image can fail resulting in a IOException * @throws NoSuchAlgorithmException MD5 is used to verify the IV, if MD5 is not in the local JDK this will fail */ + @SuppressWarnings("for-rollout:PreferSafeLoggableExceptions") public static Optional getFileDataWithIVs(RandomAccessFile rafFile, String imageIv, String fileIv) throws IOException, NoSuchAlgorithmException { /* diff --git a/src/main/java/com/palantir/isofilereader/isofilereader/IsoInputStream.java b/src/main/java/com/palantir/isofilereader/isofilereader/IsoInputStream.java index 8cd90b6..3fa9c8c 100644 --- a/src/main/java/com/palantir/isofilereader/isofilereader/IsoInputStream.java +++ b/src/main/java/com/palantir/isofilereader/isofilereader/IsoInputStream.java @@ -178,6 +178,7 @@ public long getLength() { * @param seekLoc bytes to seek in * @throws IOException if seek error occurs, either too far or failed ot read at that location */ + @SuppressWarnings("for-rollout:PreferSafeLoggableExceptions") public void seek(long seekLoc) throws IOException { if (startingLoc + seekLoc > getLength()) { throw new IOException("Seeking past end of file"); @@ -205,8 +206,8 @@ public byte[] readAllBytes() throws IOException { * @return byte array of data in area * @throws IOException error in reading underlying media */ + @SuppressWarnings({"ReadReturnValueIgnored", "for-rollout:PreferSafeLoggableExceptions"}) @Override - @SuppressWarnings("ReadReturnValueIgnored") public byte[] readNBytes(int len) throws IOException { if (len < 0) { throw new IllegalArgumentException("len < 0"); @@ -279,6 +280,7 @@ public boolean markSupported() { * @return length of file transferred in bytes * @throws IOException read IO exception can occur if there is a read error with the underlying media */ + @SuppressWarnings("for-rollout:PreferSafeLoggingPreconditions") @Override public long transferTo(OutputStream out) throws IOException { Objects.requireNonNull(out, "out"); diff --git a/src/main/java/com/palantir/isofilereader/isofilereader/iso/TraditionalIsoReader.java b/src/main/java/com/palantir/isofilereader/isofilereader/iso/TraditionalIsoReader.java index 2931236..b706926 100644 --- a/src/main/java/com/palantir/isofilereader/isofilereader/iso/TraditionalIsoReader.java +++ b/src/main/java/com/palantir/isofilereader/isofilereader/iso/TraditionalIsoReader.java @@ -99,6 +99,7 @@ public void setUseRockRidgeOverStandard(boolean useRockRidgeOverStandard) { * @return Array of data files * @throws IOException can be thrown if file can not be read */ + @SuppressWarnings("for-rollout:PreferSafeLoggableExceptions") public final IsoFormatInternalDataFile[] getInternalDataFiles( RandomAccessFile file, long logicalSector, long size, String parent) throws IOException { byte[] headerInfo = new byte[IsoFormatConstant.BYTES_PER_SECTOR]; diff --git a/src/test/java/com/palantir/isofilereader/SpeedComparisonsTests.java b/src/test/java/com/palantir/isofilereader/SpeedComparisonsTests.java index 6b36a3b..1ec48b0 100644 --- a/src/test/java/com/palantir/isofilereader/SpeedComparisonsTests.java +++ b/src/test/java/com/palantir/isofilereader/SpeedComparisonsTests.java @@ -225,6 +225,7 @@ private long[] newLibTestMethod1(File isoFile, String[] filesToGet, String[] md5 for (int i = 0; i < newTimings.length; i++) { startTime = System.currentTimeMillis(); + @SuppressWarnings("for-rollout:UnnecessaryAsync") AtomicInteger filesFound = new AtomicInteger(); // I am using precomputed settings for this image, because the other library doesnt even check for those, // so its only fair that I dont have to take the scan time into account! @@ -311,6 +312,7 @@ private long[] newLibTestMethod3(File isoFile, String[] md5s) throws FileNotFoun for (int i = 0; i < newTimings.length; i++) { startTime = System.currentTimeMillis(); + @SuppressWarnings("for-rollout:UnnecessaryAsync") AtomicInteger filesFound = new AtomicInteger(); String imageIv = "I1|2048|10|1610940416|750c30c146c68b40dc812b4f9522a23c"; @@ -346,6 +348,7 @@ private long[] newLibTestMethod4(File isoFile, String[] md5s) throws FileNotFoun for (int i = 0; i < newTimings.length; i++) { startTime = System.currentTimeMillis(); + @SuppressWarnings("for-rollout:UnnecessaryAsync") AtomicInteger filesFound = new AtomicInteger(); String imageIv = "I1|2048|10|1610940416|750c30c146c68b40dc812b4f9522a23c"; @@ -381,6 +384,7 @@ private long[] newLibTestMethod5(File isoFile, String[] md5s) throws FileNotFoun for (int i = 0; i < newTimings.length; i++) { startTime = System.currentTimeMillis(); + @SuppressWarnings("for-rollout:UnnecessaryAsync") AtomicInteger filesFound = new AtomicInteger(); String imageIv = "I1|2048|10|1610940416|750c30c146c68b40dc812b4f9522a23c"; @@ -417,6 +421,7 @@ private long[] newLibTestMethod6(File isoFile, String[] md5s) throws FileNotFoun for (int i = 0; i < newTimings.length; i++) { startTime = System.currentTimeMillis(); + @SuppressWarnings("for-rollout:UnnecessaryAsync") AtomicInteger filesFound = new AtomicInteger(); // RandomAccessFile rawIso = new RandomAccessFile(isoFile, "r");