Polishing
This commit is contained in:
@@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -70,7 +70,7 @@ public class GroovyMarkupViewResolver extends AbstractTemplateViewResolver {
|
||||
*/
|
||||
@Override
|
||||
protected Object getCacheKey(String viewName, Locale locale) {
|
||||
return viewName + "_" + locale;
|
||||
return viewName + '_' + locale;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user