SafeList<Field> sFields = null;
// pega o nome da classe que contem o metodo para usar no qualified this
Sig classSig = getSig("Class");
SafeList<Field> classFields = classSig.getFields();
Field classIdRelations = getField("id", classFields);
Map<String, List<String>> classIdRel = getRelations(classIdRelations);
//debug
// System.out.println("Body id: " + bodyId);
if (isInstanceOfType(bodyId, "MethodInvocation")) {
s = getSig("MethodInvocation");
sFields = s.getFields();
Field idRelations = getField("id", sFields);
String methodId = getFieldInstance(idRelations, bodyId);
Field qualRelations = getField("q", sFields);
String qualifier = getFieldInstance(qualRelations, bodyId);
String className = classIdRel.get(classId).get(0);
return getMethodInvocationExpression(methodId, qualifier, className);
} else if (isInstanceOfType(bodyId, "ConstructorMethodInvocation")) {
s = getSig("ConstructorMethodInvocation");
sFields = s.getFields();
Field idRelations = getField("idMethod", sFields);
String methodId = getFieldInstance(idRelations, bodyId);
Field idClassRelations = getField("idClass", sFields);
String className = getFieldInstance(idClassRelations, bodyId);
return getConstructorMethodInvocationExpression(methodId, className);
} else if (isInstanceOfType(bodyId, "FieldInvocation")) {
s = getSig("FieldInvocation");
sFields = s.getFields();
Field idRelations = getField("id", sFields);
String fieldId = getFieldInstance(idRelations, bodyId);
Field qualRelations = getField("q", sFields);
String qualifier = getFieldInstance(qualRelations, bodyId);
String className = classIdRel.get(classId).get(0);
return getFieldInvocationExpression(fieldId, qualifier, className);
} else if (isInstanceOfType(bodyId, "ConstructorFieldInvocation")) {
s = getSig("ConstructorFieldInvocation");
sFields = s.getFields();
Field idRelations = getField("idField", sFields);
String fieldId = getFieldInstance(idRelations, bodyId);
Field idClassRelations = getField("idClass", sFields);
String className = getFieldInstance(idClassRelations, bodyId);
return getConstructorFieldInvocationExpression(fieldId, className);
} else {
// System.out.println(bodyId);
// Random generator = new Random();