United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-4239141 A warning should be added to the use of toString in INetAddress
JDK-4239141 : A warning should be added to the use of toString in INetAddress

Details
Type:
Bug
Submit Date:
1999-05-18
Status:
Resolved
Updated Date:
2000-11-18
Project Name:
JDK
Resolved Date:
2000-11-18
Component:
docs
OS:
generic
Sub-Component:
guides
CPU:
generic
Priority:
P4
Resolution:
Fixed
Affected Versions:
1.2.1,1.3.0
Fixed Versions:
1.4.0 (beta)

Related Reports
Duplicate:

Sub Tasks

Description

Name: vi73552			Date: 05/18/99


When you create an INetAddress via getByName(), and then subsequently make a call to toString() there is normally no problems.  But if the network is down then that call to toString() will result in a major delay to the application (due to the hostName being null in that INetAddress instance).

We have spent an awful long time tracking this down and did not expect to find that the cause of our problem was the normally innocuous toString method.
(Review ID: 83189) 
======================================================================

                                    

Comments
EVALUATION

We decided that it's inappropriate for toString to do a DNS lookup when hostName is null. If hostName is null, we will print an empty string for the hostname part. This is the behaviour in jdk1.0.

yingxian.wang@eng 2000-08-23
                                     
2000-08-23
PUBLIC COMMENTS

The engineer responsible for this class has fixed the bug mentioned in this bug report. 
jamie.ho@Eng 2000-08-24
                                     
2000-08-24
WORK AROUND



Name: vi73552			Date: 05/18/99


What we have done is place the code doing the toString always in another thread, regardless of network presence.  It just means a short delay in getting the info we like.
======================================================================
                                     
2004-06-11
CONVERTED DATA

BugTraq+ Release Management Values

COMMIT TO FIX:
generic

FIXED IN:
merlin-beta

INTEGRATED IN:
merlin-beta


                                     
2004-06-14



Hardware and Software, Engineered to Work Together