Bug 40658 - IJavaProject.getOutputLocation/getRawClasspath require Java nature
Summary: IJavaProject.getOutputLocation/getRawClasspath require Java nature
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.0 M4   Edit
Assignee: Frederic Fusier CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 42247 (view as bug list)
Depends on:
Blocks: 39272
  Show dependency tree
 
Reported: 2003-07-23 11:16 EDT by Martin Aeschlimann CLA
Modified: 2003-10-08 07:30 EDT (History)
2 users (show)

See Also:


Attachments
Fix for PR 40658 (6.14 KB, patch)
2003-09-01 07:10 EDT, Frederic Fusier CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Aeschlimann CLA 2003-07-23 11:16:36 EDT
M2

In 2.0 it was allowed to access IJavaProject.getOutputLocation/getRawClasspath
on a project where the JavaNature was not set yet. Since 2.1 a
JavaModelException is thrown if that happens.
The new Java project wizard does this if a .classpath file is found at the
location where the project will be created. I don't want to create a Java
project right away to not have any java side effects (Java indexer) started
until OK is pressed.

Can we have this functionality back? A possibility would be to add an additional
API 'JavaCore.getOutputLocation(File file) / getRawClasspath(File) where the
file is the .classpath file.
Comment 1 Philipe Mulet CLA 2003-07-24 05:48:59 EDT
In 2.0, this was a bug from our end, and it was causing other issues like 
fooling model updates etc... the project existency check is supposed to check 
for the nature. Not every project is a Java project, the nature tells us.

Please investigate using internal Project#readClasspathFile(false, false) and 
then if ok, we will surface it as an API.

This is a fair request, along the line of the #forceClasspathReload addition.
Comment 2 Martin Aeschlimann CLA 2003-08-07 06:28:32 EDT
readClasspathFile is protected so I can't try that. But this looks like exactly
what I need.
Comment 3 Philipe Mulet CLA 2003-09-01 04:21:50 EDT
*** Bug 42247 has been marked as a duplicate of this bug. ***
Comment 4 Frederic Fusier CLA 2003-09-01 07:10:17 EDT
Created attachment 5921 [details]
Fix for PR 40658

Add two 2 new API methods on IJavaProject interface:
readRawClasspath()
readOutputLocation()
Comment 5 Frederic Fusier CLA 2003-09-01 07:11:44 EDT
Philippe,

I have attached the patch file which contains the 2 new API methods on 
IJavaProject to fix this problem.
May you buddy check it and integrate if you're happy with this solution?

Thanks
Comment 6 Philipe Mulet CLA 2003-09-01 07:35:36 EDT
Patch works fine, integrated.
Thanks for this first contribution.
Comment 7 Philipe Mulet CLA 2003-09-02 06:13:09 EDT
Incorrectly assigned
Comment 8 Philipe Mulet CLA 2003-09-02 06:13:35 EDT
Fixed
Comment 9 David Audel CLA 2003-10-08 07:30:25 EDT
Verified.