JDK-6191665 : JSR 269 could throw IllegalStateException for use of declarations from prior rounds
  • Type: Bug
  • Component: core-libs
  • Sub-Component: javax.annotation.processing
  • Affected Version: 6
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • OS: generic
  • CPU: generic
  • Submitted: 2004-11-05
  • Updated: 2024-04-12
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.
Other
tbdUnresolved
Related Reports
Relates :  
Relates :  
Description
Currently it is possible for factories to preserve state from prior rounds, e.g. caching declarations.  This could give misleading results since the declarations from prior rounds are not valid in the current round's context.  One solution would be to throw an illegal state exception (or at least issue a warning) if a declaration was accessed after its round had ended.

###@###.### 2004-11-05 21:00:15 GMT

Comments
While the ClassSymbols are re-used across the annotation processing rounds, Method and VariableSymbols are not. So the warning still may make sense for Method and VariableSymbol. This is probably a smaller problem, as the usecases to keep a non-Class Symbol seem rarer.
09-07-2014

This issue should be reevaluated in light of the fix for JDK-8038455.
02-07-2014

EVALUATION A different solution is to retain symbols across rounds. This may reasult as part of work to retain the same context across rounds.
11-03-2011

EVALUATION One way of achieving this would be to install a special Completer in all Symbols after a round has completed. This completer would throw IllegalStateException. You can easily get at all symbols via Symtab.{classes,packages}.
07-09-2010

EVALUATION Should be investigated. ###@###.### 2004-11-05 21:11:22 GMT
05-11-2004