]> source.dussan.org Git - jgit.git/commitdiff
[errorprone] ssh: suppress warning for arrays in records 80/1203980/2
authorIvan Frade <ifrade@google.com>
Tue, 12 Nov 2024 23:40:43 +0000 (15:40 -0800)
committerIvan Frade <ifrade@google.com>
Wed, 13 Nov 2024 17:10:37 +0000 (09:10 -0800)
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.ssh.apache/src/org/eclipse/jgit/internal/signing/ssh/AllowedSigners.java
org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/signing/ssh/OpenSshBinaryKrl.java

index 92cf1faec932d0409196414baf547da29cef7ed8..cfbe7a78a7c6249811fd27a4a741b7e027809c73 100644 (file)
@@ -82,6 +82,7 @@ final class AllowedSigners extends ModifiableFileWatcher {
        private static final Predicate<AllowedEntry> PLAIN_KEYS = Predicate
                        .not(CERTIFICATES);
 
+       @SuppressWarnings("ArrayRecordComponent")
        static record AllowedEntry(String[] identities, boolean isCA,
                        String[] namespaces, Instant validAfter, Instant validBefore,
                        String key) {
index 46518d8c84c0ff6ce9e0026da194d136c8e2324a..6b19eb3295c37e671784c793a7542e2b94d60807 100644 (file)
@@ -90,6 +90,7 @@ class OpenSshBinaryKrl {
         * @param blob
         *            the array to wrap
         */
+       @SuppressWarnings("ArrayRecordComponent")
        private static record Blob(byte[] blob) {
 
                @Override