]> source.dussan.org Git - jgit.git/commitdiff
ChangedPathFilter: Suppress warning about backing array (errorprone) 52/1176852/1
authorIvan Frade <ifrade@google.com>
Fri, 9 Feb 2024 17:18:37 +0000 (09:18 -0800)
committerIvan Frade <ifrade@google.com>
Fri, 9 Feb 2024 17:18:37 +0000 (09:18 -0800)
Errorprone warns about direct access to the underlying array.

That is the intention of this code, and those ByteBuffers are created
with ByteBuffer#wrap() so it should be safe.

Change-Id: Ic8e8b288f08ac794cf7f09dfccfefcba0a4685bf

org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/commitgraph/ChangedPathFilter.java

index 53d921e8f841a20c633af2f14e7aff9c2370538b..ad3ce50181fbf6cf53187c95942e3e9dfc5e8e3a 100644 (file)
@@ -87,6 +87,7 @@ public class ChangedPathFilter {
         *            the paths that the filter must match
         * @return the corresponding filter
         */
+       @SuppressWarnings("ByteBufferBackingArray")
        public static ChangedPathFilter fromPaths(Set<ByteBuffer> paths) {
                if (paths.isEmpty()) {
                        return EMPTY;