United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6817246 Redundant call to set InetAddressCachePolicy to FOREVER if not set during initialization
JDK-6817246 : Redundant call to set InetAddressCachePolicy to FOREVER if not set during initialization

Details
Type:
Enhancement
Submit Date:
2009-03-13
Status:
Resolved
Updated Date:
2010-04-02
Project Name:
JDK
Resolved Date:
2009-03-27
Component:
core-libs
OS:
generic
Sub-Component:
java.net
CPU:
generic
Priority:
P4
Resolution:
Fixed
Affected Versions:
7
Fixed Versions:

Related Reports
Backport:
Relates:

Sub Tasks

Description
System.setSecurityManager0 calls
  InetAddressCachePolicy.setIfNotSet(InetAddressCachePolicy.FOREVER);

This call is redundant since the default cache policy is already set to FOREVER if not set by the command-line property when InetAddressCachePolicy is loaded and initialized (done by the static initializer).

We can remove this call from System.setSecurityManager0() implementation.

                                    

Comments
EVALUATION

Will remove the redundant call from System.setSecurityManager0 implementation.
                                     
2009-03-13
SUGGESTED FIX

@@ -32,11 +32,10 @@
 import java.security.PrivilegedAction;
 import java.security.AllPermission;
 import java.nio.channels.Channel;
 import java.nio.channels.spi.SelectorProvider;
 import sun.nio.ch.Interruptible;
-import sun.net.InetAddressCachePolicy;
 import sun.reflect.Reflection;
 import sun.security.util.SecurityConstants;
 import sun.reflect.annotation.AnnotationType;
 
 /**

@@ -308,11 +307,10 @@
                 }
             });
         }
 
         security = s;
-        InetAddressCachePolicy.setIfNotSet(InetAddressCachePolicy.FOREVER);
     }
                                     
2009-03-25



Hardware and Software, Engineered to Work Together