incubator-bval-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject svn commit: r1036608 - in /incubator/bval/sandbox/lang3-work: ./ bval-core/src/main/java/org/apache/bval/ bval-core/src/main/java/org/apache/bval/model/ bval-jsr303/src/main/java/ bval-jsr303/src/main/java/org/apache/bval/jsr303/ bval-jsr303/src/main/j...
Date Thu, 18 Nov 2010 20:39:43 GMT
Author: mbenson
Date: Thu Nov 18 20:39:43 2010
New Revision: 1036608

URL: http://svn.apache.org/viewvc?rev=1036608&view=rev
Log:
merge recent trunk changes, r1035415:1036603

Modified:
    incubator/bval/sandbox/lang3-work/   (props changed)
    incubator/bval/sandbox/lang3-work/bval-core/src/main/java/org/apache/bval/BeanValidationContext.java
  (props changed)
    incubator/bval/sandbox/lang3-work/bval-core/src/main/java/org/apache/bval/model/MetaProperty.java
  (props changed)
    incubator/bval/sandbox/lang3-work/bval-jsr303/src/main/java/   (props changed)
    incubator/bval/sandbox/lang3-work/bval-jsr303/src/main/java/org/apache/bval/jsr303/AppendValidationToBuilder.java
  (props changed)
    incubator/bval/sandbox/lang3-work/bval-jsr303/src/main/java/org/apache/bval/jsr303/ConstraintValidation.java
  (props changed)
    incubator/bval/sandbox/lang3-work/bval-jsr303/src/main/java/org/apache/bval/jsr303/ConstraintValidationListener.java
  (props changed)
    incubator/bval/sandbox/lang3-work/bval-jsr303/src/main/java/org/apache/bval/jsr303/Jsr303MetaBeanFactory.java
    incubator/bval/sandbox/lang3-work/bval-jsr303/src/main/java/org/apache/bval/jsr303/util/SecureActions.java
    incubator/bval/sandbox/lang3-work/bval-jsr303/src/main/java/org/apache/bval/jsr303/xml/ValidationMappingParser.java
  (props changed)
    incubator/bval/sandbox/lang3-work/bval-jsr303/src/main/resources/org/apache/bval/jsr303/ValidationMessages.properties
    incubator/bval/sandbox/lang3-work/bval-jsr303/src/main/resources/org/apache/bval/jsr303/ValidationMessages_de.properties
    incubator/bval/sandbox/lang3-work/bval-jsr303/src/main/resources/org/apache/bval/jsr303/ValidationMessages_es.properties
    incubator/bval/sandbox/lang3-work/bval-jsr303/src/main/resources/org/apache/bval/jsr303/ValidationMessages_it.properties
    incubator/bval/sandbox/lang3-work/bval-xstream/   (props changed)

Propchange: incubator/bval/sandbox/lang3-work/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Nov 18 20:39:43 2010
@@ -1 +1 @@
-/incubator/bval/trunk:992143,992401,992406,992412,992510,992648,993404-993438,996236,996240,997154,1002445
+/incubator/bval/trunk:992143,992401,992406,992412,992510,992648,993404-993438,996236,996240,997154,1002445,1035416-1036603

Propchange: incubator/bval/sandbox/lang3-work/bval-core/src/main/java/org/apache/bval/BeanValidationContext.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Nov 18 20:39:43 2010
@@ -1 +1 @@
-/incubator/bval/trunk/bval-core/src/main/java/org/apache/bval/BeanValidationContext.java:992143,992401,992406,992412,992510,992648,993404-993438,996236,996240,997154,1002445,1002497,1031642
+/incubator/bval/trunk/bval-core/src/main/java/org/apache/bval/BeanValidationContext.java:992143,992401,992406,992412,992510,992648,993404-993438,996236,996240,997154,1002445,1002497,1031642,1035416-1036603

Propchange: incubator/bval/sandbox/lang3-work/bval-core/src/main/java/org/apache/bval/model/MetaProperty.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Nov 18 20:39:43 2010
@@ -1 +1 @@
-/incubator/bval/trunk/bval-core/src/main/java/org/apache/bval/model/MetaProperty.java:992143,992401,992406,992412,992510,992648,993404-993438,996236,996240,997154,1002445,1002497,1031642
+/incubator/bval/trunk/bval-core/src/main/java/org/apache/bval/model/MetaProperty.java:992143,992401,992406,992412,992510,992648,993404-993438,996236,996240,997154,1002445,1002497,1031642,1035416-1036603

Propchange: incubator/bval/sandbox/lang3-work/bval-jsr303/src/main/java/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Nov 18 20:39:43 2010
@@ -1 +1 @@
-/incubator/bval/trunk/bval-jsr303/src/main/java:992330-992353,992401,992406,992412,992510,992648,993404-993438,996236,996240,997154,1002445,1031642
+/incubator/bval/trunk/bval-jsr303/src/main/java:992330-992353,992401,992406,992412,992510,992648,993404-993438,996236,996240,997154,1002445,1031642,1035416-1036603

Propchange: incubator/bval/sandbox/lang3-work/bval-jsr303/src/main/java/org/apache/bval/jsr303/AppendValidationToBuilder.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Nov 18 20:39:43 2010
@@ -1 +1 @@
-/incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/AppendValidationToBuilder.java:992330-992353,992401,992406,992412,992510,992648,993404-993438,996236,996240,997154,1002445,1002497,1031642
+/incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/AppendValidationToBuilder.java:992330-992353,992401,992406,992412,992510,992648,993404-993438,996236,996240,997154,1002445,1002497,1031642,1035416-1036603

Propchange: incubator/bval/sandbox/lang3-work/bval-jsr303/src/main/java/org/apache/bval/jsr303/ConstraintValidation.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Nov 18 20:39:43 2010
@@ -1 +1 @@
-/incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/ConstraintValidation.java:992330-992353,992401,992406,992412,992510,992648,993404-993438,996236,996240,997154,1002445,1002497,1031642
+/incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/ConstraintValidation.java:992330-992353,992401,992406,992412,992510,992648,993404-993438,996236,996240,997154,1002445,1002497,1031642,1035416-1036603

Propchange: incubator/bval/sandbox/lang3-work/bval-jsr303/src/main/java/org/apache/bval/jsr303/ConstraintValidationListener.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Nov 18 20:39:43 2010
@@ -1 +1 @@
-/incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/ConstraintValidationListener.java:992330-992353,992401,992406,992412,992510,992648,993404-993438,996236,996240,997154,1002445,1002497,1031642
+/incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/ConstraintValidationListener.java:992330-992353,992401,992406,992412,992510,992648,993404-993438,996236,996240,997154,1002445,1002497,1031642,1035416-1036603

Modified: incubator/bval/sandbox/lang3-work/bval-jsr303/src/main/java/org/apache/bval/jsr303/Jsr303MetaBeanFactory.java
URL: http://svn.apache.org/viewvc/incubator/bval/sandbox/lang3-work/bval-jsr303/src/main/java/org/apache/bval/jsr303/Jsr303MetaBeanFactory.java?rev=1036608&r1=1036607&r2=1036608&view=diff
==============================================================================
--- incubator/bval/sandbox/lang3-work/bval-jsr303/src/main/java/org/apache/bval/jsr303/Jsr303MetaBeanFactory.java
(original)
+++ incubator/bval/sandbox/lang3-work/bval-jsr303/src/main/java/org/apache/bval/jsr303/Jsr303MetaBeanFactory.java
Thu Nov 18 20:39:43 2010
@@ -35,6 +35,7 @@ import javax.validation.groups.Default;
 import org.apache.bval.MetaBeanFactory;
 import org.apache.bval.jsr303.groups.Group;
 import org.apache.bval.jsr303.util.ClassHelper;
+import org.apache.bval.jsr303.util.SecureActions;
 import org.apache.bval.jsr303.xml.MetaConstraint;
 import org.apache.bval.model.MetaBean;
 import org.apache.bval.model.MetaProperty;
@@ -120,7 +121,7 @@ public class Jsr303MetaBeanFactory imple
                 metabean));
         }
 
-        Field[] fields = beanClass.getDeclaredFields();
+        final Field[] fields = SecureActions.getDeclaredFields(beanClass);
         for (Field field : fields) {
             MetaProperty metaProperty = metabean.getProperty(field.getName());
             // create a property for those fields for which there is not yet a
@@ -133,7 +134,7 @@ public class Jsr303MetaBeanFactory imple
                     new AppendValidationToMeta(metaProperty));
             }
         }
-        Method[] methods = beanClass.getDeclaredMethods();
+        final Method[] methods = SecureActions.getDeclaredMethods(beanClass);
         for (Method method : methods) {
             String propName = null;
             if (method.getParameterTypes().length == 0) {

Modified: incubator/bval/sandbox/lang3-work/bval-jsr303/src/main/java/org/apache/bval/jsr303/util/SecureActions.java
URL: http://svn.apache.org/viewvc/incubator/bval/sandbox/lang3-work/bval-jsr303/src/main/java/org/apache/bval/jsr303/util/SecureActions.java?rev=1036608&r1=1036607&r2=1036608&view=diff
==============================================================================
--- incubator/bval/sandbox/lang3-work/bval-jsr303/src/main/java/org/apache/bval/jsr303/util/SecureActions.java
(original)
+++ incubator/bval/sandbox/lang3-work/bval-jsr303/src/main/java/org/apache/bval/jsr303/util/SecureActions.java
Thu Nov 18 20:39:43 2010
@@ -105,6 +105,23 @@ public class SecureActions extends Privi
         });
     }
 
+    /**
+     * Get all fields declared on a given class.
+     * @param clazz
+     * @return Field found
+     */
+    public static Field[] getDeclaredFields(final Class<?> clazz) {
+        return run(new PrivilegedAction<Field[]>() {
+            public Field[] run() {
+                Field[] fs = clazz.getDeclaredFields();
+                for( Field f : fs ) {
+                    setAccessibility(f);
+                }
+                return fs;
+            }
+        });
+    }
+
     private static void setAccessibility(Field field) {
         if (!Modifier.isPublic(field.getModifiers()) || (
               Modifier.isPublic(field.getModifiers()) &&
@@ -170,6 +187,32 @@ public class SecureActions extends Privi
     }
 
     /**
+     * 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();
+            }
+        });
+    }
+
+    /**
+     * 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();
+            }
+        });
+    }
+
+    /**
      * Get the constructor of <code>clazz</code> matching <code>params</code>.
      * @param <T>
      * @param clazz

Propchange: incubator/bval/sandbox/lang3-work/bval-jsr303/src/main/java/org/apache/bval/jsr303/xml/ValidationMappingParser.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Nov 18 20:39:43 2010
@@ -1 +1 @@
-/incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/xml/ValidationMappingParser.java:992330-992353,992401,992406,992412,992510,992648,993404-993438,996236,996240,997154,1002445,1002497,1031642
+/incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/xml/ValidationMappingParser.java:992330-992353,992401,992406,992412,992510,992648,993404-993438,996236,996240,997154,1002445,1002497,1031642,1035416-1036603

Modified: incubator/bval/sandbox/lang3-work/bval-jsr303/src/main/resources/org/apache/bval/jsr303/ValidationMessages.properties
URL: http://svn.apache.org/viewvc/incubator/bval/sandbox/lang3-work/bval-jsr303/src/main/resources/org/apache/bval/jsr303/ValidationMessages.properties?rev=1036608&r1=1036607&r2=1036608&view=diff
==============================================================================
--- incubator/bval/sandbox/lang3-work/bval-jsr303/src/main/resources/org/apache/bval/jsr303/ValidationMessages.properties
(original)
+++ incubator/bval/sandbox/lang3-work/bval-jsr303/src/main/resources/org/apache/bval/jsr303/ValidationMessages.properties
Thu Nov 18 20:39:43 2010
@@ -29,6 +29,8 @@ javax.validation.constraints.Digits.mess
 javax.validation.constraints.Past.message=must be a past date
 javax.validation.constraints.Future.message=must be a future date
 javax.validation.constraints.Pattern.message=must match the following regular expression:
{regexp}
+javax.validation.constraints.DecimalMax.message=must be less than or equal to {value}
+javax.validation.constraints.DecimalMin.message=must be greater than or equal to {value}
 
 # additional built-ins
 org.apache.bval.constraints.NotEmpty.message=may not be empty

Modified: incubator/bval/sandbox/lang3-work/bval-jsr303/src/main/resources/org/apache/bval/jsr303/ValidationMessages_de.properties
URL: http://svn.apache.org/viewvc/incubator/bval/sandbox/lang3-work/bval-jsr303/src/main/resources/org/apache/bval/jsr303/ValidationMessages_de.properties?rev=1036608&r1=1036607&r2=1036608&view=diff
==============================================================================
--- incubator/bval/sandbox/lang3-work/bval-jsr303/src/main/resources/org/apache/bval/jsr303/ValidationMessages_de.properties
(original)
+++ incubator/bval/sandbox/lang3-work/bval-jsr303/src/main/resources/org/apache/bval/jsr303/ValidationMessages_de.properties
Thu Nov 18 20:39:43 2010
@@ -29,6 +29,8 @@ javax.validation.constraints.Digits.mess
 javax.validation.constraints.Past.message=muss Datum in der Vergangenheit sein
 javax.validation.constraints.Future.message=muss Datum in der Zukunft sein
 javax.validation.constraints.Pattern.message=Muss mit regulŠrem Ausdruck Ÿbereinstimmen:
{regexp}
+javax.validation.constraints.DecimalMax.message=muss kleiner oder gleich {value} sein
+javax.validation.constraints.DecimalMin.message=muss grš§er oder gleich {value} sein
 
 # additional built-ins
 org.apache.bval.constraints.NotEmpty.message=darf nicht leer sein

Modified: incubator/bval/sandbox/lang3-work/bval-jsr303/src/main/resources/org/apache/bval/jsr303/ValidationMessages_es.properties
URL: http://svn.apache.org/viewvc/incubator/bval/sandbox/lang3-work/bval-jsr303/src/main/resources/org/apache/bval/jsr303/ValidationMessages_es.properties?rev=1036608&r1=1036607&r2=1036608&view=diff
==============================================================================
--- incubator/bval/sandbox/lang3-work/bval-jsr303/src/main/resources/org/apache/bval/jsr303/ValidationMessages_es.properties
(original)
+++ incubator/bval/sandbox/lang3-work/bval-jsr303/src/main/resources/org/apache/bval/jsr303/ValidationMessages_es.properties
Thu Nov 18 20:39:43 2010
@@ -29,6 +29,8 @@ javax.validation.constraints.Digits.mess
 javax.validation.constraints.Past.message=tiene que ser una fecha en el pasado
 javax.validation.constraints.Future.message=tiene que ser una fecha en el futuro
 javax.validation.constraints.Pattern.message=tiene que corresponder a la expresión regular
"{regexp}"
+javax.validation.constraints.DecimalMax.message=tiene que ser mayor o igual que {value}
+javax.validation.constraints.DecimalMin.message=tiene que ser menor o igual que {value}
 
 # additional built-ins
 org.apache.bval.constraints.NotEmpty.message=no puede ser vacio

Modified: incubator/bval/sandbox/lang3-work/bval-jsr303/src/main/resources/org/apache/bval/jsr303/ValidationMessages_it.properties
URL: http://svn.apache.org/viewvc/incubator/bval/sandbox/lang3-work/bval-jsr303/src/main/resources/org/apache/bval/jsr303/ValidationMessages_it.properties?rev=1036608&r1=1036607&r2=1036608&view=diff
==============================================================================
--- incubator/bval/sandbox/lang3-work/bval-jsr303/src/main/resources/org/apache/bval/jsr303/ValidationMessages_it.properties
(original)
+++ incubator/bval/sandbox/lang3-work/bval-jsr303/src/main/resources/org/apache/bval/jsr303/ValidationMessages_it.properties
Thu Nov 18 20:39:43 2010
@@ -29,6 +29,8 @@ javax.validation.constraints.Digits.mess
 javax.validation.constraints.Past.message=deve essere una data nel passato
 javax.validation.constraints.Future.message=deve essere una data futura
 javax.validation.constraints.Pattern.message=deve corrispondere all'espressione regolare
"{regexp}"
+javax.validation.constraints.DecimalMax.message=deve essere maggiore o uguale di {value}
+javax.validation.constraints.DecimalMin.message=deve essere minore o uguale di {value}
 
 # additional built-ins
 org.apache.bval.constraints.NotEmpty.message=non può essere vuoto

Propchange: incubator/bval/sandbox/lang3-work/bval-xstream/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Nov 18 20:39:43 2010
@@ -1 +1 @@
-/incubator/bval/trunk/bval-xstream:992143,992401,992406,992412,992510,992648,993404-993438,996236,996240,997154,1002445,1002497
+/incubator/bval/trunk/bval-xstream:992143,992401,992406,992412,992510,992648,993404-993438,996236,996240,997154,1002445,1002497,1035416-1036603



Mime
View raw message