Author: akazakov
Date: 2012-07-27 19:26:51 -0400 (Fri, 27 Jul 2012)
New Revision: 42773
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/LibraryStorage.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/StaticLibraries.java
Log:
https://issues.jboss.org/browse/JBIDE-12373 Update RequiredExecutionEnvironment to Java
1.6 for Common/CDI/Seam/JSF components
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/LibraryStorage.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/LibraryStorage.java 2012-07-27
23:26:37 UTC (rev 42772)
+++
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/LibraryStorage.java 2012-07-27
23:26:51 UTC (rev 42773)
@@ -10,6 +10,8 @@
******************************************************************************/
package org.jboss.tools.jst.web.kb.internal;
+import java.util.ArrayList;
+import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
@@ -50,8 +52,10 @@
return allLibrariesArray;
}
- synchronized Set<ITagLibrary> getAllLibraries() {
- return allLibraries;
+ synchronized Collection<ITagLibrary> getAllLibraries() {
+ Collection<ITagLibrary> collection = new ArrayList<ITagLibrary>();
+ collection.addAll(allLibraries);
+ return collection;
}
public synchronized ITagLibrary[] getLibrariesArray(String uri) {
@@ -82,15 +86,18 @@
return result;
}
- public synchronized void addLibrary(ITagLibrary f) {
+ public void addLibrary(ITagLibrary f) {
+ addLibrary(f, f.getSourcePath());
+ }
+
+ public synchronized void addLibrary(ITagLibrary f, IPath sourcePath) {
allLibraries.add(f);
allLibrariesArray = EMPTY_LIB_ARRAY;
- IPath path = f.getSourcePath();
- if(path != null) {
- Set<ITagLibrary> fs = librariesBySource.get(path);
+ if(sourcePath != null) {
+ Set<ITagLibrary> fs = librariesBySource.get(sourcePath);
if(fs == null) {
fs = new HashSet<ITagLibrary>();
- librariesBySource.put(path, fs);
+ librariesBySource.put(sourcePath, fs);
}
fs.add(f);
}
@@ -105,16 +112,19 @@
}
public synchronized void removeLibrary(ITagLibrary f) {
+ removeLibrary(f, f.getSourcePath());
+ }
+
+ public synchronized void removeLibrary(ITagLibrary f, IPath sourcePath) {
allLibraries.remove(f);
allLibrariesArray = EMPTY_LIB_ARRAY;
- IPath path = f.getSourcePath();
- if(path != null) {
- Set<ITagLibrary> fs = librariesBySource.get(path);
+ if(sourcePath != null) {
+ Set<ITagLibrary> fs = librariesBySource.get(sourcePath);
if(fs != null) {
fs.remove(f);
}
if(fs.isEmpty()) {
- librariesBySource.remove(path);
+ librariesBySource.remove(sourcePath);
}
}
String uri = f.getURI();
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/StaticLibraries.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/StaticLibraries.java 2012-07-27
23:26:37 UTC (rev 42772)
+++
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/StaticLibraries.java 2012-07-27
23:26:51 UTC (rev 42773)
@@ -66,7 +66,7 @@
LoadedDeclarations ds = scanner.parse(fo, new Path(file.getAbsolutePath()), null);
List<ITagLibrary> ls = ds.getLibraries();
for (ITagLibrary l : ls) {
- libraries.addLibrary(l);
+ libraries.addLibrary(l, new Path(file.getAbsolutePath()));
}
}
}