Bug 570175 - Final field in conditional inside constructor not resolved
Summary: Final field in conditional inside constructor not resolved
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 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-01-07 09:39 EST by Kai Mahlmann CLA
Modified: 2021-01-07 11:14 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 Kai Mahlmann CLA 2021-01-07 09:39:21 EST
public class Dummy {

	public final boolean BOOL = false;
	
	public void foo() {
		StringJoiner sj= new StringJoiner(BOOL ? "b" : "s", null, null);
	}
	
}

BOOL is marked as "BOOL cannot be resolved to a variable".
Suggested QuickFix is "Change to BOOL".
If "b" or "s" is changed to null the error is gone.
Only happens if BOOL is final and the constructor has more than 1 parameter.
Comment 1 Andrey Loskutov CLA 2021-01-07 11:14:06 EST

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