Bug 43300 - SearchEngine(IWorkingCopy[] workingCopies) not backward compatible
Summary: SearchEngine(IWorkingCopy[] workingCopies) not backward compatible
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.0 M4   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-09-18 11:43 EDT by Martin Aeschlimann CLA
Modified: 2003-10-14 11:34 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Aeschlimann CLA 2003-09-18 11:43:26 EDT
20030918

When switching to primary working copies, search does not find any references in
cu in working copy mode.
See PrimaryWorkingCopyTest.testSearchInWorkingCopies.

The search engine is created with
  new SearchEngine(JavaUI.getSharedWorkingCopiesOnClasspath())
where 'JavaUI.getSharedWorkingCopiesOnClasspath()' returns an empty array when
we switch to primary wrking copies.

Using 'new SearchEngine()' works.
It would be better if passing an empty array behaves like the default constructor.

Of course we will eventually switch to use new SearchEngine(WorkingCopyOwner)
but for compatibility it would be good to keep a similar functionality:
The search searches in all primary compilation units, but gives the passed
working copies precedence.

The comment says 'will be removed in 3.0'. I was wonding if it wouldn't be good
to have this functionality still, offering to search with selected CU's as
working copies (where the given working copies could be even from different
workingCopyOwners).
Comment 1 Martin Aeschlimann CLA 2003-09-18 13:15:55 EDT
Discussed with with Dirk. It would be good to have this functionality so we can
easier (without hurry) port the refactoring code which uses (sand-box) working
copies with search.
See PrimaryWorkingCopyTest.testSearchInWorkingCopies2 as an illustration of how
it is used.

Disable BUG_43300 and turn on JavaPlugin.USE_WORKING_COPY_OWNERS to see the bug.
Comment 2 Dirk Baeumer CLA 2003-09-19 02:10:19 EDT
I second that. Converting all the code right now is a huge effort. I would 
rather see a solution where we deprecate the old API and we commit on 
converting to working copy owners during M5.
Comment 3 Philipe Mulet CLA 2003-09-19 04:56:01 EDT
We may even keep the deprecated API post 3.0, this is debated. If not removing 
it, there is a strong chance of having overlapping notions in our API, 
confusing our customers.

The deprecated API should still work.
Comment 4 Jerome Lanneluc CLA 2003-09-23 10:40:49 EDT
PrimaryWorkingCopyTest doesn't exist in v20030916. Please provide a test case 
that uses JDT/Core code only.
Comment 5 Martin Aeschlimann CLA 2003-09-23 11:31:19 EDT
see my comment2 in bug 43294.
Comment 6 Dirk Baeumer CLA 2003-09-23 11:53:19 EDT
Moving back to Core.
Comment 7 Jerome Lanneluc CLA 2003-09-25 10:54:58 EDT
Will merge passed-in working copies with primary working copies.
Comment 8 Jerome Lanneluc CLA 2003-09-26 07:23:07 EDT
Fixed and added regression test WorkingCopyOwnerTests.testSearch4()
Comment 9 David Audel CLA 2003-10-14 11:34:53 EDT
Verified.