Bug 3349 - Need a IJavaElement.getUnderlyingResource that does not do the exists test (1GJ69GP)
Summary: Need a IJavaElement.getUnderlyingResource that does not do the exists test (1...
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: All Windows NT
: P2 normal (vote)
Target Milestone: 2.0 M5   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-10-10 22:53 EDT by Martin Aeschlimann CLA
Modified: 2019-07-24 10:10 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Aeschlimann CLA 2001-10-10 22:53:39 EDT
MA (28.08.2001 16:07:58)
	I need to know the paths of JavaElements that has been deleted.

	IJavaElement.getUnderlyingResource throws a JavaModelException if the underlying resource does not exist.
	IResources are handles, so why not return a resource, even it does not exist? Let me do the 'exists' test, if I need it.

	Maybe an unchecked Accessor could be added.

NOTES:
Comment 1 DJ Houghton CLA 2001-10-29 17:11:34 EST
PRODUCT VERSION:
	128

Comment 2 Philipe Mulet CLA 2002-02-12 17:08:46 EST
Deferring, please reopen if it is necessary before 2.0
Comment 3 Martin Aeschlimann CLA 2002-02-13 03:57:39 EST
There is now code in our plugin that does the same thing. It works, but not 
very efficient, so it would be nice to have.

I would also be happy with IJavaElement.getCorrespondingPath(), which might be 
an even better idea.
I saw the code for this in jdt.core's JavaSearchScope.add(IJavaElement element)

There are other API requests (incoperate JavaModelUtil into jdt.core) with are 
a _must_ for 2.0 (my opinion). 
Comment 4 Jerome Lanneluc CLA 2002-03-28 07:15:36 EST
Will add IJavaElement.getResource() that will always succeed (even if the 
underlying resource doesn't exist) or return null for external jar.
Will also add IJavaElement.getCorrespondingPath().
Comment 5 Jerome Lanneluc CLA 2002-04-08 07:16:20 EDT
Added IJavaElement.getResource() and IJavaElement.getPath().
Comment 6 Eclipse Genie CLA 2019-07-23 08:28:00 EDT
New Gerrit change created: https://git.eclipse.org/r/146501