Summary: | Default package has no subpackages | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Markus Keller <markus.kell.r> |
Component: | Core | Assignee: | Jerome Lanneluc <jerome_lanneluc> |
Status: | RESOLVED WONTFIX | QA Contact: | |
Severity: | normal | ||
Priority: | P3 | ||
Version: | 3.2 | ||
Target Milestone: | 3.3 RC4 | ||
Hardware: | PC | ||
OS: | Windows XP | ||
Whiteboard: | |||
Bug Depends on: | |||
Bug Blocks: | 125486 |
Description
Markus Keller
2006-03-20 13:38:01 EST
Unfortunately, the spec for IPackageFragment#hasSubpackages() is slightly different. It says that it "returns whether this package fragment's name is a prefix of other package fragments in this package fragment's root". Since the name of the default package fragment is "", it is always a prefix of any other package fragment's name (if any). This cannot be changed without breaking the IPackageFragment's spec. (In reply to comment #1) > Since the name of the default package fragment is "", it is always a prefix of > any other package fragment's name (if any). I disagree since packages have a separator which is ".". If other packages should be treated as subpackages of "" their names should be something like ".my.own.subpackage" which is not a valid package name. (In reply to comment #2) > I disagree since packages have a separator which is ".". If other packages > should be treated as subpackages of "" their names should be something like > ".my.own.subpackage" which is not a valid package name. Yes, this is what JLS3 7.4.2 says. However IPackageFragment#hasSubpackages() is not compatible with JLS3 7.4.2 (since it is using the word 'prefix' and an empty string is always a prefix of any string). So if you wish, you can enter a feature request to ask for a new API that corresponds to JLS3 7.4.2. |