Clean up warnings in spring-web

This commit is contained in:
Sam Brannen
2015-07-06 18:30:20 +02:00
parent 67ac675e9a
commit 0f7fc12569
23 changed files with 60 additions and 67 deletions

View File

@@ -195,7 +195,6 @@ public class HttpComponentsClientHttpRequestFactory implements ClientHttpRequest
@Override
@SuppressWarnings("deprecation")
public ClientHttpRequest createRequest(URI uri, HttpMethod httpMethod) throws IOException {
HttpClient client = getHttpClient();
Assert.state(client != null, "Synchronous execution requires an HttpClient to be set");

View File

@@ -27,7 +27,6 @@ import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Random;
import javax.mail.internet.MimeUtility;
import org.springframework.core.io.Resource;
@@ -99,8 +98,6 @@ public class FormHttpMessageConverter implements HttpMessageConverter<MultiValue
private List<HttpMessageConverter<?>> partConverters = new ArrayList<HttpMessageConverter<?>>();
private final Random random = new Random();
public FormHttpMessageConverter() {
this.supportedMediaTypes.add(MediaType.APPLICATION_FORM_URLENCODED);

View File

@@ -465,6 +465,7 @@ public class Jackson2ObjectMapperBuilder {
* @see #modulesToInstall(Module...)
* @see com.fasterxml.jackson.databind.Module
*/
@SuppressWarnings("unchecked")
public Jackson2ObjectMapperBuilder modulesToInstall(Class<? extends Module>... modules) {
this.moduleClasses = modules;
this.findWellKnownModules = true;
@@ -712,7 +713,6 @@ public class Jackson2ObjectMapperBuilder {
* Obtain a {@link Jackson2ObjectMapperBuilder} instance in order to
* build an {@link XmlMapper} instance.
*/
@SuppressWarnings("unchecked")
public static Jackson2ObjectMapperBuilder xml() {
return new Jackson2ObjectMapperBuilder().createXmlMapper(true);
}

View File

@@ -348,6 +348,7 @@ public class Jackson2ObjectMapperFactoryBean implements FactoryBean<ObjectMapper
* @since 4.0.1
* @see com.fasterxml.jackson.databind.Module
*/
@SuppressWarnings("unchecked")
public void setModulesToInstall(Class<? extends Module>... modules) {
this.builder.modulesToInstall(modules);
}
@@ -391,7 +392,6 @@ public class Jackson2ObjectMapperFactoryBean implements FactoryBean<ObjectMapper
@Override
@SuppressWarnings("unchecked")
public void afterPropertiesSet() {
if (this.objectMapper != null) {
this.builder.configure(this.objectMapper);

View File

@@ -34,7 +34,6 @@ import org.springframework.http.server.ServerHttpRequest;
import org.springframework.http.server.ServerHttpResponse;
import org.springframework.http.server.ServletServerHttpRequest;
import org.springframework.http.server.ServletServerHttpResponse;
import org.springframework.util.Assert;
import org.springframework.util.CollectionUtils;
/**

View File

@@ -872,7 +872,6 @@ final class HierarchicalUriComponents extends UriComponents {
@Override
public void copyToUriComponentsBuilder(UriComponentsBuilder builder) {
}
@SuppressWarnings("EqualsWhichDoesntCheckParameterClass")
@Override
public boolean equals(Object obj) {
return (this == obj);

View File

@@ -33,9 +33,6 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.http.HttpRequest;
import org.springframework.util.Assert;
import org.springframework.util.CollectionUtils;
@@ -135,14 +132,12 @@ public abstract class WebUtils {
/** Key for the mutex session attribute */
public static final String SESSION_MUTEX_ATTRIBUTE = WebUtils.class.getName() + ".MUTEX";
private static final Log logger = LogFactory.getLog(WebUtils.class);
/**
* Set a system property to the web application root directory.
* The key of the system property can be defined with the "webAppRootKey"
* context-param in {@code web.xml}. Default is "webapp.root".
* <p>Can be used for tools that support substition with {@code System.getProperty}
* <p>Can be used for tools that support substitution with {@code System.getProperty}
* values, like log4j's "${key}" syntax within log file locations.
* @param servletContext the servlet context of the web application
* @throws IllegalStateException if the system property is already set,