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 202303 Details for
Bug 287164
Report build path error if source folder has other source folder as output folder
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed patch
bug_287164.txt (text/plain), 7.76 KB, created by
Jay Arthanareeswaran
on 2011-08-29 03:55:51 EDT
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Jay Arthanareeswaran
Created:
2011-08-29 03:55:51 EDT
Size:
7.76 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: model/org/eclipse/jdt/core/JavaCore.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/core/JavaCore.java,v >retrieving revision 1.664 >diff -u -r1.664 JavaCore.java >--- model/org/eclipse/jdt/core/JavaCore.java 28 Jul 2011 17:07:48 -0000 1.664 >+++ model/org/eclipse/jdt/core/JavaCore.java 29 Aug 2011 07:51:58 -0000 >@@ -1829,6 +1829,18 @@ > */ > public static final String CORE_ENABLE_CLASSPATH_MULTIPLE_OUTPUT_LOCATIONS = PLUGIN_ID + ".classpath.multipleOutputLocations"; //$NON-NLS-1$ > /** >+ * Core option ID: Allowing specific output to overlap anther source location >+ * <p> When disabled, no specific output location can overlap another source entry. >+ * This ensures that source files are not mixed up with derived resources. </p> >+ * <dl> >+ * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.classpath.allowOutputToOverlap"</code></dd> >+ * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> >+ * <dt>Default:</dt><dd><code>"warning"</code></dd> >+ * </dl> >+ * @since 3.8 >+ */ >+ public static final String CORE_SPECIFIC_OUTPUT_LOCATION_OVERLAPNG_ANOTHER_SOURCE = PLUGIN_ID + ".classpath.outputOverlapingAnotherSource"; //$NON-NLS-1$ >+ /** > * Core option ID: Set the timeout value for retrieving the method's parameter names from javadoc. > * <p>Timeout in milliseconds to retrieve the method's parameter names from javadoc. > * <p>If the value is <code>0</code>, the parameter names are not fetched and the raw names are returned. >Index: model/org/eclipse/jdt/internal/core/ClasspathEntry.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ClasspathEntry.java,v >retrieving revision 1.128 >diff -u -r1.128 ClasspathEntry.java >--- model/org/eclipse/jdt/internal/core/ClasspathEntry.java 14 Feb 2011 04:50:02 -0000 1.128 >+++ model/org/eclipse/jdt/internal/core/ClasspathEntry.java 29 Aug 2011 07:52:01 -0000 >@@ -1788,24 +1788,26 @@ > > if (kind == IClasspathEntry.CPE_SOURCE) { > IPath output = entry.getOutputLocation(); >- if (output == null) continue; // 36465 - for 2.0 backward compatibility, only check specific output locations (the default can still coincidate) >- // if (output == null) output = projectOutputLocation; // if no specific output, still need to check using default output (this line would check default output) >+ if (output == null) output = projectOutputLocation; // if no specific output, still need to check using default output (this line would check default output) > for (int j = 0; j < length; j++) { > IClasspathEntry otherEntry = classpath[j]; > if (otherEntry == entry) continue; > >- // Build some common strings for status message >- boolean opStartsWithProject = projectName.equals(otherEntry.getPath().segment(0)); >- String otherPathMsg = opStartsWithProject ? otherEntry.getPath().removeFirstSegments(1).toString() : otherEntry.getPath().makeRelative().toString(); >- > switch (otherEntry.getEntryKind()) { > case IClasspathEntry.CPE_SOURCE : >- if (otherEntry.getPath().equals(output)) { >+ // Bug 287164 : Report errors of overlapping output locations only if the user sets the corresponding preference. >+ // The check is required for backward compatibility with bug-fix 36465. >+ if (otherEntry.getPath().equals(output) >+ && !JavaCore.IGNORE.equals(javaProject.getOption(JavaCore.CORE_SPECIFIC_OUTPUT_LOCATION_OVERLAPNG_ANOTHER_SOURCE, true))) { >+ boolean opStartsWithProject = projectName.equals(otherEntry.getPath().segment(0)); >+ String otherPathMsg = opStartsWithProject ? otherEntry.getPath().removeFirstSegments(1).toString() : otherEntry.getPath().makeRelative().toString(); > return new JavaModelStatus(IJavaModelStatusConstants.INVALID_CLASSPATH, Messages.bind(Messages.classpath_cannotUseDistinctSourceFolderAsOutput, new String[] {entryPathMsg, otherPathMsg, projectName})); > } > break; > case IClasspathEntry.CPE_LIBRARY : >- if (otherEntry.getPath().equals(output)) { >+ if (output != projectOutputLocation && otherEntry.getPath().equals(output)) { >+ boolean opStartsWithProject = projectName.equals(otherEntry.getPath().segment(0)); >+ String otherPathMsg = opStartsWithProject ? otherEntry.getPath().removeFirstSegments(1).toString() : otherEntry.getPath().makeRelative().toString(); > return new JavaModelStatus(IJavaModelStatusConstants.INVALID_CLASSPATH, Messages.bind(Messages.classpath_cannotUseLibraryAsOutput, new String[] {entryPathMsg, otherPathMsg, projectName})); > } > } >Index: model/org/eclipse/jdt/internal/core/JavaCorePreferenceInitializer.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaCorePreferenceInitializer.java,v >retrieving revision 1.50 >diff -u -r1.50 JavaCorePreferenceInitializer.java >--- model/org/eclipse/jdt/internal/core/JavaCorePreferenceInitializer.java 10 May 2011 19:29:43 -0000 1.50 >+++ model/org/eclipse/jdt/internal/core/JavaCorePreferenceInitializer.java 29 Aug 2011 07:52:01 -0000 >@@ -58,6 +58,7 @@ > defaultOptionsMap.put(JavaCore.CORE_INCOMPATIBLE_JDK_LEVEL, JavaCore.IGNORE); > defaultOptionsMap.put(JavaCore.CORE_ENABLE_CLASSPATH_EXCLUSION_PATTERNS, JavaCore.ENABLED); > defaultOptionsMap.put(JavaCore.CORE_ENABLE_CLASSPATH_MULTIPLE_OUTPUT_LOCATIONS, JavaCore.ENABLED); >+ defaultOptionsMap.put(JavaCore.CORE_SPECIFIC_OUTPUT_LOCATION_OVERLAPNG_ANOTHER_SOURCE, JavaCore.WARNING); > > // encoding setting comes from resource plug-in > optionNames.add(JavaCore.CORE_ENCODING); >#P org.eclipse.jdt.core.tests.model >Index: src/org/eclipse/jdt/core/tests/model/ClasspathTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ClasspathTests.java,v >retrieving revision 1.226 >diff -u -r1.226 ClasspathTests.java >--- src/org/eclipse/jdt/core/tests/model/ClasspathTests.java 4 May 2011 14:47:25 -0000 1.226 >+++ src/org/eclipse/jdt/core/tests/model/ClasspathTests.java 29 Aug 2011 07:52:14 -0000 >@@ -2018,8 +2018,10 @@ > * 33207 - Reject output folder that coincidate with distinct source folder > */ > public void testClasspathValidation22() throws CoreException { >+ Hashtable options = JavaCore.getOptions(); > try { > IJavaProject proj = this.createJavaProject("P", new String[] {}, ""); >+ proj.setOption(JavaCore.CORE_SPECIFIC_OUTPUT_LOCATION_OVERLAPNG_ANOTHER_SOURCE, JavaCore.ERROR); > IClasspathEntry[] originalCP = proj.getRawClasspath(); > > IClasspathEntry[] newCP = new IClasspathEntry[originalCP.length+2]; >@@ -2033,6 +2035,7 @@ > "Source folder \'src\' in project 'P' cannot output to distinct source folder \'src2\'", > status); > } finally { >+ JavaCore.setOptions(options); > this.deleteProject("P"); > } > } >@@ -2043,8 +2046,10 @@ > * default output scenarii is still tolerated > */ > public void testClasspathValidation23() throws CoreException { >+ Hashtable options = JavaCore.getOptions(); > try { > IJavaProject proj = this.createJavaProject("P", new String[] {}, ""); >+ proj.setOption(JavaCore.CORE_SPECIFIC_OUTPUT_LOCATION_OVERLAPNG_ANOTHER_SOURCE, JavaCore.IGNORE); > IClasspathEntry[] originalCP = proj.getRawClasspath(); > > IClasspathEntry[] newCP = new IClasspathEntry[originalCP.length+2]; >@@ -2061,6 +2066,7 @@ > // "Source folder 'P/src' cannot output to distinct source folder 'P/'.", > // status); > } finally { >+ JavaCore.setOptions(options); > this.deleteProject("P"); > } > }
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
Flags:
daniel_megert
:
review-
Actions:
View
|
Diff
Attachments on
bug 287164
:
146612
|
146654
|
202303
|
205106
|
205107
|
205307
|
205312
|
205313
|
205417
|
205426
|
205470
|
205481
|
205529
|
205572
|
205586
|
205619
|
205633
|
205652
|
205653