Skip to content

Commit

Permalink
some cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
LoiNguyenCS committed Nov 19, 2023
1 parent 0c4b7af commit 7666b1b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,8 @@ public Visitable visit(Parameter para, Void p) {
if (insideTargetMethod) {
ResolvedType paraType = para.resolve().getType();
if (paraType.isReferenceType()) {
String paraName = paraType.asReferenceType().getTypeDeclaration().get().getQualifiedName();
usedClass.add(paraName);
String paraTypeFullName = paraType.asReferenceType().getTypeDeclaration().get().getQualifiedName();
usedClass.add(paraTypeFullName);
for (ResolvedType typeVariable : paraType.asReferenceType().typeParametersValues()) {
String typeVariableFullName = typeVariable.describe();
if (typeVariableFullName.contains("<")) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,6 @@ public Visitable visit(ObjectCreationExpr newExpr, Void p) {
UnsolvedClass newClass = new UnsolvedClass(type, classAndPackageMap.get(type));
newClass.addMethod(creationMethod);
this.updateMissingClass(newClass);
System.out.println("I was called by 00000");
} else {
throw new RuntimeException("Unexpected class: " + type);
}
Expand Down Expand Up @@ -818,7 +817,6 @@ public void updateUnsolvedClassWithMethod(
UnsolvedClass returnTypeForThisMethod =
new UnsolvedClass(returnType, missingClass.getPackageName());
this.updateMissingClass(returnTypeForThisMethod);
System.out.println("I was called by 2114124");
classAndPackageMap.put(
returnTypeForThisMethod.getClassName(), returnTypeForThisMethod.getPackageName());
}
Expand Down Expand Up @@ -878,7 +876,6 @@ public void updateClassesFromJarSourcesForMethodCall(MethodCallExpr expr) {
UnsolvedMethod thisMethod = new UnsolvedMethod(methodName, returnType, argumentsList);
missingClass.addMethod(thisMethod);
syntheticMethodAndClass.put(methodName, missingClass);
System.out.println("I was called by update class from Jar Sources");
this.updateMissingClass(missingClass);
}

Expand Down Expand Up @@ -1008,7 +1005,6 @@ public void updateUnsolvedClassWithFields(
setInitialValueForVariableDeclaration(variableType, variableType + " " + var));
updateMissingClass(relatedClass);
updateMissingClass(varType);
System.out.println("I was called by updateUnsolvdClassWithFields");
}
}

Expand Down Expand Up @@ -1270,7 +1266,6 @@ public void deleteOldSyntheticClass(UnsolvedClass missedClass) {
String filePathStr =
this.rootDirectory + classDirectory + "/" + missedClass.getClassName() + ".java";
Path filePath = Path.of(filePathStr);
System.out.println("Deleted file: " + filePath);
try {
Files.delete(filePath);
} catch (IOException e) {
Expand Down Expand Up @@ -1310,7 +1305,6 @@ public void createMissingClass(UnsolvedClass missedClass) {
try (BufferedWriter writer =
new BufferedWriter(new FileWriter(filePath.toFile(), StandardCharsets.UTF_8))) {
writer.write(fileContent.toString());
System.out.println(fileContent);
} catch (Exception e) {
throw new Error(e.getMessage());
}
Expand Down Expand Up @@ -1489,7 +1483,6 @@ public void updateClassSetWithQualifiedStaticMethodCall(
syntheticReturnTypes.add(returnTypeFullName);
this.updateMissingClass(returnClass);
this.updateMissingClass(classThatContainMethod);
System.out.println("I was called by adasdada");
}

/**
Expand Down Expand Up @@ -1523,7 +1516,6 @@ public void updateTypes(
else {
for (UnsolvedClass unsolClass : missingClass) {
for (String parentClass : classAndItsParent.values()) {
System.out.println(unsolClass.getClassName());
if (unsolClass.getClassName().equals(parentClass)) {
unsolClass.updateFieldByType(incorrectType, typeToCorrect.get(incorrectType));
this.deleteOldSyntheticClass(unsolClass);
Expand Down

0 comments on commit 7666b1b

Please sign in to comment.