Polishing

This commit is contained in:
Juergen Hoeller
2014-07-24 18:35:49 +02:00
parent fca72f6b65
commit 6e95b2613e
78 changed files with 467 additions and 463 deletions

View File

@@ -103,7 +103,7 @@ public final class ProducesRequestCondition extends AbstractRequestCondition<Pro
for (String header : headers) {
HeaderExpression expr = new HeaderExpression(header);
if ("Accept".equalsIgnoreCase(expr.name)) {
for( MediaType mediaType : MediaType.parseMediaTypes(expr.value)) {
for ( MediaType mediaType : MediaType.parseMediaTypes(expr.value)) {
result.add(new ProduceMediaTypeExpression(mediaType, expr.isNegated));
}
}

View File

@@ -99,7 +99,7 @@ public final class RequestMethodsRequestCondition extends AbstractRequestConditi
return this;
}
RequestMethod incomingRequestMethod = getRequestMethod(request);
if(incomingRequestMethod != null) {
if (incomingRequestMethod != null) {
for (RequestMethod method : this.methods) {
if (method.equals(incomingRequestMethod)) {
return new RequestMethodsRequestCondition(method);

View File

@@ -381,7 +381,7 @@ public class ExceptionHandlerExceptionResolver extends AbstractHandlerMethodExce
}
}
for (Entry<ControllerAdviceBean, ExceptionHandlerMethodResolver> entry : this.exceptionHandlerAdviceCache.entrySet()) {
if(entry.getKey().isApplicableToBeanType(handlerType)) {
if (entry.getKey().isApplicableToBeanType(handlerType)) {
ExceptionHandlerMethodResolver resolver = entry.getValue();
Method method = resolver.resolveMethod(exception);
if (method != null) {

View File

@@ -228,7 +228,7 @@ public class MessageTag extends HtmlEscapingAwareTag implements ArgumentAware {
if (this.code != null || this.text != null) {
// We have a code or default text that we need to resolve.
Object[] argumentsArray = resolveArguments(this.arguments);
if(!this.nestedArguments.isEmpty()) {
if (!this.nestedArguments.isEmpty()) {
argumentsArray = appendArguments(argumentsArray,
this.nestedArguments.toArray());
}
@@ -250,7 +250,7 @@ public class MessageTag extends HtmlEscapingAwareTag implements ArgumentAware {
}
private Object[] appendArguments(Object[] sourceArguments, Object[] additionalArguments) {
if(ObjectUtils.isEmpty(sourceArguments)) {
if (ObjectUtils.isEmpty(sourceArguments)) {
return additionalArguments;
}
Object[] arguments = new Object[sourceArguments.length + additionalArguments.length];

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2013 the original author or authors.
* Copyright 2002-2014 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.
@@ -137,7 +137,8 @@ public class OptionsTag extends AbstractHtmlElementTag {
Object itemsObject = null;
if (items != null) {
itemsObject = (items instanceof String ? evaluate("items", items) : items);
} else {
}
else {
Class<?> selectTagBoundType = selectTag.getBindStatus().getValueType();
if (selectTagBoundType != null && selectTagBoundType.isEnum()) {
itemsObject = selectTagBoundType.getEnumConstants();

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2014 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.
@@ -35,19 +35,20 @@ public class PasswordInputTag extends InputTag {
/**
* Is the password value to be rendered?
* @return {@code true} if the password value to be rendered.
* @param showPassword {@code true} if the password value is to be rendered
*/
public void setShowPassword(boolean showPassword) {
this.showPassword = showPassword;
}
/**
* Is the password value to be rendered?
* @return {@code true} if the password value to be rendered
*/
public boolean isShowPassword() {
return this.showPassword;
}
/**
* Is the password value to be rendered?
* @param showPassword {@code true} if the password value is to be rendered.
*/
public void setShowPassword(boolean showPassword) {
this.showPassword = showPassword;
}
/**
* Flags "type" as an illegal dynamic attribute.
@@ -75,8 +76,10 @@ public class PasswordInputTag extends InputTag {
protected void writeValue(TagWriter tagWriter) throws JspException {
if (this.showPassword) {
super.writeValue(tagWriter);
} else {
}
else {
tagWriter.writeAttribute("value", processFieldValue(getName(), "", getType()));
}
}
}

View File

@@ -257,7 +257,7 @@ public class TilesConfigurer implements ServletContextAware, InitializingBean, D
}
/**
* Creates a new instance of {@link SpringTilesInitializer}.
* Creates a new instance of {@code SpringTilesInitializer}.
* <p>Override it to use a different initializer.
* @see org.apache.tiles.web.startup.AbstractTilesListener#createTilesInitializer()
*/

View File

@@ -82,7 +82,7 @@
* by user config.
*#
#macro( springBind $path )
#if("$!springHtmlEscape" != "")
#if ("$!springHtmlEscape" != "")
#set( $status = $springMacroRequestContext.getBindStatus($path, $springHtmlEscape) )
#else
#set( $status = $springMacroRequestContext.getBindStatus($path) )
@@ -171,7 +171,7 @@
* from a list of options.
*
* The null check for $status.value leverages Velocity's 'quiet' notation rather
* than the more common #if($status.value) since this method evaluates to the
* than the more common #if ($status.value) since this method evaluates to the
* boolean 'false' if the content of $status.value is the String "false" - not
* what we want.
*
@@ -185,7 +185,7 @@
<select id="${status.expression}" name="${status.expression}" ${attributes}>
#foreach($option in $options.keySet())
<option value="${option}"
#if("$!status.value" == "$option") selected="selected" #end>
#if ("$!status.value" == "$option") selected="selected" #end>
${options.get($option)}</option>
#end
</select>
@@ -208,7 +208,7 @@
#foreach($option in $options.keySet())
<option value="${option}"
#foreach($item in $status.actualValue)
#if($item == $option) selected="selected" #end
#if ($item == $option) selected="selected" #end
#end
>${options.get($option)}</option>
#end
@@ -231,7 +231,7 @@
#springBind($path)
#foreach($option in $options.keySet())
<input type="radio" name="${status.expression}" value="${option}"
#if("$!status.value" == "$option") checked="checked" #end
#if ("$!status.value" == "$option") checked="checked" #end
${attributes}
#springCloseTag()
${options.get($option)} ${separator}
@@ -255,7 +255,7 @@
#foreach($option in $options.keySet())
<input type="checkbox" name="${status.expression}" value="${option}"
#foreach($item in $status.actualValue)
#if($item == $option) checked="checked" #end
#if ($item == $option) checked="checked" #end
#end
${attributes} #springCloseTag()
${options.get($option)} ${separator}
@@ -275,7 +275,7 @@
#macro( springFormCheckbox $path $attributes )
#springBind($path)
<input type="hidden" name="_${status.expression}" value="on"/>
<input type="checkbox" id="${status.expression}" name="${status.expression}"#if("$!{status.value}"=="true") checked="checked"#end ${attributes}/>
<input type="checkbox" id="${status.expression}" name="${status.expression}"#if ("$!{status.value}"=="true") checked="checked"#end ${attributes}/>
#end
#**
@@ -293,10 +293,10 @@
*#
#macro( springShowErrors $separator $classOrStyle )
#foreach($error in $status.errorMessages)
#if($classOrStyle == "")
#if ($classOrStyle == "")
<b>${error}</b>
#else
#if($classOrStyle.indexOf(":") == -1)
#if ($classOrStyle.indexOf(":") == -1)
#set($attr="class")
#else
#set($attr="style")
@@ -314,7 +314,7 @@
* depending on the value of a 'springXhtmlCompliant' variable in the
* template context.
*#
#macro( springCloseTag )#if($springXhtmlCompliant)/>#else>#end #end
#macro( springCloseTag )#if ($springXhtmlCompliant)/>#else>#end #end