bval-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From romanst...@apache.org
Subject svn commit: r1161648 [2/2] - in /incubator/bval/trunk: ./ bval-core/src/main/java/org/apache/bval/util/ bval-jsr303/src/main/java/org/apache/bval/constraints/ bval-jsr303/src/main/java/org/apache/bval/jsr303/ bval-jsr303/src/main/java/org/apache/bval/j...
Date Thu, 25 Aug 2011 17:14:18 GMT
Modified: incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/resolver/DefaultTraversableResolver.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/resolver/DefaultTraversableResolver.java?rev=1161648&r1=1161647&r2=1161648&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/resolver/DefaultTraversableResolver.java (original)
+++ incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/resolver/DefaultTraversableResolver.java Thu Aug 25 17:14:15 2011
@@ -16,17 +16,17 @@
  */
 package org.apache.bval.jsr303.resolver;
 
-import java.lang.annotation.ElementType;
-
-import javax.validation.Path;
-import javax.validation.TraversableResolver;
-
 import org.apache.bval.jsr303.util.ClassHelper;
-import org.apache.bval.jsr303.util.SecureActions;
-
+import org.apache.commons.lang.ClassUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import javax.validation.Path;
+import javax.validation.TraversableResolver;
+import java.lang.annotation.ElementType;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
 
 /** @see javax.validation.TraversableResolver */
 public class DefaultTraversableResolver implements TraversableResolver, CachingRelevant {
@@ -73,8 +73,9 @@ public class DefaultTraversableResolver 
     /** Tries to load detect and load JPA. */
     @SuppressWarnings("unchecked")
     private void initJpa() {
+        final ClassLoader classLoader = getClassLoader();
         try {
-            ClassHelper.getClass(PERSISTENCE_UTIL_CLASSNAME);
+            ClassUtils.getClass(classLoader, PERSISTENCE_UTIL_CLASSNAME, true);
             log.debug("Found {} on classpath.", PERSISTENCE_UTIL_CLASSNAME);
         } catch (Exception e) {
             log.debug("Cannot find {} on classpath. All properties will per default be traversable.", PERSISTENCE_UTIL_CLASSNAME);
@@ -83,9 +84,9 @@ public class DefaultTraversableResolver 
 
         try {
             Class<? extends TraversableResolver> jpaAwareResolverClass =
-                  (Class<? extends TraversableResolver>) ClassHelper
-                        .getClass(JPA_AWARE_TRAVERSABLE_RESOLVER_CLASSNAME);
-            jpaTR = SecureActions.newInstance(jpaAwareResolverClass);
+              (Class<? extends TraversableResolver>)
+                ClassUtils.getClass(classLoader, JPA_AWARE_TRAVERSABLE_RESOLVER_CLASSNAME, true);
+            jpaTR = jpaAwareResolverClass.newInstance();
             log.debug("Instantiated an instance of {}.", JPA_AWARE_TRAVERSABLE_RESOLVER_CLASSNAME);
         } catch (Exception e) {
             log.warn("Unable to load or instanciate JPA aware resolver " +
@@ -100,4 +101,25 @@ public class DefaultTraversableResolver 
     public boolean needsCaching() {
         return jpaTR != null && CachingTraversableResolver.needsCaching(jpaTR);
     }
+
+
+    
+    private static ClassLoader getClassLoader()
+    {
+      return (System.getSecurityManager() == null)
+        ? getClassLoader0()
+        : AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
+              public ClassLoader run() {
+                return getClassLoader0();
+              }
+          });
+    }
+
+    private static ClassLoader getClassLoader0()
+    {
+      final ClassLoader loader = Thread.currentThread().getContextClassLoader();
+      return (loader != null) ? loader : ClassHelper.class.getClassLoader();
+    }
+
+
 }

Modified: incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/util/ClassHelper.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/util/ClassHelper.java?rev=1161648&r1=1161647&r2=1161648&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/util/ClassHelper.java (original)
+++ incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/util/ClassHelper.java Thu Aug 25 17:14:15 2011
@@ -18,13 +18,11 @@
  */
 package org.apache.bval.jsr303.util;
 
+import org.apache.commons.lang.ClassUtils;
+
 import java.security.AccessController;
-import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.List;
 
-import org.apache.commons.lang.ClassUtils;
-
 /**
  * Common operations on classes that do not require an {@link AccessController}.
  * 
@@ -53,23 +51,32 @@ public class ClassHelper {
             return;
         }
         allClasses.add(clazz);
-        List<Class<?>> subClasses = new ArrayList<Class<?>>(Arrays.asList(clazz.getInterfaces()));
-        subClasses.add(0, clazz.getSuperclass());
-        for (Class<?> subClass : subClasses) {
+        fillFullClassHierarchyAsList(allClasses, clazz.getSuperclass());
+        for (Class<?> subClass : clazz.getInterfaces()) {
             fillFullClassHierarchyAsList(allClasses, subClass);
         }
     }
 
     /**
+     * @deprecated Will be removed for security reasons.
+     *
      * Perform ClassUtils.getClass functions with Java 2 Security enabled.
      */
+    @Deprecated
     public static Class<?> getClass(String className) throws ClassNotFoundException {
         return getClass(className, true);
     }
 
+    /**
+     * @deprecated Will be removed for security reasons.
+     *
+     * Perform ClassUtils.getClass functions with Java 2 Security enabled.
+     */
+    @Deprecated
     public static Class<?> getClass(String className, boolean initialize) throws ClassNotFoundException {
-        ClassLoader ctxtCldr = SecureActions.getContextClassLoader(Thread.currentThread());
-        ClassLoader loader = (ctxtCldr != null) ? ctxtCldr : SecureActions.getClassLoader(ClassHelper.class);
+        ClassLoader loader = Thread.currentThread().getContextClassLoader();
+        if (loader == null)
+          loader = ClassHelper.class.getClassLoader();
         return ClassUtils.getClass(loader, className, initialize);
     }
 }

Modified: incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/util/ConstraintDefinitionValidator.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/util/ConstraintDefinitionValidator.java?rev=1161648&r1=1161647&r2=1161648&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/util/ConstraintDefinitionValidator.java (original)
+++ incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/util/ConstraintDefinitionValidator.java Thu Aug 25 17:14:15 2011
@@ -59,17 +59,19 @@ public class ConstraintDefinitionValidat
      * @param annotation
      *            The annotation to check.
      */
-    private static void validGroups(Annotation annotation) {
+    private static void validGroups(final Annotation annotation) {
         // Ensure that it has a groups() method...
-        Method groupsMethod = SecureActions.getMethod(annotation.annotationType(), Jsr303MetaBeanFactory.ANNOTATION_GROUPS);
-        if ( groupsMethod == null ) {
+        final Method groupsMethod = SecureActions.doPrivileged(
+            SecureActions.getPublicMethod(annotation.annotationType(), Jsr303MetaBeanFactory.ANNOTATION_GROUPS)
+        );
+        if (groupsMethod == null) {
             throw new ConstraintDefinitionException("Constraint definition " + annotation + " has no groups() method");
         }
         
         // ...whose default value is an empty array
-        Object defaultGroupsValue = groupsMethod.getDefaultValue();
-        if ( defaultGroupsValue instanceof Class<?>[] ) {
-            if ( ((Class[]) defaultGroupsValue).length != 0 ) {
+        final Object defaultGroupsValue = groupsMethod.getDefaultValue();
+        if (defaultGroupsValue instanceof Class<?>[]) {
+            if (((Class[]) defaultGroupsValue).length != 0) {
                 throw new ConstraintDefinitionException("Default value for groups() must be an empty array");
             }
         }
@@ -88,17 +90,19 @@ public class ConstraintDefinitionValidat
      * @param annotation
      *            The annotation to check.
      */
-    private static void validPayload(Annotation annotation) {
+    private static void validPayload(final Annotation annotation) {
         // Ensure that it has a payload() method...
-        Method payloadMethod = SecureActions.getMethod(annotation.annotationType(), Jsr303MetaBeanFactory.ANNOTATION_PAYLOAD);
-        if ( payloadMethod == null ) {
+        final Method payloadMethod = SecureActions.doPrivileged(
+            SecureActions.getPublicMethod(annotation.annotationType(), Jsr303MetaBeanFactory.ANNOTATION_PAYLOAD)
+        );
+        if (payloadMethod == null) {
             throw new ConstraintDefinitionException("Constraint definition " + annotation + " has no payload() method");
         }
         
         // ...whose default value is an empty array
-        Object defaultPayloadValue = payloadMethod.getDefaultValue();
-        if ( defaultPayloadValue instanceof Class<?>[] ) {
-            if ( ((Class[]) defaultPayloadValue).length != 0 ) {
+        final Object defaultPayloadValue = payloadMethod.getDefaultValue();
+        if (defaultPayloadValue instanceof Class<?>[]) {
+            if (((Class[]) defaultPayloadValue).length != 0) {
                 throw new ConstraintDefinitionException("Default value for payload() must be an empty array");
             }
         }
@@ -117,16 +121,18 @@ public class ConstraintDefinitionValidat
      * @param annotation
      *            The annotation to check.
      */
-    private static void validMessage(Annotation annotation) {
+    private static void validMessage(final Annotation annotation) {
         // Ensure that it has a message() method...
-        Method messageMethod = SecureActions.getMethod(annotation.annotationType(), Jsr303MetaBeanFactory.ANNOTATION_MESSAGE);
-        if ( messageMethod == null ) {
+        final Method messageMethod = SecureActions.doPrivileged(
+            SecureActions.getPublicMethod(annotation.annotationType(), Jsr303MetaBeanFactory.ANNOTATION_MESSAGE)
+        );
+        if (messageMethod == null) {
             throw new ConstraintDefinitionException("Constraint definition " + annotation + " has no message() method");
         }
         
         // ...whose default value is a String
-        Object defaultMessageValue = messageMethod.getDefaultValue();
-        if ( !(defaultMessageValue instanceof String) ) {
+        final Object defaultMessageValue = messageMethod.getDefaultValue();
+        if (!(defaultMessageValue instanceof String)) {
             throw new ConstraintDefinitionException("Return type for message() must be of type String");
         }
     }
@@ -137,9 +143,11 @@ public class ConstraintDefinitionValidat
      * @param annotation
      *            The annotation to check.
      */
-    private static void validAttributes(Annotation annotation) {
-        Method[] methods = SecureActions.getDeclaredMethods(annotation.annotationType());
-        for ( Method method : methods ) {
+    private static void validAttributes(final Annotation annotation) {
+        final Method[] methods = SecureActions.doPrivileged(
+            SecureActions.getDeclaredMethods(annotation.annotationType())
+        );
+        for (Method method : methods ){
             // Currently case insensitive, the spec is unclear about this
             if ( method.getName().toLowerCase(Locale.ENGLISH).startsWith("valid") ) {
                 throw new ConstraintDefinitionException("A constraint annotation cannot have methods which start with 'valid'");

Modified: incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/util/NodeBuilderCustomizableContextImpl.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/util/NodeBuilderCustomizableContextImpl.java?rev=1161648&r1=1161647&r2=1161648&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/util/NodeBuilderCustomizableContextImpl.java (original)
+++ incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/util/NodeBuilderCustomizableContextImpl.java Thu Aug 25 17:14:15 2011
@@ -19,10 +19,10 @@
 package org.apache.bval.jsr303.util;
 
 
-import javax.validation.ConstraintValidatorContext;
-
 import org.apache.bval.jsr303.ConstraintValidatorContextImpl;
 
+import javax.validation.ConstraintValidatorContext;
+
 /**
  * Description: implementation of {@link NodeBuilderCustomizableContext}.<br/>
  */

Modified: incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/util/NodeBuilderDefinedContextImpl.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/util/NodeBuilderDefinedContextImpl.java?rev=1161648&r1=1161647&r2=1161648&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/util/NodeBuilderDefinedContextImpl.java (original)
+++ incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/util/NodeBuilderDefinedContextImpl.java Thu Aug 25 17:14:15 2011
@@ -19,10 +19,10 @@
 package org.apache.bval.jsr303.util;
 
 
-import javax.validation.ConstraintValidatorContext;
-
 import org.apache.bval.jsr303.ConstraintValidatorContextImpl;
 
+import javax.validation.ConstraintValidatorContext;
+
 /**
  * Description: Implementation of {@link NodeBuilderDefinedContext}.<br/>
  */

Modified: incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/util/NodeContextBuilderImpl.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/util/NodeContextBuilderImpl.java?rev=1161648&r1=1161647&r2=1161648&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/util/NodeContextBuilderImpl.java (original)
+++ incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/util/NodeContextBuilderImpl.java Thu Aug 25 17:14:15 2011
@@ -19,11 +19,11 @@
 package org.apache.bval.jsr303.util;
 
 
+import org.apache.bval.jsr303.ConstraintValidatorContextImpl;
+
 import javax.validation.ConstraintValidatorContext;
 import javax.validation.ConstraintValidatorContext.ConstraintViolationBuilder.NodeContextBuilder;
 
-import org.apache.bval.jsr303.ConstraintValidatorContextImpl;
-
 /**
  * Description: Implementation of {@link NodeContextBuilder}.<br/>
  */

Modified: incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/util/SecureActions.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/util/SecureActions.java?rev=1161648&r1=1161647&r2=1161648&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/util/SecureActions.java (original)
+++ incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/util/SecureActions.java Thu Aug 25 17:14:15 2011
@@ -19,13 +19,12 @@
 package org.apache.bval.jsr303.util;
 
 import org.apache.bval.util.PrivilegedActions;
-import org.apache.commons.lang.StringUtils;
 
-import javax.validation.ValidationException;
-import java.lang.reflect.Constructor;
+import java.lang.reflect.AccessibleObject;
 import java.lang.reflect.Field;
 import java.lang.reflect.Method;
 import java.lang.reflect.Modifier;
+import java.security.AccessController;
 import java.security.PrivilegedAction;
 
 /**
@@ -34,202 +33,114 @@ import java.security.PrivilegedAction;
 public class SecureActions extends PrivilegedActions {
 
     /**
-     * Create a new instance of the class using the default no-arg constructor.
-     * perform newInstance() call with AccessController.doPrivileged() if possible.
+     * Create a privileged action to get the context classloader of the current thread.
      *
-     * @param cls - the class (no interface, non-abstract, has accessible default no-arg-constructor)
-     * @return a new instance
+     * @see Thread#getContextClassLoader()
      */
-    public static <T> T newInstance(final Class<T> cls) {
-        return newInstance(cls, ValidationException.class);
+    public static PrivilegedAction<ClassLoader> getContextClassLoader()
+    {
+        return SecureActions.GetContextClassLoader.instance;
     }
 
-    /**
-     * Create a new instance of a specified class, rethrowing {@link ValidationException}.
-     *
-     * @param <T>
-     * @param cls - the class (no interface, non-abstract, has accessible matching constructor)
-     * @param paramTypes
-     * @param values
-     * @return a new instance
-     */
-    public static <T> T newInstance(final Class<T> cls, final Class<?>[] paramTypes,
-                                    final Object[] values) {
-        return newInstance(cls, ValidationException.class, paramTypes, values);
-    }
-
-    /**
-     * Load a class.
-     * @param className
-     * @param caller
-     * @return loaded Class instance
-     */
-    public static Class<?> loadClass(final String className, final Class<?> caller) {
-        return run(new PrivilegedAction<Class<?>>() {
-            public Class<?> run() {
-                try {
-                    ClassLoader contextClassLoader =
-                          Thread.currentThread().getContextClassLoader();
-                    if (contextClassLoader != null) {
-                        return contextClassLoader.loadClass(className);
-                    }
-                } catch (Throwable e) {
-                    // ignore
-                }
-                try {
-                    return Class.forName(className, true, caller.getClassLoader());
-                } catch (ClassNotFoundException e) {
-                    throw new ValidationException("Unable to load class: " + className, e);
-                }
-            }
-        });
-    }
 
     /**
-     * Get a field declared on a given class.
-     * @param clazz
-     * @param fieldName
-     * @return Field found
+     * Create a privileged action to get the named field declared by the specified class.
+     * The result of the action will be {@code null} if there is no such field.
      */
-    public static Field getDeclaredField(final Class<?> clazz, final String fieldName) {
-        return run(new PrivilegedAction<Field>() {
+    public static PrivilegedAction<Field> getDeclaredField(final Class<?> clazz, final String fieldName) {
+        return new PrivilegedAction<Field>() {
             public Field run() {
                 try {
-                    Field f = clazz.getDeclaredField(fieldName);
+                    final Field f = clazz.getDeclaredField(fieldName);
                     setAccessibility(f);
                     return f;
-                } catch (NoSuchFieldException e) {
+                } catch (final NoSuchFieldException ex) {
                     return null;
                 }
             }
-        });
+        };
     }
 
+
+
     /**
-     * Get all fields declared on a given class.
-     * @param clazz
-     * @return Field found
+     * Create a privileged action to get all fields declared by the specified class.
      */
-    public static Field[] getDeclaredFields(final Class<?> clazz) {
-        return run(new PrivilegedAction<Field[]>() {
+    public static PrivilegedAction<Field[]> getDeclaredFields(final Class<?> clazz) {
+        return new PrivilegedAction<Field[]>() {
             public Field[] run() {
-                Field[] fs = clazz.getDeclaredFields();
-                for( Field f : fs ) {
-                    setAccessibility(f);
-                }
-                return fs;
+                final Field[] fields = clazz.getDeclaredFields();
+                if (fields.length > 0)
+                    AccessibleObject.setAccessible(fields, true);
+                return fields;
             }
-        });
+        };
     }
 
-    private static void setAccessibility(Field field) {
-        if (!Modifier.isPublic(field.getModifiers()) || (
-              Modifier.isPublic(field.getModifiers()) &&
-                    Modifier.isAbstract(field.getModifiers()))) {
-            field.setAccessible(true);
-        }
-    }
-
-    /**
-     * Returns the <b>public method</b> with the specified name or null if it does not exist.
-     *
-     * @param clazz
-     * @param methodName
-     * @return Returns the method or null if not found.
-     */
-    public static Method getGetter(final Class<?> clazz, final String methodName) {
-        return run(new PrivilegedAction<Method>() {
-            public Method run() {
-                try {
-                    String methodName0 = StringUtils.capitalize(methodName);
-                    try {
-                        return clazz.getMethod("get" + methodName0);
-                    } catch (NoSuchMethodException e) {
-                        return clazz.getMethod("is" + methodName0);
-                    }
-                } catch (NoSuchMethodException e) {
-                    return null;
-                }
-            }
-        });
 
-    }
 
     /**
-     * Get the method of <code>methodName</code> available on <code>clazz</code>.
-     * @param clazz
-     * @param methodName
-     * @return {@link Method} found
+     * Create a privileged action to get all methods declared by the specified class.
      */
-    public static Method getMethod(final Class<?> clazz, final String methodName) {
-        return run(new PrivilegedAction<Method>() {
-            public Method run() {
-                try {
-                    return clazz.getMethod(methodName);
-                } catch (NoSuchMethodException e) {
-                    return null;
-                }
-            }
-        });
+    public static PrivilegedAction<Method[]> getDeclaredMethods(final Class<?> clazz) {
+      // XXX 2011-03-27 jw: Inconsistent behaviour.
+      // doGetDeclaredFields() is setting fields accessible, but here we don't.
+      return new PrivilegedAction<Method[]>() {
+          public Method[] run() {
+            return clazz.getDeclaredMethods();
+        }
+      };
     }
 
     /**
-     * Get methods declared on <code>clazz</code>.
-     * @param clazz
-     * @return {@link Method} array
-     */
-    public static Method[] getDeclaredMethods(final Class<?> clazz) {
-        return run(new PrivilegedAction<Method[]>() {
-            public Method[] run() {
-                return clazz.getDeclaredMethods();
-            }
-        });
+     * Create a privileged action to get the named method declared by the specified class
+     * or by one of its ancestors.
+     * The result of the action will be {@code null} if there is no such method.
+     */
+    public static PrivilegedAction<Method> getPublicMethod(final Class<?> clazz, final String methodName) {
+      return new PrivilegedAction<Method>() {
+          public Method run() {
+              try {
+                  return clazz.getMethod(methodName, (Class[]) null);
+              } catch (final NoSuchMethodException ex) {
+                  return null;
+              }
+          }
+      };
     }
 
-    /**
-     * Get class loader of <code>clazz</code>.
-     * @param clazz
-     * @return {@link ClassLoader}
-     */
-    public static ClassLoader getClassLoader(final Class<?> clazz) {
-        return run(new PrivilegedAction<ClassLoader>() {
-            public ClassLoader run() {
-                return clazz.getClassLoader();
-            }
-        });
+    private static void setAccessibility(Field field) {
+      // FIXME 2011-03-27 jw:
+      // - Why not simply call field.setAccessible(true)?
+      // - Fields can not be abstract.
+        if (!Modifier.isPublic(field.getModifiers()) || (
+              Modifier.isPublic(field.getModifiers()) &&
+                    Modifier.isAbstract(field.getModifiers()))) {
+            field.setAccessible(true);
+        }
     }
 
-    /**
-     * Get context class loader of <code>thread</code>.
-     * @param thread
-     * @return {@link ClassLoader}
-     */
-    public static ClassLoader getContextClassLoader(final Thread thread) {
-        return run(new PrivilegedAction<ClassLoader>() {
-            public ClassLoader run() {
-                return thread.getContextClassLoader();
-            }
-        });
+    static <T> T doPrivileged(final PrivilegedAction<T> action) {
+        if (System.getSecurityManager() != null) {
+            return AccessController.doPrivileged(action);
+        } else {
+            return action.run();
+        }
     }
 
-    /**
-     * Get the constructor of <code>clazz</code> matching <code>params</code>.
-     * @param <T>
-     * @param clazz
-     * @param params
-     * @return {@link Constructor} found
-     */
-    public static <T> Constructor<T> getConstructor(final Class<T> clazz,
-                                                    final Class<?>... params) {
-        return run(new PrivilegedAction<Constructor<T>>() {
-            public Constructor<T> run() {
-                try {
-                    return clazz.getConstructor(params);
-                } catch (NoSuchMethodException e) {
-                    return null;
-                }
-            }
-        });
+    private static final class GetContextClassLoader extends Object implements PrivilegedAction<ClassLoader> {
+
+      static final GetContextClassLoader instance = new GetContextClassLoader();
+
+      private GetContextClassLoader()
+      {
+        super();
+      }
+
+      public final ClassLoader run() {
+          return Thread.currentThread().getContextClassLoader();
+      }
+
     }
 
 }

Modified: incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/xml/AnnotationProxy.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/xml/AnnotationProxy.java?rev=1161648&r1=1161647&r2=1161648&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/xml/AnnotationProxy.java (original)
+++ incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/xml/AnnotationProxy.java Thu Aug 25 17:14:15 2011
@@ -23,6 +23,8 @@ import java.io.Serializable;
 import java.lang.annotation.Annotation;
 import java.lang.reflect.InvocationHandler;
 import java.lang.reflect.Method;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.SortedSet;
@@ -58,7 +60,9 @@ public class AnnotationProxy implements 
     private <A extends Annotation> Map<String, Object> getAnnotationValues(AnnotationProxyBuilder<A> descriptor) {
         Map<String, Object> result = new HashMap<String, Object>();
         int processedValuesFromDescriptor = 0;
-        final Method[] declaredMethods = SecureActions.getDeclaredMethods(annotationType);
+        final Method[] declaredMethods = doPrivileged(
+          SecureActions.getDeclaredMethods(annotationType)
+        );
         for (Method m : declaredMethods) {
             if (descriptor.contains(m.getName())) {
                 result.put(m.getName(), descriptor.getValue(m.getName()));
@@ -114,5 +118,15 @@ public class AnnotationProxy implements 
         result.addAll(values.keySet());
         return result;
     }
+
+
+
+    private static <T> T doPrivileged(final PrivilegedAction<T> action) {
+        if (System.getSecurityManager() != null) {
+            return AccessController.doPrivileged(action);
+        } else {
+            return action.run();
+        }
+    }
 }
 

Modified: incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/xml/AnnotationProxyBuilder.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/xml/AnnotationProxyBuilder.java?rev=1161648&r1=1161647&r2=1161648&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/xml/AnnotationProxyBuilder.java (original)
+++ incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/xml/AnnotationProxyBuilder.java Thu Aug 25 17:14:15 2011
@@ -19,14 +19,14 @@ package org.apache.bval.jsr303.xml;
 
 import org.apache.bval.jsr303.Jsr303MetaBeanFactory;
 import org.apache.bval.jsr303.util.SecureActions;
+import org.apache.bval.util.PrivilegedActions;
 
 import javax.validation.Payload;
 import javax.validation.ValidationException;
 import java.lang.annotation.Annotation;
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.lang.reflect.Proxy;
+import java.lang.reflect.*;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
 import java.util.HashMap;
 import java.util.Map;
 
@@ -43,6 +43,7 @@ final public class AnnotationProxyBuilde
 
     /**
      * Create a new AnnotationProxyBuilder instance.
+     *
      * @param annotationType
      */
     public AnnotationProxyBuilder(Class<A> annotationType) {
@@ -51,6 +52,7 @@ final public class AnnotationProxyBuilde
 
     /**
      * Create a new AnnotationProxyBuilder instance.
+     *
      * @param annotationType
      * @param elements
      */
@@ -64,16 +66,15 @@ final public class AnnotationProxyBuilde
     /**
      * Create a builder initially configured to create an annotation equivalent to <code>annot</code>.
      *
-     * @param annot
-     *            Annotation to be replicated.
+     * @param annot Annotation to be replicated.
      */
     @SuppressWarnings("unchecked")
     public AnnotationProxyBuilder(A annot) {
         this((Class<A>) annot.annotationType());
         // Obtain the "elements" of the annotation
-        Method[] methods = SecureActions.getDeclaredMethods(annot.annotationType());
-        for ( Method m : methods ) {
-            if ( !m.isAccessible() ) {
+        final Method[] methods = doPrivileged(SecureActions.getDeclaredMethods(annot.annotationType()));
+        for (Method m : methods) {
+            if (!m.isAccessible()) {
                 m.setAccessible(true);
             }
             try {
@@ -92,6 +93,7 @@ final public class AnnotationProxyBuilde
 
     /**
      * Add an element to the configuration.
+     *
      * @param elementName
      * @param value
      */
@@ -101,6 +103,7 @@ final public class AnnotationProxyBuilde
 
     /**
      * Get the specified element value from the current configuration.
+     *
      * @param elementName
      * @return Object value
      */
@@ -110,6 +113,7 @@ final public class AnnotationProxyBuilde
 
     /**
      * Learn whether a given element has been configured.
+     *
      * @param elementName
      * @return <code>true</code> if an <code>elementName</code> element is found on this annotation
      */
@@ -119,6 +123,7 @@ final public class AnnotationProxyBuilde
 
     /**
      * Get the number of configured elements.
+     *
      * @return int
      */
     public int size() {
@@ -127,6 +132,7 @@ final public class AnnotationProxyBuilde
 
     /**
      * Get the configured Annotation type.
+     *
      * @return Class<A>
      */
     public Class<A> getType() {
@@ -135,6 +141,7 @@ final public class AnnotationProxyBuilde
 
     /**
      * Configure the well-known JSR303 "message" element.
+     *
      * @param message
      */
     public void setMessage(String message) {
@@ -143,6 +150,7 @@ final public class AnnotationProxyBuilde
 
     /**
      * Configure the well-known JSR303 "groups" element.
+     *
      * @param groups
      */
     public void setGroups(Class<?>[] groups) {
@@ -151,6 +159,7 @@ final public class AnnotationProxyBuilde
 
     /**
      * Configure the well-known JSR303 "payload" element.
+     *
      * @param payload
      */
     public void setPayload(Class<? extends Payload>[] payload) {
@@ -159,21 +168,31 @@ final public class AnnotationProxyBuilde
 
     /**
      * Create the annotation represented by this builder.
+     *
      * @return {@link Annotation}
      */
     @SuppressWarnings("unchecked")
     public A createAnnotation() {
         ClassLoader classLoader = SecureActions.getClassLoader(getType());
-        Class<A> proxyClass = (Class<A>) Proxy.getProxyClass(classLoader, getType());
-        InvocationHandler handler = new AnnotationProxy(this);
-        try {
-            return SecureActions.getConstructor(proxyClass, InvocationHandler.class)
-                  .newInstance(handler);
-        } catch (ValidationException e) {
-            throw e;
-        } catch (Exception e) {
-            throw new ValidationException(
-                  "Unable to create annotation for configured constraint", e);
+        final Class<A> proxyClass = (Class<A>) Proxy.getProxyClass(classLoader, getType());
+        final InvocationHandler handler = new AnnotationProxy(this);
+        return PrivilegedActions.run(new PrivilegedAction<A>() {
+            public A run() {
+                try {
+                    Constructor<A> constructor = proxyClass.getConstructor(InvocationHandler.class);
+                    return constructor.newInstance(handler);
+                } catch (Exception e) {
+                    throw new ValidationException("Unable to create annotation for configured constraint", e);
+                }
+            }
+        });
+    }
+
+    private static <T> T doPrivileged(final PrivilegedAction<T> action) {
+        if (System.getSecurityManager() != null) {
+            return AccessController.doPrivileged(action);
+        } else {
+            return action.run();
         }
     }
 }

Modified: incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/xml/MetaConstraint.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/xml/MetaConstraint.java?rev=1161648&r1=1161647&r2=1161648&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/xml/MetaConstraint.java (original)
+++ incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/xml/MetaConstraint.java Thu Aug 25 17:14:15 2011
@@ -17,12 +17,11 @@
 package org.apache.bval.jsr303.xml;
 
 
-import javax.validation.ValidationException;
-
 import org.apache.bval.util.AccessStrategy;
 import org.apache.bval.util.FieldAccess;
 import org.apache.bval.util.MethodAccess;
 
+import javax.validation.ValidationException;
 import java.lang.annotation.Annotation;
 import java.lang.reflect.Field;
 import java.lang.reflect.Member;

Modified: incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/xml/ValidationMappingParser.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/xml/ValidationMappingParser.java?rev=1161648&r1=1161647&r2=1161648&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/xml/ValidationMappingParser.java (original)
+++ incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/xml/ValidationMappingParser.java Thu Aug 25 17:14:15 2011
@@ -26,6 +26,7 @@ import org.apache.bval.util.FieldAccess;
 import org.apache.bval.util.MethodAccess;
 import org.apache.commons.beanutils.ConvertUtils;
 import org.apache.commons.beanutils.Converter;
+import org.apache.commons.lang.StringUtils;
 
 import javax.validation.Constraint;
 import javax.validation.ConstraintValidator;
@@ -44,6 +45,8 @@ import java.lang.reflect.Array;
 import java.lang.reflect.Field;
 import java.lang.reflect.Member;
 import java.lang.reflect.Method;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
 import java.util.*;
 
 
@@ -185,8 +188,8 @@ public class ValidationMappingParser {
     }
 
     private <A extends Annotation> Class<?> getAnnotationParameterType(
-          Class<A> annotationClass, String name) {
-        Method m = SecureActions.getMethod(annotationClass, name);
+          final Class<A> annotationClass, final String name) {
+        final Method m = doPrivileged(SecureActions.getPublicMethod(annotationClass, name));
         if (m == null) {
             throw new ValidationException("Annotation of type " + annotationClass.getName() +
                   " does not contain a parameter " + name + ".");
@@ -355,7 +358,7 @@ public class ValidationMappingParser {
             } else {
                 fieldNames.add(fieldName);
             }
-            final Field field = SecureActions.getDeclaredField(beanClass, fieldName);
+            final Field field = doPrivileged(SecureActions.getDeclaredField(beanClass, fieldName));
             if (field == null) {
                 throw new ValidationException(
                       beanClass.getName() + " does not contain the fieldType  " + fieldName);
@@ -394,7 +397,7 @@ public class ValidationMappingParser {
             } else {
                 getterNames.add(getterName);
             }
-            final Method method = SecureActions.getGetter(beanClass, getterName);
+            final Method method = getGetter(beanClass, getterName);
             if (method == null) {
                 throw new ValidationException(
                       beanClass.getName() + " does not contain the property  " + getterName);
@@ -450,8 +453,8 @@ public class ValidationMappingParser {
             }
             for (JAXBElement<String> validatorClassName : validatedByType.getValue()) {
                 Class<? extends ConstraintValidator<?, ?>> validatorClass;
-                validatorClass = (Class<? extends ConstraintValidator<?, ?>>) SecureActions
-                      .loadClass(validatorClassName.getValue(), this.getClass());
+                validatorClass = (Class<? extends ConstraintValidator<?, ?>>)
+                      loadClass(validatorClassName.getValue());
 
 
                 if (!ConstraintValidator.class.isAssignableFrom(validatorClass)) {
@@ -496,8 +499,7 @@ public class ValidationMappingParser {
     }
 
     private Class<?> loadClass(String className, String defaultPackage) {
-        return SecureActions
-              .loadClass(toQualifiedClassName(className, defaultPackage), this.getClass());
+        return loadClass(toQualifiedClassName(className, defaultPackage));
     }
 
     private String toQualifiedClassName(String className, String defaultPackage) {
@@ -511,4 +513,48 @@ public class ValidationMappingParser {
         return clazz.contains(".");
     }
 
+
+
+    private static <T> T doPrivileged(final PrivilegedAction<T> action) {
+        if (System.getSecurityManager() != null) {
+            return AccessController.doPrivileged(action);
+        } else {
+            return action.run();
+        }
+    }
+
+
+
+    private static Method getGetter(final Class<?> clazz, final String propertyName) {
+        return doPrivileged(new PrivilegedAction<Method>() {
+            public Method run() {
+                try {
+                    final String p = StringUtils.capitalize(propertyName);
+                    try {
+                        return clazz.getMethod("get" + p);
+                    } catch (NoSuchMethodException e) {
+                        return clazz.getMethod("is" + p);
+                    }
+                } catch (NoSuchMethodException e) {
+                    return null;
+                }
+            }
+        });
+
+    }
+
+
+
+    private Class<?> loadClass(final String className) {
+        ClassLoader loader = doPrivileged(SecureActions.getContextClassLoader());
+        if (loader == null)
+            loader = getClass().getClassLoader();
+
+        try {
+            return Class.forName(className, true, loader);
+        } catch (ClassNotFoundException ex) {
+            throw new ValidationException("Unable to load class: " + className, ex);
+        }
+    }
+
 }

Modified: incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/xml/ValidationParser.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/xml/ValidationParser.java?rev=1161648&r1=1161647&r2=1161648&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/xml/ValidationParser.java (original)
+++ incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/xml/ValidationParser.java Thu Aug 25 17:14:15 2011
@@ -43,6 +43,8 @@ import javax.xml.validation.SchemaFactor
 import java.io.IOException;
 import java.io.InputStream;
 import java.net.URL;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
 import java.util.Enumeration;
 
 /**
@@ -176,8 +178,7 @@ public class ValidationParser {
         String providerClassName = xmlConfig.getDefaultProvider();
         if (providerClassName != null) {
             Class<? extends ValidationProvider<?>> clazz =
-                    (Class<? extends ValidationProvider<?>>) SecureActions
-                            .loadClass(providerClassName, this.getClass());
+                    (Class<? extends ValidationProvider<?>>) loadClass(providerClassName);
             target.setProviderClass(clazz);
             log.info("Using {} as validation provider.", providerClassName);
         }
@@ -189,9 +190,9 @@ public class ValidationParser {
         String messageInterpolatorClass = xmlConfig.getMessageInterpolator();
         if (target.getMessageInterpolator() == null) {
             if (messageInterpolatorClass != null) {
-                Class<MessageInterpolator> clazz = (Class<MessageInterpolator>) SecureActions
-                        .loadClass(messageInterpolatorClass, this.getClass());
-                target.messageInterpolator(SecureActions.newInstance(clazz));
+                Class<MessageInterpolator> clazz = (Class<MessageInterpolator>)
+                        loadClass(messageInterpolatorClass);
+                target.messageInterpolator(newInstance(clazz));
                 log.info("Using {} as message interpolator.", messageInterpolatorClass);
             }
         }
@@ -203,24 +204,35 @@ public class ValidationParser {
         String traversableResolverClass = xmlConfig.getTraversableResolver();
         if (target.getTraversableResolver() == null) {
             if (traversableResolverClass != null) {
-                Class<TraversableResolver> clazz = (Class<TraversableResolver>) SecureActions
-                        .loadClass(traversableResolverClass, this.getClass());
-                target.traversableResolver(SecureActions.newInstance(clazz));
+                Class<TraversableResolver> clazz = (Class<TraversableResolver>)
+                        loadClass(traversableResolverClass);
+                target.traversableResolver(newInstance(clazz));
                 log.info("Using {} as traversable resolver.", traversableResolverClass);
             }
         }
     }
 
+    private <T> T newInstance(final Class<T> cls) {
+        return AccessController.doPrivileged(new PrivilegedAction<T>() {
+            public T run() {
+                try {
+                    return cls.newInstance();
+                } catch (final Exception ex) {
+                    throw new ValidationException("Cannot instantiate : " + cls, ex);
+                }
+            }
+        });
+    }
+
     @SuppressWarnings("unchecked")
     private void applyConstraintFactory(ValidationConfigType xmlConfig,
                                         ConfigurationImpl target) {
         String constraintFactoryClass = xmlConfig.getConstraintValidatorFactory();
         if (target.getConstraintValidatorFactory() == null) {
             if (constraintFactoryClass != null) {
-                Class<ConstraintValidatorFactory> clazz =
-                        (Class<ConstraintValidatorFactory>) SecureActions
-                                .loadClass(constraintFactoryClass, this.getClass());
-                target.constraintValidatorFactory(SecureActions.newInstance(clazz));
+                Class<ConstraintValidatorFactory> clazz = (Class<ConstraintValidatorFactory>)
+                        loadClass(constraintFactoryClass);
+                target.constraintValidatorFactory(newInstance(clazz));
                 log.info("Using {} as constraint factory.", constraintFactoryClass);
             }
         }
@@ -250,4 +262,26 @@ public class ValidationParser {
             target.addMapping(in);
         }
     }
+
+
+    private static <T> T doPrivileged(final PrivilegedAction<T> action) {
+        if (System.getSecurityManager() != null) {
+            return AccessController.doPrivileged(action);
+        } else {
+            return action.run();
+        }
+    }
+
+    private Class<?> loadClass(final String className) {
+        ClassLoader loader = doPrivileged(SecureActions.getContextClassLoader());
+        if (loader == null)
+            loader = getClass().getClassLoader();
+
+        try {
+            return Class.forName(className, true, loader);
+        } catch (ClassNotFoundException ex) {
+            throw new ValidationException("Unable to load class: " + className, ex);
+        }
+    }
+
 }

Modified: incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/constraints/DigitsValidatorTest.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/constraints/DigitsValidatorTest.java?rev=1161648&r1=1161647&r2=1161648&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/constraints/DigitsValidatorTest.java (original)
+++ incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/constraints/DigitsValidatorTest.java Thu Aug 25 17:14:15 2011
@@ -25,9 +25,6 @@ import junit.framework.TestSuite;
 
 import java.math.BigDecimal;
 
-import org.apache.bval.constraints.DigitsValidatorForNumber;
-import org.apache.bval.constraints.DigitsValidatorForString;
-
 /**
  * DigitsConstraintValidator Tester.
  *

Modified: incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/constraints/EmailValidatorTest.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/constraints/EmailValidatorTest.java?rev=1161648&r1=1161647&r2=1161648&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/constraints/EmailValidatorTest.java (original)
+++ incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/constraints/EmailValidatorTest.java Thu Aug 25 17:14:15 2011
@@ -22,12 +22,11 @@ import junit.framework.Assert;
 import junit.framework.Test;
 import junit.framework.TestCase;
 import junit.framework.TestSuite;
-
-import javax.validation.Validator;
-
 import org.apache.bval.jsr303.ApacheValidatorFactory;
 import org.apache.bval.jsr303.example.Customer;
 
+import javax.validation.Validator;
+
 /**
  * EmailValidator Tester.
  *

Modified: incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/constraints/FrenchZipCode.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/constraints/FrenchZipCode.java?rev=1161648&r1=1161647&r2=1161648&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/constraints/FrenchZipCode.java (original)
+++ incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/constraints/FrenchZipCode.java Thu Aug 25 17:14:15 2011
@@ -24,15 +24,13 @@ import javax.validation.Payload;
 import javax.validation.ReportAsSingleViolation;
 import javax.validation.constraints.NotNull;
 import javax.validation.constraints.Size;
-
-import org.apache.bval.constraints.NotEmpty;
-
 import java.lang.annotation.Documented;
-import static java.lang.annotation.ElementType.*;
 import java.lang.annotation.Retention;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
 import java.lang.annotation.Target;
 
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
 /**
  * Description: example for composed constraint.
  * not implemented! simple dummy implemenation for tests only! <br/>

Modified: incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/constraints/HasValue.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/constraints/HasValue.java?rev=1161648&r1=1161647&r2=1161648&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/constraints/HasValue.java (original)
+++ incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/constraints/HasValue.java Thu Aug 25 17:14:15 2011
@@ -20,11 +20,12 @@ package org.apache.bval.constraints;
 
 import javax.validation.Constraint;
 import javax.validation.Payload;
-import static java.lang.annotation.ElementType.*;
 import java.lang.annotation.Retention;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
 import java.lang.annotation.Target;
 
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
 /**
  * Description: allow distinct string values for element (like enums) <br/>
  */

Modified: incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/constraints/ZipCodeCityCoherence.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/constraints/ZipCodeCityCoherence.java?rev=1161648&r1=1161647&r2=1161648&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/constraints/ZipCodeCityCoherence.java (original)
+++ incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/constraints/ZipCodeCityCoherence.java Thu Aug 25 17:14:15 2011
@@ -21,11 +21,12 @@ package org.apache.bval.constraints;
 import javax.validation.Constraint;
 import javax.validation.Payload;
 import java.lang.annotation.Documented;
-import static java.lang.annotation.ElementType.TYPE;
 import java.lang.annotation.Retention;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
 import java.lang.annotation.Target;
 
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
 /**
  * not implemented! simple dummy implemenation for tests only!
  */

Modified: incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/constraints/ZipCodeCityCoherenceValidator.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/constraints/ZipCodeCityCoherenceValidator.java?rev=1161648&r1=1161647&r2=1161648&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/constraints/ZipCodeCityCoherenceValidator.java (original)
+++ incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/constraints/ZipCodeCityCoherenceValidator.java Thu Aug 25 17:14:15 2011
@@ -19,11 +19,11 @@
 package org.apache.bval.constraints;
 
 
+import org.apache.bval.jsr303.example.ZipCodeCityCarrier;
+
 import javax.validation.ConstraintValidator;
 import javax.validation.ConstraintValidatorContext;
 
-import org.apache.bval.jsr303.example.ZipCodeCityCarrier;
-
 /**
  * Description: Class not implemented! simple dummy implemenation for tests only! <br/>
  * User: roman.stumm <br/>

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=1161648&r1=1161647&r2=1161648&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 Thu Aug 25 17:14:15 2011
@@ -20,23 +20,18 @@ package org.apache.bval.jsr303;
 
 import junit.framework.Assert;
 import junit.framework.TestCase;
+import org.apache.bval.jsr303.util.TestUtils;
 
 import javax.validation.*;
 import javax.validation.constraints.NotNull;
 import javax.validation.groups.Default;
-import javax.validation.metadata.BeanDescriptor;
-import javax.validation.metadata.ConstraintDescriptor;
-import javax.validation.metadata.ElementDescriptor;
-import javax.validation.metadata.PropertyDescriptor;
-import javax.validation.metadata.Scope;
+import javax.validation.metadata.*;
 import javax.validation.metadata.ElementDescriptor.ConstraintFinder;
-
 import java.lang.annotation.Documented;
 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 static java.lang.annotation.ElementType.*;
 import static java.lang.annotation.RetentionPolicy.RUNTIME;

Modified: incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/CustomValidatorFactoryTest.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/CustomValidatorFactoryTest.java?rev=1161648&r1=1161647&r2=1161648&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/CustomValidatorFactoryTest.java (original)
+++ incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/CustomValidatorFactoryTest.java Thu Aug 25 17:14:15 2011
@@ -18,18 +18,11 @@
  */
 package org.apache.bval.jsr303;
 
-import javax.validation.ConstraintValidatorFactory;
-import javax.validation.MessageInterpolator;
-import javax.validation.TraversableResolver;
-import javax.validation.Validation;
-import javax.validation.ValidationException;
-import javax.validation.Validator;
-import javax.validation.ValidatorContext;
-import javax.validation.ValidatorFactory;
-import javax.validation.spi.ConfigurationState;
-
 import junit.framework.TestCase;
 
+import javax.validation.*;
+import javax.validation.spi.ConfigurationState;
+
 /**
  * Test the ability to force a particular {@link ValidatorFactory}
  * implementation class.

Modified: incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/FooTest.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/FooTest.java?rev=1161648&r1=1161647&r2=1161648&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/FooTest.java (original)
+++ incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/FooTest.java Thu Aug 25 17:14:15 2011
@@ -18,16 +18,15 @@
  */
 package org.apache.bval.jsr303;
 
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Set;
+import junit.framework.TestCase;
 
 import javax.validation.ConstraintViolation;
 import javax.validation.Valid;
 import javax.validation.Validator;
 import javax.validation.constraints.NotNull;
-
-import junit.framework.TestCase;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Set;
 
 /**
  * Description: <br/>

Modified: incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/PayloadTest.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/PayloadTest.java?rev=1161648&r1=1161647&r2=1161648&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/PayloadTest.java (original)
+++ incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/PayloadTest.java Thu Aug 25 17:14:15 2011
@@ -18,16 +18,14 @@
  */
 package org.apache.bval.jsr303;
 
-import java.util.Set;
+import junit.framework.TestCase;
+import org.apache.bval.jsr303.util.TestUtils;
 
 import javax.validation.ConstraintViolation;
 import javax.validation.Payload;
 import javax.validation.Validator;
 import javax.validation.constraints.NotNull;
-
-import junit.framework.TestCase;
-
-import org.apache.bval.jsr303.util.TestUtils;
+import java.util.Set;
 
 /**
  * Description: test that payload information can be retrieved

Modified: incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/ValidatorResolutionTest.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/ValidatorResolutionTest.java?rev=1161648&r1=1161647&r2=1161648&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/ValidatorResolutionTest.java (original)
+++ incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/ValidatorResolutionTest.java Thu Aug 25 17:14:15 2011
@@ -18,27 +18,17 @@
  */
 package org.apache.bval.jsr303;
 
-import static java.lang.annotation.ElementType.FIELD;
-import static java.lang.annotation.ElementType.METHOD;
-import static java.lang.annotation.ElementType.TYPE;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import junit.framework.TestCase;
 
+import javax.validation.*;
+import javax.validation.constraints.NotNull;
 import java.lang.annotation.Documented;
 import java.lang.annotation.Retention;
 import java.lang.annotation.Target;
 import java.util.Locale;
 
-import javax.validation.Constraint;
-import javax.validation.ConstraintDefinitionException;
-import javax.validation.ConstraintValidator;
-import javax.validation.ConstraintValidatorContext;
-import javax.validation.Payload;
-import javax.validation.Validation;
-import javax.validation.Validator;
-import javax.validation.ValidatorFactory;
-import javax.validation.constraints.NotNull;
-
-import junit.framework.TestCase;
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
 
 
 /**

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=1161648&r1=1161647&r2=1161648&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 Thu Aug 25 17:14:15 2011
@@ -19,10 +19,10 @@
 package org.apache.bval.jsr303.example;
 
 
-import javax.validation.Valid;
-
 import org.apache.bval.constraints.HasValue;
 
+import javax.validation.Valid;
+
 /**
  * Description: <br/>
  */

Modified: incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/example/Address.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/example/Address.java?rev=1161648&r1=1161647&r2=1161648&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/example/Address.java (original)
+++ incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/example/Address.java Thu Aug 25 17:14:15 2011
@@ -19,14 +19,14 @@
 package org.apache.bval.jsr303.example;
 
 
+import org.apache.bval.constraints.ZipCodeCityCoherence;
+
 import javax.validation.GroupSequence;
 import javax.validation.Valid;
 import javax.validation.constraints.NotNull;
 import javax.validation.constraints.Size;
 import javax.validation.groups.Default;
 
-import org.apache.bval.constraints.ZipCodeCityCoherence;
-
 @ZipCodeCityCoherence
 public class Address implements ZipCodeCityCarrier {
     @NotNull

Modified: incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/example/Author.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/example/Author.java?rev=1161648&r1=1161647&r2=1161648&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/example/Author.java (original)
+++ incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/example/Author.java Thu Aug 25 17:14:15 2011
@@ -19,12 +19,11 @@
 package org.apache.bval.jsr303.example;
 
 
+import org.apache.bval.constraints.NotEmpty;
+
 import javax.validation.GroupSequence;
 import javax.validation.Valid;
 import javax.validation.constraints.Size;
-
-import org.apache.bval.constraints.NotEmpty;
-
 import java.util.List;
 
 @GroupSequence({First.class, Author.class, Last.class})

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=1161648&r1=1161647&r2=1161648&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 Thu Aug 25 17:14:15 2011
@@ -19,13 +19,13 @@
 package org.apache.bval.jsr303.example;
 
 
+import org.apache.bval.constraints.NotEmpty;
+
 import javax.validation.GroupSequence;
 import javax.validation.Valid;
 import javax.validation.constraints.NotNull;
 import javax.validation.constraints.Size;
 
-import org.apache.bval.constraints.NotEmpty;
-
 @GroupSequence({First.class, Second.class, Book.class, Last.class})
 public class Book {
     @NotNull(groups = First.class)

Modified: incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/example/Customer.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/example/Customer.java?rev=1161648&r1=1161647&r2=1161648&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/example/Customer.java (original)
+++ incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/example/Customer.java Thu Aug 25 17:14:15 2011
@@ -19,11 +19,11 @@
 package org.apache.bval.jsr303.example;
 
 
-import javax.validation.constraints.NotNull;
-
 import org.apache.bval.constraints.Email;
 import org.apache.bval.constraints.Password;
 
+import javax.validation.constraints.NotNull;
+
 public class Customer implements Person {
     private String firstName;
     private String middleName;

Modified: incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/example/RecursiveFoo.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/example/RecursiveFoo.java?rev=1161648&r1=1161647&r2=1161648&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/example/RecursiveFoo.java (original)
+++ incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/example/RecursiveFoo.java Thu Aug 25 17:14:15 2011
@@ -19,10 +19,9 @@
 package org.apache.bval.jsr303.example;
 
 
-import javax.validation.Valid;
-
 import org.apache.bval.constraints.NotEmpty;
 
+import javax.validation.Valid;
 import java.util.ArrayList;
 import java.util.Collection;
 

Modified: incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/groups/DefaultGroupSequenceTest.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/groups/DefaultGroupSequenceTest.java?rev=1161648&r1=1161647&r2=1161648&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/groups/DefaultGroupSequenceTest.java (original)
+++ incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/groups/DefaultGroupSequenceTest.java Thu Aug 25 17:14:15 2011
@@ -22,10 +22,6 @@ import junit.framework.TestCase;
 
 import javax.validation.GroupDefinitionException;
 import javax.validation.groups.Default;
-
-import org.apache.bval.jsr303.groups.Group;
-import org.apache.bval.jsr303.groups.Groups;
-
 import java.util.ArrayList;
 import java.util.List;
 

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=1161648&r1=1161647&r2=1161648&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 Thu Aug 25 17:14:15 2011
@@ -27,11 +27,7 @@ import org.apache.bval.jsr303.example.*;
 import org.apache.bval.jsr303.util.TestUtils;
 import org.apache.bval.model.MetaBean;
 
-import javax.validation.ConstraintViolation;
-import javax.validation.GroupSequence;
-import javax.validation.Validation;
-import javax.validation.Validator;
-import javax.validation.ValidatorFactory;
+import javax.validation.*;
 import javax.validation.constraints.NotNull;
 import java.util.List;
 import java.util.Locale;

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=1161648&r1=1161647&r2=1161648&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 Thu Aug 25 17:14:15 2011
@@ -19,13 +19,11 @@
 package org.apache.bval.jsr303.groups;
 
 import junit.framework.TestCase;
-
-import javax.validation.ConstraintViolation;
-import javax.validation.Validator;
-
 import org.apache.bval.jsr303.ApacheValidatorFactory;
 import org.apache.bval.jsr303.util.TestUtils;
 
+import javax.validation.ConstraintViolation;
+import javax.validation.Validator;
 import java.util.Set;
 
 /**

Modified: incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/groups/GroupsComputerTest.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/groups/GroupsComputerTest.java?rev=1161648&r1=1161647&r2=1161648&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/groups/GroupsComputerTest.java (original)
+++ incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/groups/GroupsComputerTest.java Thu Aug 25 17:14:15 2011
@@ -21,19 +21,14 @@ package org.apache.bval.jsr303.groups;
 import junit.framework.Test;
 import junit.framework.TestCase;
 import junit.framework.TestSuite;
-
-import javax.validation.GroupDefinitionException;
-import javax.validation.ValidationException;
-import javax.validation.groups.Default;
-
 import org.apache.bval.jsr303.example.Address;
 import org.apache.bval.jsr303.example.First;
 import org.apache.bval.jsr303.example.Last;
 import org.apache.bval.jsr303.example.Second;
-import org.apache.bval.jsr303.groups.Group;
-import org.apache.bval.jsr303.groups.Groups;
-import org.apache.bval.jsr303.groups.GroupsComputer;
 
+import javax.validation.GroupDefinitionException;
+import javax.validation.ValidationException;
+import javax.validation.groups.Default;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;

Modified: incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/groups/implicit/ImplicitGroupingTest.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/groups/implicit/ImplicitGroupingTest.java?rev=1161648&r1=1161647&r2=1161648&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/groups/implicit/ImplicitGroupingTest.java (original)
+++ incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/groups/implicit/ImplicitGroupingTest.java Thu Aug 25 17:14:15 2011
@@ -19,13 +19,11 @@
 package org.apache.bval.jsr303.groups.implicit;
 
 import junit.framework.TestCase;
-
-import javax.validation.ConstraintViolation;
-import javax.validation.Validator;
-
 import org.apache.bval.jsr303.ApacheValidatorFactory;
 import org.apache.bval.jsr303.util.TestUtils;
 
+import javax.validation.ConstraintViolation;
+import javax.validation.Validator;
 import java.util.Set;
 
 /**

Modified: incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/groups/inheritance/BillableUser.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/groups/inheritance/BillableUser.java?rev=1161648&r1=1161647&r2=1161648&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/groups/inheritance/BillableUser.java (original)
+++ incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/groups/inheritance/BillableUser.java Thu Aug 25 17:14:15 2011
@@ -19,12 +19,12 @@
 package org.apache.bval.jsr303.groups.inheritance;
 
 
-import javax.validation.constraints.NotNull;
-import javax.validation.groups.Default;
-
 import org.apache.bval.jsr303.groups.Billable;
 import org.apache.bval.jsr303.groups.BillableCreditCard;
 
+import javax.validation.constraints.NotNull;
+import javax.validation.groups.Default;
+
 /**
  * Description: <br/>
  */

Modified: incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/groups/inheritance/BuyInOneClick.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/groups/inheritance/BuyInOneClick.java?rev=1161648&r1=1161647&r2=1161648&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/groups/inheritance/BuyInOneClick.java (original)
+++ incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/groups/inheritance/BuyInOneClick.java Thu Aug 25 17:14:15 2011
@@ -19,10 +19,10 @@
 package org.apache.bval.jsr303.groups.inheritance;
 
 
-import javax.validation.groups.Default;
-
 import org.apache.bval.jsr303.groups.Billable;
 
+import javax.validation.groups.Default;
+
 /**
  * Customer can buy without harrassing checking process.
  * spec: Example 3.3. Groups can inherit other groups

Modified: incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/groups/inheritance/GroupInheritanceTest.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/groups/inheritance/GroupInheritanceTest.java?rev=1161648&r1=1161647&r2=1161648&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/groups/inheritance/GroupInheritanceTest.java (original)
+++ incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/groups/inheritance/GroupInheritanceTest.java Thu Aug 25 17:14:15 2011
@@ -19,13 +19,11 @@
 package org.apache.bval.jsr303.groups.inheritance;
 
 import junit.framework.TestCase;
-
-import javax.validation.ConstraintViolation;
-import javax.validation.Validator;
-
 import org.apache.bval.jsr303.ApacheValidatorFactory;
 import org.apache.bval.jsr303.util.TestUtils;
 
+import javax.validation.ConstraintViolation;
+import javax.validation.Validator;
 import java.util.Set;
 
 /**

Modified: incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/groups/redefining/Address.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/groups/redefining/Address.java?rev=1161648&r1=1161647&r2=1161648&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/groups/redefining/Address.java (original)
+++ incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/groups/redefining/Address.java Thu Aug 25 17:14:15 2011
@@ -19,13 +19,13 @@
 package org.apache.bval.jsr303.groups.redefining;
 
 
+import org.apache.bval.constraints.ZipCodeCityCoherence;
+import org.apache.bval.jsr303.example.ZipCodeCityCarrier;
+
 import javax.validation.GroupSequence;
 import javax.validation.constraints.NotNull;
 import javax.validation.constraints.Size;
 
-import org.apache.bval.constraints.ZipCodeCityCoherence;
-import org.apache.bval.jsr303.example.ZipCodeCityCarrier;
-
 /**
  * Example 3.6. Redefining Default group for Address:
  * To redefine Default for a class, place a @GroupSequence annotation on the class ; 

Modified: incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/groups/redefining/RedefiningDefaultGroupTest.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/groups/redefining/RedefiningDefaultGroupTest.java?rev=1161648&r1=1161647&r2=1161648&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/groups/redefining/RedefiningDefaultGroupTest.java (original)
+++ incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/groups/redefining/RedefiningDefaultGroupTest.java Thu Aug 25 17:14:15 2011
@@ -19,14 +19,12 @@
 package org.apache.bval.jsr303.groups.redefining;
 
 import junit.framework.TestCase;
+import org.apache.bval.jsr303.ApacheValidatorFactory;
+import org.apache.bval.jsr303.util.TestUtils;
 
 import javax.validation.ConstraintViolation;
 import javax.validation.GroupDefinitionException;
 import javax.validation.Validator;
-
-import org.apache.bval.jsr303.ApacheValidatorFactory;
-import org.apache.bval.jsr303.util.TestUtils;
-
 import java.util.Set;
 
 /**

Modified: incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/util/EnumerationConverterTestCase.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/util/EnumerationConverterTestCase.java?rev=1161648&r1=1161647&r2=1161648&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/util/EnumerationConverterTestCase.java (original)
+++ incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/util/EnumerationConverterTestCase.java Thu Aug 25 17:14:15 2011
@@ -21,7 +21,6 @@ package org.apache.bval.jsr303.util;
 import junit.framework.Test;
 import junit.framework.TestCase;
 import junit.framework.TestSuite;
-
 import org.apache.commons.beanutils.Converter;
 
 /**

Modified: incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/util/PathImplTest.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/util/PathImplTest.java?rev=1161648&r1=1161647&r2=1161648&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/util/PathImplTest.java (original)
+++ incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/util/PathImplTest.java Thu Aug 25 17:14:15 2011
@@ -23,10 +23,6 @@ import junit.framework.TestCase;
 import junit.framework.TestSuite;
 
 import javax.validation.Path;
-
-import org.apache.bval.jsr303.util.NodeImpl;
-import org.apache.bval.jsr303.util.PathImpl;
-
 import java.util.Iterator;
 
 /**

Modified: incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/util/TestUtils.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/util/TestUtils.java?rev=1161648&r1=1161647&r2=1161648&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/util/TestUtils.java (original)
+++ incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/util/TestUtils.java Thu Aug 25 17:14:15 2011
@@ -18,12 +18,11 @@
  */
 package org.apache.bval.jsr303.util;
 
-import java.util.Collection;
-import java.util.Set;
+import org.junit.Assert;
 
 import javax.validation.ConstraintViolation;
-
-import org.junit.Assert;
+import java.util.Collection;
+import java.util.Set;
 
 /**
  * Description: <br/>

Modified: incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/xml/ValidationParserTest.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/xml/ValidationParserTest.java?rev=1161648&r1=1161647&r2=1161648&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/xml/ValidationParserTest.java (original)
+++ incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/xml/ValidationParserTest.java Thu Aug 25 17:14:15 2011
@@ -46,7 +46,7 @@ public class ValidationParserTest extend
 
     public void testGetInputStream() throws IOException {
         ValidationParser vp = new ValidationParser("sample-validation.xml");
-        assertNotNull(vp.getInputStream(vp.validationXmlFile));
+        assertNotNull(vp.getInputStream("sample-validation.xml"));
 
         try {
             vp.getInputStream("META-INF/MANIFEST.MF"); // this is available in multiple jars hopefully

Modified: incubator/bval/trunk/pom.xml
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/pom.xml?rev=1161648&r1=1161647&r2=1161648&view=diff
==============================================================================
--- incubator/bval/trunk/pom.xml (original)
+++ incubator/bval/trunk/pom.xml Thu Aug 25 17:14:15 2011
@@ -265,6 +265,7 @@
             <plugin>
                 <groupId>org.codehaus.mojo</groupId>
                 <artifactId>findbugs-maven-plugin</artifactId>
+                <version>2.3.2</version>
             </plugin>
         </plugins>
     </reporting>
@@ -497,7 +498,7 @@
                 <plugin>
                     <groupId>org.apache.rat</groupId>
                     <artifactId>apache-rat-plugin</artifactId>
-                    <version>0.6</version>
+                    <version>0.7</version>
                     <executions>
                         <execution>
                             <phase>verify</phase>
@@ -523,6 +524,8 @@
                             <exclude>**/target/**/*</exclude>
                             <exclude>**/*.iml</exclude>
                             <exclude>**/*.patch</exclude>
+                            <exclude>**/*.ipr</exclude>
+                            <exclude>**/*.iws</exclude>
                         </excludes>
                     </configuration>
                 </plugin>
@@ -602,6 +605,7 @@
             <plugin>
                 <groupId>org.apache.rat</groupId>
                 <artifactId>apache-rat-plugin</artifactId>
+                <version>0.7</version>
             </plugin>
             <plugin>
                 <groupId>org.codehaus.mojo</groupId>



Mime
View raw message