You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Alexey Petrenko (JIRA)" <ji...@apache.org> on 2006/12/07 13:07:22 UTC

[jira] Updated: (HARMONY-1391) [classlib][rmi] compatibility: Naming.bidi(String, null) expected NPE

     [ http://issues.apache.org/jira/browse/HARMONY-1391?page=all ]

Alexey Petrenko updated HARMONY-1391:
-------------------------------------

    Patch Info: [Patch Available]

> [classlib][rmi] compatibility: Naming.bidi(String, null) expected NPE
> ---------------------------------------------------------------------
>
>                 Key: HARMONY-1391
>                 URL: http://issues.apache.org/jira/browse/HARMONY-1391
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Denis Kishenko
>         Attachments: 1391-Naming.patch, 1391-NamingTest.patch
>
>
> Harmony implementation of Naming.bidi(String, Remote) checks parameters in different order than RI
> ============== Test.java ==================
> import java.rmi.Naming;
> import java.rmi.Remote;
> public class Test {
>     public static void main(String [] args) {
>         System.err.println("----name is empty----------");
>         try {
>             Naming.bind("", null);
>             System.err.println("Test failed");
>         } catch (NullPointerException e) {
>             System.err.println("Test passes");
>             e.printStackTrace();
>         } catch (Throwable e) {
>             System.err.println("Test failed: unexpected error");
>             e.printStackTrace();
>         }
>         System.err.println("----name defines wrong port----------");
>         try {
>             Naming.bind("//ttt:2222/zzz", null);
>             System.err.println("Test failed");
>         } catch (NullPointerException e) {
>             System.err.println("Test passes");
>             e.printStackTrace();
>         } catch (Throwable e) {
>             System.err.println("Test failed: unexpected error");
>             e.printStackTrace();
>         }
>     }
> }
> RI Output ================================
> ----name is empty----------
> Test passes
> java.lang.NullPointerException: cannot bind to null
>     at java.rmi.Naming.bind(Naming.java:109)
>     at Test.main(Test.java:10)
> ----name defines wrong port----------
> Test passes
> java.lang.NullPointerException: cannot bind to null
>     at java.rmi.Naming.bind(Naming.java:109)
>     at Test.main(Test.java:21)
> Harmony Output ================================
> ----name is empty----------
> Test failed: unexpected error
> java.net.MalformedURLException: Name could not be empty (URL: "").
>     at java.rmi.Naming.getRegistryURL(Naming.java:139)
>     at java.rmi.Naming.bind(Naming.java:75)
>     at Test.main(Test.java:10)
> ----name defines wrong port----------
> Test failed: unexpected error
> java.rmi.UnknownHostException: Unable to connect to server [ttt:2222]; nested exception is:
>     java.net.UnknownHostException: ttt - Authoritative Answer Host not found
>     at org.apache.harmony.rmi.transport.Endpoint.createSocket(Endpoint.java:169)
>     at org.apache.harmony.rmi.client.ClientConnectionManager.getConnection(ClientConnectionManager.java:102)
>     at org.apache.harmony.rmi.remoteref.UnicastRef.newCall(UnicastRef.java:226)
>     at org.apache.harmony.rmi.remoteref.UnicastRef.invoke(UnicastRef.java:127)
>     at org.apache.harmony.rmi.registry.RegistryImpl_Stub.bind(RegistryImpl_Stub.java:66)
>     at java.rmi.Naming.bind(Naming.java:77)
>     at Test.main(Test.java:21)
> Caused by: java.net.UnknownHostException: ttt - Authoritative Answer Host not found
>     at java.net.InetAddress.lookupHostByName(InetAddress.java:430)
>     at java.net.InetAddress.getByName(InetAddress.java:267)
>     at java.net.Socket.<init>(Socket.java:137)
>     at org.apache.harmony.rmi.transport.tcp.DirectRMISocketFactory.createSocket(DirectRMISocketFactory.java:53)
>     at org.apache.harmony.rmi.transport.DefaultRMISocketFactory.createSocket(DefaultRMISocketFactory.java:121)
>     at org.apache.harmony.rmi.transport.Endpoint.createSocket(Endpoint.java:167)
>     at org.apache.harmony.rmi.client.ClientConnectionManager.getConnection(ClientConnectionManager.java:102)
>     ... 5 more

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira