JDK-6839872 : remove implementation inheritance from JSR 292 APIs
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.lang.invoke
  • Affected Version: 7
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2009-05-12
  • Updated: 2012-10-01
  • Resolved: 2011-04-19
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
7 b135Fixed
Related Reports
Duplicate :  
Relates :  
Relates :  
Relates :  
Description
Initial versions (including the preview in 7/M3) of the JSR 292 API use an undesirable technique for data structure factoring, implementation inheritance.  The types MethodHandle and JavaMethodHandle both inherit from JVM-internal supertypes.  This pollutes their API, makes unreadable "holes" in their javadoc, and breaks the API filtering performed by javac (as driven by the file "lib/ct.sym").

A stopgap solution (for javac and the ct.sym file) is to place sun.dyn on the list of packages to allow but not to document.

The real solution is to remove those private supertypes from those public types.

Because the implementation types are special-cased by the JVM, this will require a coordinated JVM and java change, with the JVM changes coming first.
Also, inheritance from MethodHandle must not be exposed via protected or public constructors.

Fixing this bug must remove all "sun.misc" types from the MethodHandle API.

Comments
EVALUATION http://hg.openjdk.java.net/jdk7/hotspot-rt/hotspot/rev/72dee110246f
21-03-2011

EVALUATION http://hg.openjdk.java.net/jdk7/hotspot-comp/hotspot/rev/72dee110246f
12-03-2011

EVALUATION yes
14-09-2010

SUGGESTED FIX As part of fixing this bug, remove any lines like these from Release.gmk in jdk: diff --git a/make/common/Release.gmk b/make/common/Release.gmk --- b/make/common/Release.gmk +++ a/make/common/Release.gmk @@ -51,9 +51,6 @@ com.sun.java.swing.plaf.windows \ com.sun.java.swing.plaf.motif \ com.sun.java.swing.plaf.gtk - -# This is a stopgap until 6839872 is fixed. -EXCLUDE_PROPWARN_PKGS += sun.dyn # 64-bit solaris has a few special cases. We define the variable # SOLARIS64 for use in this Makefile to easily test those cases
12-05-2009