if(rmdtl == null){
System.err.println("Trying to Write the Proxy Remote Method without any Details, Not Supported Currently");
return null;
}
for(Object md: rmdtl){
MethodDetails mD = (MethodDetails) md;
Type[] src = Type.getArgumentTypes(mD.desc);
Type rType = Type.getReturnType(mD.desc);
//For Remote Method
Type[] rmdesc = new Type[src.length + 2];
rmdesc[0] = Type.getType(Object.class);
rmdesc[1] = Type.getType(ControlContext.class);
System.arraycopy(src, 0, rmdesc, 2, src.length);
//For Deuce Method
Type[] drmdesc = new Type[src.length + 1];
System.arraycopy(src, 0, drmdesc, 0, src.length);
drmdesc[src.length] = Type.getType(ControlContext.class);
//Get new Exceptions
String[] exceptions;
if(mD.exceptions != null){
exceptions = new String[mD.exceptions.length + 1];
exceptions[0] = Names.RMIException;
System.arraycopy(mD.exceptions, 0, exceptions, 1, mD.exceptions.length);
}else{
String[] exceptions2 = {Names.RMIException};
exceptions = exceptions2;
}
String rdesc = Type.getMethodDescriptor(rType, rmdesc);
String ddesc = Type.getMethodDescriptor(rType, drmdesc);
MethodDetails nrmD = new MethodDetails(mD.access, mD.name, rdesc, mD.signature, exceptions,mD.accessType);
MethodDetails ndmD = new MethodDetails(mD.access, mD.name, ddesc, mD.signature, exceptions,mD.accessType);
RemoteMethodDetails nmD = new RemoteMethodDetails(nrmD, ndmD);
urmdtl.add(nmD);
}
return urmdtl;