aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomasz Zarna2012-07-13 06:56:00 (EDT)
committerSrikanth2012-07-13 06:58:47 (EDT)
commitd570cff61e3ba15da985069c84a18fc45b8f6668 (patch)
treea18d1b6364150f68993f963ee86d3436657da630
parent825cca6caee37e91576fd766b631af4026c2a293 (diff)
downloadeclipse.jdt.core-d570cff61e3ba15da985069c84a18fc45b8f6668.zip
eclipse.jdt.core-d570cff61e3ba15da985069c84a18fc45b8f6668.tar.gz
eclipse.jdt.core-d570cff61e3ba15da985069c84a18fc45b8f6668.tar.bz2
Fixed bug 379718: test264301 failed in org.eclipse.jdt.core.tests.modelv20120713-105847M20120719-1200M20120719-1000
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AbstractJavaModelTests.java2
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AttachSourceTests.java12
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/JavaModelException.java4
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ClasspathEntry.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SetClasspathOperation.java2
5 files changed, 13 insertions, 9 deletions
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AbstractJavaModelTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AbstractJavaModelTests.java
index 8a6a0c8..9c74e48 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AbstractJavaModelTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AbstractJavaModelTests.java
@@ -1108,7 +1108,7 @@ public abstract class AbstractJavaModelTests extends SuiteOfTestCases {
}
/**
* Creates an operation to delete the given element, asserts
- * the operation is successfull, and ensures the element is no
+ * the operation is successful, and ensures the element is no
* longer present in the model.
*/
public void assertDeletion(IJavaElement elementToDelete) throws JavaModelException {
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AttachSourceTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AttachSourceTests.java
index 621f9e0..ee7353c 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AttachSourceTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AttachSourceTests.java
@@ -608,8 +608,11 @@ public void testZIPArchive4() throws CoreException {
deleteProject("P2");
}
}
+
/*
- * Test that a path must have at least one segment
+ * Test that a source path must have at least one segment. Set source path
+ * to the current workspace location root. The test runs on Windows only, so
+ * the path is usually "C:\" or "D:\".
*/
public void test264301() throws CoreException {
String os = Platform.getOS();
@@ -625,11 +628,12 @@ public void test264301() throws CoreException {
"\n" +
"public class Test {}");
IPackageFragmentRoot root = javaProject.getPackageFragmentRoot(getFile("/AttachSourceTests/test.jar"));
+ String dev = ResourcesPlugin.getWorkspace().getRoot().getLocation().getDevice() + IPath.SEPARATOR;
try {
- attachSource(root, "C:/", null);
- assertTrue("Should not be there", false);
+ attachSource(root, dev, null);
+ assertTrue("Should not be here", false);
} catch(JavaModelException e) {
- // expected exception
+ // expected exception when source path overlaps with the current workspace location
}
} finally {
deleteProject("Test");
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/JavaModelException.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/JavaModelException.java
index aed7fe2..bb6d6c4 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/JavaModelException.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/JavaModelException.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2012 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
@@ -74,7 +74,7 @@ public JavaModelException(IJavaModelStatus status) {
/**
* Returns the underlying <code>Throwable</code> that caused the failure.
*
- * @return the wrappered <code>Throwable</code>, or <code>null</code> if the
+ * @return the wrapped <code>Throwable</code>, or <code>null</code> if the
* direct case of the failure was at the Java model layer
*/
public Throwable getException() {
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ClasspathEntry.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ClasspathEntry.java
index 8baef63..ee35713 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ClasspathEntry.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ClasspathEntry.java
@@ -1582,7 +1582,7 @@ public class ClasspathEntry implements IClasspathEntry {
* <li> The project output location path cannot be null, must be absolute and located inside the project.
* <li> Specific output locations (specified on source entries) can be null, if not they must be located inside the project,
* <li> A project entry cannot refer to itself directly (that is, a project cannot prerequisite itself).
- * <li> Classpath entries or output locations cannot coincidate or be nested in each other, except for the following scenarii listed below:
+ * <li> Classpath entries or output locations cannot coincidate or be nested in each other, except for the following scenario listed below:
* <ul><li> A source folder can coincidate with its own output location, in which case this output can then contain library archives.
* However, a specific output location cannot coincidate with any library or a distinct source folder than the one referring to it. </li>
* <li> A source/library folder can be nested in any source folder as long as the nested folder is excluded from the enclosing one. </li>
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SetClasspathOperation.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SetClasspathOperation.java
index 887a56b..fdca294 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SetClasspathOperation.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SetClasspathOperation.java
@@ -115,7 +115,7 @@ public class SetClasspathOperation extends ChangeClasspathOperation {
if (!status.isOK())
return status;
this.project.flushClasspathProblemMarkers(false, false, true);
- return ClasspathEntry.validateClasspath( this.project, this.newRawClasspath, this.newOutputLocation);
+ return ClasspathEntry.validateClasspath(this.project, this.newRawClasspath, this.newOutputLocation);
}
}