#18860 add back @SafeVarargs annotations

This commit is contained in:
2beaucoup 2016-01-14 14:43:07 +01:00
parent e92429dab9
commit aed67715af
4 changed files with 7 additions and 3 deletions

View file

@ -4,6 +4,7 @@ import scala.collection.Seq;
public class JAPI {
@SafeVarargs
public static <T> Seq<T> seq(T... ts) {
return Util.immutableSeq(ts);
}

View file

@ -40,6 +40,7 @@ public final class FormData {
/**
* Creates the FormData from the given parameters.
*/
@SafeVarargs
public static FormData create(Pair<String, String>... params) {
return new FormData(Query.create(params));
}

View file

@ -94,6 +94,7 @@ public abstract class Query {
/**
* Returns a Query from the given parameters.
*/
@SafeVarargs
public static Query create(Pair<String, String>... params) {
return new JavaQuery(UriJavaAccessor.queryApply(params));
}

View file

@ -34,16 +34,17 @@ public class FormFieldsTest extends JUnitRouteTest {
static RequestVal<Option<Integer>> optionalIntParam = FormFields.intValue("optionalIntParam").optional();
private Map.Entry<String, String> entry(String name, String value) {
return new AbstractMap.SimpleImmutableEntry<String, String>(name, value);
return new AbstractMap.SimpleImmutableEntry<>(name, value);
}
private HttpRequest urlEncodedRequest(Map.Entry<String, String>... entries) {
@SafeVarargs
final private HttpRequest urlEncodedRequest(Map.Entry<String, String>... entries) {
StringBuilder sb = new StringBuilder();
boolean next = false;
for (Map.Entry<String, String> entry: entries) {
if (next) {
sb.append('&');
next = true;
}
next = true;
sb.append(entry.getKey());
sb.append('=');
sb.append(entry.getValue());