Avoid unnecessary generics on emptyMap/Set/List

This commit is contained in:
Juergen Hoeller
2016-09-26 18:04:49 +02:00
parent a6b0b6e279
commit fb7ae010c8
35 changed files with 69 additions and 73 deletions

View File

@@ -269,7 +269,7 @@ public class MediaType extends MimeType implements Serializable {
* @throws IllegalArgumentException if any of the parameters contain illegal characters
*/
public MediaType(String type, String subtype) {
super(type, subtype, Collections.<String, String>emptyMap());
super(type, subtype, Collections.emptyMap());
}
/**
@@ -463,7 +463,7 @@ public class MediaType extends MimeType implements Serializable {
*/
public static List<MediaType> parseMediaTypes(List<String> mediaTypes) {
if (CollectionUtils.isEmpty(mediaTypes)) {
return Collections.<MediaType>emptyList();
return Collections.emptyList();
}
else if (mediaTypes.size() == 1) {
return parseMediaTypes(mediaTypes.get(0));

View File

@@ -47,7 +47,7 @@ public class InterceptingAsyncClientHttpRequestFactory implements AsyncClientHtt
List<AsyncClientHttpRequestInterceptor> interceptors) {
this.delegate = delegate;
this.interceptors = (interceptors != null ? interceptors : Collections.<AsyncClientHttpRequestInterceptor>emptyList());
this.interceptors = (interceptors != null ? interceptors : Collections.emptyList());
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2015 the original author or authors.
* Copyright 2002-2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -42,7 +42,7 @@ public class InterceptingClientHttpRequestFactory extends AbstractClientHttpRequ
List<ClientHttpRequestInterceptor> interceptors) {
super(requestFactory);
this.interceptors = (interceptors != null ? interceptors : Collections.<ClientHttpRequestInterceptor>emptyList());
this.interceptors = (interceptors != null ? interceptors : Collections.emptyList());
}
@Override

View File

@@ -45,7 +45,7 @@ public class HeaderContentNegotiationStrategy implements ContentNegotiationStrat
String[] headerValueArray = request.getHeaderValues(HttpHeaders.ACCEPT);
if (headerValueArray == null) {
return Collections.<MediaType>emptyList();
return Collections.emptyList();
}
List<String> headerValues = Arrays.asList(headerValueArray);

View File

@@ -90,7 +90,7 @@ public class MappingMediaTypeFileExtensionResolver implements MediaTypeFileExten
@Override
public List<String> resolveFileExtensions(MediaType mediaType) {
List<String> fileExtensions = this.fileExtensions.get(mediaType);
return (fileExtensions != null) ? fileExtensions : Collections.<String>emptyList();
return (fileExtensions != null) ? fileExtensions : Collections.emptyList();
}
@Override

View File

@@ -213,7 +213,7 @@ public class ForwardedHeaderFilter extends OncePerRequestFilter {
@Override
public Enumeration<String> getHeaders(String name) {
List<String> value = this.headers.get(name);
return (Collections.enumeration(value != null ? value : Collections.<String>emptySet()));
return (Collections.enumeration(value != null ? value : Collections.emptySet()));
}
@Override