From 0d872a083700f6e8153069b656d28eb7b7e2e1ec Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Thu, 21 Jul 2016 18:45:27 +0900 Subject: Annotate Sets#of with @SafeVarArgs to prevent heap pollution warning This prevents the warning: Potential heap pollution via varargs parameter The method doesn't do any casting of types that would cause the heap pollution, so it should be safe to add @SafeVarArgs. See [1] for information about this warning. [1] http://stackoverflow.com/a/12462259/381622 Change-Id: Ic6d252915ea44b4f1c385afecb98906cd2c54382 Signed-off-by: David Pursehouse --- org.eclipse.jgit.test/src/org/eclipse/jgit/lib/Sets.java | 1 + 1 file changed, 1 insertion(+) (limited to 'org.eclipse.jgit.test') diff --git a/org.eclipse.jgit.test/src/org/eclipse/jgit/lib/Sets.java b/org.eclipse.jgit.test/src/org/eclipse/jgit/lib/Sets.java index 731685731b..4454e1a393 100644 --- a/org.eclipse.jgit.test/src/org/eclipse/jgit/lib/Sets.java +++ b/org.eclipse.jgit.test/src/org/eclipse/jgit/lib/Sets.java @@ -47,6 +47,7 @@ import java.util.HashSet; import java.util.Set; public class Sets { + @SafeVarargs public static Set of(T... elements) { Set ret = new HashSet(); for (T element : elements) -- cgit v1.2.3