Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to latest EISOP #429

Closed
wants to merge 16 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .ci-build-without-test.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/bin/bash

echo Entering "$(cd "$(dirname "$0")" && pwd -P)/$(basename "$0")" in `pwd`

# Fail the whole script if any command fails
Expand Down
2 changes: 1 addition & 1 deletion scripts/inference-dev
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ libDir="$cfiDir"/lib
CFBuild="${cfDir}"/dataflow/"${classes}":"${cfDir}"/javacutil/"${classes}":"${cfDir}"/framework/"${classes}":"${cfDir}"/framework/"${resources}"
CFBuild="${CFBuild}":"${cfDir}"/checker/"${classes}":"${cfDir}"/checker/"${resources}":"${annoToolsDir}"/scene-lib/bin

CFDepJars="${stubparserDir}"/javaparser-core/target/stubparser-3.24.7.jar:"${afuDir}"/annotation-file-utilities-all.jar
CFDepJars="${stubparserDir}"/javaparser-core/target/stubparser-3.25.5.jar:"${afuDir}"/annotation-file-utilities-all.jar

# sanity check: ensure each jar in CFDepJars actually exists in the file system
# total number of jars
Expand Down
3 changes: 2 additions & 1 deletion src/checkers/inference/DefaultSlotManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import org.checkerframework.framework.type.AnnotatedTypeFactory;
import org.checkerframework.framework.type.AnnotatedTypeMirror;
import org.checkerframework.javacutil.AnnotationBuilder;
import org.checkerframework.javacutil.AnnotationMirrorMap;
import org.checkerframework.javacutil.AnnotationUtils;
import org.checkerframework.javacutil.BugInCF;
import org.checkerframework.javacutil.TreeUtils;
Expand Down Expand Up @@ -164,7 +165,7 @@ public DefaultSlotManager( final ProcessingEnvironment processingEnvironment,
this.varAnnot = builder.build();

// Construct empty caches
constantCache = AnnotationUtils.createAnnotationMap();
constantCache = new AnnotationMirrorMap<>();
locationCache = new LinkedHashMap<>();
existentialSlotPairCache = new LinkedHashMap<>();
combSlotPairCache = new LinkedHashMap<>();
Expand Down
13 changes: 6 additions & 7 deletions src/checkers/inference/InferenceAnnotatedTypeFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import org.checkerframework.framework.type.typeannotator.TypeAnnotator;
import org.checkerframework.framework.type.visitor.AnnotatedTypeScanner;
import org.checkerframework.framework.util.AnnotatedTypes;
import org.checkerframework.framework.util.AnnotationMirrorSet;
import org.checkerframework.javacutil.AnnotationMirrorSet;
import org.checkerframework.framework.util.defaults.QualifierDefaults;
import org.checkerframework.framework.util.dependenttypes.DependentTypesHelper;
import org.checkerframework.javacutil.AnnotationBuilder;
Expand Down Expand Up @@ -277,7 +277,7 @@ protected void postDirectSuperTypes(AnnotatedTypeMirror type, List<? extends Ann
// we cannot call super.postDirectSuperTypes because GenericAnnotatedTypeFactory will cause
// annotateImplicit(element,type) to be called on the supertype which will overwrite the annotations from type
// with those for the declaration of the super type
Set<AnnotationMirror> annotations = type.getEffectiveAnnotations();
AnnotationMirrorSet annotations = type.getEffectiveAnnotations();
for (AnnotatedTypeMirror supertype : supertypes) {
if (!annotations.equals(supertype.getEffectiveAnnotations())) {
supertype.clearAnnotations();
Expand Down Expand Up @@ -569,12 +569,11 @@ protected InferenceViewpointAdapter createViewpointAdapter() {
* @param type a type
* @return the singleton set with the {@link VarAnnot} on the class bound
*/
@Override
public Set<AnnotationMirror> getTypeDeclarationBounds(TypeMirror type) {
public AnnotationMirrorSet getTypeDeclarationBounds(TypeMirror type) {
final TypeElement elt = (TypeElement) getProcessingEnv().getTypeUtils().asElement(type);
AnnotationMirror vAnno = variableAnnotator.getClassDeclVarAnnot(elt);
if (vAnno != null) {
return Collections.singleton(vAnno);
return new AnnotationMirrorSet(Collections.singleton(vAnno));
}

// This is to handle the special case of anonymous classes when the super class (or interface)
Expand All @@ -587,11 +586,11 @@ public Set<AnnotationMirror> getTypeDeclarationBounds(TypeMirror type) {
if (realAnno != null) {
Slot slot = slotManager.getSlot(realAnno);
vAnno = slotManager.getAnnotation(slot);
return Collections.singleton(vAnno);
return new AnnotationMirrorSet(Collections.singleton(vAnno));
}

// If the declaration bound of the underlying type is not cached, use default
return (Set<AnnotationMirror>) getDefaultTypeDeclarationBounds();
return (AnnotationMirrorSet) getDefaultTypeDeclarationBounds();
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/checkers/inference/InferenceQualifierHierarchy.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import org.checkerframework.checker.nullness.qual.Nullable;
import org.checkerframework.framework.type.ElementQualifierHierarchy;
import org.checkerframework.framework.type.QualifierHierarchy;
import org.checkerframework.framework.util.AnnotationMirrorSet;
import org.checkerframework.javacutil.AnnotationMirrorSet;
import org.checkerframework.framework.util.DefaultQualifierKindHierarchy;
import org.checkerframework.framework.util.QualifierKind;
import org.checkerframework.framework.util.QualifierKindHierarchy;
Expand Down Expand Up @@ -196,7 +196,7 @@ public Set<? extends AnnotationMirror> leastUpperBounds(
Collection<? extends AnnotationMirror> annos1,
Collection<? extends AnnotationMirror> annos2) {
if (InferenceMain.isHackMode(annos1.size() != annos2.size())) {
Set<AnnotationMirror> result = AnnotationUtils.createAnnotationSet();
Set<AnnotationMirror> result = new AnnotationMirrorSet();
for (AnnotationMirror a1 : annos1) {
for (AnnotationMirror a2 : annos2) {
AnnotationMirror lub = leastUpperBound(a1, a2);
Expand Down
Loading
Loading