Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpfullbright2007-09-12 20:51:43 +0000
committerpfullbright2007-09-12 20:51:43 +0000
commitb40168262a0554e4aba14eda7d1acef99ece2a36 (patch)
tree76422b120186462315fabf75649e25ae46fc2cf1 /jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetInstallDelegate.java
parente6b624669f7a3616105a8a08a669e05dd9dd37a4 (diff)
downloadwebtools.dali-b40168262a0554e4aba14eda7d1acef99ece2a36.tar.gz
webtools.dali-b40168262a0554e4aba14eda7d1acef99ece2a36.tar.xz
webtools.dali-b40168262a0554e4aba14eda7d1acef99ece2a36.zip
combined port of bug fixes for 192477, 202684, 202811, and 202959 - adding artifact edit functionality
Diffstat (limited to 'jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetInstallDelegate.java')
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetInstallDelegate.java13
1 files changed, 8 insertions, 5 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetInstallDelegate.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetInstallDelegate.java
index 288e9b1261..791160aff7 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetInstallDelegate.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetInstallDelegate.java
@@ -17,6 +17,7 @@ import org.eclipse.jdt.core.IClasspathAttribute;
import org.eclipse.jdt.core.IClasspathEntry;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jpt.utility.internal.CollectionTools;
import org.eclipse.jpt.utility.internal.StringTools;
import org.eclipse.jst.j2ee.classpathdep.ClasspathDependencyUtil;
import org.eclipse.jst.j2ee.classpathdep.IClasspathDependencyConstants;
@@ -61,15 +62,17 @@ public class JpaFacetInstallDelegate
)
};
}
+
IClasspathEntry jpaLibraryEntry =
JavaCore.newContainerEntry(
new Path(JavaCore.USER_LIBRARY_CONTAINER_ID + "/" + jpaLibrary),
null, attributes, true);
- IClasspathEntry[] newClasspath = new IClasspathEntry[newLength];
- System.arraycopy(classpath, 0, newClasspath, 0, newLength - 1);
- newClasspath[newLength - 1] = jpaLibraryEntry;
-
- javaProject.setRawClasspath(newClasspath, monitor);
+ if (! CollectionTools.contains(classpath, jpaLibraryEntry)) {
+ IClasspathEntry[] newClasspath = new IClasspathEntry[newLength];
+ System.arraycopy(classpath, 0, newClasspath, 0, newLength - 1);
+ newClasspath[newLength - 1] = jpaLibraryEntry;
+ javaProject.setRawClasspath(newClasspath, monitor);
+ }
}
if (monitor != null) {

Back to the top