diff --git a/src/main/java/edu/ucr/cs/riple/taint/ucrtainting/serialization/location/AbstractSymbolLocation.java b/src/main/java/edu/ucr/cs/riple/taint/ucrtainting/serialization/location/AbstractSymbolLocation.java index 094b89a1..912139d8 100644 --- a/src/main/java/edu/ucr/cs/riple/taint/ucrtainting/serialization/location/AbstractSymbolLocation.java +++ b/src/main/java/edu/ucr/cs/riple/taint/ucrtainting/serialization/location/AbstractSymbolLocation.java @@ -115,4 +115,8 @@ public Path path() { public Set getTypeIndexSet() { return typeIndexSet; } + + public boolean isTopLevel() { + return typeIndexSet.size() == 1 && typeIndexSet.contains(TypeIndex.TOP_LEVEL); + } } diff --git a/src/main/java/edu/ucr/cs/riple/taint/ucrtainting/serialization/visitors/GenericMethodFixVisitor.java b/src/main/java/edu/ucr/cs/riple/taint/ucrtainting/serialization/visitors/GenericMethodFixVisitor.java index d9908ad0..2d5ed745 100644 --- a/src/main/java/edu/ucr/cs/riple/taint/ucrtainting/serialization/visitors/GenericMethodFixVisitor.java +++ b/src/main/java/edu/ucr/cs/riple/taint/ucrtainting/serialization/visitors/GenericMethodFixVisitor.java @@ -273,7 +273,7 @@ public static Set 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(); } diff --git a/src/main/java/edu/ucr/cs/riple/taint/ucrtainting/serialization/visitors/SpecializedFixComputer.java b/src/main/java/edu/ucr/cs/riple/taint/ucrtainting/serialization/visitors/SpecializedFixComputer.java index f8903234..aa0f4a48 100644 --- a/src/main/java/edu/ucr/cs/riple/taint/ucrtainting/serialization/visitors/SpecializedFixComputer.java +++ b/src/main/java/edu/ucr/cs/riple/taint/ucrtainting/serialization/visitors/SpecializedFixComputer.java @@ -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); }