Commits

Anonymous committed ac87374

XW-560 ThreadLocal problem in ContainerImpl
o applied patch by Adam Crume

git-svn-id: http://svn.opensymphony.com/svn/xwork/trunk@1803e221344d-f017-0410-9bd5-d282ab1896d7

Comments (0)

Files changed (1)

src/java/com/opensymphony/xwork2/inject/ContainerImpl.java

 
   ThreadLocal<Object[]> localContext =
       new ThreadLocal<Object[]>() {
-        protected InternalContext[] initialValue() {
-          return new InternalContext[1];
+        protected Object[] initialValue() {
+          return new Object[1];
         }
       };
 
    * necessary.
    */
   <T> T callInContext(ContextualCallable<T> callable) {
-    InternalContext[] reference = (InternalContext[])localContext.get();
+    Object[] reference = localContext.get();
     if (reference[0] == null) {
       reference[0] = new InternalContext(this);
       try {
-        return callable.call(reference[0]);
+        return callable.call((InternalContext)reference[0]);
       } finally {
         // Only remove the context if this call created it.
         reference[0] = null;
       }
     } else {
       // Someone else will clean up this context.
-      return callable.call(reference[0]);
+      return callable.call((InternalContext)reference[0]);
     }
   }