Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 5921 Details for
Bug 40658
IJavaProject.getOutputLocation/getRawClasspath require Java nature
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Fix for PR 40658
patch_40658.txt (text/plain), 6.14 KB, created by
Frederic Fusier
on 2003-09-01 07:10:17 EDT
(
hide
)
Description:
Fix for PR 40658
Filename:
MIME Type:
Creator:
Frederic Fusier
Created:
2003-09-01 07:10:17 EDT
Size:
6.14 KB
patch
obsolete
>Index: model/org/eclipse/jdt/core/IJavaProject.java >=================================================================== >RCS file: /data/cvs/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IJavaProject.java,v >retrieving revision 1.56 >diff -u -r1.56 IJavaProject.java >--- model/org/eclipse/jdt/core/IJavaProject.java 26 Jun 2003 15:28:50 -0000 1.56 >+++ model/org/eclipse/jdt/core/IJavaProject.java 1 Sep 2003 10:08:27 -0000 >@@ -464,6 +464,7 @@ > * A classpath variable provides an indirection level for better sharing a classpath. As an example, it allows > * a classpath to no longer refer directly to external JARs located in some user specific location. The classpath > * can simply refer to some variables defining the proper locations of these external JARs. >+ * TODO (jim) please reformulate to include classpath containers in resolution aspects > * <p> > * Note that in case the project isn't yet opened, the classpath will directly be read from the associated <tt>.classpath</tt> file. > * <p> >@@ -801,4 +802,59 @@ > */ > void setRawClasspath(IClasspathEntry[] entries, IPath outputLocation, IProgressMonitor monitor) > throws JavaModelException; >+ >+ >+ /** >+ * Returns the raw classpath for the project as defined by its <code>.classpath</code> file from disk, or <code>null</code> >+ * if unable to read the file. >+ * <p>This classpath may differ from the in-memory classpath returned by <code>getRawClasspath</code>, in case the >+ * automatic reconciliation mechanism has not been performed yet. Usually, any change to the <code>.classpath</code> file >+ * is automatically noticed and reconciled at the next resource change notification event. >+ * However, if the file is modified within an operation, where this change needs to be taken into account before the >+ * operation ends, then the classpath from disk can be read using this method, and further assigned to the project >+ * using <code>setRawClasspath(...)</code>. >+ * <p> >+ * A raw classpath may contain classpath variable and/or container entries. Classpath variable entries can be resolved >+ * individually (see <code>JavaCore#getClasspathVariable</code>), or the full classpath can be resolved at once using the >+ * helper method <code>getResolvedClasspath</code>. >+ * TODO (jim) please reformulate to include classpath containers in resolution aspects >+ * <p> >+ * Note that no check is performed whether the project has the Java nature set, allowing an existing <code>.classpath</code> >+ * file to be considered independantly (unlike <code>getRawClasspath</code> which requires the Java nature to be associated >+ * with the project). >+ * >+ * @return the raw classpath from disk for the project, as a list of classpath entries >+ * @exception JavaModelException if this element does not exist or if an >+ * exception occurs while accessing its corresponding resource >+ * @see #getRawClassPath >+ * @see IClasspathEntry >+ * @since 3.0 >+ */ >+ IClasspathEntry[] readRawClasspath() throws JavaModelException; >+ >+ /** >+ * Returns the default output location for the project as defined by its <code>.classpath</code> file from disk, or <code>null</code> >+ * if unable to read the file. >+ * <p>This output location may differ from the in-memory one returned by <code>getOutputLocation</code>, in case the >+ * automatic reconciliation mechanism has not been performed yet. Usually, any change to the <code>.classpath</code> file >+ * is automatically noticed and reconciled at the next resource change notification event. >+ * However, if the file is modified within an operation, where this change needs to be taken into account before the >+ * operation ends, then the output location from disk can be read using this method, and further assigned to the project >+ * using <code>setRawClasspath(...)</code>. >+ * <p> >+ * The default output location is where class files are ordinarily generated >+ * (and resource files, copied). Each source classpath entry can also >+ * specify an output location for the generated class files (and copied >+ * resource files) corresponding to compilation units under that source >+ * folder. This makes it possible to arrange generated class files for >+ * different source folders in different output folders, and not >+ * necessarily the default output folder. This means that the generated >+ * class files for the project may end up scattered across several folders, >+ * rather than all in the default output folder (which is more standard). >+ * >+ * @return the workspace-relative absolute path of the default output folder >+ * @exception JavaModelException if this element does not exist >+ * @see #getOutputLocation >+ */ >+ IPath readOutputLocation() throws JavaModelException; > } >Index: model/org/eclipse/jdt/internal/core/JavaProject.java >=================================================================== >RCS file: /data/cvs/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaProject.java,v >retrieving revision 1.256 >diff -u -r1.256 JavaProject.java >--- model/org/eclipse/jdt/internal/core/JavaProject.java 29 Aug 2003 17:13:46 -0000 1.256 >+++ model/org/eclipse/jdt/internal/core/JavaProject.java 1 Sep 2003 10:08:27 -0000 >@@ -2121,7 +2121,8 @@ > */ > public IPath readOutputLocation() throws JavaModelException { > >- IClasspathEntry[] classpath = this.readClasspathFile(false/*don't create markers*/, false/*log problems*/); >+ // Read classpath file without creating markers nor logging problems >+ IClasspathEntry[] classpath = this.readClasspathFile(false, false); > // extract the output location > IPath outputLocation = null; > if (classpath != null && classpath.length > 0) { >@@ -2138,7 +2139,8 @@ > */ > public IClasspathEntry[] readRawClasspath() throws JavaModelException { > >- IClasspathEntry[] classpath = this.readClasspathFile(false/*don't create markers*/, false/*log problems*/); >+ // Read classpath file without creating markers nor logging problems >+ IClasspathEntry[] classpath = this.readClasspathFile(false, false); > // discard the output location > if (classpath != null && classpath.length > 0) { > IClasspathEntry entry = classpath[classpath.length - 1];
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 40658
: 5921