Bug 117020

Summary: [search] Search for '*' does not report empty packages
Product: [Eclipse Project] JDT Reporter: Benno Baumgartner <benno.baumgartner>
Component: CoreAssignee: Frederic Fusier <frederic_fusier>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: k-matsumae, martinae
Version: 3.2   
Target Milestone: 3.2 M4   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on:    
Bug Blocks: 111501    

Description Benno Baumgartner CLA 2005-11-18 06:35:23 EST
Version: 3.2.0
Build id: I20051116-1332

Create a new java project
Add an empty package to the project
Search -> Java ->
  Search String: *
  Search For: Package
  Limit To: Declarations

Search does not find the empty package.

Even if you search for the package (search string= package name) the package is
not reported.

The problem seams to be located in:
MatchLocator#locatePackageDeclarations :

IPackageFragment pkg = (IPackageFragment) pkgs[k];
IJavaElement[] children= pkg.getChildren();
if (children.length > 0 && ...) {
   ... report match ...
}
Comment 1 Frederic Fusier CLA 2005-11-28 12:13:19 EST
Problem rightly came from this condition, thanks for the job :-)

Fixed and released in HEAD.

Test case added in JavaSearchTests
Comment 2 Jerome Lanneluc CLA 2005-12-13 10:34:50 EST
Verified for 3.2 M4 using build I20051213-0010
Comment 3 Frederic Fusier CLA 2006-05-10 03:54:34 EDT
*** Bug 140992 has been marked as a duplicate of this bug. ***