incubator-bval-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From romanst...@apache.org
Subject svn commit: r1161657 - in /incubator/bval/trunk/bval-core/src/main/java/org/apache/bval/util: FieldAccess.java MethodAccess.java
Date Thu, 25 Aug 2011 17:29:34 GMT
Author: romanstumm
Date: Thu Aug 25 17:29:34 2011
New Revision: 1161657

URL: http://svn.apache.org/viewvc?rev=1161657&view=rev
Log:
BVAL-91 - applied the patch for "Security hole in org.apache.bval.util.MethodAccess.get()"
that basically removed the PrivilegedAction in FieldAccess.get() and MethodAccess.get()

Modified:
    incubator/bval/trunk/bval-core/src/main/java/org/apache/bval/util/FieldAccess.java
    incubator/bval/trunk/bval-core/src/main/java/org/apache/bval/util/MethodAccess.java

Modified: incubator/bval/trunk/bval-core/src/main/java/org/apache/bval/util/FieldAccess.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-core/src/main/java/org/apache/bval/util/FieldAccess.java?rev=1161657&r1=1161656&r2=1161657&view=diff
==============================================================================
--- incubator/bval/trunk/bval-core/src/main/java/org/apache/bval/util/FieldAccess.java (original)
+++ incubator/bval/trunk/bval-core/src/main/java/org/apache/bval/util/FieldAccess.java Thu
Aug 25 17:29:34 2011
@@ -48,15 +48,11 @@ public class FieldAccess extends AccessS
      * {@inheritDoc}
      */
     public Object get(final Object instance) {
-        return PrivilegedActions.run(new PrivilegedAction<Object>() {
-            public Object run() {
-                try {
-                    return field.get(instance);
-                } catch (IllegalAccessException e) {
-                    throw new IllegalArgumentException(e);
-                }
-            }
-        });
+        try {
+            return field.get(instance);
+        } catch (IllegalAccessException e) {
+            throw new IllegalArgumentException(e);
+        }
     }
 
     /**

Modified: incubator/bval/trunk/bval-core/src/main/java/org/apache/bval/util/MethodAccess.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-core/src/main/java/org/apache/bval/util/MethodAccess.java?rev=1161657&r1=1161656&r2=1161657&view=diff
==============================================================================
--- incubator/bval/trunk/bval-core/src/main/java/org/apache/bval/util/MethodAccess.java (original)
+++ incubator/bval/trunk/bval-core/src/main/java/org/apache/bval/util/MethodAccess.java Thu
Aug 25 17:29:34 2011
@@ -95,17 +95,13 @@ public class MethodAccess extends Access
      * {@inheritDoc}
      */
     public Object get(final Object instance) {
-        return PrivilegedActions.run(new PrivilegedAction<Object>() {
-            public Object run() {
-                try {
-                    return method.invoke(instance);
-                } catch (IllegalAccessException e) {
-                    throw new IllegalArgumentException(e);
-                } catch (InvocationTargetException e) {
-                    throw new IllegalArgumentException(e);
-                }
-            }
-        });
+        try {
+            return method.invoke(instance);
+        } catch (IllegalAccessException e) {
+            throw new IllegalArgumentException(e);
+        } catch (InvocationTargetException e) {
+            throw new IllegalArgumentException(e);
+        }
     }
 
     /**



Mime
View raw message