Polishing

This commit is contained in:
Juergen Hoeller
2018-07-25 14:16:02 +02:00
parent 3899b7a909
commit 3881a4aded
39 changed files with 133 additions and 147 deletions

View File

@@ -172,7 +172,7 @@ import org.springframework.web.util.UrlPathHelper;
*/
public class WebMvcConfigurationSupport implements ApplicationContextAware, ServletContextAware {
private static boolean romePresent;
private static final boolean romePresent;
private static final boolean jaxb2Present;

View File

@@ -122,6 +122,14 @@ public class RequestMappingHandlerMapping extends RequestMappingInfoHandlerMappi
this.pathPrefixes = Collections.unmodifiableMap(new LinkedHashMap<>(prefixes));
}
/**
* The configured path prefixes as a read-only, possibly empty map.
* @since 5.1
*/
public Map<String, Predicate<Class<?>>> getPathPrefixes() {
return this.pathPrefixes;
}
/**
* Set the {@link ContentNegotiationManager} to use to determine requested media types.
* If not set, the default constructor is used.
@@ -131,6 +139,13 @@ public class RequestMappingHandlerMapping extends RequestMappingInfoHandlerMappi
this.contentNegotiationManager = contentNegotiationManager;
}
/**
* Return the configured {@link ContentNegotiationManager}.
*/
public ContentNegotiationManager getContentNegotiationManager() {
return this.contentNegotiationManager;
}
@Override
public void setEmbeddedValueResolver(StringValueResolver resolver) {
this.embeddedValueResolver = resolver;
@@ -171,21 +186,6 @@ public class RequestMappingHandlerMapping extends RequestMappingInfoHandlerMappi
return this.useTrailingSlashMatch;
}
/**
* The configured path prefixes as a read-only, possibly empty map.
* @since 5.1
*/
public Map<String, Predicate<Class<?>>> getPathPrefixes() {
return this.pathPrefixes;
}
/**
* Return the configured {@link ContentNegotiationManager}.
*/
public ContentNegotiationManager getContentNegotiationManager() {
return this.contentNegotiationManager;
}
/**
* Return the file extensions to use for suffix pattern matching.
*/

View File

@@ -108,7 +108,7 @@ public class CssLinkResourceTransformer extends ResourceTransformerSupport {
private boolean hasScheme(String link) {
int schemeIndex = link.indexOf(':');
return (schemeIndex > 0 && !link.substring(0, schemeIndex).contains("/")) || link.indexOf("//") == 0;
return ((schemeIndex > 0 && !link.substring(0, schemeIndex).contains("/")) || link.indexOf("//") == 0);
}
@@ -167,9 +167,7 @@ public class CssLinkResourceTransformer extends ResourceTransformerSupport {
* Invoked after a keyword match, after whitespaces removed, and when
* the next char is neither a single nor double quote.
*/
protected abstract int extractLink(int index, String content,
SortedSet<ContentChunkInfo> linksToAdd);
protected abstract int extractLink(int index, String content, SortedSet<ContentChunkInfo> linksToAdd);
}

View File

@@ -149,7 +149,9 @@ public class EncodedResourceResolver extends AbstractResourceResolver {
}
}
catch (IOException ex) {
logger.trace("No " + coding + " resource for [" + resource.getFilename() + "]", ex);
if (logger.isTraceEnabled()) {
logger.trace("No " + coding + " resource for [" + resource.getFilename() + "]", ex);
}
}
}
}
@@ -188,7 +190,6 @@ public class EncodedResourceResolver extends AbstractResourceResolver {
private final Resource encoded;
EncodedResource(Resource original, String coding, String extension) throws IOException {
this.original = original;
this.coding = coding;