Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
nimakarimipour committed Jul 23, 2024
1 parent d976a84 commit 1ed436c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,8 @@ public Path path() {
public Set<TypeIndex> getTypeIndexSet() {
return typeIndexSet;
}

public boolean isTopLevel() {
return typeIndexSet.size() == 1 && typeIndexSet.contains(TypeIndex.TOP_LEVEL);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ public static Set<Fix> computeFixesOnClassDeclarationForRawType(
classDeclarationLocation.setTypeIndexSet(TypeIndex.setOf(index + 1, 0));
Serializer.log(
"CLASS DECLARATION TYPE INDEX: " + classDeclarationLocation.getTypeIndexSet());
if (classDeclarationLocation.getTypeIndexSet().equals(TypeIndex.TOP_LEVEL)) {
if (classDeclarationLocation.getTypeIndexSet().equals(TypeIndex.setOf(TypeIndex.TOP_LEVEL))) {
Serializer.log("ENTERED HERE: " + TypeIndex.TOP_LEVEL);
return Set.of();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,9 @@ public Fix buildFixForElement(Element element, FoundRequired pair) {
Serializer.log(
"CONDITION: "
+ (classDeclarationLocation.getTypeIndexSet().isEmpty()
|| classDeclarationLocation.getTypeIndexSet().equals(TypeIndex.TOP_LEVEL)));
|| classDeclarationLocation.getTypeIndexSet().equals(TypeIndex.setOf(TypeIndex.TOP_LEVEL))));
return classDeclarationLocation.getTypeIndexSet().isEmpty()
|| classDeclarationLocation.getTypeIndexSet().equals(TypeIndex.TOP_LEVEL)
|| classDeclarationLocation.getTypeIndexSet().equals(TypeIndex.setOf(TypeIndex.TOP_LEVEL))
? null
: new Fix(classDeclarationLocation);
}
Expand Down

0 comments on commit 1ed436c

Please sign in to comment.