Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 4239141
Votes 0
Synopsis A warning should be added to the use of toString in INetAddress
Category guides:none
Reported Against 1.3 , 1.2.1
Release Fixed 1.4(merlin-beta)
State 10-Fix Delivered, bug
Priority: 4-Low
Related Bugs 4379243
Submit Date 18-MAY-1999
Description
The engineer responsible for this class has fixed the bug mentioned in this bug report. 
  xxxxx@xxxxx   2000-08-24




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) 
======================================================================
Work Around




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

  xxxxx@xxxxx   2000-08-23
Comments
  
  Include a link with my name & email   


PLEASE NOTE: JDK6 is formerly known as Project Mustang