Polishing

This commit is contained in:
Juergen Hoeller
2016-10-21 12:26:27 +02:00
parent be187babf9
commit 3726c6f18d
37 changed files with 104 additions and 120 deletions

View File

@@ -641,7 +641,7 @@ public abstract class FrameworkServlet extends HttpServletBean implements Applic
else {
// Generate default id...
wac.setId(ConfigurableWebApplicationContext.APPLICATION_CONTEXT_ID_PREFIX +
ObjectUtils.getDisplayString(getServletContext().getContextPath()) + "/" + getServletName());
ObjectUtils.getDisplayString(getServletContext().getContextPath()) + '/' + getServletName());
}
}

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.
@@ -105,7 +105,7 @@ public abstract class AbstractVersionStrategy implements VersionStrategy {
}
else {
return (this.prefix.endsWith("/") || path.startsWith("/") ?
this.prefix + path : this.prefix + "/" + path);
this.prefix + path : this.prefix + '/' + path);
}
}
}
@@ -124,7 +124,7 @@ public abstract class AbstractVersionStrategy implements VersionStrategy {
Matcher matcher = pattern.matcher(requestPath);
if (matcher.find()) {
String match = matcher.group(1);
return (match.contains("-") ? match.substring(match.lastIndexOf("-") + 1) : match);
return (match.contains("-") ? match.substring(match.lastIndexOf('-') + 1) : match);
}
else {
return null;
@@ -140,7 +140,7 @@ public abstract class AbstractVersionStrategy implements VersionStrategy {
public String addVersion(String requestPath, String version) {
String baseFilename = StringUtils.stripFilenameExtension(requestPath);
String extension = StringUtils.getFilenameExtension(requestPath);
return (baseFilename + "-" + version + "." + extension);
return (baseFilename + '-' + version + '.' + extension);
}
}

View File

@@ -300,7 +300,7 @@ public class UrlTag extends HtmlEscapingAwareTag implements ParamAware {
}
}
else {
template = URL_TEMPLATE_DELIMITER_PREFIX + "/" + param.getName() + URL_TEMPLATE_DELIMITER_SUFFIX;
template = URL_TEMPLATE_DELIMITER_PREFIX + '/' + param.getName() + URL_TEMPLATE_DELIMITER_SUFFIX;
if (uri.contains(template)) {
usedParams.add(param.getName());
try {

View File

@@ -179,7 +179,7 @@ public abstract class AbstractCachingViewResolver extends WebApplicationObjectSu
* lead to a different view resource.
*/
protected Object getCacheKey(String viewName, Locale locale) {
return viewName + "_" + locale;
return viewName + '_' + locale;
}
/**

View File

@@ -303,7 +303,7 @@ public class ContentNegotiatingViewResolver extends WebApplicationObjectSupport
for (MediaType requestedMediaType : requestedMediaTypes) {
List<String> extensions = this.contentNegotiationManager.resolveFileExtensions(requestedMediaType);
for (String extension : extensions) {
String viewNameWithExtension = viewName + "." + extension;
String viewNameWithExtension = viewName + '.' + extension;
view = viewResolver.resolveViewName(viewNameWithExtension, locale);
if (view != null) {
candidateViews.add(view);

View File

@@ -70,7 +70,7 @@ public class GroovyMarkupViewResolver extends AbstractTemplateViewResolver {
*/
@Override
protected Object getCacheKey(String viewName, Locale locale) {
return viewName + "_" + locale;
return viewName + '_' + locale;
}
}