JDK-5017871 : REGRESSION:create a socket with a Japanese hostname throws IllegalArgumentExcept
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.net
  • Affected Version: 5.0
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2004-03-22
  • Updated: 2004-04-06
  • Resolved: 2004-04-06
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
5.0 b46Fixed
Related Reports
Duplicate :  
Relates :  
Description
###@###.### 2004-03-22

J2SE Version (please include all output from java -version flag):
  java version "1.5.0-beta2"
  Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-beta2-b42)
  Java HotSpot(TM) Client VM (build 1.5.0-beta2-b42, mixed mode, sharing)

Does this problem occur on J2SE 1.3.x or 1.4.x?  Yes / No (pick one)
  No

Operating System Configuration Information (be specific):
  Windows XP

Hardware Configuration Information (be specific):
  Pentium 4, 1.5GHz, 512MB memory

Bug Description:

  <Bug-Id:4957669  has not been correctly fixed yet>

  Creating a socket with a Japanese name throws not UnknowHostException 
  but IllegalArgumentException.

  Sorry for reporting late. I noticed this but I didn't find time to
  investigate which japanese name caused the problem. 

Steps to Reproduce (be specific):

Just try to compile the following code and run it.
------------------------------------------------

import java.io.IOException;
import java.net.Socket;
import java.net.UnknownHostException;

class SocketTest {
    public static void main(String[] args) {
        try {
            Socket s = new Socket("\u6749\u672c \u671d\u9999", 8000);
        } catch (UnknownHostException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}






Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: generic tiger-beta2 FIXED IN: tiger-beta2 INTEGRATED IN: tiger-b46 tiger-beta2
04-09-2004

EVALUATION Bug 4957669 has been fixed. This new bug appears when the host name contains a space, it has nothing to do with whether Japanese characters are used. However, it is a regression in 1.5 in that we now throw an IllegalArgumentException instead of UnknownHostException. Will further investigate the legality of having space in hostnames. ###@###.### 2004-03-22
22-03-2004