Bug 240355 - [search] JDT Search Engine should filter out all anonymous class types
Summary: [search] JDT Search Engine should filter out all anonymous class types
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2008-07-10 11:59 EDT by Ahmed Mohamed Orabi CLA
Modified: 2022-05-25 19:22 EDT (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 Ahmed Mohamed Orabi CLA 2008-07-10 11:59:37 EDT
I talked with Frederic Fusier and provided him with the Jar test case. 


Code example:
new SearchEngine().searchAllTypeNames(
				null,
				null,
				scope,
				requestor,
				waitingPolicy,
				monitor);

Actual Result:
I got some anonymous class types.

Expected Result:
SearchEngine.searchAllTypeNames is supposed to filter out all anonymous class types.
Comment 1 Frederic Fusier CLA 2008-07-10 12:44:52 EDT
I got the jar file from Ahmed which helps me to reproduce the problem.

This issue can be workarounded by client by filtering received match with empty element name:
	TypeNameMatchRequestor requestor = new TypeNameMatchRequestor() {
		public void acceptTypeNameMatch(TypeNameMatch match) {
			IType type = match.getType();
			if (type.getElementName().length() == 0) {
				System.out.println("filter anonymous class!");
			}
        }
	};

Ahmed, as the workaround is really simple, would you accept to decrease the severity of this bug to 'normal' instead of 'major'?
Comment 2 Ahmed Mohamed Orabi CLA 2008-07-10 13:01:36 EDT
sure
Comment 3 Frederic Fusier CLA 2009-03-04 10:45:50 EST
The problem comes from the class file stored in the jar file. E.g. IBMKeyManagementServer.jar\com\ibm\keymanager\keystore\KeyStoreLoader$1 does not have any innerInfo set, hence is not recognized as an anonymous by our ClassFileLoader...

Was the jar file build with any obfuscator which could explain the missing inner information?
Comment 4 Frederic Fusier CLA 2009-06-19 12:25:30 EDT
Please provide requested information, thx
Comment 5 Eclipse Genie CLA 2020-05-30 13:50:09 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 6 Eclipse Genie CLA 2022-05-25 19:22:44 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.