Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 543831

Summary: [12][syntax highlighting] Second (or later) Case Constant (String in this case) in a switch label is not colored blue
Product: [Eclipse Project] JDT Reporter: Vikas Chandra <Vikas.Chandra>
Component: TextAssignee: Noopur Gupta <noopur_gupta>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, jarthana, noopur_gupta
Version: 4.11   
Target Milestone: BETA J12   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on: 539080, 542558    
Bug Blocks: 545120    
Attachments:
Description Flags
discrepancy
none
screenshot of working code none

Description Vikas Chandra CLA 2019-01-25 07:01:42 EST
Created attachment 277284 [details]
discrepancy

1) Use latest Y build with Java 12 ( or use I build + latest Java 12 jdt.core, jdt.ui and jdt debug code)
2) Import the project ( Code completion error inside lambda block) from bug 542560
3) In file abc.java and line number 34, see the discrepancy mentioned in subject line

See image attached
Comment 1 Dani Megert CLA 2019-01-25 11:03:20 EST
> Second Case Constant
What about the third one?
Comment 2 Vikas Chandra CLA 2019-01-26 03:48:09 EST
>>What about the third one?

Everything except the 1st one. I adjusted the subject line to reflect the same.
Comment 3 Jay Arthanareeswaran CLA 2019-02-07 09:16:31 EST
With the latest patch released on bug 542558, I see this working well now.

Vikas, can you please confirm once and resolve this?
Comment 4 Vikas Chandra CLA 2019-02-07 23:17:33 EST
>>I see this working well now.

Now it looks consistent to me but for the worse !

Even the 1st case coloring is broken and usage of those constants outside switch expression is not getting colored ( not sure if I checked that before but such things work well with java 8).

Can you use the project here https://bugs.eclipse.org/bugs/show_bug.cgi?id=542560#c2

and attach screenshot if that is behaving OK on your setup.
Comment 5 Jay Arthanareeswaran CLA 2019-02-07 23:57:08 EST
Created attachment 277499 [details]
screenshot of working code

Vikas, I am attaching what it looks in my set up. I know why it works in my set-up. I have made changes to the JDT UI project to set the default AST level to 12.

I think we should do that soon in the UI repo and make a Y build.
Comment 6 Vikas Chandra CLA 2019-02-08 00:02:31 EST
Works perfectly in your setup. We need a Y build with all the changes.
Comment 7 Noopur Gupta CLA 2019-02-08 00:03:04 EST
(In reply to Jay Arthanareeswaran from comment #5)
> I have made changes to the JDT UI project to set the default AST
> level to 12.
> 
> I think we should do that soon in the UI repo and make a Y build.
That's bug 539080 and I am working on it. I need to go through all the UI code first to adapt to the changes and new APIs in the AST. Only changing the default AST level will cause more exceptions from the UI. It should be done by early next week.
Comment 8 Noopur Gupta CLA 2019-03-07 03:17:57 EST
Fixed with bug 539080.