harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nathan Beyer (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HARMONY-5784) Bad error message when InetAddress.getByName is called
Date Thu, 24 Apr 2008 00:41:21 GMT

    [ https://issues.apache.org/jira/browse/HARMONY-5784?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12591887#action_12591887
] 

Nathan Beyer commented on HARMONY-5784:
---------------------------------------

A test working doesn't make it a specification requirement though. I looked at the javadoc,
at it seems like the only way to infer this guarantee is because the name of the variable
for the String on the UnknownHostException is "host" [1].

I'll see what I can do, but I would suggest logging a bug on Axis2 as this is completely undocumented.

Also, don't you really mean the "exception.getMessage()" instead of "exception.getCause().getMessage()".
There's no cause for this exception, at least not a guaranteed one. InetAddress.getByName()
just says UnknownHostException can be thrown [2].

[1] http://java.sun.com/j2se/1.5.0/docs/api/java/net/UnknownHostException.html#UnknownHostException(java.lang.String)
[2] http://java.sun.com/j2se/1.5.0/docs/api/java/net/InetAddress.html#getByName(java.lang.String)

> Bad error message when InetAddress.getByName is called
> ------------------------------------------------------
>
>                 Key: HARMONY-5784
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5784
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Davanum Srinivas
>
> Good Message (Sun JDK 1.5)
> Exception in thread "main" java.net.UnknownHostException: this.is.a.bad.endpoint.terrible.in.fact:
this.is.a.bad.endpoint.terrible.in.fact
>         at java.net.InetAddress.getAllByName0(InetAddress.java:1145)
>         at java.net.InetAddress.getAllByName(InetAddress.java:1072)
>         at java.net.InetAddress.getAllByName(InetAddress.java:1008)
>         at java.net.InetAddress.getByName(InetAddress.java:958)
>         at Main.main(Main.java:5)
> Bad Message (Harmony - 650843)
> [dims@dims-desktop test]$java Main
> Uncaught exception in main:
> java.net.UnknownHostException: this.is.a.bad.endpoint.terrible.in.fact - No such file
or directory
>         at java.net.InetAddress.lookupHostByName(InetAddress.java:418)
>         at java.net.InetAddress.getByName(InetAddress.java:253)
>         at Main.main(Main.java:5)
> Sample code
> import java.net.InetAddress;
> public class Main {
>     public static void main(String[] args) throws Exception {
>         InetAddress.getByName("this.is.a.bad.endpoint.terrible.in.fact");
>     }
> }
> thanks,
> dims

-- 
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