Guilhem Lavaux wrote:
> I have stumbled across a bug probably shared by all VMs using GNU 
> Classpath. In Apache Ant a SecurityManager is installed to be able to 
> execute java application without forking the VM. Thanks to the SM 
> exiting a VM is forbidden and so ant is protected from the 
> applications using System.exit(). However it causes us some troubles
> for the cases where we have not pre-loaded some core classes such as 
> java.security.Permission/java.security.Security (and probably some 
> other). I have attached with this email a testcase which summarises 
> quite well the situation.

After fixing some IKVM specific bugs, I was able to run the testcase
succesfully with only the attached GNU Classpath fix.

Can you please see if this patch improves things for you as well?

Regards,
Jeroen
Index: java/net/URL.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/net/URL.java,v
retrieving revision 1.51
diff -u -r1.51 URL.java
--- java/net/URL.java   4 Dec 2005 20:52:47 -0000       1.51
+++ java/net/URL.java   11 Jan 2006 06:48:21 -0000
@@ -1,5 +1,5 @@
 /* URL.java -- Uniform Resource Locator Class
-   Copyright (C) 1998, 1999, 2000, 2002, 2003, 2004, 2005
+   Copyright (C) 1998, 1999, 2000, 2002, 2003, 2004, 2005, 2006
    Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
@@ -38,6 +38,7 @@
 
 package java.net;
 
+import gnu.classpath.SystemProperties;
 import gnu.java.net.URLParseError;
 
 import java.io.IOException;
@@ -198,7 +199,7 @@
 
   static
     {
-      String s = System.getProperty("gnu.java.net.nocache_protocol_handlers");
+      String s = 
SystemProperties.getProperty("gnu.java.net.nocache_protocol_handlers");
 
       if (s == null)
        cache_handlers = true;
@@ -867,7 +868,7 @@
        // Except in very unusual environments the JDK specified one shouldn't
        // ever be needed (or available).
        String ph_search_path =
-         System.getProperty("java.protocol.handler.pkgs");
+         SystemProperties.getProperty("java.protocol.handler.pkgs");
 
        // Tack our default package on at the ends.
        if (ph_search_path != null)
_______________________________________________
Classpath mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/classpath

Reply via email to