From 4815db563bd106605b55c0e30d637150b02aa6b3 Mon Sep 17 00:00:00 2001 From: Ivan Frade Date: Tue, 12 Nov 2024 15:40:43 -0800 Subject: [PATCH] [errorprone] ssh: suppress warning for arrays in records Errorpone considers an error to have arrays (mutable) inside records (immutable) [1]. Suppress the warnings in these records, as they are overriding equals and hash to do the right thing. [1] https://errorprone.info/bugpattern/ArrayRecordComponent Change-Id: I01c724516b1b14d512d366a35708436463fccffc --- .../org/eclipse/jgit/internal/signing/ssh/AllowedSigners.java | 1 + .../org/eclipse/jgit/internal/signing/ssh/OpenSshBinaryKrl.java | 1 + 2 files changed, 2 insertions(+) diff --git a/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/signing/ssh/AllowedSigners.java b/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/signing/ssh/AllowedSigners.java index 92cf1faec9..cfbe7a78a7 100644 --- a/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/signing/ssh/AllowedSigners.java +++ b/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/signing/ssh/AllowedSigners.java @@ -82,6 +82,7 @@ final class AllowedSigners extends ModifiableFileWatcher { private static final Predicate PLAIN_KEYS = Predicate .not(CERTIFICATES); + @SuppressWarnings("ArrayRecordComponent") static record AllowedEntry(String[] identities, boolean isCA, String[] namespaces, Instant validAfter, Instant validBefore, String key) { diff --git a/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/signing/ssh/OpenSshBinaryKrl.java b/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/signing/ssh/OpenSshBinaryKrl.java index 46518d8c84..6b19eb3295 100644 --- a/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/signing/ssh/OpenSshBinaryKrl.java +++ b/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/signing/ssh/OpenSshBinaryKrl.java @@ -90,6 +90,7 @@ class OpenSshBinaryKrl { * @param blob * the array to wrap */ + @SuppressWarnings("ArrayRecordComponent") private static record Blob(byte[] blob) { @Override -- 2.39.5