JDK-7153958 : add constant pool reference to class containing inlined constants
  • Type: Enhancement
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 8
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2012-03-14
  • Updated: 2015-02-18
  • Resolved: 2012-11-30
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 8
8 b68Fixed
Related Reports
Relates :  
Description
We are increasingly analysing class files to find the dependencies between them.  One dependency that is currently hard (i.e. impossible) to track with just the info in class files is when javac has inlined references to constants defined in other classes.

A partial solution would be to include a reference to the defining class in the class file. This does not change the existing compilation strategy in any way, nor does it affect runtime performance in any way, other than adding an otherwise unused reference to the constant pool.

Note that such an unused reference is likely to be optimized away by pack200 anyway, but up until that point, the extra reference will help class file analyzers detect the dependence. 
One important use case for this feature is the Ant <depend> task, used to minimize compilation time by helping to eliminate unnecessary compilations.  See, for example,
http://ant.apache.org/manual/Tasks/depend.html

Comments
Patch sent to review
02-11-2012