Bug 9579 - Search: declaration in hierarchy - wrong matches
Summary: Search: declaration in hierarchy - wrong matches
Status: RESOLVED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P1 normal (vote)
Target Milestone: 2.0 M4   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-02-13 08:10 EST by Dirk Baeumer CLA
Modified: 2002-03-01 04:36 EST (History)
0 users

See Also:


Attachments

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