Author: Grid.Qian
Date: 2008-06-11 05:17:23 -0400 (Wed, 11 Jun 2008)
New Revision: 8706
Modified:
trunk/ws/plugins/org.jboss.tools.ws.core/plugin.xml
trunk/ws/plugins/org.jboss.tools.ws.core/src/org/jboss/tools/ws/core/classpath/JbossWSRuntimeClassPathInitializer.java
trunk/ws/plugins/org.jboss.tools.ws.core/src/org/jboss/tools/ws/core/messages/JbossWSCore.properties
Log:
JBIDE-2264: filter same name jars from different folder and set a logical name to
container
Modified: trunk/ws/plugins/org.jboss.tools.ws.core/plugin.xml
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.core/plugin.xml 2008-06-11 08:34:45 UTC (rev
8705)
+++ trunk/ws/plugins/org.jboss.tools.ws.core/plugin.xml 2008-06-11 09:17:23 UTC (rev
8706)
@@ -66,7 +66,7 @@
point="org.eclipse.jdt.core.classpathContainerInitializer">
<classpathContainerInitializer
class="org.jboss.tools.ws.core.classpath.JbossWSRuntimeClassPathInitializer"
- id="JbossWSRuntimeLib">
+ id="JBossWS_Runtime">
</classpathContainerInitializer>
</extension>
Modified:
trunk/ws/plugins/org.jboss.tools.ws.core/src/org/jboss/tools/ws/core/classpath/JbossWSRuntimeClassPathInitializer.java
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.core/src/org/jboss/tools/ws/core/classpath/JbossWSRuntimeClassPathInitializer.java 2008-06-11
08:34:45 UTC (rev 8705)
+++
trunk/ws/plugins/org.jboss.tools.ws.core/src/org/jboss/tools/ws/core/classpath/JbossWSRuntimeClassPathInitializer.java 2008-06-11
09:17:23 UTC (rev 8706)
@@ -67,7 +67,7 @@
public IClasspathEntry[] getClasspathEntries() {
if (entries == null) {
- ArrayList<IClasspathEntry> list = new ArrayList<IClasspathEntry>();
+ ArrayList<IClasspathEntry> entryList = new ArrayList<IClasspathEntry>();
JbossWSRuntime jbws = JbossWSRuntimeManager.getInstance()
.findRuntimeByName(segment);
IPath wsPath = null;
@@ -76,10 +76,10 @@
}
if (wsPath != null) {
IPath libPath = wsPath.append(JbossWSCoreMessages.Dir_Lib);
- list.addAll(Arrays.asList(getEntries(libPath)));
+ entryList.addAll(Arrays.asList(getEntries(libPath,entryList)));
libPath = wsPath.append(JbossWSCoreMessages.Dir_Client);
- list.addAll(Arrays.asList(getEntries(libPath)));
- entries = list.toArray(new IClasspathEntry[list.size()]);
+ entryList.addAll(Arrays.asList(getEntries(libPath,entryList)));
+ entries = entryList.toArray(new IClasspathEntry[entryList.size()]);
}
if (entries == null)
return new IClasspathEntry[0];
@@ -92,15 +92,15 @@
.getClasspathEntry();
}
- protected IClasspathEntry[] getEntries(IPath folder) {
+ protected IClasspathEntry[] getEntries(IPath folder, ArrayList<IClasspathEntry>
entryList) {
String[] files = folder.toFile().list();
ArrayList<IClasspathEntry> list = new ArrayList<IClasspathEntry>();
for (int i = 0; i < files.length; i++) {
- if (files[i].endsWith(".jar")) {
+ if (files[i].endsWith(".jar") && filterJars(files[i],entryList)) {
list.add(getEntry(folder.append(files[i])));
} else if (folder.append(files[i]).toFile().isDirectory()) {
list.addAll(Arrays.asList(getEntries(folder
- .append(files[i]))));
+ .append(files[i]),entryList)));
}
}
return list.toArray(new IClasspathEntry[list.size()]);
@@ -122,4 +122,13 @@
}
+ public boolean filterJars(String jarName, ArrayList<IClasspathEntry> list) {
+ for(IClasspathEntry entry : list){
+ if(entry.getPath().lastSegment().equals(jarName)){
+ return false;
+ }
+ }
+ return true;
+ }
+
}
Modified:
trunk/ws/plugins/org.jboss.tools.ws.core/src/org/jboss/tools/ws/core/messages/JbossWSCore.properties
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.core/src/org/jboss/tools/ws/core/messages/JbossWSCore.properties 2008-06-11
08:34:45 UTC (rev 8705)
+++
trunk/ws/plugins/org.jboss.tools.ws.core/src/org/jboss/tools/ws/core/messages/JbossWSCore.properties 2008-06-11
09:17:23 UTC (rev 8706)
@@ -5,7 +5,7 @@
Dir_Web_Content=WebContent
Error_Copy=Exception while copy JBossWS jars
WS_Location=jbosswsruntimelocation
-JBossWS_Runtime_Lib=JbossWSRuntimeLib
+JBossWS_Runtime_Lib=JBossWS_Runtime
JBossWS_Runtime=JBoss WS Runtime
JBossAS=JBOSS
Error_WS_Location=The JBoss WS Runtime Location is NULL
Show replies by date