United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6839872 remove implementation inheritance from JSR 292 APIs
JDK-6839872 : remove implementation inheritance from JSR 292 APIs

Details
Type:
Bug
Submit Date:
2009-05-12
Status:
Closed
Updated Date:
2012-10-01
Project Name:
JDK
Resolved Date:
2011-04-19
Component:
core-libs
OS:
generic
Sub-Component:
java.lang.invoke
CPU:
generic
Priority:
P2
Resolution:
Fixed
Affected Versions:
7
Fixed Versions:

Related Reports
Duplicate:
Relates:
Relates:
Relates:

Sub Tasks

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
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
                                     
2009-05-12
EVALUATION

yes
                                     
2010-09-14
EVALUATION

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

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



Hardware and Software, Engineered to Work Together