Program: 28249
Project: 28249
Buggy source:
protected void postInvoke(EjbInvocation inv,boolean doTxProcessing){
  if (containerState != CONTAINER_STARTED) {
    throw new EJBException(localStrings.getLocalString("String_Node_Str","String_Node_Str",containerStateToString(containerState)));
  }
  inv.setDoTxProcessingInPostInvoke(doTxProcessing);
  if (inv.mustInvokeAsynchronously()) {
    EjbAsyncInvocationManager asyncManager=((EjbContainerUtilImpl)ejbContainerUtilImpl).getEjbAsyncInvocationManager();
    asyncManager.submit(inv);
    return;
  }
  if (inv.ejb != null) {
    if (!inv.useFastPath) {
      invocationManager.postInvoke(inv);
      delistExtendedEntityManagers(inv.context);
    }
 else {
      doTxProcessing=doTxProcessing && (inv.exception != null);
    }
    try {
      if (doTxProcessing) {
        postInvokeTx(inv);
      }
    }
 catch (    Exception ex) {
      _logger.log(Level.FINE,"String_Node_Str",ex);
      if (ex instanceof EJBException)       inv.exception=(EJBException)ex;
 else       inv.exception=new EJBException(ex);
    }
    releaseContext(inv);
  }
  if (inv.exception != null) {
    if (inv.exception instanceof PreInvokeException) {
      inv.exception=((PreInvokeException)inv.exception).exception;
    }
    if (isSystemUncheckedException(inv.exception)) {
      _logger.log(Level.WARNING,"String_Node_Str",new Object[]{ejbDescriptor.getName(),inv.beanMethod});
      _logger.log(Level.WARNING,"String_Node_Str",inv.exception);
    }
 else {
      _logger.log(Level.FINE,"String_Node_Str",new Object[]{ejbDescriptor.getName(),inv.beanMethod});
      _logger.log(Level.FINE,"String_Node_Str",inv.exception);
    }
    if (inv.isRemote) {
      if (protocolMgr != null) {
        inv.exception=mapRemoteException(inv);
      }
      _logger.log(Level.FINE,"String_Node_Str",inv.exception);
    }
 else {
      if (inv.isBusinessInterface) {
        inv.exception=mapLocal3xException(inv.exception);
      }
    }
  }
  if (_logger.isLoggable(Level.FINE)) {
    _logger.log(Level.FINE,"String_Node_Str" + inv);
  }
}

Fixed version (ground truth):
protected void postInvoke(EjbInvocation inv,boolean doTxProcessing){
  if (containerState != CONTAINER_STARTED) {
    throw new EJBException(localStrings.getLocalString("String_Node_Str","String_Node_Str",containerStateToString(containerState)));
  }
  inv.setDoTxProcessingInPostInvoke(doTxProcessing);
  if (inv.mustInvokeAsynchronously()) {
    EjbAsyncInvocationManager asyncManager=((EjbContainerUtilImpl)ejbContainerUtilImpl).getEjbAsyncInvocationManager();
    asyncManager.submit(inv);
    return;
  }
  if (inv.ejb != null) {
    if (!inv.useFastPath) {
      invocationManager.postInvoke(inv);
      delistExtendedEntityManagers(inv.context);
    }
 else {
      doTxProcessing=doTxProcessing && (inv.exception != null);
    }
    try {
      if (doTxProcessing) {
        postInvokeTx(inv);
      }
    }
 catch (    Exception ex) {
      _logger.log(Level.FINE,"String_Node_Str",ex);
      if (ex instanceof EJBException)       inv.exception=(EJBException)ex;
 else       inv.exception=new EJBException(ex);
    }
    releaseContext(inv);
  }
  if (inv.exception != null) {
    if (inv.exception instanceof PreInvokeException) {
      inv.exception=((PreInvokeException)inv.exception).exception;
    }
    if (isSystemUncheckedException(inv.exception)) {
      _logger.log(Level.WARNING,SYSTEM_EXCEPTION,new Object[]{ejbDescriptor.getName(),inv.beanMethod});
      _logger.log(Level.WARNING,"String_Node_Str",inv.exception);
    }
 else {
      _logger.log(Level.FINE,"String_Node_Str",new Object[]{ejbDescriptor.getName(),inv.beanMethod});
      _logger.log(Level.FINE,"String_Node_Str",inv.exception);
    }
    if (inv.isRemote) {
      if (protocolMgr != null) {
        inv.exception=mapRemoteException(inv);
      }
      _logger.log(Level.FINE,"String_Node_Str",inv.exception);
    }
 else {
      if (inv.isBusinessInterface) {
        inv.exception=mapLocal3xException(inv.exception);
      }
    }
  }
  if (_logger.isLoggable(Level.FINE)) {
    _logger.log(Level.FINE,"String_Node_Str" + inv);
  }
}