JDK-7148164 : attribution code for diamond should not rely on mutable state
  • Type: Sub-task
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 8
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: unknown
  • Submitted: 2012-02-23
  • Updated: 2012-09-28
  • Resolved: 2012-03-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 8
8 b30Fixed
Description
The code for attributing an instance creation expression with diamond relies on mutable state. The code changes the scope of a class with a 'synthetic' scope, so that a slightly different overload step could be applied. Mutable state is problematic, as in the future, we might have the compiler doing something more during overload resolution (i.e. type-checking expressions) - in which case the change in the class scope might become visible and cause spurious errors.

Comments
SUGGESTED FIX A webrev of this fix is available at the following URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/d2508136751c
02-03-2012

EVALUATION This should be fixed as the current implementation is too fragile and not robust to the direction we are headed for lambda.
23-02-2012