Skip to content

Commit

Permalink
Fix crash by remove initialized from the holder
Browse files Browse the repository at this point in the history
  • Loading branch information
Ao-senXiong committed May 1, 2024
1 parent 751052b commit e052dfe
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 7 deletions.
2 changes: 0 additions & 2 deletions src/main/java/pico/typecheck/PICOAnnotationMirrorHolder.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ public class PICOAnnotationMirrorHolder {
public static AnnotationMirror RECEIVER_DEPENDANT_MUTABLE;
public static AnnotationMirror IMMUTABLE;
public static AnnotationMirror BOTTOM;
public static AnnotationMirror COMMITED;

public static void init(SourceChecker checker) {
Elements elements = checker.getElementUtils();
Expand All @@ -35,6 +34,5 @@ public static void init(SourceChecker checker) {
IMMUTABLE = AnnotationBuilder.fromClass(elements, Immutable.class);
BOTTOM = AnnotationBuilder.fromClass(elements, Bottom.class);

COMMITED = AnnotationBuilder.fromClass(elements, Initialized.class);
}
}
3 changes: 0 additions & 3 deletions src/main/java/pico/typecheck/PICONoInitVisitor.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package pico.typecheck;

import static pico.typecheck.PICOAnnotationMirrorHolder.BOTTOM;
import static pico.typecheck.PICOAnnotationMirrorHolder.COMMITED;
import static pico.typecheck.PICOAnnotationMirrorHolder.IMMUTABLE;
import static pico.typecheck.PICOAnnotationMirrorHolder.MUTABLE;
import static pico.typecheck.PICOAnnotationMirrorHolder.POLY_MUTABLE;
Expand Down Expand Up @@ -573,15 +572,13 @@ private void saveFbcViolatedMethods(
protected AnnotationMirrorSet getExceptionParameterLowerBoundAnnotations() {
AnnotationMirrorSet result = new AnnotationMirrorSet();
result.add(atypeFactory.getQualifierHierarchy().getBottomAnnotation(BOTTOM));
result.add(COMMITED);
return result;
}

@Override
protected AnnotationMirrorSet getThrowUpperBoundAnnotations() {
AnnotationMirrorSet result = new AnnotationMirrorSet();
result.add(atypeFactory.getQualifierHierarchy().getTopAnnotation(READONLY));
result.add(COMMITED);
return result;
}

Expand Down
1 change: 0 additions & 1 deletion testinput/inference/inferrable/OverrideEquals.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import qual.Mutable;
import qual.Readonly;
// @skip-test crash bug

// Copied from typechecking side testcase. AFU bug causes @Immutable is not inserted
// back to class A's declaration position, but it is inferred as result - @Immutable.
Expand Down
1 change: 1 addition & 0 deletions testinput/typecheck/DateCell.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
package typecheck;
// @skip-test wait for discussion

import java.util.Date;

Expand Down
1 change: 0 additions & 1 deletion testinput/typecheck/RGB.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import qual.Mutable;
import qual.Readonly;
import qual.ReceiverDependantMutable;
// @skip-test crash bug

// Inspire by: https://docs.oracle.com/javase/tutorial/essential/concurrency/imstrat.html
// Allow both mutable and immutable instance creation
Expand Down

0 comments on commit e052dfe

Please sign in to comment.