#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

@ -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());