incubator-bval-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject svn commit: r1226560 - in /incubator/bval/trunk: bval-core/src/test/java/org/apache/bval/ bval-json/src/test/java/org/apache/bval/json/ bval-jsr303/src/main/java/org/apache/bval/jsr303/ bval-jsr303/src/main/java/org/apache/bval/jsr303/util/ bval-jsr303...
Date Mon, 02 Jan 2012 22:18:20 GMT
Author: mbenson
Date: Mon Jan  2 22:18:19 2012
New Revision: 1226560

URL: http://svn.apache.org/viewvc?rev=1226560&view=rev
Log:
clean up compiler warnings

Modified:
    incubator/bval/trunk/bval-core/src/test/java/org/apache/bval/ValidationResultsTest.java
    incubator/bval/trunk/bval-json/src/test/java/org/apache/bval/json/JSONGeneratorTest.java
    incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/ApacheValidatorFactory.java
    incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/ElementDescriptorImpl.java
    incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/Jsr303MetaBeanFactory.java
    incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/util/EnumerationConverter.java
    incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/BeanDescriptorTest.java
    incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/ComposedConstraintsTest.java
    incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/example/AccessTestBusinessObject.java
    incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/example/Book.java
    incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/example/CompanyAddress.java
    incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/example/NoValidatorTestEntity.java
    incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/groups/GroupSequenceTest.java
    incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/groups/GroupValidationTest.java
    incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/groups/redefining/InvalidRedefinedDefaultGroupAddress.java
    incubator/bval/trunk/bval-xstream/src/main/java/org/apache/bval/routines/StandardValidation.java
    incubator/bval/trunk/bval-xstream/src/main/java/org/apache/bval/xml/XMLFeaturesCapable.java
    incubator/bval/trunk/bval-xstream/src/main/java/org/apache/bval/xml/XMLMetaBean.java
    incubator/bval/trunk/bval-xstream/src/main/java/org/apache/bval/xml/XMLMetaBeanFactory.java
    incubator/bval/trunk/bval-xstream/src/main/java/org/apache/bval/xml/XMLMetaBeanReference.java
    incubator/bval/trunk/bval-xstream/src/main/java/org/apache/bval/xml/XMLMetaElement.java
    incubator/bval/trunk/bval-xstream/src/main/java/org/apache/bval/xml/XMLMetaFeature.java
    incubator/bval/trunk/bval-xstream/src/main/java/org/apache/bval/xml/XMLMetaProperty.java
    incubator/bval/trunk/bval-xstream/src/main/java/org/apache/bval/xml/XMLMetaValidatorReference.java
    incubator/bval/trunk/bval-xstream/src/test/java/org/apache/bval/example/BusinessObjectBeanInfo.java
    incubator/bval/trunk/bval-xstream/src/test/java/org/apache/bval/xml/BeanValidatorTest.java
    incubator/bval/trunk/bval-xstream/src/test/java/org/apache/bval/xml/XMLMetaBeanInfosTest.java
    incubator/bval/trunk/bval-xstream/src/test/java/org/apache/bval/xml/XMLMetaBeanManagerTest.java

Modified: incubator/bval/trunk/bval-core/src/test/java/org/apache/bval/ValidationResultsTest.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-core/src/test/java/org/apache/bval/ValidationResultsTest.java?rev=1226560&r1=1226559&r2=1226560&view=diff
==============================================================================
--- incubator/bval/trunk/bval-core/src/test/java/org/apache/bval/ValidationResultsTest.java
(original)
+++ incubator/bval/trunk/bval-core/src/test/java/org/apache/bval/ValidationResultsTest.java
Mon Jan  2 22:18:19 2012
@@ -42,7 +42,7 @@ public class ValidationResultsTest exten
 
     public void testValidationResults() throws Exception {
         assertTrue(results.isEmpty());
-        BeanValidationContext ctx = new BeanValidationContext(results);
+        BeanValidationContext<ValidationResults> ctx = new BeanValidationContext<ValidationResults>(results);
         ctx.setBean(this);
         ctx.setMetaProperty(new MetaProperty());
         ctx.getMetaProperty().setName("prop");

Modified: incubator/bval/trunk/bval-json/src/test/java/org/apache/bval/json/JSONGeneratorTest.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-json/src/test/java/org/apache/bval/json/JSONGeneratorTest.java?rev=1226560&r1=1226559&r2=1226560&view=diff
==============================================================================
--- incubator/bval/trunk/bval-json/src/test/java/org/apache/bval/json/JSONGeneratorTest.java
(original)
+++ incubator/bval/trunk/bval-json/src/test/java/org/apache/bval/json/JSONGeneratorTest.java
Mon Jan  2 22:18:19 2012
@@ -59,7 +59,7 @@ public class JSONGeneratorTest extends T
 
         JSONGenerator converter = new JSONGenerator();
 
-        List<MetaBean> metaBeans = new ArrayList(2);
+        List<MetaBean> metaBeans = new ArrayList<MetaBean>(2);
         metaBeans.add(mbean);
         MetaBean mbean2 = mbm.findForId("UnknownObject");
         metaBeans.add(mbean2);
@@ -76,7 +76,7 @@ public class JSONGeneratorTest extends T
         MetaBean info3 = mbm.findForClass(BusinessObjectAddress.class);
         JSONGenerator converter = new JSONGenerator();
 
-        List<MetaBean> metaBeans = new ArrayList(2);
+        List<MetaBean> metaBeans = new ArrayList<MetaBean>(2);
         metaBeans.add(info);
         metaBeans.add(info2);
         metaBeans.add(info3);
@@ -92,7 +92,7 @@ public class JSONGeneratorTest extends T
 
         JSONGenerator converter = new JSONGenerator();
 
-        List<MetaBean> metaBeans = new ArrayList(1);
+        List<MetaBean> metaBeans = new ArrayList<MetaBean>(1);
         metaBeans.add(info);
         String json = converter.toJSON(metaBeans);
         assertNotNull(json);

Modified: incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/ApacheValidatorFactory.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/ApacheValidatorFactory.java?rev=1226560&r1=1226559&r2=1226560&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/ApacheValidatorFactory.java
(original)
+++ incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/ApacheValidatorFactory.java
Mon Jan  2 22:18:19 2012
@@ -230,8 +230,9 @@ public class ApacheValidatorFactory impl
         // Can't fix this because don't know which classes this method should support.
 
         if (type.isInstance(this)) {
-            //noinspection unchecked
-            return (T) this;
+            @SuppressWarnings("unchecked")
+            T result = (T) this;
+            return result;
         } else if (!(type.isInterface() || Modifier.isAbstract(type
                 .getModifiers()))) {
             return newInstance(type);
@@ -239,8 +240,9 @@ public class ApacheValidatorFactory impl
             try {
                 Class<?> cls = ClassUtils.getClass(type.getName() + "Impl");
                 if (type.isAssignableFrom(cls)) {
-                    //noinspection unchecked
-                    return (T) newInstance(cls);
+                    @SuppressWarnings("unchecked")
+                    T result = (T) newInstance(cls);
+                    return result;
                 }
             } catch (ClassNotFoundException e) {
                 // do nothing

Modified: incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/ElementDescriptorImpl.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/ElementDescriptorImpl.java?rev=1226560&r1=1226559&r2=1226560&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/ElementDescriptorImpl.java
(original)
+++ incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/ElementDescriptorImpl.java
Mon Jan  2 22:18:19 2012
@@ -22,7 +22,6 @@ import org.apache.bval.model.Validation;
 import javax.validation.metadata.ConstraintDescriptor;
 import javax.validation.metadata.ElementDescriptor;
 import java.util.Collections;
-import java.util.Collections;
 import java.util.HashSet;
 import java.util.Set;
 

Modified: incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/Jsr303MetaBeanFactory.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/Jsr303MetaBeanFactory.java?rev=1226560&r1=1226559&r2=1226560&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/Jsr303MetaBeanFactory.java
(original)
+++ incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/Jsr303MetaBeanFactory.java
Mon Jan  2 22:18:19 2012
@@ -34,7 +34,6 @@ import javax.validation.ValidationExcept
 import javax.validation.groups.Default;
 
 import org.apache.bval.MetaBeanFactory;
-import org.apache.bval.Validate;
 import org.apache.bval.jsr303.groups.Group;
 import org.apache.bval.jsr303.util.ClassHelper;
 import org.apache.bval.jsr303.util.SecureActions;

Modified: incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/util/EnumerationConverter.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/util/EnumerationConverter.java?rev=1226560&r1=1226559&r2=1226560&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/util/EnumerationConverter.java
(original)
+++ incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/util/EnumerationConverter.java
Mon Jan  2 22:18:19 2012
@@ -52,7 +52,7 @@ public final class EnumerationConverter 
     /**
      * {@inheritDoc}
      */
-    @SuppressWarnings("unchecked")
+    @SuppressWarnings({ "unchecked", "rawtypes" })
     public Object convert(Class type, Object value) {
         if (!type.isEnum()) {
             throw new RuntimeException("Only enum types supported in this version!");

Modified: incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/BeanDescriptorTest.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/BeanDescriptorTest.java?rev=1226560&r1=1226559&r2=1226560&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/BeanDescriptorTest.java
(original)
+++ incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/BeanDescriptorTest.java
Mon Jan  2 22:18:19 2012
@@ -29,7 +29,6 @@ import java.lang.annotation.Retention;
 import java.lang.annotation.Target;
 import java.util.Locale;
 import java.util.Set;
-import org.apache.bval.jsr303.util.TestUtils;
 
 import javax.validation.Constraint;
 import javax.validation.Payload;

Modified: incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/ComposedConstraintsTest.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/ComposedConstraintsTest.java?rev=1226560&r1=1226559&r2=1226560&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/ComposedConstraintsTest.java
(original)
+++ incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/ComposedConstraintsTest.java
Mon Jan  2 22:18:19 2012
@@ -87,6 +87,7 @@ public class ComposedConstraintsTest ext
     public void processConstraintDescriptor(ConstraintDescriptor<?> cd) {
         //Size.class is understood by the tool
         if (cd.getAnnotation().annotationType().equals(Size.class)) {
+            @SuppressWarnings("unused")
             Size m = (Size) cd.getAnnotation();//what for?
         }
         for (ConstraintDescriptor<?> composingCd : cd.getComposingConstraints()) {

Modified: incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/example/AccessTestBusinessObject.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/example/AccessTestBusinessObject.java?rev=1226560&r1=1226559&r2=1226560&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/example/AccessTestBusinessObject.java
(original)
+++ incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/example/AccessTestBusinessObject.java
Mon Jan  2 22:18:19 2012
@@ -32,6 +32,7 @@ public class AccessTestBusinessObject {
     protected String var1;
 
     // test that field-access is used, not method-access
+    @SuppressWarnings("unused")
     @Valid
     private AccessTestBusinessObject next;
 

Modified: incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/example/Book.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/example/Book.java?rev=1226560&r1=1226559&r2=1226560&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/example/Book.java
(original)
+++ incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/example/Book.java
Mon Jan  2 22:18:19 2012
@@ -39,6 +39,7 @@ public class Book {
     @NotNull(groups = First.class)
     private Author author;
 
+    @SuppressWarnings("unused")
     @NotNull
     private int uselessField;
 

Modified: incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/example/CompanyAddress.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/example/CompanyAddress.java?rev=1226560&r1=1226559&r2=1226560&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/example/CompanyAddress.java
(original)
+++ incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/example/CompanyAddress.java
Mon Jan  2 22:18:19 2012
@@ -24,6 +24,7 @@ import org.apache.bval.constraints.Compa
  * Description: <br/>
  */
 public class CompanyAddress {
+    @SuppressWarnings("unused")
     @CompanyEmail
     private String email;
 

Modified: incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/example/NoValidatorTestEntity.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/example/NoValidatorTestEntity.java?rev=1226560&r1=1226559&r2=1226560&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/example/NoValidatorTestEntity.java
(original)
+++ incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/example/NoValidatorTestEntity.java
Mon Jan  2 22:18:19 2012
@@ -24,6 +24,7 @@ import javax.validation.constraints.Max;
  * Description: <br/>
  */
 public class NoValidatorTestEntity {
+    @SuppressWarnings("unused")
     @Max(20)
     private Object anything;
     

Modified: incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/groups/GroupSequenceTest.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/groups/GroupSequenceTest.java?rev=1226560&r1=1226559&r2=1226560&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/groups/GroupSequenceTest.java
(original)
+++ incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/groups/GroupSequenceTest.java
Mon Jan  2 22:18:19 2012
@@ -113,7 +113,7 @@ public class GroupSequenceTest extends T
         author.setLastName("King");
 
         constraintViolations = validator.validate(book, First.class, Second.class, Last.class);
-        ConstraintViolation constraintViolation = constraintViolations.iterator().next();
+        ConstraintViolation<?> constraintViolation = constraintViolations.iterator().next();
         assertEquals(1, constraintViolations.size());
         assertEquals("may not be empty", constraintViolation.getMessage());
         assertEquals(book, constraintViolation.getRootBean());
@@ -165,7 +165,7 @@ public class GroupSequenceTest extends T
         author.setLastName("Cline");
 
         constraintViolations = validator.validate(book, Book.All.class);
-        ConstraintViolation constraintViolation = constraintViolations.iterator().next();
+        ConstraintViolation<?> constraintViolation = constraintViolations.iterator().next();
         assertEquals(1, constraintViolations.size());
         assertEquals("may not be null", constraintViolation.getMessage());
         assertEquals(book, constraintViolation.getRootBean());

Modified: incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/groups/GroupValidationTest.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/groups/GroupValidationTest.java?rev=1226560&r1=1226559&r2=1226560&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/groups/GroupValidationTest.java
(original)
+++ incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/groups/GroupValidationTest.java
Mon Jan  2 22:18:19 2012
@@ -45,7 +45,7 @@ public class GroupValidationTest extends
 
         Set<ConstraintViolation<BillableUser>> violations = validator.validate(user);
         assertEquals(2, violations.size());
-        ConstraintViolation violation = TestUtils.getViolation(violations, "firstname");
+        ConstraintViolation<?> violation = TestUtils.getViolation(violations, "firstname");
         assertNotNull(violation);
         assertEquals(user, violation.getRootBean());
         violation = TestUtils.getViolation(violations, "lastname");
@@ -63,7 +63,7 @@ public class GroupValidationTest extends
         Set<ConstraintViolation<BillableUser>> violations = validator.validate(user,
               Billable.class);
         assertEquals(1, violations.size());
-        ConstraintViolation violation = TestUtils.getViolation(violations, "defaultCreditCard");
+        ConstraintViolation<?> violation = TestUtils.getViolation(violations, "defaultCreditCard");
         assertNotNull(violation);
         assertEquals(user, violation.getRootBean());
     }
@@ -74,7 +74,7 @@ public class GroupValidationTest extends
         Set<ConstraintViolation<BillableUser>> violations = validator.validate(user,
               BuyInOneClick.class, Billable.class);
         assertEquals(1, violations.size());
-        ConstraintViolation violation = TestUtils.getViolation(violations, "defaultCreditCard");
+        ConstraintViolation<?> violation = TestUtils.getViolation(violations, "defaultCreditCard");
         assertNotNull(violation);
         assertEquals(user, violation.getRootBean());
     }

Modified: incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/groups/redefining/InvalidRedefinedDefaultGroupAddress.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/groups/redefining/InvalidRedefinedDefaultGroupAddress.java?rev=1226560&r1=1226559&r2=1226560&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/groups/redefining/InvalidRedefinedDefaultGroupAddress.java
(original)
+++ incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/groups/redefining/InvalidRedefinedDefaultGroupAddress.java
Mon Jan  2 22:18:19 2012
@@ -29,9 +29,11 @@ import javax.validation.constraints.NotN
  */
 @GroupSequence({Address.class, Address.HighLevelCoherence.class})
 public class InvalidRedefinedDefaultGroupAddress {
+    @SuppressWarnings("unused")
     @NotNull(groups = Address.HighLevelCoherence.class)
     private String street;
 
+    @SuppressWarnings("unused")
     @NotNull
     private String city;
 

Modified: incubator/bval/trunk/bval-xstream/src/main/java/org/apache/bval/routines/StandardValidation.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-xstream/src/main/java/org/apache/bval/routines/StandardValidation.java?rev=1226560&r1=1226559&r2=1226560&view=diff
==============================================================================
--- incubator/bval/trunk/bval-xstream/src/main/java/org/apache/bval/routines/StandardValidation.java
(original)
+++ incubator/bval/trunk/bval-xstream/src/main/java/org/apache/bval/routines/StandardValidation.java
Mon Jan  2 22:18:19 2012
@@ -102,6 +102,7 @@ public class StandardValidation implemen
     }
 
     protected <T extends ValidationListener> void validateMinValue(ValidationContext<T>
context) {
+        @SuppressWarnings("unchecked")
         Comparable<Object> minValue = (Comparable<Object>) context.getMetaProperty().getFeature(MIN_VALUE);
         if (minValue == null || context.getPropertyValue() == null) return;
         if (compare(context, minValue, context.getPropertyValue()) > 0) {
@@ -110,6 +111,7 @@ public class StandardValidation implemen
     }
 
     protected <T extends ValidationListener> void validateMaxValue(ValidationContext<T>
context) {
+        @SuppressWarnings("unchecked")
         Comparable<Object> maxValue = (Comparable<Object>) context.getMetaProperty().getFeature(MAX_VALUE);
         if (maxValue == null || context.getPropertyValue() == null) return;
         if (compare(context, maxValue, context.getPropertyValue()) < 0) {

Modified: incubator/bval/trunk/bval-xstream/src/main/java/org/apache/bval/xml/XMLFeaturesCapable.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-xstream/src/main/java/org/apache/bval/xml/XMLFeaturesCapable.java?rev=1226560&r1=1226559&r2=1226560&view=diff
==============================================================================
--- incubator/bval/trunk/bval-xstream/src/main/java/org/apache/bval/xml/XMLFeaturesCapable.java
(original)
+++ incubator/bval/trunk/bval-xstream/src/main/java/org/apache/bval/xml/XMLFeaturesCapable.java
Mon Jan  2 22:18:19 2012
@@ -27,6 +27,9 @@ import java.util.List;
  * Description: <br/>
  */
 public class XMLFeaturesCapable implements Serializable {
+    /** Serialization version */
+    private static final long serialVersionUID = 1L;
+
     @XStreamImplicit
     private List<XMLMetaFeature> features;
     @XStreamImplicit(itemFieldName = "validator")

Modified: incubator/bval/trunk/bval-xstream/src/main/java/org/apache/bval/xml/XMLMetaBean.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-xstream/src/main/java/org/apache/bval/xml/XMLMetaBean.java?rev=1226560&r1=1226559&r2=1226560&view=diff
==============================================================================
--- incubator/bval/trunk/bval-xstream/src/main/java/org/apache/bval/xml/XMLMetaBean.java (original)
+++ incubator/bval/trunk/bval-xstream/src/main/java/org/apache/bval/xml/XMLMetaBean.java Mon
Jan  2 22:18:19 2012
@@ -28,6 +28,9 @@ import java.util.List;
  */
 @XStreamAlias("bean")
 public class XMLMetaBean extends XMLFeaturesCapable {
+    /** Serialization version */
+    private static final long serialVersionUID = 1L;
+
     @XStreamAsAttribute()
     private String id;
     @XStreamAsAttribute()
@@ -72,7 +75,7 @@ public class XMLMetaBean extends XMLFeat
     }
 
     public void addProperty(XMLMetaProperty property) {
-        if (properties == null) properties = new ArrayList();
+        if (properties == null) properties = new ArrayList<XMLMetaProperty>();
         properties.add(property);
     }
 
@@ -116,7 +119,7 @@ public class XMLMetaBean extends XMLFeat
 
 
     public void addBeanRef(XMLMetaBeanReference beanRelation) {
-        if (beanRelations == null) beanRelations = new ArrayList();
+        if (beanRelations == null) beanRelations = new ArrayList<XMLMetaBeanReference>();
         beanRelations.add(beanRelation);
     }
 

Modified: incubator/bval/trunk/bval-xstream/src/main/java/org/apache/bval/xml/XMLMetaBeanFactory.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-xstream/src/main/java/org/apache/bval/xml/XMLMetaBeanFactory.java?rev=1226560&r1=1226559&r2=1226560&view=diff
==============================================================================
--- incubator/bval/trunk/bval-xstream/src/main/java/org/apache/bval/xml/XMLMetaBeanFactory.java
(original)
+++ incubator/bval/trunk/bval-xstream/src/main/java/org/apache/bval/xml/XMLMetaBeanFactory.java
Mon Jan  2 22:18:19 2012
@@ -37,7 +37,7 @@ public class XMLMetaBeanFactory implemen
 
     // use LinkedHashMap to keep sequence of loaders
     private final Map<XMLMetaBeanLoader, XMLMetaBeanInfos> resources =
-          new LinkedHashMap();
+          new LinkedHashMap<XMLMetaBeanLoader, XMLMetaBeanInfos>();
 
     private StandardValidation standardValidation = StandardValidation.getInstance();
 
@@ -121,6 +121,7 @@ public class XMLMetaBeanFactory implemen
         }
     }
 
+    @SuppressWarnings("deprecation")
     protected void enrichValidations(FeaturesCapable prop, XMLFeaturesCapable xmlProp,
                                      XMLResult result, boolean addStandard)
           throws Exception {

Modified: incubator/bval/trunk/bval-xstream/src/main/java/org/apache/bval/xml/XMLMetaBeanReference.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-xstream/src/main/java/org/apache/bval/xml/XMLMetaBeanReference.java?rev=1226560&r1=1226559&r2=1226560&view=diff
==============================================================================
--- incubator/bval/trunk/bval-xstream/src/main/java/org/apache/bval/xml/XMLMetaBeanReference.java
(original)
+++ incubator/bval/trunk/bval-xstream/src/main/java/org/apache/bval/xml/XMLMetaBeanReference.java
Mon Jan  2 22:18:19 2012
@@ -26,6 +26,9 @@ import org.apache.bval.model.MetaPropert
  */
 @XStreamAlias("relationship")
 public class XMLMetaBeanReference extends XMLMetaElement {
+    /** Serialization version */
+    private static final long serialVersionUID = 1L;
+
     @XStreamAsAttribute
     private String beanId;
 

Modified: incubator/bval/trunk/bval-xstream/src/main/java/org/apache/bval/xml/XMLMetaElement.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-xstream/src/main/java/org/apache/bval/xml/XMLMetaElement.java?rev=1226560&r1=1226559&r2=1226560&view=diff
==============================================================================
--- incubator/bval/trunk/bval-xstream/src/main/java/org/apache/bval/xml/XMLMetaElement.java
(original)
+++ incubator/bval/trunk/bval-xstream/src/main/java/org/apache/bval/xml/XMLMetaElement.java
Mon Jan  2 22:18:19 2012
@@ -26,6 +26,8 @@ import static org.apache.bval.model.Feat
  * Description: <br/>
  */
 public class XMLMetaElement extends XMLFeaturesCapable {
+    /** Serialization version */
+    private static final long serialVersionUID = 1L;
 
     @XStreamAsAttribute()
     private String name;

Modified: incubator/bval/trunk/bval-xstream/src/main/java/org/apache/bval/xml/XMLMetaFeature.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-xstream/src/main/java/org/apache/bval/xml/XMLMetaFeature.java?rev=1226560&r1=1226559&r2=1226560&view=diff
==============================================================================
--- incubator/bval/trunk/bval-xstream/src/main/java/org/apache/bval/xml/XMLMetaFeature.java
(original)
+++ incubator/bval/trunk/bval-xstream/src/main/java/org/apache/bval/xml/XMLMetaFeature.java
Mon Jan  2 22:18:19 2012
@@ -26,6 +26,9 @@ import java.io.Serializable;
  */
 @XStreamAlias("feature")
 public class XMLMetaFeature implements Serializable {
+    /** Serialization version */
+    private static final long serialVersionUID = 1L;
+
     @XStreamAsAttribute
     private String key;
     @XStreamAsAttribute

Modified: incubator/bval/trunk/bval-xstream/src/main/java/org/apache/bval/xml/XMLMetaProperty.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-xstream/src/main/java/org/apache/bval/xml/XMLMetaProperty.java?rev=1226560&r1=1226559&r2=1226560&view=diff
==============================================================================
--- incubator/bval/trunk/bval-xstream/src/main/java/org/apache/bval/xml/XMLMetaProperty.java
(original)
+++ incubator/bval/trunk/bval-xstream/src/main/java/org/apache/bval/xml/XMLMetaProperty.java
Mon Jan  2 22:18:19 2012
@@ -27,6 +27,8 @@ import static org.apache.bval.model.Feat
  */
 @XStreamAlias("property")
 public class XMLMetaProperty extends XMLMetaElement {
+    /** Serialization version */
+    private static final long serialVersionUID = 1L;
 
     /**
      * if you need other types (Long, double, String) for maxValue and

Modified: incubator/bval/trunk/bval-xstream/src/main/java/org/apache/bval/xml/XMLMetaValidatorReference.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-xstream/src/main/java/org/apache/bval/xml/XMLMetaValidatorReference.java?rev=1226560&r1=1226559&r2=1226560&view=diff
==============================================================================
--- incubator/bval/trunk/bval-xstream/src/main/java/org/apache/bval/xml/XMLMetaValidatorReference.java
(original)
+++ incubator/bval/trunk/bval-xstream/src/main/java/org/apache/bval/xml/XMLMetaValidatorReference.java
Mon Jan  2 22:18:19 2012
@@ -26,6 +26,9 @@ import java.io.Serializable;
  */
 @XStreamAlias("validator-ref")
 public class XMLMetaValidatorReference implements Serializable {
+    /** Serialization version */
+    private static final long serialVersionUID = 1L;
+
     @XStreamAsAttribute
     private String refId;
 

Modified: incubator/bval/trunk/bval-xstream/src/test/java/org/apache/bval/example/BusinessObjectBeanInfo.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-xstream/src/test/java/org/apache/bval/example/BusinessObjectBeanInfo.java?rev=1226560&r1=1226559&r2=1226560&view=diff
==============================================================================
--- incubator/bval/trunk/bval-xstream/src/test/java/org/apache/bval/example/BusinessObjectBeanInfo.java
(original)
+++ incubator/bval/trunk/bval-xstream/src/test/java/org/apache/bval/example/BusinessObjectBeanInfo.java
Mon Jan  2 22:18:19 2012
@@ -27,7 +27,7 @@ import java.beans.SimpleBeanInfo;
  * Description: <br/>
  */
 public class BusinessObjectBeanInfo extends SimpleBeanInfo {
-    Class targetClass = BusinessObject.class;
+    Class<?> targetClass = BusinessObject.class;
 
     @Override
     public BeanInfo[] getAdditionalBeanInfo() {

Modified: incubator/bval/trunk/bval-xstream/src/test/java/org/apache/bval/xml/BeanValidatorTest.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-xstream/src/test/java/org/apache/bval/xml/BeanValidatorTest.java?rev=1226560&r1=1226559&r2=1226560&view=diff
==============================================================================
--- incubator/bval/trunk/bval-xstream/src/test/java/org/apache/bval/xml/BeanValidatorTest.java
(original)
+++ incubator/bval/trunk/bval-xstream/src/test/java/org/apache/bval/xml/BeanValidatorTest.java
Mon Jan  2 22:18:19 2012
@@ -56,21 +56,21 @@ public class BeanValidatorTest extends T
 
         // 1. validate a bean
         BusinessObjectAddress adr = new BusinessObjectAddress();
-        BeanValidator<ValidationResults> validator = new BeanValidator();
+        BeanValidator<ValidationResults> validator = new BeanValidator<ValidationResults>();
         ValidationResults results = validator.validate(adr, mb);
         assertEquals(2,
               results.getErrorsByReason().get(Features.Property.MANDATORY).size());
 
         // 2. validate a map with the same metabean
         validator.setTreatMapsLikeBeans(true);
-        results = validator.validate(new HashMap(), mb);
+        results = validator.validate(new HashMap<String, Object>(), mb);
         assertFalse(results.isEmpty());
         assertEquals(2,
               results.getErrorsByReason().get(Features.Property.MANDATORY).size());
 
         // 3. validate as empty map (jsr303 behavior)
         validator.setTreatMapsLikeBeans(false);
-        results = validator.validate(new HashMap(), mb);
+        results = validator.validate(new HashMap<Object, Object>(), mb);
         assertTrue(results.isEmpty());
     }
 
@@ -82,7 +82,7 @@ public class BeanValidatorTest extends T
         BusinessObject object = new BusinessObject();
         object.setAddress(new BusinessObjectAddress());
         object.getAddress().setOwner(object);
-        BeanValidator<ValidationResults> validator = new BeanValidator();
+        BeanValidator<ValidationResults> validator = new BeanValidator<ValidationResults>();
         ValidationResults results = validator.validate(object, info);
         assertTrue(results.hasErrorForReason(Reasons.MANDATORY));
         assertTrue(results.hasError(object, null));
@@ -103,7 +103,7 @@ public class BeanValidatorTest extends T
         assertFalse(validator.validate(object, info).isEmpty());
 
         object.getAddress().setCountry("Germany");
-        object.setAddresses(new ArrayList());
+        object.setAddresses(new ArrayList<BusinessObjectAddress>());
         object.getAddresses().add(object.getAddress());
         object.getAddresses().add(object.getAddress());
         object.getAddresses().add(object.getAddress());

Modified: incubator/bval/trunk/bval-xstream/src/test/java/org/apache/bval/xml/XMLMetaBeanInfosTest.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-xstream/src/test/java/org/apache/bval/xml/XMLMetaBeanInfosTest.java?rev=1226560&r1=1226559&r2=1226560&view=diff
==============================================================================
--- incubator/bval/trunk/bval-xstream/src/test/java/org/apache/bval/xml/XMLMetaBeanInfosTest.java
(original)
+++ incubator/bval/trunk/bval-xstream/src/test/java/org/apache/bval/xml/XMLMetaBeanInfosTest.java
Mon Jan  2 22:18:19 2012
@@ -46,8 +46,8 @@ public class XMLMetaBeanInfosTest extend
 
     public void testBeanInfosToXML() {
         XMLMetaBeanInfos infos = new XMLMetaBeanInfos();
-        infos.setBeans(new ArrayList());
-        infos.setValidators(new ArrayList());
+        infos.setBeans(new ArrayList<XMLMetaBean>());
+        infos.setValidators(new ArrayList<XMLMetaValidator>());
 
         XMLMetaValidator validator = new XMLMetaValidator();
         validator.setId("mandatory");
@@ -106,7 +106,7 @@ public class XMLMetaBeanInfosTest extend
         property.setName("email");
         property.putFeature(XMLMetaValue.ANNOKEY_Widget, "entry");
         property.putFeature(XMLMetaValue.ANNOKEY_TableColumn, true);
-        Map formatterMap = new HashMap();
+        Map<String, String> formatterMap = new HashMap<String, String>();
         formatterMap.put("locale", "DE");
         formatterMap.put("style", "info");
         property.putFeature("ajax-formatter", formatterMap);

Modified: incubator/bval/trunk/bval-xstream/src/test/java/org/apache/bval/xml/XMLMetaBeanManagerTest.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-xstream/src/test/java/org/apache/bval/xml/XMLMetaBeanManagerTest.java?rev=1226560&r1=1226559&r2=1226560&view=diff
==============================================================================
--- incubator/bval/trunk/bval-xstream/src/test/java/org/apache/bval/xml/XMLMetaBeanManagerTest.java
(original)
+++ incubator/bval/trunk/bval-xstream/src/test/java/org/apache/bval/xml/XMLMetaBeanManagerTest.java
Mon Jan  2 22:18:19 2012
@@ -65,6 +65,7 @@ public class XMLMetaBeanManagerTest exte
         assertTrue(mb2.getProperty("dateBirth") != mb.getProperty("dateBirth"));
     }
 
+    @SuppressWarnings("deprecation")
     public void testFindForClass() throws Exception {
         MetaBeanFinder finder = mbm;
         MetaBean info = finder.findForClass(BusinessObject.class);



Mime
View raw message