harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vasily Zakharov (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HARMONY-4411) [classlib][luni][ibmvm][jedit] URL.getHost() returns null
Date Wed, 11 Jul 2007 17:38:04 GMT

    [ https://issues.apache.org/jira/browse/HARMONY-4411?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12511807
] 

Vasily Zakharov commented on HARMONY-4411:
------------------------------------------

The problem is specific to resource loading from bootclasspath. URLClassLoader in general
works well. The following test passes on RI/DRLVM/IBMVM:

import java.net.*;
public class Test {
    public static void main(String[] args) throws Throwable {
         ClassLoader classLoader = new URLClassLoader(new URL[] { new URL("file:test.jar")
});
         URL url = classLoader.getResource("a");
         System.out.println("URL: " + url);
         String host = url.getHost();
         System.out.println("Host: " + host);
         System.out.println("".equals(host) ? "SUCCESS" : "FAIL");
    }
}


> [classlib][luni][ibmvm][jedit] URL.getHost() returns null
> ---------------------------------------------------------
>
>                 Key: HARMONY-4411
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4411
>             Project: Harmony
>          Issue Type: Bug
>          Components: App-Oriented Bug Reports, Classlib
>            Reporter: Vasily Zakharov
>         Attachments: test.jar
>
>
> Consider the following simple test:
> public class Test {
>     public static void main(String[] args) {
>          Class cls = javax.swing.plaf.metal.MetalLookAndFeel.class;
>          java.net.URL url = cls.getResource("icons/Error.gif");
>          System.out.println("URL: " + url);
>          String host = url.getHost();
>          System.out.println("Host: " + host);
>          System.out.println("".equals(host) ? "SUCCESS" : "FAIL");
>     }
> }
> Output on RI:
> URL: jar:file:/C:/Program%20Files/Java/jre1.5.0_11/lib/rt.jar!/javax/swing/plaf/metal/icons/Error.gif
> Host:
> SUCCESS
> Harmony/DRLVM:
> URL: jar:file:/C:/HarmonyTrunk/working_vm/build/deploy/jdk/jre/lib/boot/swing.jar!/javax/swing/plaf/metal/icons/Error.gif
> Host:
> SUCCESS
> Harmony/IBMVM:
> URL: jar:file:/C:/HarmonyTrunk/working_classlib/deploy/jdk/jre/lib/boot/swing.jar!/javax/swing/plaf/metal/icons/Error.gif
> Host: null
> FAIL
> Though the test passes on DRLVM, I suspect a problem in java.net.URL implementation in
classlib.
> The problem was discovered while running jEdit on Harmony.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message