Summary: | [search] selecting class with a main type ignores the default package | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Genady Beryozkin <eclipse> | ||||||
Component: | Core | Assignee: | Jerome Lanneluc <jerome_lanneluc> | ||||||
Status: | VERIFIED FIXED | QA Contact: | |||||||
Severity: | normal | ||||||||
Priority: | P3 | CC: | frederic_fusier | ||||||
Version: | 3.1 | ||||||||
Target Milestone: | 3.2 M2 | ||||||||
Hardware: | PC | ||||||||
OS: | Windows XP | ||||||||
Whiteboard: | |||||||||
Attachments: |
|
Description
Genady Beryozkin
2005-06-25 17:33:13 EDT
This works for me on RC4, which build are you using? OK, I found it does not work for a simple project layout with *no* source folder. If I create a project 'P' with a main type 'A' in the top level folder, the main type is not found. If I create a 'src' folder that contains the top level type 'A', then it works. This did work properly in M6 - not sure when it got broken. Moving to JCORE for comment. It appears we set up a search scope for main methods and perform the search in the default package, getting no results when the project has a simple setup (i.e. source and binaries in the root folder). However, the search works when there is a top level source folder, and separate output folder. To step thru our code that performs the search. Place a breakpoint in MainMethodSearchEngine.searchMainMethods(IProgressMonitor pm, IJavaSearchScope scope, boolean includeSubtypes), and invoke the "Run As > Java Application" on a default package. You're right, I don't have a source folder defined. I have two questions irrelevant to this bug: 1. why by default the projects are creating without separate source folders? 2. can MainMethodSearchEngine be made an API? There are already two implementations of this class and I needed a similar functionality to implement the launcher in my RMI Plugin. Thanks, Genady Created attachment 24130 [details]
Improved JavaSearchScope
Created attachment 24131 [details]
Regression tests
*** Bug 101602 has been marked as a duplicate of this bug. *** Released fix from comment 6 and tests from comment 7 were improved and moved to a new class JavaSearchScopeTests by Frederic. Verified in I20050920-0010 for 3.2M2 |