summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcbateman2013-05-01 18:43:03 (EDT)
committercbateman2013-05-01 18:43:03 (EDT)
commitebded28855ee370151ed017f57424f98e4f7b061 (patch)
tree5dd12f402d73989f10b4c1d6d6b1948589f45ded
parenta93531ded6ab2f17b7d105b0b30c36ff2d2527d3 (diff)
downloadwebtools.jsf-ebded28855ee370151ed017f57424f98e4f7b061.zip
webtools.jsf-ebded28855ee370151ed017f57424f98e4f7b061.tar.gz
webtools.jsf-ebded28855ee370151ed017f57424f98e4f7b061.tar.bz2
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/internal/MetaDataEnabledFeatureRegistry.java22
1 files changed, 17 insertions, 5 deletions
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/internal/MetaDataEnabledFeatureRegistry.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/internal/MetaDataEnabledFeatureRegistry.java
index 2f34223..4632f5d 100644
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/internal/MetaDataEnabledFeatureRegistry.java
+++ b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/internal/MetaDataEnabledFeatureRegistry.java
@@ -13,6 +13,7 @@
package org.eclipse.jst.jsf.metadataprocessors.internal;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
@@ -91,7 +92,10 @@ public class MetaDataEnabledFeatureRegistry{
}
else {
List list = featuresMap.get(typeId);
- list.add(aFeature);
+ if (list != null)
+ {
+ list.add(aFeature);
+ }
}
}
}
@@ -123,7 +127,7 @@ public class MetaDataEnabledFeatureRegistry{
featuresMap.put(typeId,new ArrayList());
//copy current featuresMapped to typeId into return list
- List<IMetaDataEnabledFeatureExtension> srcList = featuresMap.get(typeId);
+ List<IMetaDataEnabledFeatureExtension> srcList = getExtensionsForId(typeId);
List<IMetaDataEnabledFeatureExtension> ret = new ArrayList<IMetaDataEnabledFeatureExtension>(srcList.size());
copy(ret, srcList);
@@ -158,12 +162,20 @@ public class MetaDataEnabledFeatureRegistry{
for (Iterator it=typeCacheMap.keySet().iterator();it.hasNext();){
String featureTypeId = (String)it.next();
Class featureTypeClass = typeCacheMap.get(featureTypeId);
- if (featureTypeClass.isAssignableFrom(typeClass)) {
- ret.addAll(featuresMap.get(featureTypeId));
+ if (featureTypeClass != null && featureTypeClass.isAssignableFrom(typeClass)) {
+ ret.addAll(getExtensionsForId(featureTypeId));
}
}
return ret;
}
-
+ private List<IMetaDataEnabledFeatureExtension> getExtensionsForId(String featureTypeId)
+ {
+ List<IMetaDataEnabledFeatureExtension> list = featuresMap.get(featureTypeId);
+ if (list == null)
+ {
+ return Collections.emptyList();
+ }
+ return Collections.unmodifiableList(list);
+ }
}