incubator-bval-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dwo...@apache.org
Subject svn commit: r959084 - in /incubator/bval/trunk/bval-jsr303/src: main/java/org/apache/bval/jsr303/ test/java/org/apache/bval/jsr303/
Date Tue, 29 Jun 2010 19:46:38 GMT
Author: dwoods
Date: Tue Jun 29 19:46:37 2010
New Revision: 959084

URL: http://svn.apache.org/viewvc?rev=959084&view=rev
Log:
BVAL-70 Remove @Override annotations from methods implementing interfaces.  Original patch
contributed by Matt Benson.

Modified:
    incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/ClassValidator.java
    incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/ConstraintCompositionTest.java
    incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/ConstraintValidatorContextTest.java
    incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/CustomConstraintValidatorFactoryTest.java

Modified: incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/ClassValidator.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/ClassValidator.java?rev=959084&r1=959083&r2=959084&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/ClassValidator.java
(original)
+++ incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/ClassValidator.java
Tue Jun 29 19:46:37 2010
@@ -101,7 +101,7 @@ public class ClassValidator extends Abst
    *             if a non recoverable error happens
    *             during the validation process
    */
-  @Override
+  // @Override - not allowed in 1.5 for Interface methods
   public <T> Set<ConstraintViolation<T>> validate(T object, Class<?>...
groupArray) {
     if (object == null) throw new IllegalArgumentException("cannot validate null");
     checkGroups(groupArray);
@@ -163,7 +163,7 @@ public class ClassValidator extends Abst
    *             if a non recoverable error happens
    *             during the validation process
    */
-  @Override
+  // @Override - not allowed in 1.5 for Interface methods
   public <T> Set<ConstraintViolation<T>> validateProperty(T object, String
propertyName,
                                                           Class<?>... groups) {
     if (object == null) throw new IllegalArgumentException("cannot validate null");
@@ -245,7 +245,7 @@ public class ClassValidator extends Abst
    *             if a non recoverable error happens
    *             during the validation process
    */
-  @Override
+  // @Override - not allowed in 1.5 for Interface methods
   public <T> Set<ConstraintViolation<T>> validateValue(Class<T> beanType,
                                                        String propertyName, Object value,
                                                        Class<?>... groups) {
@@ -303,7 +303,7 @@ public class ClassValidator extends Abst
    *             during the metadata discovery or if some
    *             constraints are invalid.
    */
-  @Override
+  // @Override - not allowed in 1.5 for Interface methods
   public BeanDescriptor getConstraintsForClass(Class<?> clazz) {
     if (clazz == null) {
       throw new IllegalArgumentException("Class cannot be null");
@@ -337,7 +337,7 @@ public class ClassValidator extends Abst
    *             if the provider does not support the call.
    */
   @SuppressWarnings("unchecked")
-  @Override
+  // @Override - not allowed in 1.5 for Interface methods
   public <T> T unwrap(Class<T> type) {
     if (type.isAssignableFrom(getClass())) {
       return (T) this;

Modified: incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/ConstraintCompositionTest.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/ConstraintCompositionTest.java?rev=959084&r1=959083&r2=959084&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/ConstraintCompositionTest.java
(original)
+++ incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/ConstraintCompositionTest.java
Tue Jun 29 19:46:37 2010
@@ -27,6 +27,7 @@ import javax.validation.constraints.NotN
 import javax.validation.constraints.Pattern;
 import javax.validation.constraints.Size;
 import javax.validation.metadata.ConstraintDescriptor;
+import java.lang.annotation.Annotation;
 import java.lang.annotation.Documented;
 import java.lang.annotation.Retention;
 import java.lang.annotation.Target;
@@ -182,7 +183,7 @@ public class ConstraintCompositionTest e
         Assert.assertEquals("Only 1 violation expected", 1, constraintViolations.size());
         ConstraintViolation<Code> violation = constraintViolations.iterator().next();
         Assert.assertEquals("Wrong violation message", "Invalid code", violation.getMessage());
-        Assert.assertEquals("Wrong violation type", ElevenDigitsCode.class, violation.getConstraintDescriptor().getAnnotation().annotationType());
+        Assert.assertEquals("Wrong violation type", ElevenDigitsCode.class, ((Annotation)violation.getConstraintDescriptor().getAnnotation()).annotationType());
         
     }
     

Modified: incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/ConstraintValidatorContextTest.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/ConstraintValidatorContextTest.java?rev=959084&r1=959083&r2=959084&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/ConstraintValidatorContextTest.java
(original)
+++ incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/ConstraintValidatorContextTest.java
Tue Jun 29 19:46:37 2010
@@ -222,12 +222,12 @@ public class ConstraintValidatorContextT
             throw new IllegalStateException("Unexpected call");
         }
 
-        @Override
+        // @Override - not allowed in 1.5 for Interface methods
         public Class<?> getCurrentOwner() {
             throw new IllegalStateException("Unexpected call");
         }
 
-        @Override
+        // @Override - not allowed in 1.5 for Interface methods
         public void setCurrentOwner(Class<?> currentOwner) {
             throw new IllegalStateException("Unexpected call");
         }

Modified: incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/CustomConstraintValidatorFactoryTest.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/CustomConstraintValidatorFactoryTest.java?rev=959084&r1=959083&r2=959084&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/CustomConstraintValidatorFactoryTest.java
(original)
+++ incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/CustomConstraintValidatorFactoryTest.java
Tue Jun 29 19:46:37 2010
@@ -57,7 +57,7 @@ public class CustomConstraintValidatorFa
     public void testValidationExceptionWhenFactoryReturnsNullValidator() {
         
         ConstraintValidatorFactory customFactory = new ConstraintValidatorFactory() {
-            @Override
+            // @Override - not allowed in 1.5 for Interface methods
             public <T extends ConstraintValidator<?, ?>> T getInstance(Class<T>
key) {
                 return null; // always return null
             }
@@ -90,11 +90,11 @@ public class CustomConstraintValidatorFa
         Class<? extends Payload>[] payload() default {};
         
         public static class GoodPersonValidator implements ConstraintValidator<GoodPerson,
Person> {
-            @Override
+            // @Override - not allowed in 1.5 for Interface methods
             public void initialize(GoodPerson constraintAnnotation) {
             }
 
-            @Override
+            // @Override - not allowed in 1.5 for Interface methods
             public boolean isValid(Person value, ConstraintValidatorContext context) {
                 return true;
             }



Mime
View raw message