Bug 569824 - Java compiler can no longer resolves some final identifiers (since 4.18)
Summary: Java compiler can no longer resolves some final identifiers (since 4.18)
Status: CLOSED DUPLICATE of bug 569498
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.18   Edit
Hardware: PC Windows 10
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-12-18 15:49 EST by Nicolas Falliere CLA
Modified: 2020-12-18 16:09 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nicolas Falliere CLA 2020-12-18 15:49:28 EST
Repro:
final boolean x = true;
String.format("%s", x ? "a": "b");  // Error: "x cannot be resolved or is not a field"

The problem also manifests itself if x is a static final field.
The problem disappears if the tertiary expression is not a parameter.
The problem showed up right after upgrading from 4.17 to 4.18.
Comment 1 Andrey Loskutov CLA 2020-12-18 16:09:43 EST

*** This bug has been marked as a duplicate of bug 569498 ***