Added @SafeVarargs annotation for methods with varargs

Suppress compiler warning

Signed-off-by: Karsten Thoms <karsten.thoms@itemis.de>
This commit is contained in:
Karsten Thoms 2017-01-05 07:16:44 +01:00
parent c11fc9bb46
commit 89fc6af674
3 changed files with 4 additions and 0 deletions

View file

@ -25,6 +25,7 @@ public final class Tuples {
return new Triple<A, B, C>(a,b,c);
}
@SafeVarargs
public static <A,B> Map<A,B> toMap(Pair<A,B>...pairs) {
Map<A, B> result = new LinkedHashMap<A, B>();
for (Pair<A,B> pair : pairs) {

View file

@ -158,6 +158,7 @@ public class NfaToProduction {
super();
}
@SafeVarargs
public AlternativeAlias(boolean optional, boolean many, AbstractElementAlias<T>... children) {
super(optional, many);
Collections.addAll(this.children, children);
@ -243,6 +244,7 @@ public class NfaToProduction {
super();
}
@SafeVarargs
public GroupAlias(boolean optional, boolean many, AbstractElementAlias<T>... children) {
super(optional, many);
Collections.addAll(this.children, children);

View file

@ -27,6 +27,7 @@ public class RegionsOutsideFrameException extends RuntimeException {
private final String frameTitle;
private final Pair<String, ITextSegment>[] regions;
@SafeVarargs
public RegionsOutsideFrameException(String title, ITextSegment frame, Pair<String, ITextSegment>... regions) {
this.frameTitle = title;
this.frameRegion = frame;