From 5266ff2e075bbee9b5fedc5b96e46581047ca7fb Mon Sep 17 00:00:00 2001 From: Miguel Date: Mon, 20 Jan 2025 14:59:52 +0000 Subject: [PATCH 1/2] Correct linting issues between gms and github. Should hopefully make integrating somewhat easier. --- .../main/java/org/conscrypt/metrics/NoopStatsLog.java | 3 +++ .../main/java/org/conscrypt/metrics/StatsLogImpl.java | 3 +++ .../org/conscrypt/javax/crypto/CipherBasicsTest.java | 9 +++++---- .../src/test/java/org/conscrypt/AndroidHpkeSpiTest.java | 2 +- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/common/src/main/java/org/conscrypt/metrics/NoopStatsLog.java b/common/src/main/java/org/conscrypt/metrics/NoopStatsLog.java index f6befdbb8..8bd7232b5 100644 --- a/common/src/main/java/org/conscrypt/metrics/NoopStatsLog.java +++ b/common/src/main/java/org/conscrypt/metrics/NoopStatsLog.java @@ -20,6 +20,9 @@ import org.conscrypt.ct.PolicyCompliance; import org.conscrypt.ct.VerificationResult; +/** + * Noop class for stats logging + */ @Internal public class NoopStatsLog implements StatsLog { private static final StatsLog INSTANCE = new NoopStatsLog(); diff --git a/common/src/main/java/org/conscrypt/metrics/StatsLogImpl.java b/common/src/main/java/org/conscrypt/metrics/StatsLogImpl.java index 8a5421fcd..42f8b2e5f 100644 --- a/common/src/main/java/org/conscrypt/metrics/StatsLogImpl.java +++ b/common/src/main/java/org/conscrypt/metrics/StatsLogImpl.java @@ -44,6 +44,9 @@ import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; +/** + * Implements logging for Conscrypt metrics. + */ @Internal public final class StatsLogImpl implements StatsLog { private static final ExecutorService e = Executors.newSingleThreadExecutor(new ThreadFactory() { diff --git a/common/src/test/java/org/conscrypt/javax/crypto/CipherBasicsTest.java b/common/src/test/java/org/conscrypt/javax/crypto/CipherBasicsTest.java index 8fc873f93..8ef7c1be7 100644 --- a/common/src/test/java/org/conscrypt/javax/crypto/CipherBasicsTest.java +++ b/common/src/test/java/org/conscrypt/javax/crypto/CipherBasicsTest.java @@ -416,10 +416,11 @@ public void testAeadEncryption() throws Exception { // Some providers may not support all tag lengths or nonce lengths, // that's allowed if (e.getMessage().contains("IV must not be re-used")) { - throw new AssertionError( - "The same IV was used twice and therefore some tests did not run." + - "Provider = " + p.getName() + ", algorithm = " + transformation, - e); + throw new AssertionError("The same IV was used twice and therefore " + + "some tests did not run." + + "Provider = " + p.getName() + + ", algorithm = " + transformation, + e); } } } diff --git a/platform/src/test/java/org/conscrypt/AndroidHpkeSpiTest.java b/platform/src/test/java/org/conscrypt/AndroidHpkeSpiTest.java index 2545c2e1b..94b4f515e 100644 --- a/platform/src/test/java/org/conscrypt/AndroidHpkeSpiTest.java +++ b/platform/src/test/java/org/conscrypt/AndroidHpkeSpiTest.java @@ -54,4 +54,4 @@ public void functionalTest() throws Exception { assertNotNull(DuckTypedHpkeSpi.newInstance(spi)); } } -} \ No newline at end of file +} From 62dd5d557bab37ce4db95d3575eca45cd9d32e20 Mon Sep 17 00:00:00 2001 From: miguelaranda0 <90468342+miguelaranda0@users.noreply.github.com> Date: Mon, 20 Jan 2025 15:07:02 +0000 Subject: [PATCH 2/2] Update CipherBasicsTest.java Make it pass clang --- .../test/java/org/conscrypt/javax/crypto/CipherBasicsTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/src/test/java/org/conscrypt/javax/crypto/CipherBasicsTest.java b/common/src/test/java/org/conscrypt/javax/crypto/CipherBasicsTest.java index 8ef7c1be7..819f3e16d 100644 --- a/common/src/test/java/org/conscrypt/javax/crypto/CipherBasicsTest.java +++ b/common/src/test/java/org/conscrypt/javax/crypto/CipherBasicsTest.java @@ -417,7 +417,7 @@ public void testAeadEncryption() throws Exception { // that's allowed if (e.getMessage().contains("IV must not be re-used")) { throw new AssertionError("The same IV was used twice and therefore " - + "some tests did not run." + + "some tests did not run." + "Provider = " + p.getName() + ", algorithm = " + transformation, e);