Author: cwiklik
Date: Tue Dec 13 19:38:38 2011
New Revision: 1213887

URL: http://svn.apache.org/viewvc?rev=1213887&view=rev
Log:
UIMA-2308 missed one method which also needs to synchronize access to 
defineCasPool(). Reformatted code in defineCasPool() method. 

Modified:
    
uima/uima-as/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/EECasManager_impl.java

Modified: 
uima/uima-as/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/EECasManager_impl.java
URL: 
http://svn.apache.org/viewvc/uima/uima-as/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/EECasManager_impl.java?rev=1213887&r1=1213886&r2=1213887&view=diff
==============================================================================
--- 
uima/uima-as/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/EECasManager_impl.java
 (original)
+++ 
uima/uima-as/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/EECasManager_impl.java
 Tue Dec 13 19:38:38 2011
@@ -44,31 +44,34 @@ public class EECasManager_impl extends C
   }
 
   public void defineCasPool(String aRequestorContextName, int aMinimumSize,
-          Properties aPerformanceTuningSettings) throws 
ResourceInitializationException {
+    Properties aPerformanceTuningSettings) throws 
ResourceInitializationException {
     if (aPerformanceTuningSettings == null) {
       aPerformanceTuningSettings = new Properties();
     }
     if (initialCasHeapSize > 0) {
-      
aPerformanceTuningSettings.setProperty(UIMAFramework.CAS_INITIAL_HEAP_SIZE, 
Integer.valueOf(
-              (int) initialCasHeapSize).toString());
+      
aPerformanceTuningSettings.setProperty(UIMAFramework.CAS_INITIAL_HEAP_SIZE, 
String.valueOf(
+              initialCasHeapSize));
+    }
+    synchronized (CasManager_impl.class) {
+      super.defineCasPool(aRequestorContextName, aMinimumSize, 
aPerformanceTuningSettings);
     }
-    super.defineCasPool(aRequestorContextName, aMinimumSize, 
aPerformanceTuningSettings);
   }
 
   @Override
   public void defineCasPool(UimaContextAdmin aRequestorContext, int 
aMinimumSize,
-          Properties aPerformanceTuningSettings) throws 
ResourceInitializationException {
-         // synchronize on class level lock for mutual exclusion between 
different instances of the object     
-         synchronized(CasManager_impl.class) {
-                 if (aPerformanceTuningSettings == null) {
-                     aPerformanceTuningSettings = new Properties();
-             }
-                 if (initialCasHeapSize > 0) {
-                     
aPerformanceTuningSettings.setProperty(UIMAFramework.CAS_INITIAL_HEAP_SIZE, 
Integer.valueOf(
-                             (int) initialCasHeapSize).toString());
-                 }
-                 super.defineCasPool(aRequestorContext, aMinimumSize, 
aPerformanceTuningSettings);
-         }
+    Properties aPerformanceTuningSettings) throws 
ResourceInitializationException {
+    // synchronize on class level lock for mutual exclusion between different 
instances of the
+    // object
+    if (aPerformanceTuningSettings == null) {
+      aPerformanceTuningSettings = new Properties();
+    }
+    if (initialCasHeapSize > 0) {
+      
aPerformanceTuningSettings.setProperty(UIMAFramework.CAS_INITIAL_HEAP_SIZE,
+              String.valueOf(initialCasHeapSize));
+    }
+    synchronized (CasManager_impl.class) {
+      super.defineCasPool(aRequestorContext, aMinimumSize, 
aPerformanceTuningSettings);
+    }
   }
 
   public void setPoolSize(String aRequestorContextName, int aSize) {


Reply via email to