JDK-8026854 : java.time.temporal.TemporalQueries doesn't compile after javac modification to lambda flow analysis
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.time
  • Affected Version: 8
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2013-10-18
  • Updated: 2013-11-18
  • Resolved: 2013-10-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 b115Fixed
Related Reports
Blocks :  
Relates :  
Description
compilation of jdk/src/share/classes/java/time/temporal/TemporalQueries.java is failing with a javac patch to modify lambda flow analysis.

There are minor, conservative changes that can be applied for it to compile with last javac.
Comments
Why does fully qualifying the reference solve the problem? It does not seem that should make a difference.
18-10-2013

Thanks Stephen
18-10-2013

Webrev is fine by me.
18-10-2013

public webrev: http://cr.openjdk.java.net/~vromero/8026854/webrev_01/ I think the proposed change (code reordering to avoid forward reference plus use of TemporalQueries.<static field>) should keep the code essentially the same and the invariant mentioned by Stephen Colebourne should hold.
18-10-2013

Just to note that it is essential that these lambdas are defined as singleton constants internally, as the rest of the code checks for them using ==. eg. public T query(TemporalQuery<T> query) { if (query == TemporalQueries.localDate()) { return this; } return query.queryFrom(this); }
18-10-2013