Community
Participate
Working Groups
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).
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.
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.
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.
PrimaryWorkingCopyTest doesn't exist in v20030916. Please provide a test case that uses JDT/Core code only.
see my comment2 in bug 43294.
Moving back to Core.
Will merge passed-in working copies with primary working copies.
Fixed and added regression test WorkingCopyOwnerTests.testSearch4()
Verified.