JDK-6520096 : extraneous code in Policy.getInstance regression test
  • Type: Bug
  • Component: security-libs
  • Sub-Component: java.security
  • Affected Version: 6
  • Priority: P5
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2007-02-01
  • Updated: 2010-05-05
  • Resolved: 2007-02-01
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 7
7Resolved
Related Reports
Duplicate :  
Description
The custom policy created as part of this test captures its own ProtectionDomain unnecessarily.  This code can be removed.

As a side-effect, this allows the test to successfully run with jtreg 2.1.6 as well as 3.2.2_02.

Comments
EVALUATION will fix
01-02-2007

SUGGESTED FIX angeles(204):sccs diffs GetInstancePolicySpi.java ------- GetInstancePolicySpi.java ------- 8d7 < private ProtectionDomain me; 12,20d10 < < // get own PD so we can avoid recursion during implies < me = AccessController.doPrivileged < (new PrivilegedAction<ProtectionDomain>() { < public ProtectionDomain run() { < return this.getClass().getProtectionDomain(); < } < }); < 40,43c30,37 < if (me == domain) { < // avoid recursion since we are not on bootclasspath < return true; < } --- > /** > * Note there is no need to capture own protection domain and > * return immediately if we are performing a check against outself > * (a task normally needed for custom policy implementations). > * > * We simply call PolicyFile.implies - any doPrivileged > * that it performs will truncate us from the current ACC. > */
01-02-2007