Bug 21282

Summary: IType.getFullyQualifiedName() problems
Product: [Eclipse Project] JDT Reporter: Genady Beryozkin <eclipse>
Component: CoreAssignee: Philipe Mulet <philippe_mulet>
Status: RESOLVED WORKSFORME QA Contact:
Severity: normal    
Priority: P3    
Version: 2.0   
Target Milestone: 2.0.1   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

Description Genady Beryozkin CLA 2002-07-06 16:59:37 EDT
I have a problem with getFullyQualifiedName() method 
on binary types (class files)

The returned value does not have any package information. 
It is simply the type name.

Eclipse 2.0
Comment 1 Kent Johnson CLA 2002-07-09 10:23:03 EDT
This is the source for the method:

String packageName = getPackageFragment().getElementName();
if (packageName.equals(IPackageFragment.DEFAULT_PACKAGE_NAME))
	return getTypeQualifiedName(enclosingTypeSeparator);
return packageName + '.' + getTypeQualifiedName(enclosingTypeSeparator);

Are you see this for every binary type or just a few? Are they from different 
packages?
Comment 2 Genady Beryozkin CLA 2002-07-09 12:03:00 EDT
the problems is with the getPackageFragment().getElementName() method.
it always returns the default package.
I should have noted, that I work with classes
from the output folder.

Genady
Comment 3 Philipe Mulet CLA 2002-07-11 05:26:52 EDT
The output folder isn't part of the JavaModel, which rather accounts for the 
elements reachable from the classpath description. 

You cannot navigate from a Java project to elements inside the output folder, 
though you can manually create handles onto them (as you can on units outside 
the classpath as well), but then little is operational on these.

Why are you manipulating classfiles inside the output folder, rather than their 
corresponding sources ?
Comment 4 Philipe Mulet CLA 2002-07-13 05:37:13 EDT
Units outside the classpath are all rooted in a fake package fragment root 
accounting for their immediate container, and inside a default package.

This minimalistic approach is only here to allow to open a Java editor on such 
files, but nothing more than that. Clearly, these elements do not belong to the 
JavaModel, and if it wasn't for the Java editor, they should not even be 
created.
Comment 5 Philipe Mulet CLA 2002-07-16 16:30:34 EDT
Ok to close ?
Comment 6 Genady Beryozkin CLA 2002-07-18 07:51:39 EDT
ok
Comment 7 Philipe Mulet CLA 2002-07-18 09:12:26 EDT
Closing, working as designed.