Bug 42937 - IProject.getOutputLocation() and IClasspathEntry.getOutputLocation() should return the project-relative path.
Summary: IProject.getOutputLocation() and IClasspathEntry.getOutputLocation() should r...
Status: RESOLVED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows 2000
: P3 enhancement (vote)
Target Milestone: 3.0 M4   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-09-11 06:36 EDT by Chris Wege CLA
Modified: 2003-09-11 15:09 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 Chris Wege CLA 2003-09-11 06:36:59 EDT
Version: 2.1.1
Build id: 200306271545

IJavaProject>>getOutputLocation 
Returns the default output location for this project as a workspace-
relative absolute path.

Now if I have a project that is outside the standard workspace directory, I
can't rely on the location of the workspace directory, because it would give me
a wrong result. Example:
IPath outpath = project.getOutputLocation() -> /MyProject/bin
IPath projpath = project.getUnderlyingRsource().getLocation() ->
c:/outside/MyProject
IPath rootpath = workspaceroot.getLocation() -> c:/workspace
To get the absolute path to the output directory I have to 
IPath absolute = projpath.removeLastSegments(1).append(outpath);

In my moind it makes no sense to return the output location relative to the
workspace root in any case. Same for output locations of IClasspathEntry.

IProject.getOutputLocation() and IClasspathEntry.getOutputLocation() should
return the project-relative path.
Comment 1 Philipe Mulet CLA 2003-09-11 15:09:26 EDT
Every resource path has the same issue, it may be different from the location. 
This isn't specific to a project output location, and is documented on resource 
APIs.

Furthermore, changing such an API at this stage would simply be breaking 
compatibility.

Closing.