db-jdo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m..@apache.org
Subject svn commit: r231194 - /incubator/jdo/trunk/fostore20/test/java/org/apache/jdo/test/Test_ClassRegistration.java
Date Wed, 10 Aug 2005 08:33:19 GMT
Author: mbo
Date: Wed Aug 10 01:33:14 2005
New Revision: 231194

URL: http://svn.apache.org/viewcvs?rev=231194&view=rev
Log:
Added doPrivileged block to code getting the JDOImplHelper instance in Test_ClassRegistration

Modified:
    incubator/jdo/trunk/fostore20/test/java/org/apache/jdo/test/Test_ClassRegistration.java

Modified: incubator/jdo/trunk/fostore20/test/java/org/apache/jdo/test/Test_ClassRegistration.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/fostore20/test/java/org/apache/jdo/test/Test_ClassRegistration.java?rev=231194&r1=231193&r2=231194&view=diff
==============================================================================
--- incubator/jdo/trunk/fostore20/test/java/org/apache/jdo/test/Test_ClassRegistration.java
(original)
+++ incubator/jdo/trunk/fostore20/test/java/org/apache/jdo/test/Test_ClassRegistration.java
Wed Aug 10 01:33:14 2005
@@ -125,11 +125,23 @@
     }
 
     /** */
-    private Class getImplHelperClass(ClassLoader cl)
-        throws Exception
+    private Class getImplHelperClass(final ClassLoader cl)
+        throws Throwable
     {
-        Class implHelperClass = 
-            Class.forName("javax.jdo.spi.JDOImplHelper", true, cl);
+        Class implHelperClass = null;
+        try {
+            implHelperClass = (Class)AccessController.doPrivileged(
+                new PrivilegedExceptionAction () {
+                    public Object run () throws Exception {
+                        return Class.forName("javax.jdo.spi.JDOImplHelper", true, cl);
+                    }});
+        }
+        catch (PrivilegedActionException pae) {
+            Throwable e = pae.getException();
+            if (e instanceof InvocationTargetException)
+                e = ((InvocationTargetException)e).getTargetException();
+            throw e;
+        }
         assertEquals("JDOImplHelper loaded by wrong class loader", 
                      cl, getClassLoaderForClass(implHelperClass));
         return implHelperClass;



Mime
View raw message