add synchronized locks to cache methods to avoid potential cpu thrashing (FELIX-1592)


git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@814724 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/sigil/common/core/src/org/apache/felix/sigil/model/ModelElementSupport.java b/sigil/common/core/src/org/apache/felix/sigil/model/ModelElementSupport.java
index 4ea0b0c..c10aa25 100644
--- a/sigil/common/core/src/org/apache/felix/sigil/model/ModelElementSupport.java
+++ b/sigil/common/core/src/org/apache/felix/sigil/model/ModelElementSupport.java
@@ -311,7 +311,7 @@
     }
 
 
-    private static PropertyAdapter[] cachedProps( Class<? extends IModelElement> type )
+    private static synchronized PropertyAdapter[] cachedProps( Class<? extends IModelElement> type )
     {
         SoftReference<PropertyAdapter[]> ref = propertyCache.get( type );
 
@@ -391,7 +391,7 @@
     }
 
 
-    private static ChildAdapter[] loadAdapters( IModelElement target )
+    private static synchronized ChildAdapter[] loadAdapters( IModelElement target )
     {
         Class<? extends IModelElement> type = target.getClass();
         SoftReference<ChildAdapter[]> ref = adapterCache.get( type );