Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 574735 - [17] Highlighting of field is missing in Pattern Matching for switch
Summary: [17] Highlighting of field is missing in Pattern Matching for switch
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.21   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: BETA J17   Edit
Assignee: Sarika Sinha CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 573941
Blocks: 572061
  Show dependency tree
 
Reported: 2021-07-08 08:31 EDT by Vikas Chandra CLA
Modified: 2021-08-12 03:43 EDT (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 Vikas Chandra CLA 2021-07-08 08:31:40 EDT
public class X {
public static int field;
public static void main(String[] args) {
field =3;
foo(Integer.valueOf(5));
foo(new Object());
}
private static void foo(Object o) {
 switch (o) {
	case Integer i     : System.out.println("Integer:" + i);
	case String str && field>0    : System.out.println("String:" + str + str);
	default       : System.out.println("Object" + o);
 	}
}
}


Select the field named "field" to "field2".

I see 3 related issues as mentioned below

1)Although the renaming is successful, the highlighting of field is not present in case statement. 
2_Also as you type, change is not visible
3) Also it is not possible to select field at that location and rename ( it should be possible to do that as well)
Comment 1 Kalyan Prasad Tatavarthi CLA 2021-08-12 03:43:38 EDT
Fixed as a result of fix for 573941