Skip to content

Commit

Permalink
Merge pull request #4 from xingweitian/adapt-to-cf-master
Browse files Browse the repository at this point in the history
Fix typos and unify the name of test filess.
  • Loading branch information
xingweitian authored Aug 17, 2019
2 parents fb54eb2 + cab2d60 commit 147db8d
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/main/java/pico/typecheck/PICOValidator.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ private void checkStaticReceiverDependantMutableError(AnnotatedTypeMirror type,
}
}

/**Check that implicitly immutable type has immutable or bottom type. Dataflow might refine immtable type to @Bottom,
/**Check that implicitly immutable type has immutable or bottom type. Dataflow might refine immutable type to @Bottom,
* so we accept @Bottom as a valid qualifier for implicitly immutable types*/
private void checkImplicitlyImmutableTypeError(AnnotatedTypeMirror type, Tree tree) {
if (PICOTypeUtil.isImplicitlyImmutableType(type) && !type.hasAnnotation(IMMUTABLE) && !type.hasAnnotation(BOTTOM)) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/pico/typecheck/PICOViewpointAdapter.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ protected AnnotationMirror combineAnnotationWithAnnotation(AnnotationMirror rece
} else if (AnnotationUtils.areSame(declaredAnnotation, RECEIVER_DEPENDANT_MUTABLE)) {
return receiverAnnotation;
} else {
throw new BugInCF("Unkown declared modifier: " + declaredAnnotation, new UnkownImmutabilityQualifierException());
throw new BugInCF("Unknown declared modifier: " + declaredAnnotation, new UnkownImmutabilityQualifierException());
}
}
//
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/pico/typecheck/PICOVisitor.java
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public boolean isValidUse(AnnotatedDeclaredType declarationType, AnnotatedDeclar
// if (AnnotationUtils.areSame(declared, atypeFactory.READONLY)) {
// // Special case for java.lang.Object. Usually @Readonly is never used as a bound annotation for a
// // TypeElement. But we want to have @Readonly as the default for java.lang.Object. There is no way
// // of doing this using any exsisting family of @DefaultFor qualifiers, but @ImplicitFor annotation
// // of doing this using any existing family of @DefaultFor qualifiers, but @ImplicitFor annotation
// // does the trick. But the side effect is, we can't write @ReceiverDependantMutable, which is the
// // correct bound for Object element, in jdk.astub, because otherwise it makes all java.lang.Object
// // to be @ReceiverDependantMutable; Another side effect is here @Readonly is passed into here as
Expand All @@ -101,7 +101,7 @@ public boolean isValidUse(AnnotatedDeclaredType declarationType, AnnotatedDeclar
return true;
}
// At this point, element type can only be @Mutable or @Immutable. Otherwise, it's a problem in
// PICOVisitor#processorClassTree(ClassTree)
// PICOVisitor#processClassTree(ClassTree)
assert AnnotationUtils.areSame(declared, MUTABLE) || AnnotationUtils.areSame(declared, IMMUTABLE);

AnnotationMirror used = useType.getAnnotationInHierarchy(READONLY);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
import java.util.ArrayList;
import java.util.List;

public class ImmutabilityTypecheckTests extends CheckerFrameworkPerFileTest {
public ImmutabilityTypecheckTests(File testFile) {
public class ImmutabilityTypecheckTest extends CheckerFrameworkPerFileTest {
public ImmutabilityTypecheckTest(File testFile) {
super(testFile, PICOChecker.class, "", "-Anomsgtext",
"-Anocheckjdk", "-d", "testTmp/typecheck");
}
Expand Down
4 changes: 2 additions & 2 deletions testinput/typecheck/SuperClass.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class SubClass extends SuperClass{

public static void main(String[] args) {
@Mutable SubClass victim = new @Mutable SubClass();
victim.maliciouslyModifyDate();;
victim.maliciouslyModifyDate();
}
}

Expand All @@ -39,6 +39,6 @@ class AnotherSubClass extends SuperClass{

public static void main(String[] args) {
@Mutable SubClass victim = new @Mutable SubClass();
victim.maliciouslyModifyDate();;
victim.maliciouslyModifyDate();
}
}

0 comments on commit 147db8d

Please sign in to comment.