Polishing

This commit is contained in:
Juergen Hoeller
2015-09-04 14:38:47 +02:00
parent 811de8e50b
commit 667fc7e4a9
12 changed files with 32 additions and 37 deletions

View File

@@ -422,10 +422,10 @@ public class ResponseEntity<T> extends HttpEntity<T> {
@Override
public BodyBuilder eTag(String eTag) {
if (eTag != null) {
if(!eTag.startsWith("\"") && !eTag.startsWith("W/\"")) {
if (!eTag.startsWith("\"") && !eTag.startsWith("W/\"")) {
eTag = "\"" + eTag;
}
if(!eTag.endsWith("\"")) {
if (!eTag.endsWith("\"")) {
eTag = eTag + "\"";
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2014 the original author or authors.
* Copyright 2002-2015 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.
@@ -234,7 +234,7 @@ public class ContentNegotiationManagerFactoryBean
strategies.add(new HeaderContentNegotiationStrategy());
}
if(this.defaultNegotiationStrategy != null) {
if (this.defaultNegotiationStrategy != null) {
strategies.add(defaultNegotiationStrategy);
}

View File

@@ -80,7 +80,7 @@ public class HttpMessageConverterExtractor<T> implements ResponseExtractor<T> {
public T extractData(ClientHttpResponse response) throws IOException {
MessageBodyClientHttpResponseWrapper responseWrapper = new MessageBodyClientHttpResponseWrapper(response);
if(!responseWrapper.hasMessageBody() || responseWrapper.hasEmptyMessageBody()) {
if (!responseWrapper.hasMessageBody() || responseWrapper.hasEmptyMessageBody()) {
return null;
}
MediaType contentType = getContentType(responseWrapper);

View File

@@ -61,7 +61,7 @@ class MessageBodyClientHttpResponseWrapper implements ClientHttpResponse {
responseStatus == HttpStatus.NOT_MODIFIED) {
return false;
}
else if(this.getHeaders().getContentLength() == 0) {
else if (this.getHeaders().getContentLength() == 0) {
return false;
}
return true;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2014 the original author or authors.
* Copyright 2002-2015 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.
@@ -180,7 +180,7 @@ public class UrlPathHelper {
String path;
// if the app container sanitized the servletPath, check against the sanitized version
if(servletPath.indexOf(sanitizedPathWithinApp) != -1) {
if (servletPath.indexOf(sanitizedPathWithinApp) != -1) {
path = getRemainingPath(sanitizedPathWithinApp, servletPath, false);
}
else {