Program: 28962
Project: 28962
Buggy source:
Object invoke(Class clientInterface,Method method,Object[] args) throws Throwable {
  ClassLoader originalClassLoader=null;
  try {
    container.onEnteringContainer();
    if (Thread.currentThread().getContextClassLoader() != getContainer().getClassLoader()) {
      originalClassLoader=Utility.setContextClassLoader(getContainer().getClassLoader());
    }
    Class methodClass=method.getDeclaringClass();
    if (methodClass == java.lang.Object.class) {
      return InvocationHandlerUtil.invokeJavaObjectMethod(this,method,args);
    }
    InvocationInfo invInfo=(InvocationInfo)invocationInfoMap_.get(method,((args != null) ? args.length : 0));
    if (invInfo == null) {
      throw new RemoteException("String_Node_Str" + method);
    }
    if ((methodClass == javax.ejb.EJBObject.class) || invInfo.ejbIntfOverride) {
      return invokeEJBObjectMethod(method.getName(),args);
    }
 else     if (invInfo.targetMethod1 == null) {
      Object[] params=new Object[]{invInfo.ejbName,"String_Node_Str",invInfo.method.toString()};
      String errorMsg=localStrings.getLocalString("String_Node_Str","String_Node_Str",params);
      _logger.log(Level.SEVERE,"String_Node_Str",params);
      throw new RemoteException(errorMsg);
    }
    Object returnValue=null;
    EjbInvocation inv=container.createEjbInvocation();
    inv.isRemote=true;
    inv.isHome=false;
    inv.isBusinessInterface=!isRemoteHomeView();
    inv.ejbObject=this;
    inv.method=method;
    inv.clientInterface=clientInterface;
    inv.transactionAttribute=invInfo.txAttr;
    inv.securityPermissions=invInfo.securityPermissions;
    inv.invocationInfo=invInfo;
    inv.beanMethod=invInfo.targetMethod1;
    inv.methodParams=args;
    try {
      container.preInvoke(inv);
      returnValue=container.intercept(inv);
    }
 catch (    InvocationTargetException ite) {
      inv.exception=ite.getCause();
      inv.exceptionFromBeanMethod=inv.exception;
    }
catch (    Throwable t) {
      inv.exception=t;
    }
 finally {
      container.postInvoke(inv);
      if (container.getSecurityManager() != null) {
        container.getSecurityManager().resetPolicyContext();
      }
    }
    if (inv.exception != null) {
      InvocationHandlerUtil.throwRemoteException(inv.exception,method.getExceptionTypes());
    }
    return returnValue;
  }
  finally {
    if (originalClassLoader != null) {
      Utility.setContextClassLoader(originalClassLoader);
    }
    container.onLeavingContainer();
  }
}

Fixed version (ground truth):
Object invoke(Class clientInterface,Method method,Object[] args) throws Throwable {
  ClassLoader originalClassLoader=null;
  try {
    container.onEnteringContainer();
    if (Thread.currentThread().getContextClassLoader() != getContainer().getClassLoader()) {
      originalClassLoader=Utility.setContextClassLoader(getContainer().getClassLoader());
    }
    Class methodClass=method.getDeclaringClass();
    if (methodClass == java.lang.Object.class) {
      return InvocationHandlerUtil.invokeJavaObjectMethod(this,method,args);
    }
    InvocationInfo invInfo=(InvocationInfo)invocationInfoMap_.get(method,((args != null) ? args.length : 0));
    if (invInfo == null) {
      throw new RemoteException("String_Node_Str" + method);
    }
    if ((methodClass == javax.ejb.EJBObject.class) || invInfo.ejbIntfOverride) {
      return invokeEJBObjectMethod(method.getName(),args);
    }
 else     if (invInfo.targetMethod1 == null) {
      Object[] params=new Object[]{invInfo.ejbName,"String_Node_Str",invInfo.method.toString()};
      String errorMsg=localStrings.getLocalString("String_Node_Str","String_Node_Str",params);
      _logger.log(Level.SEVERE,"String_Node_Str",params);
      throw new RemoteException(errorMsg);
    }
    Object returnValue=null;
    EjbInvocation inv=container.createEjbInvocation();
    inv.isRemote=true;
    inv.isHome=false;
    inv.isBusinessInterface=!isRemoteHomeView();
    inv.ejbObject=this;
    inv.method=method;
    inv.clientInterface=clientInterface;
    inv.transactionAttribute=invInfo.txAttr;
    inv.invocationInfo=invInfo;
    inv.beanMethod=invInfo.targetMethod1;
    inv.methodParams=args;
    try {
      container.preInvoke(inv);
      returnValue=container.intercept(inv);
    }
 catch (    InvocationTargetException ite) {
      inv.exception=ite.getCause();
      inv.exceptionFromBeanMethod=inv.exception;
    }
catch (    Throwable t) {
      inv.exception=t;
    }
 finally {
      container.postInvoke(inv);
      if (container.getSecurityManager() != null) {
        container.getSecurityManager().resetPolicyContext();
      }
    }
    if (inv.exception != null) {
      InvocationHandlerUtil.throwRemoteException(inv.exception,method.getExceptionTypes());
    }
    return returnValue;
  }
  finally {
    if (originalClassLoader != null) {
      Utility.setContextClassLoader(originalClassLoader);
    }
    container.onLeavingContainer();
  }
}