Bug 9579

Summary: Search: declaration in hierarchy - wrong matches
Product: [Eclipse Project] JDT Reporter: Dirk Baeumer <dirk_baeumer>
Component: CoreAssignee: Jerome Lanneluc <jerome_lanneluc>
Status: RESOLVED WONTFIX QA Contact:
Severity: normal    
Priority: P1    
Version: 2.0   
Target Milestone: 2.0 M4   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

Description Dirk Baeumer CLA 2002-02-13 08:10:37 EST
Test pass for M3

- create JUnit workspace
- select TestCase.setup.
- Search->Declarations->Hierarchy

The result set includes matches like

testSetupErrorDontTearDown() - junit.tests.ExtensionTest
testSetupErrorInTestSetup() - junit.tests.ExtensionTest
testSetupFails() - junit.tests.TestTest
testTearDownSetupFails() - junit.tests.TestTest

these matches aren't related to TestCase.setup although they are implementors of
the interface Test
Comment 1 Erich Gamma CLA 2002-02-13 14:40:08 EST
Dani pls investigate whether this is JCORE or UI.
Comment 2 Dani Megert CLA 2002-02-26 03:40:46 EST
All of the listed "wrong" matches are anonymous inner classes but not all of
them are wrong: TornDown is an inner class in ExtensionTest (extending
TestSetup) and in TestTest (extending TestCase). 

==> The matches in the anonymous inner class of ExtensionTest.TornDown are
therefore wrong but the two other results are correct.
I guess ExtensionTest.TornDown somehow made it into the hierarchy scope.

Moving JCore
Comment 3 Jerome Lanneluc CLA 2002-02-28 13:00:51 EST
The hierarchy scope is just a filter on the potential matches. In this case, 
you looked for the declaration of all 'setup' methods (pattern is '*.setup'). 
Only the one that were not part of the hierarchy were filtered out. Since it is 
not possible to have java elements corresponding to local type declarations, 
the hierarchy scope considered that the match (which is inside ExtensionTest) 
is part of the hierarchy since ExtensionTest is a subclass of TestCase.

To have the behavior you expect, the UI should use the java element for 
TestCase.setup as the search pattern.