aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit/src/org/eclipse/jgit
diff options
context:
space:
mode:
authorMatthias Sohn <matthias.sohn@sap.com>2023-09-20 16:17:00 +0200
committerMatthias Sohn <matthias.sohn@sap.com>2023-09-25 16:15:35 +0200
commit28d4b349024420ae56a54fb449f1791986bbff89 (patch)
treee770b971890461eb294607b9b2cf28c1a1c44332 /org.eclipse.jgit/src/org/eclipse/jgit
parentcda8ffdbb4600410451ea8e100f7f6cd4ab8b3f3 (diff)
downloadjgit-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.java6
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);
}