Program: 29105
Project: 29105
Buggy source:
public Object invoke(Object proxy,Method method,Object[] args) throws Throwable {
  if (method.getDeclaringClass() == java.lang.Object.class) {
    return invokeJavaObjectMethod(this,method,args);
  }
  int methodType=getMethodType(method);
  checkUnsupportedMethods(methodType);
  Object returnValue=null;
  try {
    Object serviceToInvoke=serviceDelegate;
    Method methodToInvoke=method;
    int methodTypeToInvoke=methodType;
    Object[] argsForInvoke=args;
switch (methodType) {
case GET_PORT_CONTAINER_MANAGED:
      Class serviceEndpointInterfaceClass=(Class)args[0];
    String serviceEndpointInterface=serviceEndpointInterfaceClass.getName();
  ServiceRefPortInfo portInfo=serviceRef.getPortInfo(serviceEndpointInterface);
if ((portInfo != null) && portInfo.hasWsdlPort()) {
  methodToInvoke=getClientManagedPortMethod;
  methodTypeToInvoke=GET_PORT_CLIENT_MANAGED;
  argsForInvoke=new Object[]{portInfo.getWsdlPort(),args[0]};
}
 else {
}
break;
case GET_WSDL_LOCATION:
return wsdlLocation;
case CREATE_CALL_PORT:
case CREATE_CALL_OPERATION_QNAME:
case CREATE_CALL_OPERATION_STRING:
case GET_CALLS:
case GET_PORTS:
serviceToInvoke=getConfiguredServiceDelegate();
break;
}
returnValue=methodToInvoke.invoke(serviceToInvoke,argsForInvoke);
if (returnValue instanceof Stub) {
Stub stub=(Stub)returnValue;
setStubProperties(stub,methodTypeToInvoke,methodToInvoke,argsForInvoke);
}
 else if (returnValue instanceof Call) {
Call[] calls=new Call[1];
calls[0]=(Call)returnValue;
setCallProperties(calls,methodTypeToInvoke,argsForInvoke);
}
 else if (methodType == GET_CALLS) {
Call[] calls=(Call[])returnValue;
setCallProperties(calls,methodTypeToInvoke,argsForInvoke);
}
}
 catch (InvocationTargetException ite) {
throw ite.getCause();
}
return returnValue;
}

Fixed version (ground truth):
public Object invoke(Object proxy,Method method,Object[] args) throws Throwable {
  if (method.getDeclaringClass() == java.lang.Object.class) {
    return invokeJavaObjectMethod(this,method,args);
  }
  int methodType=getMethodType(method);
  checkUnsupportedMethods(methodType);
  Object returnValue=null;
  try {
    Object serviceToInvoke=serviceDelegate;
    Method methodToInvoke=method;
    int methodTypeToInvoke=methodType;
    Object[] argsForInvoke=args;
switch (methodType) {
case GET_PORT_CONTAINER_MANAGED:
      Class serviceEndpointInterfaceClass=(Class)args[0];
    String serviceEndpointInterface=serviceEndpointInterfaceClass.getName();
  ServiceRefPortInfo portInfo=serviceRef.getPortInfo(serviceEndpointInterface);
if ((portInfo != null) && portInfo.hasWsdlPort()) {
  methodToInvoke=getClientManagedPortMethod;
  methodTypeToInvoke=GET_PORT_CLIENT_MANAGED;
  argsForInvoke=new Object[]{portInfo.getWsdlPort(),args[0]};
}
 else {
}
break;
case GET_WSDL_LOCATION:
return wsdlLocation;
case CREATE_CALL_PORT:
case CREATE_CALL_OPERATION_QNAME:
case CREATE_CALL_OPERATION_STRING:
case GET_CALLS:
case GET_PORTS:
serviceToInvoke=getConfiguredServiceDelegate();
break;
default :
break;
}
returnValue=methodToInvoke.invoke(serviceToInvoke,argsForInvoke);
if (returnValue instanceof Stub) {
Stub stub=(Stub)returnValue;
setStubProperties(stub,methodTypeToInvoke,methodToInvoke,argsForInvoke);
}
 else if (returnValue instanceof Call) {
Call[] calls=new Call[1];
calls[0]=(Call)returnValue;
setCallProperties(calls,methodTypeToInvoke,argsForInvoke);
}
 else if (methodType == GET_CALLS) {
Call[] calls=(Call[])returnValue;
setCallProperties(calls,methodTypeToInvoke,argsForInvoke);
}
}
 catch (InvocationTargetException ite) {
throw ite.getCause();
}
return returnValue;
}