diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ClasspathTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ClasspathTests.java index 4166cb2..47d2148 100644 --- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ClasspathTests.java +++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ClasspathTests.java @@ -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_OUTPUT_LOCATION_OVERLAPPING_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_OUTPUT_LOCATION_OVERLAPPING_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"); } } @@ -2305,11 +2311,14 @@ newCP[originalCP.length] = JavaCore.newSourceEntry(new Path("/P/src1"), new IPath[]{new Path("src2/")}, new Path("/P/src1/src2")); newCP[originalCP.length+1] = JavaCore.newSourceEntry(new Path("/P/src1/src2")); - IJavaModelStatus status = JavaConventions.validateClasspath(proj, newCP, proj.getOutputLocation()); + proj.setRawClasspath(newCP, proj.getOutputLocation(), null); - assertStatus( - "Source folder \'src1\' in project 'P' cannot output to distinct source folder \'src1/src2\'", - status); + assertMarkers( + "Unexpected markers", + "Project \'P\' is missing required source folder: \'src1\'\n" + + "Project \'P\' is missing required source folder: \'src1/src2\'\n" + + "Source folder \'src1\' in project \'P\' cannot output to distinct source folder \'src1/src2\'", + proj); } finally { this.deleteProject("P"); } diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IJavaModelMarker.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IJavaModelMarker.java index dbc6e55..e25a8cb 100644 --- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IJavaModelMarker.java +++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IJavaModelMarker.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2010 IBM Corporation and others. + * Copyright (c) 2000, 2011 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -114,4 +114,13 @@ * @since 2.0 */ String CLASSPATH_FILE_FORMAT = "classpathFileFormat"; //$NON-NLS-1$ + + /** + * Output overlapping another source attribute (value "outputOverlappingSource"Status constant indicating that the default or specific output folder is overlapping + * with another source location.

+ * @since 3.8 + */ + public static final int OUTPUT_LOCATION_OVERLAPPING_ANOTHER_SOURCE = 1013; } diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/JavaConventions.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/JavaConventions.java index 5d80813..07e5fc7 100644 --- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/JavaConventions.java +++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/JavaConventions.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2010 IBM Corporation and others. + * Copyright (c) 2000, 2011 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -583,7 +583,9 @@ *
  • A project entry cannot refer to itself directly (that is, a project cannot prerequisite itself). *
  • Classpath entries or output locations cannot coincidate or be nested in each other, except for the following scenarii listed below: *