JDK-6817246 : Redundant call to set InetAddressCachePolicy to FOREVER if not set during initialization
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.net
  • Affected Version: 7
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2009-03-13
  • Updated: 2010-04-02
  • Resolved: 2009-03-27
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.
JDK 6 JDK 7
6u14Fixed 7 b53Fixed
Related Reports
Relates :  
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
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); }
25-03-2009

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