Polishing

This commit is contained in:
Juergen Hoeller
2014-01-13 22:25:34 +01:00
parent f7fc2cbc3b
commit 547646de6d
7 changed files with 46 additions and 102 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2013 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.
@@ -33,7 +33,7 @@ public class EnvironmentAccessor implements PropertyAccessor {
@Override
public Class<?>[] getSpecificTargetClasses() {
return new Class<?>[] { Environment.class };
return new Class<?>[] {Environment.class};
}
/**
@@ -51,12 +51,11 @@ public class EnvironmentAccessor implements PropertyAccessor {
*/
@Override
public TypedValue read(EvaluationContext context, Object target, String name) throws AccessException {
return new TypedValue(((Environment)target).getProperty(name));
return new TypedValue(((Environment) target).getProperty(name));
}
/**
* Read only.
* @return false
* Read-only: returns {@code false}.
*/
@Override
public boolean canWrite(EvaluationContext context, Object target, String name) throws AccessException {
@@ -64,7 +63,7 @@ public class EnvironmentAccessor implements PropertyAccessor {
}
/**
* Read only. No-op.
* Read-only: no-op.
*/
@Override
public void write(EvaluationContext context, Object target, String name, Object newValue) throws AccessException {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2013 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.
@@ -31,6 +31,7 @@ import org.springframework.util.StringUtils;
* of {@link ObjectError ObjectErrors} and {@link FieldError FieldErrors}.
*
* @author Juergen Hoeller
* @author Rossen Stoyanchev
* @since 2.5.3
*/
@SuppressWarnings("serial")
@@ -230,7 +231,7 @@ public abstract class AbstractErrors implements Errors, Serializable {
if (field.equals(fieldError.getField())) {
return true;
}
// Optimization: use chatAt instead of endsWith (SPR-11304, VESC-165)
// Optimization: use charAt instead of endsWith (SPR-11304)
int endIndex = field.length() - 1;
return (field.charAt(endIndex) == '*' && fieldError.getField().startsWith(field.substring(0, endIndex)));
}