Author: hardy.ferentschik
Date: 2010-05-26 05:43:07 -0400 (Wed, 26 May 2010)
New Revision: 19610
Modified:
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/cfg/ConstraintMapping.java
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/engine/groups/GroupChain.java
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/engine/resolver/SingleThreadCachedTraversableResolver.java
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/messageinterpolation/ResourceBundleMessageInterpolator.java
Log:
HV-274 some coding style fixes
Modified:
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/cfg/ConstraintMapping.java
===================================================================
---
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/cfg/ConstraintMapping.java 2010-05-25
20:45:26 UTC (rev 19609)
+++
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/cfg/ConstraintMapping.java 2010-05-26
09:43:07 UTC (rev 19610)
@@ -28,7 +28,7 @@
import java.util.Set;
/**
- * Top level class for programmatically configured constraints.
+ * Top level class for constraints configured via the programmatic API.
*
* @author Hardy Ferentschik
*/
@@ -51,6 +51,7 @@
protected <A extends Annotation> void addConstraintConfig(ConstraintDef<?>
definition) {
Class<?> beanClass = definition.beanType;
+ @SuppressWarnings( "unchecked")
ConstraintDefAccessor<A> defAccessor = new ConstraintDefAccessor<A>(
beanClass,
( Class<A> ) definition.constraintType,
Modified:
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/engine/groups/GroupChain.java
===================================================================
---
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/engine/groups/GroupChain.java 2010-05-25
20:45:26 UTC (rev 19609)
+++
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/engine/groups/GroupChain.java 2010-05-26
09:43:07 UTC (rev 19610)
@@ -30,7 +30,7 @@
*
* @author Hardy Ferentschik
*/
-public class GroupChain {
+public final class GroupChain {
/**
* The list of single groups to be used this validation.
@@ -78,11 +78,11 @@
public void assertDefaultGroupSequenceIsExpandable(List<Class<?>>
defaultGroupSequence) {
for ( Map.Entry<Class<?>, List<Group>> entry : sequenceMap.entrySet()
) {
Class<?> sequence = entry.getKey();
- List<Group> groupList = entry.getValue();
+ List<Group> groups = entry.getValue();
List<Group> defaultGroupList = buildTempGroupList( defaultGroupSequence,
sequence );
- int defaultGroupIndex = containsDefaultGroupAtIndex( sequence, groupList );
+ int defaultGroupIndex = containsDefaultGroupAtIndex( sequence, groups );
if ( defaultGroupIndex != -1 ) {
- ensureDefaultGroupSequenceIsExpandable( groupList, defaultGroupList,
defaultGroupIndex );
+ ensureDefaultGroupSequenceIsExpandable( groups, defaultGroupList, defaultGroupIndex
);
}
}
}
@@ -113,11 +113,11 @@
}
private List<Group> buildTempGroupList(List<Class<?>>
defaultGroupSequence, Class<?> sequence) {
- List<Group> groupList = new ArrayList<Group>();
+ List<Group> groups = new ArrayList<Group>();
for ( Class<?> clazz : defaultGroupSequence ) {
Group g = new Group( clazz, sequence );
- groupList.add( g );
+ groups.add( g );
}
- return groupList;
+ return groups;
}
}
Modified:
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/engine/resolver/SingleThreadCachedTraversableResolver.java
===================================================================
---
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/engine/resolver/SingleThreadCachedTraversableResolver.java 2010-05-25
20:45:26 UTC (rev 19609)
+++
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/engine/resolver/SingleThreadCachedTraversableResolver.java 2010-05-26
09:43:07 UTC (rev 19610)
@@ -94,7 +94,7 @@
return cachedLH.isCascadable;
}
- private static class TraversableHolder {
+ private static final class TraversableHolder {
private final Object traversableObject;
private final Path.Node traversableProperty;
private final Class<?> rootBeanType;
Modified:
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/messageinterpolation/ResourceBundleMessageInterpolator.java
===================================================================
---
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/messageinterpolation/ResourceBundleMessageInterpolator.java 2010-05-25
20:45:26 UTC (rev 19609)
+++
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/messageinterpolation/ResourceBundleMessageInterpolator.java 2010-05-26
09:43:07 UTC (rev 19610)
@@ -99,11 +99,16 @@
defaultLocale = Locale.getDefault();
if ( userResourceBundleLocator == null ) {
- userResourceBundleLocator = new PlatformResourceBundleLocator(
USER_VALIDATION_MESSAGES );
+ this.userResourceBundleLocator = new CachingResourceBundleLocator(
+ new PlatformResourceBundleLocator(
+ USER_VALIDATION_MESSAGES
+ )
+ );
}
+ else {
+ this.userResourceBundleLocator = new CachingResourceBundleLocator(
userResourceBundleLocator );
+ }
- this.userResourceBundleLocator = new CachingResourceBundleLocator(
userResourceBundleLocator );
-
this.defaultResourceBundleLocator =
new CachingResourceBundleLocator(
new PlatformResourceBundleLocator( DEFAULT_VALIDATION_MESSAGES )
Show replies by date