Bug 397777 - When searching for types, 'Match locations' doesn't include class literals (SomeType.class)
Summary: When searching for types, 'Match locations' doesn't include class literals (S...
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.2   Edit
Hardware: PC Windows 7
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-09 11:56 EST by Ben Davis CLA
Modified: 2013-01-14 00:32 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.