harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r419556 - /incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/java/lang/ClassLoader.java
Date Thu, 06 Jul 2006 14:01:30 GMT
Author: hindessm
Date: Thu Jul  6 07:01:30 2006
New Revision: 419556

URL: http://svn.apache.org/viewvc?rev=419556&view=rev
Log:
Applied patch from "[#HARMONY-765] [drlvm] incorrect initialization of default domain in j.l.ClassLoader".

Modified:
    incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/java/lang/ClassLoader.java

Modified: incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/java/lang/ClassLoader.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/java/lang/ClassLoader.java?rev=419556&r1=419555&r2=419556&view=diff
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/java/lang/ClassLoader.java
(original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/java/lang/ClassLoader.java
Thu Jul  6 07:01:30 2006
@@ -51,9 +51,9 @@
 public abstract class ClassLoader {
 
     /**
-     * default protection domain. It is initialized in static block.
+     * default protection domain.
      */
-    private static final ProtectionDomain defaultDomain;
+    private ProtectionDomain defaultDomain;
 
     /**
      * package private to access from the java.lang.Class class.
@@ -123,10 +123,6 @@
     private final ClassLoader parentClassLoader;
 
     static {
-        // Initializes default protection domain
-        CodeSource cs = new CodeSource(null, (Certificate[])null);
-        PermissionCollection perm = Policy.getPolicy().getPermissions(cs);
-        defaultDomain = new ProtectionDomain(cs, perm);
         // Check whether we should enable assertions
         enableAssertions = VMExecutionEngine.getAssertionStatus(null) > 0
             ? true : false;
@@ -387,6 +383,10 @@
             throw new IndexOutOfBoundsException("Check your arguments");
         }
         if (domain == null) {
+            if (defaultDomain == null) {
+                defaultDomain = new ProtectionDomain(
+                        new CodeSource(null, (Certificate[])null), null, this, null);   
        
+            }        
             domain = defaultDomain;
         }
         Certificate[] certs = null;



Mime
View raw message