Bug 28908

Summary: ClassCastException in JavaProject.computePackageFragmentRoots
Product: [Eclipse Project] JDT Reporter: Kevin O'Neill <kevin>
Component: CoreAssignee: Philipe Mulet <philippe_mulet>
Status: RESOLVED INVALID QA Contact:
Severity: major    
Priority: P3    
Version: 2.1   
Target Milestone: 2.1 M5   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Kevin O'Neill CLA 2002-12-30 00:46:04 EST
If you create a custom IClassPathEntry class then
JavaProject.computePackageFragmentRoots throws an exception when the
IClassPathEntry passed to the method is cast to the internal ClasspathEntry
 
String rootID = ((ClasspathEntry)resolvedEntry).rootID();

My work around is to create an instance of ClasspathEntry rather than my custom
IClasspathEntry. This is not 100% legit as the ClasspathEntry class is in an
internal package.
Comment 1 Philipe Mulet CLA 2003-01-07 08:28:43 EST
From IClasspathEntry javadoc:

 * This interface is not intended to be implemented by clients.
 * Classpath entries can be created via methods on <code>JavaCore</code>.
Comment 2 Philipe Mulet CLA 2003-01-08 05:50:20 EST
Closing, working as designed.