Skip to content

Commit

Permalink
Adapt code with new CF update
Browse files Browse the repository at this point in the history
  • Loading branch information
Ao-senXiong committed Jul 18, 2024
1 parent d4ca1ed commit 7043820
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
7 changes: 3 additions & 4 deletions src/checkers/inference/InferenceAnnotatedTypeFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -512,9 +512,8 @@ protected void applyInferredAnnotations(
* This is the same as the super method, but we do not want to use defaults or typeAnnotator.
*/
@Override
protected void addComputedTypeAnnotations(
Tree tree, AnnotatedTypeMirror type, boolean iUseFlow) {
assert root != null
protected void addComputedTypeAnnotations(Tree tree, AnnotatedTypeMirror type) {
assert getRoot() != null
: "GenericAnnotatedTypeFactory.annotateImplicit: "
+ " root needs to be set when used on trees; factory: "
+ this.getClass();
Expand All @@ -527,7 +526,7 @@ protected void addComputedTypeAnnotations(
// typeAnnotator.visit(type, null);
defaults.annotate(tree, type);

if (iUseFlow) {
if (getUseFlow()) {
CFValue as = getInferredValueFor(tree);
if (as != null) {
applyInferredAnnotations(type, as);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,8 @@ public void applyDefault(Default def) {
}

@Override
protected boolean shouldBeAnnotated(AnnotatedTypeMirror type, boolean applyToTypeVar) {
return super.shouldBeAnnotated(type, applyToTypeVar)
&& !type.hasAnnotation(VarAnnot.class);
protected boolean shouldBeAnnotated(AnnotatedTypeMirror type) {
return super.shouldBeAnnotated(type) && !type.hasAnnotation(VarAnnot.class);
}
}
}
5 changes: 2 additions & 3 deletions src/sparta/checkers/SimpleFlowAnnotatedTypeFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -233,11 +233,10 @@ protected void addCheckedCodeDefaults(QualifierDefaults defaults) {
}

@Override
protected void addComputedTypeAnnotations(
Tree tree, AnnotatedTypeMirror type, boolean useFlow) {
protected void addComputedTypeAnnotations(Tree tree, AnnotatedTypeMirror type) {
Element element = TreeUtils.elementFromTree(tree);
handleDefaulting(element, type);
super.addComputedTypeAnnotations(tree, type, useFlow);
super.addComputedTypeAnnotations(tree, type);
}

@Override
Expand Down

0 comments on commit 7043820

Please sign in to comment.