From: Thomas D. <tdi...@us...> - 2004-03-24 13:09:36
|
User: tdiesler Date: 04/03/24 04:59:01 Modified: src/main/org/jboss/ejb/plugins StatefulSessionInstanceInterceptor.java Log: + fix NPE in finally clause on popInMethodFlag Revision Changes Path 1.41 +9 -8 jboss/src/main/org/jboss/ejb/plugins/StatefulSessionInstanceInterceptor.java Index: StatefulSessionInstanceInterceptor.java =================================================================== RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/StatefulSessionInstanceInterceptor.java,v retrieving revision 1.40 retrieving revision 1.41 diff -u -r1.40 -r1.41 --- StatefulSessionInstanceInterceptor.java 16 Mar 2004 22:31:39 -0000 1.40 +++ StatefulSessionInstanceInterceptor.java 24 Mar 2004 12:59:01 -0000 1.41 @@ -36,7 +36,7 @@ * @author <a href="mailto:mar...@jb...">Marc Fleury</a> * @author <a href="mailto:bi...@bu...">Bill Burke</a> * @author <a href="mailto:sco...@jb...">Scott Stark</a> - * @version $Revision: 1.40 $ + * @version $Revision: 1.41 $ * * <p><b>Revisions:</b> * <p><b>20010704 marcf</b> @@ -273,21 +273,22 @@ // Set the current security information ctx.setPrincipal(mi.getPrincipal()); - + + boolean validContext = true; try { ctx.pushInMethodFlag(EnterpriseContext.IN_BUSINESS_METHOD); // Invoke through interceptors - return getNext().invoke(mi); - + Object ret = getNext().invoke(mi); + return ret; } catch (RemoteException e) { // Discard instance cache.remove(methodID); pool.discard(ctx); - ctx = null; + validContext = false; throw e; } @@ -296,7 +297,7 @@ // Discard instance cache.remove(methodID); pool.discard(ctx); - ctx = null; + validContext = false; throw e; } @@ -305,7 +306,7 @@ // Discard instance cache.remove(methodID); pool.discard(ctx); - ctx = null; + validContext = false; throw e; } @@ -313,7 +314,7 @@ { ctx.popInMethodFlag(); - if (ctx != null) + if (validContext) { // Still a valid instance lock.sync(); // synchronized(ctx) |