String[] paramTypes = new String[method.getParameterTypes().length];
SpecVar[] opParams = new SpecVar[method.getParameterNames().length];
for (int ndx = 0; ndx < paramTypes.length; ndx++) {
paramTypes[ndx] = Utilities.resolveType(contextType, Signature.toString(method.getParameterTypes()[ndx]));
opParams[ndx] = new SpecVar(method.getParameterNames()[ndx]);
}
op = new ConstructorOp(type, opParams, paramTypes);
}
else {
IType contextType = method.getDeclaringType();
String methodName = method.getElementName();
String receiverType = contextType.getFullyQualifiedName();
String returnType = Utilities.resolveType(contextType, Signature.toString(method.getReturnType()));
String[] paramTypes = new String[method.getParameterTypes().length];
SpecVar[] opParams = new SpecVar[method.getParameterNames().length];
boolean isStatic = Flags.isStatic(method.getFlags());
for (int ndx = 0; ndx < paramTypes.length; ndx++) {
paramTypes[ndx] = Utilities.resolveType(contextType, Signature.toString(method.getParameterTypes()[ndx]));
opParams[ndx] = new SpecVar(method.getParameterNames()[ndx]);
}
op = new MethodInvocationOp(methodName, receiverType, opParams, paramTypes, returnType, isStatic);
}
String owner = method.getDeclaringType().getFullyQualifiedName();
constraints.add(new Constraint(owner, op, new TruePredicate(), new TruePredicate(), new TruePredicate(), effects));