Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephan Herrmann2010-09-30 08:20:28 -0400
committerStephan Herrmann2010-09-30 08:20:28 -0400
commitbbcb0849cf0ade56c1d33217176072494bfb2a38 (patch)
tree362d5f2a5a63d3ce580d25c82d2bf6ee6875c9ac /org.eclipse.jdt.core.tests.model
parenta0af2642fc93147ea6deb322a709ddc3fd028d84 (diff)
downloadorg.eclipse.objectteams-bbcb0849cf0ade56c1d33217176072494bfb2a38.tar.gz
org.eclipse.objectteams-bbcb0849cf0ade56c1d33217176072494bfb2a38.tar.xz
org.eclipse.objectteams-bbcb0849cf0ade56c1d33217176072494bfb2a38.zip
added class from my own patch to bug 320618 (3.7M2)
Diffstat (limited to 'org.eclipse.jdt.core.tests.model')
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/extensions/TestExternalLibContainerInitializer.java56
1 files changed, 56 insertions, 0 deletions
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/extensions/TestExternalLibContainerInitializer.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/extensions/TestExternalLibContainerInitializer.java
new file mode 100644
index 000000000..a1b7d30fd
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/extensions/TestExternalLibContainerInitializer.java
@@ -0,0 +1,56 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Stephan Herrmann.
+ * 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Stephan Herrmann <stephan@cs.tu-berlin.de> - inconsistent initialization of classpath container backed by external class folder, see https://bugs.eclipse.org/320618
+ *******************************************************************************/
+package org.eclipse.jdt.core.tests.extensions;
+
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.jdt.core.ClasspathContainerInitializer;
+import org.eclipse.jdt.core.IClasspathContainer;
+import org.eclipse.jdt.core.IClasspathEntry;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.JavaCore;
+
+public class TestExternalLibContainerInitializer extends ClasspathContainerInitializer {
+
+ IClasspathEntry[] entries;
+
+ public void initialize(final IPath containerName, IJavaProject project)
+ throws CoreException {
+ IPath ws = ResourcesPlugin.getWorkspace().getRoot().getLocation();
+ final IPath containerPath = ws.append("../TestContainer/");
+ IClasspathContainer container = new IClasspathContainer() {
+
+ public IPath getPath() {
+ return containerName;
+ }
+
+ public int getKind() {
+ return IClasspathContainer.K_APPLICATION;
+ }
+
+ public String getDescription() {
+ return "Test Container";
+ }
+
+ public IClasspathEntry[] getClasspathEntries() {
+ if (TestExternalLibContainerInitializer.this.entries == null) {
+ TestExternalLibContainerInitializer.this.entries = new IClasspathEntry[] {
+ JavaCore.newLibraryEntry(containerPath, null, null)
+ };
+ }
+ return TestExternalLibContainerInitializer.this.entries;
+ }
+ };
+ JavaCore.setClasspathContainer(containerName, new IJavaProject[]{ project}, new IClasspathContainer[] { container }, null);
+ }
+
+}

Back to the top