From 7043820e6e8050279382ac0e2fed06f343694bd6 Mon Sep 17 00:00:00 2001 From: Aosen Xiong Date: Thu, 18 Jul 2024 01:45:08 -0400 Subject: [PATCH 1/3] Adapt code with new CF update --- src/checkers/inference/InferenceAnnotatedTypeFactory.java | 7 +++---- .../util/defaults/InferenceQualifierDefaults.java | 5 ++--- src/sparta/checkers/SimpleFlowAnnotatedTypeFactory.java | 5 ++--- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/checkers/inference/InferenceAnnotatedTypeFactory.java b/src/checkers/inference/InferenceAnnotatedTypeFactory.java index d2e7a975..fdfdda0b 100644 --- a/src/checkers/inference/InferenceAnnotatedTypeFactory.java +++ b/src/checkers/inference/InferenceAnnotatedTypeFactory.java @@ -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(); @@ -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); diff --git a/src/checkers/inference/util/defaults/InferenceQualifierDefaults.java b/src/checkers/inference/util/defaults/InferenceQualifierDefaults.java index 36c36067..83c5ff02 100644 --- a/src/checkers/inference/util/defaults/InferenceQualifierDefaults.java +++ b/src/checkers/inference/util/defaults/InferenceQualifierDefaults.java @@ -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); } } } diff --git a/src/sparta/checkers/SimpleFlowAnnotatedTypeFactory.java b/src/sparta/checkers/SimpleFlowAnnotatedTypeFactory.java index 3d99b856..11629ac4 100644 --- a/src/sparta/checkers/SimpleFlowAnnotatedTypeFactory.java +++ b/src/sparta/checkers/SimpleFlowAnnotatedTypeFactory.java @@ -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 From 1825b0b92c00beb35be618dd6ca4a2e1a6ef45f5 Mon Sep 17 00:00:00 2001 From: Aosen Xiong <82676488+Ao-senXiong@users.noreply.github.com> Date: Fri, 2 Aug 2024 17:02:02 -0400 Subject: [PATCH 2/3] Update setup tools and wheels for python 3.8 --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7af63409..cf6cdf4c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -50,6 +50,7 @@ jobs: - name: Install Python dependencies run: | python3 -m pip install --upgrade pip + pip install --upgrade setuptools wheel if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - name: Spotless Check if: matrix.jdk == 11 || matrix.jdk == 17 From 4f8c8b5b12e2dd70e8e3d9c3fd3d24406b32cbdb Mon Sep 17 00:00:00 2001 From: Aosen Xiong Date: Mon, 30 Sep 2024 17:04:11 -0400 Subject: [PATCH 3/3] Empty commit for CI