Bug 25255 - ICompilationUnit::getUnderlyingResource throws an exception
Summary: ICompilationUnit::getUnderlyingResource throws an exception
Status: RESOLVED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P2 major (vote)
Target Milestone: 2.1 M3   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-10-23 12:05 EDT by Adam Kiezun CLA
Modified: 2002-11-08 09:38 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Kiezun CLA 2002-10-23 12:05:57 EDT
it throws a JavaModelException for ICompilationUnits outside the classpath
the spec says that the exception is thrown when the element does not exist

but it does exist - calling exists() confirms it

it used to work - now a lot of code is broken
Comment 1 Philipe Mulet CLA 2002-10-23 16:09:21 EDT
We warned you about this change, and we are still debating on the right 
behavior. See the question asked on jdt-core-dev.

Jerome-please investigate asap. I thought we hadn't changed yet.
Comment 2 Jerome Lanneluc CLA 2002-10-23 16:59:45 EDT
I don't understand how this could happen. The implementation of 
CompilationUnit.getUnderlyingResource() is to return getResource() which cannot 
throw a JavaModelException. Which version are using?
Comment 3 Adam Kiezun CLA 2002-10-28 11:04:04 EST
i was using a sneak preview version from Philippe
Comment 4 Jerome Lanneluc CLA 2002-11-08 09:38:31 EST
Fix for bug 25184 now ensures that exists() returns false for a cu outside the 
classpath. In this case getUnderlyingResource() will throw a JavaModelException 
as specified.