Bug 397777

Summary: When searching for types, 'Match locations' doesn't include class literals (SomeType.class)
Product: [Eclipse Project] JDT Reporter: Ben Davis <entheh>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: NEW --- QA Contact:
Severity: enhancement    
Priority: P3 CC: jarthana, markus.kell.r
Version: 4.2   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Ben Davis CLA 2013-01-09 11:56:13 EST
Given a project containing the following example:

class Test {
  Object test() {
    return Test.class;
  }
}

1. Put the cursor over type 'Test' (either place it's mentioned).
2. Open the Java search (e.g. by pressing Ctrl+H).
3. Make sure Type is selected, and a type appears in the box.
4. Next to 'Match locations', click 'x of 15 selected', click 'Select All', then click 'OK'.
5. Click 'Search'. In the results, observe that 'Test.class' is not found.
6. Repeat the above, but in Step 4, choose 'References' instead of 'Match locations'. In the results, observe that 'Test.class' IS found.

It would be good to be able to search for class literals like this one :)
Comment 1 Jay Arthanareeswaran CLA 2013-01-14 00:32:51 EST
You can achieve this by selecting "All occurrences" too.

Agree, people might want to limit the search scope to the literals. But unfortunately, given how under-resourced we are, we are not going to be able to get to this any time soon.

Copying Markus as this will involve UI work too.