You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@harmony.apache.org by Alexander Kleymenov <kl...@gmail.com> on 2006/05/04 09:19:03 UTC

[vm] J9 system class loader issue

The classes loaded by the J9 system class loader have incorrect CodeSource
objects. Particularly the location URL of CodeSource object specifying the
place from where the class has been loaded has null value. To reproduce the
bug run the following test:

---------------------------- test.java ---------------------------
import java.security.CodeSource;
public class test {

    public static void main(String[] args) throws Exception {
        CodeSource cs = test.class.getProtectionDomain().getCodeSource();
        System.out.println("Host of code source location: '"
                + cs.getLocation().getHost() +"'");
    }
}
------------------------------------------------------------------

  The output of the test on J9 VM is:

Host of code source location: 'null'

  But RI prints the following:

Host of code source location: ''

  Empty string printed by RI corresponds to the 'localhost' value while null
value corresponds to undefined host.
  This issue causes incorrect processing of permissions granted by
security.policy file and it is one of the reasons of failure of the
following unit test placed in security module:

tests.api.java.security.PermissionCollectionTest

  Further investigations showed that incorrect URLs for CodeSource objects
are created in J9 internal class

at com.ibm.oti.vm.URLAppClassLoader.getClassPath(URLAppClassLoader.java:59)


Thank You,
Alexander Kleymenov