diff options
author | Matthias Sohn <matthias.sohn@sap.com> | 2023-09-20 16:17:00 +0200 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2023-09-25 16:15:35 +0200 |
commit | 28d4b349024420ae56a54fb449f1791986bbff89 (patch) | |
tree | e770b971890461eb294607b9b2cf28c1a1c44332 /org.eclipse.jgit/src/org/eclipse/jgit | |
parent | cda8ffdbb4600410451ea8e100f7f6cd4ab8b3f3 (diff) | |
download | jgit-28d4b349024420ae56a54fb449f1791986bbff89.tar.gz jgit-28d4b349024420ae56a54fb449f1791986bbff89.zip |
[errorprone] PathFilter#getPathsBestEffort: fix ArrayAsKeyOfSetOrMap
See https://errorprone.info/bugpattern/ArrayAsKeyOfSetOrMap
Change-Id: Ia94899bfa68db39f4eb8bfca455c92f5c888647c
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse/jgit')
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/PathFilter.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/PathFilter.java b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/PathFilter.java index 66ab8bb5be..62422817ac 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/PathFilter.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/PathFilter.java @@ -11,9 +11,10 @@ package org.eclipse.jgit.treewalk.filter; +import java.util.Collections; import java.util.Optional; import java.util.Set; -import java.util.HashSet; + import org.eclipse.jgit.internal.JGitText; import org.eclipse.jgit.lib.Constants; import org.eclipse.jgit.treewalk.TreeWalk; @@ -91,8 +92,7 @@ public class PathFilter extends TreeFilter { @Override public Optional<Set<byte[]>> getPathsBestEffort() { - HashSet<byte[]> s = new HashSet<>(); - s.add(pathRaw); + Set<byte[]> s = Collections.singleton(pathRaw); return Optional.of(s); } |