JDK-7017664 : Add listeners infrastracture to javac scopes
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 7
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: unknown
  • Submitted: 2011-02-07
  • Updated: 2011-03-08
  • Resolved: 2011-03-08
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 b132Fixed
Related Reports
Relates :  
Relates :  
Description
There are a bunch of places in which a listener infrastructure will come very handy when dealing with javac scopes:

*) Types.implementation/Types.membersClosure cache - those two caches need to be invalidated if the scope of a given symbol is changed (i.e. a symbol is added/removed) at a later stage (i.e. during lowering). Note that this is not normally the case (all members are entered in MemberEnter/ClassReader on demand when calling TypeSymbol.members()).

*) To cleanup the fix of 6996626 (issues with import scopes). This fix partially relies on a proto-listener infrastructure in order to get notifications from the removal of symbols from a package scope.

Comments
SUGGESTED FIX A webrev of this fix is available at the following URL: http://hg.openjdk.java.net/jdk7/tl/langtools/rev/351027202f60
15-02-2011

EVALUATION Add proper listener infrastructure to javac' Scope class. Also, add a new kind of Scope, namely CompoundScope, to handle closure of members more efficiently (doesn't require copying of members from one scope to another, always up to date).
07-02-2011