bval-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmannibu...@apache.org
Subject svn commit: r1514466 - in /bval/branches/bval-11/bval-jsr303/src/main/java/org/apache/bval/jsr303: BeanDescriptorImpl.java ConstraintAnnotationAttributes.java
Date Thu, 15 Aug 2013 20:16:44 GMT
Author: rmannibucau
Date: Thu Aug 15 20:16:44 2013
New Revision: 1514466

URL: http://svn.apache.org/r1514466
Log:
String.format is useless here

Modified:
    bval/branches/bval-11/bval-jsr303/src/main/java/org/apache/bval/jsr303/BeanDescriptorImpl.java
    bval/branches/bval-11/bval-jsr303/src/main/java/org/apache/bval/jsr303/ConstraintAnnotationAttributes.java

Modified: bval/branches/bval-11/bval-jsr303/src/main/java/org/apache/bval/jsr303/BeanDescriptorImpl.java
URL: http://svn.apache.org/viewvc/bval/branches/bval-11/bval-jsr303/src/main/java/org/apache/bval/jsr303/BeanDescriptorImpl.java?rev=1514466&r1=1514465&r2=1514466&view=diff
==============================================================================
--- bval/branches/bval-11/bval-jsr303/src/main/java/org/apache/bval/jsr303/BeanDescriptorImpl.java
(original)
+++ bval/branches/bval-11/bval-jsr303/src/main/java/org/apache/bval/jsr303/BeanDescriptorImpl.java
Thu Aug 15 20:16:44 2013
@@ -329,7 +329,7 @@ public class BeanDescriptorImpl extends 
 
             buildExecutableDescriptors();
 
-            boolean hasAnyContraints = false;
+            boolean hasAnyContraints;
             if (!constraintDescriptors.isEmpty()) {
                 hasAnyContraints = true;
             } else {

Modified: bval/branches/bval-11/bval-jsr303/src/main/java/org/apache/bval/jsr303/ConstraintAnnotationAttributes.java
URL: http://svn.apache.org/viewvc/bval/branches/bval-11/bval-jsr303/src/main/java/org/apache/bval/jsr303/ConstraintAnnotationAttributes.java?rev=1514466&r1=1514465&r2=1514466&view=diff
==============================================================================
--- bval/branches/bval-11/bval-jsr303/src/main/java/org/apache/bval/jsr303/ConstraintAnnotationAttributes.java
(original)
+++ bval/branches/bval-11/bval-jsr303/src/main/java/org/apache/bval/jsr303/ConstraintAnnotationAttributes.java
Thu Aug 15 20:16:44 2013
@@ -149,22 +149,22 @@ public enum ConstraintAnnotationAttribut
         Worker(final Class<C> constraintType) {
             Object _defaultValue = null;
             try {
-                method = Reflection.INSTANCE.getPublicMethod(constraintType, getAttributeName());
+                method = Reflection.INSTANCE.getPublicMethod(constraintType, attributeName);
                 if (method == null) {
-                    error = new ConstraintDefinitionException(String.format("Annotation %1$s
has no %2$s() method", constraintType, getAttributeName()));
+                    error = new ConstraintDefinitionException("Annotation " + constraintType
+ " has no " + attributeName + " method");
                     return;
                 }
 
-                if (!TypeUtils.isAssignable(method.getReturnType(), getType())) {
-                    error = new ConstraintDefinitionException(String.format("Return type
for %1$s() must be of type %2$s", getAttributeName(), getType()));
+                 if (!TypeUtils.isAssignable(method.getReturnType(), type)) {
+                    error = new ConstraintDefinitionException("Return type for " + attributeName
+ "() must be of type " + type);
                     return;
                 }
                 _defaultValue = method.getDefaultValue();
                 if (_defaultValue == null && permitNullDefaultValue) {
                     return;
                 }
-                if (TypeUtils.isArrayType(getType()) && Array.getLength(_defaultValue)
> 0) {
-                    error = new ConstraintDefinitionException(String.format("Default value
for %1$s() must be an empty array", getAttributeName()));
+                if (TypeUtils.isArrayType(type) && Array.getLength(_defaultValue)
> 0) {
+                    error = new ConstraintDefinitionException("Default value for " + attributeName
+ "() must be an empty array");
                 }
             } finally {
                 defaultValue = _defaultValue;



Mime
View raw message