Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgkessler2010-06-30 15:50:39 -0400
committergkessler2010-06-30 15:50:39 -0400
commiteb08389a909e69f909cbb7705f7c49e11f11296a (patch)
treeb578454259300c57f0f2446107f97e400e6aacba
parentb343d7b6de52660a25826fcf8683581f062bb0dc (diff)
downloadwebtools.jsf-eb08389a909e69f909cbb7705f7c49e11f11296a.tar.gz
webtools.jsf-eb08389a909e69f909cbb7705f7c49e11f11296a.tar.xz
webtools.jsf-eb08389a909e69f909cbb7705f7c49e11f11296a.zip
317756 - [JSF2.0] CompositeTagRegistryFactory caching causes major loss of service
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/CompositeTagRegistryFactory.java61
1 files changed, 27 insertions, 34 deletions
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/CompositeTagRegistryFactory.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/CompositeTagRegistryFactory.java
index 9a56b804d..a3abf88a4 100644
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/CompositeTagRegistryFactory.java
+++ b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/CompositeTagRegistryFactory.java
@@ -12,11 +12,9 @@ package org.eclipse.jst.jsf.core.internal;
import java.util.ArrayList;
import java.util.Collections;
-import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
-import java.util.Map;
import java.util.Set;
import org.eclipse.core.resources.IProject;
@@ -50,7 +48,7 @@ public final class CompositeTagRegistryFactory
{
TEST_PROVIDER = factoryProvider;
// TODO: this is risky
- _cachedExtensionsByType.clear();
+// _cachedExtensionsByType.clear();
}
/**
@@ -65,8 +63,8 @@ public final class CompositeTagRegistryFactory
return INSTANCE;
}
- private final Map<TagRegistryIdentifier, Set<ITagRegistryFactoryInfo>> _cachedExtensionsByType =
- new HashMap<TagRegistryIdentifier, Set<ITagRegistryFactoryInfo>>(4);
+// private final Map<TagRegistryIdentifier, Set<ITagRegistryFactoryInfo>> _cachedExtensionsByType =
+// new HashMap<TagRegistryIdentifier, Set<ITagRegistryFactoryInfo>>(4);
private CompositeTagRegistryFactory()
{
@@ -188,37 +186,32 @@ public final class CompositeTagRegistryFactory
return Collections.emptySet();
}
- private Set<ITagRegistryFactoryInfo> findMatchingExtensions(
- TagRegistryIdentifier id, Set<ITagRegistryFactoryInfo> handlers)
- {
- Set<ITagRegistryFactoryInfo> matching = _cachedExtensionsByType.get(id);
-
- if (matching == null)
- {
- matching = new HashSet<ITagRegistryFactoryInfo>(4);
+ private Set<ITagRegistryFactoryInfo> findMatchingExtensions(
+ TagRegistryIdentifier id, Set<ITagRegistryFactoryInfo> handlers)
+ {
+ Set<ITagRegistryFactoryInfo> matching = new HashSet<ITagRegistryFactoryInfo>(
+ 4);
- for (final ITagRegistryFactoryInfo handler : handlers)
- {
- if (handler.getContentTypes().contains(id.getContentType())
- && handler.getTagRegistryFactory().projectIsValid(id.getProject()))
- {
- matching.add(handler);
- }
- }
+ for (final ITagRegistryFactoryInfo handler : handlers) {
+ if (handler.getContentTypes().contains(id.getContentType())
+ && handler.getTagRegistryFactory().projectIsValid(
+ id.getProject())) {
+ matching.add(handler);
+ }
+ }
- // if there is nothing matching, just store the empty set and
- // discard the extra memory
- if (matching.size() > 0)
- {
- _cachedExtensionsByType.put(id, matching);
- }
- else
- {
- _cachedExtensionsByType.put(id, Collections.EMPTY_SET);
- }
- }
- return matching;
- }
+ // // if there is nothing matching, just store the empty set and
+ // // discard the extra memory
+ // if (matching.size() > 0)
+ // {
+ // _cachedExtensionsByType.put(id, matching);
+ // }
+ // else
+ // {
+ // _cachedExtensionsByType.put(id, Collections.EMPTY_SET);
+ // }
+ return matching;
+ }
/**
* Identifies a content type/project context in which to request a tag

Back to the top