Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoreyuen2015-12-03 17:15:41 +0000
committereyuen2015-12-03 17:15:41 +0000
commit3905b20591c209ccd5513be4848dffedc002a3e6 (patch)
tree89a35457ddbab3af1ac87d337de4cb28fb242eee
parentf46d34e6ac6f11e16c08686d4e7e4eaa6f94a0ee (diff)
downloadwebtools.servertools-3905b20591c209ccd5513be4848dffedc002a3e6.tar.gz
webtools.servertools-3905b20591c209ccd5513be4848dffedc002a3e6.tar.xz
webtools.servertools-3905b20591c209ccd5513be4848dffedc002a3e6.zip
[469037] RuntimeClasspathProviderDelegate does not update the classpathv20151203_1216
container in certain cases
-rw-r--r--plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/RuntimeClasspathProviderDelegate.java26
1 files changed, 21 insertions, 5 deletions
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/RuntimeClasspathProviderDelegate.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/RuntimeClasspathProviderDelegate.java
index bdae7500c..9639ec89b 100644
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/RuntimeClasspathProviderDelegate.java
+++ b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/RuntimeClasspathProviderDelegate.java
@@ -60,7 +60,7 @@ public abstract class RuntimeClasspathProviderDelegate {
private Map<String, IPath> runtimePathMap = Collections.synchronizedMap(new HashMap<String, IPath>());
- private Map<String, Integer> previousClasspath = Collections.synchronizedMap(new HashMap<String, Integer>());
+ private Map<String, IClasspathEntry[]> previousClasspath = Collections.synchronizedMap(new HashMap<String, IClasspathEntry[]>());
public RuntimeClasspathProviderDelegate() {
// default constructor
@@ -160,15 +160,17 @@ public abstract class RuntimeClasspathProviderDelegate {
String key = project.getName() + "/" + runtime.getId();
if (!previousClasspath.containsKey(key))
- previousClasspath.put(key, new Integer(entries.length));
+ previousClasspath.put(key, entries);
else {
- Integer previousEntries = previousClasspath.get(key);
+ IClasspathEntry[] previousClasspathEntries = previousClasspath.get(key);
- if ((previousEntries == null) || (previousEntries.intValue() != entries.length)) {
+ if (previousClasspathEntries == null
+ || previousClasspathEntries.length != entries.length
+ || entriesChanged(previousClasspathEntries,entries)) {
if (Trace.FINEST) {
Trace.trace(Trace.STRING_FINEST, "Classpath update: " + key + " " + entries);
}
- previousClasspath.put(key, new Integer(entries.length));
+ previousClasspath.put(key, entries);
IPath path = new Path(RuntimeClasspathContainer.SERVER_CONTAINER);
path = path.append(extensionId).append(runtime.getId());
@@ -187,6 +189,20 @@ public abstract class RuntimeClasspathProviderDelegate {
return entries;
}
+ private boolean entriesChanged(IClasspathEntry[] previousEntries, IClasspathEntry[] entries) {
+ if (previousEntries.length != entries.length) {
+ return true;
+ }
+ for (int i=0; i<previousEntries.length; i++) {
+ if ((previousEntries[i] == null && entries[i] != null)
+ || (previousEntries[i].getPath() == null && entries[i].getPath() != null)
+ || !previousEntries[i].getPath().equals(entries[i].getPath())) {
+ return true;
+ }
+ }
+ return false;
+ }
+
/*
* Returns true if there are any changes in the runtime since the last time that the
* classpath was resolved which may affect the classpath, and false otherwise. This

Back to the top