From b81bf4443245d927d80d6d534b493765679594b1 Mon Sep 17 00:00:00 2001 From: cushon Date: Wed, 12 Feb 2020 12:08:30 -0800 Subject: [PATCH] Use the shaded CF dataflow jar Fixes https://github.com/google/error-prone/pull/1499 GOOGLE: ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=294723271 --- check_api/pom.xml | 2 +- .../BaseErrorProneJavaCompiler.java | 19 --- .../google/errorprone/MaskedClassLoader.java | 2 +- .../errorprone/dataflow/AccessPath.java | 12 +- .../errorprone/dataflow/AccessPathStore.java | 10 +- .../dataflow/ConstantPropagationAnalysis.java | 4 +- .../google/errorprone/dataflow/DataFlow.java | 19 ++- .../errorprone/dataflow/LocalStore.java | 20 +-- .../dataflow/LocalVariableValues.java | 2 +- .../AbstractNullnessPropagationTransfer.java | 152 +++++++++--------- .../nullnesspropagation/Nullness.java | 2 +- .../NullnessPropagationTransfer.java | 40 ++--- .../TrustingNullnessAnalysis.java | 8 +- core/pom.xml | 2 +- pom.xml | 2 +- test_helpers/pom.xml | 2 +- 16 files changed, 139 insertions(+), 159 deletions(-) diff --git a/check_api/pom.xml b/check_api/pom.xml index 323bdb33d64..e1bc5df2948 100644 --- a/check_api/pom.xml +++ b/check_api/pom.xml @@ -62,7 +62,7 @@ org.checkerframework - dataflow + dataflow-shaded ${dataflow.version} diff --git a/check_api/src/main/java/com/google/errorprone/BaseErrorProneJavaCompiler.java b/check_api/src/main/java/com/google/errorprone/BaseErrorProneJavaCompiler.java index 57d8ab57f40..6dbb754fbb9 100644 --- a/check_api/src/main/java/com/google/errorprone/BaseErrorProneJavaCompiler.java +++ b/check_api/src/main/java/com/google/errorprone/BaseErrorProneJavaCompiler.java @@ -49,7 +49,6 @@ import javax.tools.JavaFileManager; import javax.tools.JavaFileObject; import javax.tools.StandardJavaFileManager; -import org.checkerframework.javacutil.AnnotationUtils; /** An Error Prone compiler that implements {@link javax.tools.JavaCompiler}. */ public class BaseErrorProneJavaCompiler implements JavaCompiler { @@ -91,7 +90,6 @@ public CompilationTask getTask( if (refactoringCollection[0] != null) { task.addTaskListener(new RefactoringTask(task.getContext(), refactoringCollection[0])); } - task.addTaskListener(new CFCacheClearingListener()); return task; } @@ -268,21 +266,4 @@ public void finished(TaskEvent event) { } } } - - /** - * A listener that clears out a global Checker Framework cache at the end of compilation. This - * prevents a memory leak in cases where the compiler is being run in memory as part of a daemon - * process. - * - *

See https://github.com/typetools/checker-framework/issues/1482 - */ - private static class CFCacheClearingListener implements TaskListener { - - @Override - public void finished(TaskEvent e) { - if (e.getKind() == Kind.COMPILATION) { - AnnotationUtils.clear(); - } - } - } } diff --git a/check_api/src/main/java/com/google/errorprone/MaskedClassLoader.java b/check_api/src/main/java/com/google/errorprone/MaskedClassLoader.java index 1877f5529b5..4ba112610e9 100644 --- a/check_api/src/main/java/com/google/errorprone/MaskedClassLoader.java +++ b/check_api/src/main/java/com/google/errorprone/MaskedClassLoader.java @@ -53,7 +53,7 @@ public MaskedClassLoader(ClassLoader parent) { @Override protected Class findClass(String name) throws ClassNotFoundException { if (name.startsWith("com.google.errorprone.") - || name.startsWith("org.checkerframework.dataflow.")) { + || name.startsWith("org.checkerframework.shaded.dataflow.")) { return Class.forName(name); } else { throw new ClassNotFoundException(name); diff --git a/check_api/src/main/java/com/google/errorprone/dataflow/AccessPath.java b/check_api/src/main/java/com/google/errorprone/dataflow/AccessPath.java index d4872d3244f..ba6d80d29e6 100644 --- a/check_api/src/main/java/com/google/errorprone/dataflow/AccessPath.java +++ b/check_api/src/main/java/com/google/errorprone/dataflow/AccessPath.java @@ -32,12 +32,12 @@ import javax.lang.model.element.Element; import javax.lang.model.element.ElementKind; import javax.lang.model.element.Modifier; -import org.checkerframework.dataflow.cfg.node.AssignmentNode; -import org.checkerframework.dataflow.cfg.node.FieldAccessNode; -import org.checkerframework.dataflow.cfg.node.LocalVariableNode; -import org.checkerframework.dataflow.cfg.node.Node; -import org.checkerframework.dataflow.cfg.node.VariableDeclarationNode; -import org.checkerframework.javacutil.TreeUtils; +import org.checkerframework.shaded.dataflow.cfg.node.AssignmentNode; +import org.checkerframework.shaded.dataflow.cfg.node.FieldAccessNode; +import org.checkerframework.shaded.dataflow.cfg.node.LocalVariableNode; +import org.checkerframework.shaded.dataflow.cfg.node.Node; +import org.checkerframework.shaded.dataflow.cfg.node.VariableDeclarationNode; +import org.checkerframework.shaded.javacutil.TreeUtils; /** * A sequence of field names or autovalue accessors, along with a receiver: either a variable or a diff --git a/check_api/src/main/java/com/google/errorprone/dataflow/AccessPathStore.java b/check_api/src/main/java/com/google/errorprone/dataflow/AccessPathStore.java index 4851d6af1af..aef9bb16e7d 100644 --- a/check_api/src/main/java/com/google/errorprone/dataflow/AccessPathStore.java +++ b/check_api/src/main/java/com/google/errorprone/dataflow/AccessPathStore.java @@ -24,11 +24,11 @@ import java.util.LinkedHashMap; import java.util.Map; import javax.annotation.Nullable; -import org.checkerframework.dataflow.analysis.AbstractValue; -import org.checkerframework.dataflow.analysis.FlowExpressions; -import org.checkerframework.dataflow.analysis.Store; -import org.checkerframework.dataflow.cfg.CFGVisualizer; -import org.checkerframework.dataflow.cfg.node.LocalVariableNode; +import org.checkerframework.shaded.dataflow.analysis.AbstractValue; +import org.checkerframework.shaded.dataflow.analysis.FlowExpressions; +import org.checkerframework.shaded.dataflow.analysis.Store; +import org.checkerframework.shaded.dataflow.cfg.CFGVisualizer; +import org.checkerframework.shaded.dataflow.cfg.node.LocalVariableNode; /** * Immutable map from local variables or heap access paths to their {@link AbstractValue} diff --git a/check_api/src/main/java/com/google/errorprone/dataflow/ConstantPropagationAnalysis.java b/check_api/src/main/java/com/google/errorprone/dataflow/ConstantPropagationAnalysis.java index 0e6960fae53..e56576581bb 100644 --- a/check_api/src/main/java/com/google/errorprone/dataflow/ConstantPropagationAnalysis.java +++ b/check_api/src/main/java/com/google/errorprone/dataflow/ConstantPropagationAnalysis.java @@ -19,8 +19,8 @@ import com.sun.source.util.TreePath; import com.sun.tools.javac.util.Context; import javax.annotation.Nullable; -import org.checkerframework.dataflow.constantpropagation.Constant; -import org.checkerframework.dataflow.constantpropagation.ConstantPropagationTransfer; +import org.checkerframework.shaded.dataflow.constantpropagation.Constant; +import org.checkerframework.shaded.dataflow.constantpropagation.ConstantPropagationTransfer; /** An interface to the constant propagation analysis. */ public final class ConstantPropagationAnalysis { diff --git a/check_api/src/main/java/com/google/errorprone/dataflow/DataFlow.java b/check_api/src/main/java/com/google/errorprone/dataflow/DataFlow.java index 49600add869..7cb70d7cec9 100644 --- a/check_api/src/main/java/com/google/errorprone/dataflow/DataFlow.java +++ b/check_api/src/main/java/com/google/errorprone/dataflow/DataFlow.java @@ -36,16 +36,16 @@ import com.sun.tools.javac.util.Context; import javax.annotation.Nullable; import javax.annotation.processing.ProcessingEnvironment; -import org.checkerframework.dataflow.analysis.AbstractValue; -import org.checkerframework.dataflow.analysis.Analysis; -import org.checkerframework.dataflow.analysis.Store; -import org.checkerframework.dataflow.analysis.TransferFunction; -import org.checkerframework.dataflow.cfg.CFGBuilder; -import org.checkerframework.dataflow.cfg.ControlFlowGraph; -import org.checkerframework.dataflow.cfg.UnderlyingAST; +import org.checkerframework.shaded.dataflow.analysis.AbstractValue; +import org.checkerframework.shaded.dataflow.analysis.Analysis; +import org.checkerframework.shaded.dataflow.analysis.Store; +import org.checkerframework.shaded.dataflow.analysis.TransferFunction; +import org.checkerframework.shaded.dataflow.cfg.CFGBuilder; +import org.checkerframework.shaded.dataflow.cfg.ControlFlowGraph; +import org.checkerframework.shaded.dataflow.cfg.UnderlyingAST; /** - * Provides a wrapper around {@link org.checkerframework.dataflow.analysis.Analysis}. + * Provides a wrapper around {@link org.checkerframework.shaded.dataflow.analysis.Analysis}. * * @author konne@google.com (Konstantin Weitz) */ @@ -76,12 +76,11 @@ public static interface Result< new CacheLoader>() { @Override public Analysis load(AnalysisParams key) { - final ProcessingEnvironment env = key.environment(); final ControlFlowGraph cfg = key.cfg(); final TransferFunction transfer = key.transferFunction(); @SuppressWarnings({"unchecked", "rawtypes"}) - final Analysis analysis = new Analysis(transfer, env); + final Analysis analysis = new Analysis(transfer); analysis.performAnalysis(cfg); return analysis; } diff --git a/check_api/src/main/java/com/google/errorprone/dataflow/LocalStore.java b/check_api/src/main/java/com/google/errorprone/dataflow/LocalStore.java index b3ff29ef27a..0634c67e57c 100644 --- a/check_api/src/main/java/com/google/errorprone/dataflow/LocalStore.java +++ b/check_api/src/main/java/com/google/errorprone/dataflow/LocalStore.java @@ -29,12 +29,12 @@ import java.util.Map; import javax.annotation.Nullable; import javax.lang.model.element.Element; -import org.checkerframework.dataflow.analysis.AbstractValue; -import org.checkerframework.dataflow.analysis.FlowExpressions; -import org.checkerframework.dataflow.analysis.Store; -import org.checkerframework.dataflow.cfg.CFGVisualizer; -import org.checkerframework.dataflow.cfg.node.LocalVariableNode; -import org.checkerframework.javacutil.trees.DetachedVarSymbol; +import org.checkerframework.shaded.dataflow.analysis.AbstractValue; +import org.checkerframework.shaded.dataflow.analysis.FlowExpressions; +import org.checkerframework.shaded.dataflow.analysis.Store; +import org.checkerframework.shaded.dataflow.cfg.CFGVisualizer; +import org.checkerframework.shaded.dataflow.cfg.node.LocalVariableNode; +import org.checkerframework.shaded.javacutil.trees.DetachedVarSymbol; /** * Immutable map from each local variable to its {@link AbstractValue}. Note that, while the @@ -72,8 +72,8 @@ public V valueOfLocalVariable(LocalVariableNode node, V defaultValue) { /** * Returns the value for the given variable. {@code element} must come from a call to {@link * LocalVariableNode#getElement()} or {@link - * org.checkerframework.javacutil.TreeUtils#elementFromDeclaration} ({@link - * org.checkerframework.dataflow.cfg.node.VariableDeclarationNode#getTree()}). + * org.checkerframework.shaded.javacutil.TreeUtils#elementFromDeclaration} ({@link + * org.checkerframework.shaded.dataflow.cfg.node.VariableDeclarationNode#getTree()}). */ @Nullable private V getInformation(Element element) { @@ -100,8 +100,8 @@ public static final class Builder> { /** * Sets the value for the given variable. {@code element} must come from a call to {@link * LocalVariableNode#getElement()} or {@link - * org.checkerframework.javacutil.TreeUtils#elementFromDeclaration} ({@link - * org.checkerframework.dataflow.cfg.node.VariableDeclarationNode#getTree()}). + * org.checkerframework.shaded.javacutil.TreeUtils#elementFromDeclaration} ({@link + * org.checkerframework.shaded.dataflow.cfg.node.VariableDeclarationNode#getTree()}). */ public Builder setInformation(Element element, V value) { checkElementType(element); diff --git a/check_api/src/main/java/com/google/errorprone/dataflow/LocalVariableValues.java b/check_api/src/main/java/com/google/errorprone/dataflow/LocalVariableValues.java index 1f30ca96d2a..9dfd2ee991a 100644 --- a/check_api/src/main/java/com/google/errorprone/dataflow/LocalVariableValues.java +++ b/check_api/src/main/java/com/google/errorprone/dataflow/LocalVariableValues.java @@ -16,7 +16,7 @@ package com.google.errorprone.dataflow; -import org.checkerframework.dataflow.cfg.node.LocalVariableNode; +import org.checkerframework.shaded.dataflow.cfg.node.LocalVariableNode; /** Read-only access to {@link LocalStore} for convenience. */ public interface LocalVariableValues { diff --git a/check_api/src/main/java/com/google/errorprone/dataflow/nullnesspropagation/AbstractNullnessPropagationTransfer.java b/check_api/src/main/java/com/google/errorprone/dataflow/nullnesspropagation/AbstractNullnessPropagationTransfer.java index 1f13da8ca95..74d1847b78f 100644 --- a/check_api/src/main/java/com/google/errorprone/dataflow/nullnesspropagation/AbstractNullnessPropagationTransfer.java +++ b/check_api/src/main/java/com/google/errorprone/dataflow/nullnesspropagation/AbstractNullnessPropagationTransfer.java @@ -29,82 +29,82 @@ import java.util.List; import java.util.Map; import java.util.Map.Entry; -import org.checkerframework.dataflow.analysis.ConditionalTransferResult; -import org.checkerframework.dataflow.analysis.RegularTransferResult; -import org.checkerframework.dataflow.analysis.TransferFunction; -import org.checkerframework.dataflow.analysis.TransferInput; -import org.checkerframework.dataflow.analysis.TransferResult; -import org.checkerframework.dataflow.cfg.UnderlyingAST; -import org.checkerframework.dataflow.cfg.node.ArrayAccessNode; -import org.checkerframework.dataflow.cfg.node.ArrayCreationNode; -import org.checkerframework.dataflow.cfg.node.ArrayTypeNode; -import org.checkerframework.dataflow.cfg.node.AssertionErrorNode; -import org.checkerframework.dataflow.cfg.node.AssignmentNode; -import org.checkerframework.dataflow.cfg.node.BitwiseAndNode; -import org.checkerframework.dataflow.cfg.node.BitwiseComplementNode; -import org.checkerframework.dataflow.cfg.node.BitwiseOrNode; -import org.checkerframework.dataflow.cfg.node.BitwiseXorNode; -import org.checkerframework.dataflow.cfg.node.BooleanLiteralNode; -import org.checkerframework.dataflow.cfg.node.CaseNode; -import org.checkerframework.dataflow.cfg.node.CharacterLiteralNode; -import org.checkerframework.dataflow.cfg.node.ClassDeclarationNode; -import org.checkerframework.dataflow.cfg.node.ClassNameNode; -import org.checkerframework.dataflow.cfg.node.ConditionalAndNode; -import org.checkerframework.dataflow.cfg.node.ConditionalNotNode; -import org.checkerframework.dataflow.cfg.node.ConditionalOrNode; -import org.checkerframework.dataflow.cfg.node.DoubleLiteralNode; -import org.checkerframework.dataflow.cfg.node.EqualToNode; -import org.checkerframework.dataflow.cfg.node.ExplicitThisLiteralNode; -import org.checkerframework.dataflow.cfg.node.FieldAccessNode; -import org.checkerframework.dataflow.cfg.node.FloatLiteralNode; -import org.checkerframework.dataflow.cfg.node.FloatingDivisionNode; -import org.checkerframework.dataflow.cfg.node.FloatingRemainderNode; -import org.checkerframework.dataflow.cfg.node.FunctionalInterfaceNode; -import org.checkerframework.dataflow.cfg.node.GreaterThanNode; -import org.checkerframework.dataflow.cfg.node.GreaterThanOrEqualNode; -import org.checkerframework.dataflow.cfg.node.ImplicitThisLiteralNode; -import org.checkerframework.dataflow.cfg.node.InstanceOfNode; -import org.checkerframework.dataflow.cfg.node.IntegerDivisionNode; -import org.checkerframework.dataflow.cfg.node.IntegerLiteralNode; -import org.checkerframework.dataflow.cfg.node.IntegerRemainderNode; -import org.checkerframework.dataflow.cfg.node.LambdaResultExpressionNode; -import org.checkerframework.dataflow.cfg.node.LeftShiftNode; -import org.checkerframework.dataflow.cfg.node.LessThanNode; -import org.checkerframework.dataflow.cfg.node.LessThanOrEqualNode; -import org.checkerframework.dataflow.cfg.node.LocalVariableNode; -import org.checkerframework.dataflow.cfg.node.LongLiteralNode; -import org.checkerframework.dataflow.cfg.node.MarkerNode; -import org.checkerframework.dataflow.cfg.node.MethodAccessNode; -import org.checkerframework.dataflow.cfg.node.MethodInvocationNode; -import org.checkerframework.dataflow.cfg.node.NarrowingConversionNode; -import org.checkerframework.dataflow.cfg.node.Node; -import org.checkerframework.dataflow.cfg.node.NotEqualNode; -import org.checkerframework.dataflow.cfg.node.NullChkNode; -import org.checkerframework.dataflow.cfg.node.NullLiteralNode; -import org.checkerframework.dataflow.cfg.node.NumericalAdditionNode; -import org.checkerframework.dataflow.cfg.node.NumericalMinusNode; -import org.checkerframework.dataflow.cfg.node.NumericalMultiplicationNode; -import org.checkerframework.dataflow.cfg.node.NumericalPlusNode; -import org.checkerframework.dataflow.cfg.node.NumericalSubtractionNode; -import org.checkerframework.dataflow.cfg.node.ObjectCreationNode; -import org.checkerframework.dataflow.cfg.node.PackageNameNode; -import org.checkerframework.dataflow.cfg.node.ParameterizedTypeNode; -import org.checkerframework.dataflow.cfg.node.PrimitiveTypeNode; -import org.checkerframework.dataflow.cfg.node.ReturnNode; -import org.checkerframework.dataflow.cfg.node.ShortLiteralNode; -import org.checkerframework.dataflow.cfg.node.SignedRightShiftNode; -import org.checkerframework.dataflow.cfg.node.StringConcatenateAssignmentNode; -import org.checkerframework.dataflow.cfg.node.StringConcatenateNode; -import org.checkerframework.dataflow.cfg.node.StringConversionNode; -import org.checkerframework.dataflow.cfg.node.StringLiteralNode; -import org.checkerframework.dataflow.cfg.node.SuperNode; -import org.checkerframework.dataflow.cfg.node.SynchronizedNode; -import org.checkerframework.dataflow.cfg.node.TernaryExpressionNode; -import org.checkerframework.dataflow.cfg.node.ThrowNode; -import org.checkerframework.dataflow.cfg.node.TypeCastNode; -import org.checkerframework.dataflow.cfg.node.UnsignedRightShiftNode; -import org.checkerframework.dataflow.cfg.node.VariableDeclarationNode; -import org.checkerframework.dataflow.cfg.node.WideningConversionNode; +import org.checkerframework.shaded.dataflow.analysis.ConditionalTransferResult; +import org.checkerframework.shaded.dataflow.analysis.RegularTransferResult; +import org.checkerframework.shaded.dataflow.analysis.TransferFunction; +import org.checkerframework.shaded.dataflow.analysis.TransferInput; +import org.checkerframework.shaded.dataflow.analysis.TransferResult; +import org.checkerframework.shaded.dataflow.cfg.UnderlyingAST; +import org.checkerframework.shaded.dataflow.cfg.node.ArrayAccessNode; +import org.checkerframework.shaded.dataflow.cfg.node.ArrayCreationNode; +import org.checkerframework.shaded.dataflow.cfg.node.ArrayTypeNode; +import org.checkerframework.shaded.dataflow.cfg.node.AssertionErrorNode; +import org.checkerframework.shaded.dataflow.cfg.node.AssignmentNode; +import org.checkerframework.shaded.dataflow.cfg.node.BitwiseAndNode; +import org.checkerframework.shaded.dataflow.cfg.node.BitwiseComplementNode; +import org.checkerframework.shaded.dataflow.cfg.node.BitwiseOrNode; +import org.checkerframework.shaded.dataflow.cfg.node.BitwiseXorNode; +import org.checkerframework.shaded.dataflow.cfg.node.BooleanLiteralNode; +import org.checkerframework.shaded.dataflow.cfg.node.CaseNode; +import org.checkerframework.shaded.dataflow.cfg.node.CharacterLiteralNode; +import org.checkerframework.shaded.dataflow.cfg.node.ClassDeclarationNode; +import org.checkerframework.shaded.dataflow.cfg.node.ClassNameNode; +import org.checkerframework.shaded.dataflow.cfg.node.ConditionalAndNode; +import org.checkerframework.shaded.dataflow.cfg.node.ConditionalNotNode; +import org.checkerframework.shaded.dataflow.cfg.node.ConditionalOrNode; +import org.checkerframework.shaded.dataflow.cfg.node.DoubleLiteralNode; +import org.checkerframework.shaded.dataflow.cfg.node.EqualToNode; +import org.checkerframework.shaded.dataflow.cfg.node.ExplicitThisLiteralNode; +import org.checkerframework.shaded.dataflow.cfg.node.FieldAccessNode; +import org.checkerframework.shaded.dataflow.cfg.node.FloatLiteralNode; +import org.checkerframework.shaded.dataflow.cfg.node.FloatingDivisionNode; +import org.checkerframework.shaded.dataflow.cfg.node.FloatingRemainderNode; +import org.checkerframework.shaded.dataflow.cfg.node.FunctionalInterfaceNode; +import org.checkerframework.shaded.dataflow.cfg.node.GreaterThanNode; +import org.checkerframework.shaded.dataflow.cfg.node.GreaterThanOrEqualNode; +import org.checkerframework.shaded.dataflow.cfg.node.ImplicitThisLiteralNode; +import org.checkerframework.shaded.dataflow.cfg.node.InstanceOfNode; +import org.checkerframework.shaded.dataflow.cfg.node.IntegerDivisionNode; +import org.checkerframework.shaded.dataflow.cfg.node.IntegerLiteralNode; +import org.checkerframework.shaded.dataflow.cfg.node.IntegerRemainderNode; +import org.checkerframework.shaded.dataflow.cfg.node.LambdaResultExpressionNode; +import org.checkerframework.shaded.dataflow.cfg.node.LeftShiftNode; +import org.checkerframework.shaded.dataflow.cfg.node.LessThanNode; +import org.checkerframework.shaded.dataflow.cfg.node.LessThanOrEqualNode; +import org.checkerframework.shaded.dataflow.cfg.node.LocalVariableNode; +import org.checkerframework.shaded.dataflow.cfg.node.LongLiteralNode; +import org.checkerframework.shaded.dataflow.cfg.node.MarkerNode; +import org.checkerframework.shaded.dataflow.cfg.node.MethodAccessNode; +import org.checkerframework.shaded.dataflow.cfg.node.MethodInvocationNode; +import org.checkerframework.shaded.dataflow.cfg.node.NarrowingConversionNode; +import org.checkerframework.shaded.dataflow.cfg.node.Node; +import org.checkerframework.shaded.dataflow.cfg.node.NotEqualNode; +import org.checkerframework.shaded.dataflow.cfg.node.NullChkNode; +import org.checkerframework.shaded.dataflow.cfg.node.NullLiteralNode; +import org.checkerframework.shaded.dataflow.cfg.node.NumericalAdditionNode; +import org.checkerframework.shaded.dataflow.cfg.node.NumericalMinusNode; +import org.checkerframework.shaded.dataflow.cfg.node.NumericalMultiplicationNode; +import org.checkerframework.shaded.dataflow.cfg.node.NumericalPlusNode; +import org.checkerframework.shaded.dataflow.cfg.node.NumericalSubtractionNode; +import org.checkerframework.shaded.dataflow.cfg.node.ObjectCreationNode; +import org.checkerframework.shaded.dataflow.cfg.node.PackageNameNode; +import org.checkerframework.shaded.dataflow.cfg.node.ParameterizedTypeNode; +import org.checkerframework.shaded.dataflow.cfg.node.PrimitiveTypeNode; +import org.checkerframework.shaded.dataflow.cfg.node.ReturnNode; +import org.checkerframework.shaded.dataflow.cfg.node.ShortLiteralNode; +import org.checkerframework.shaded.dataflow.cfg.node.SignedRightShiftNode; +import org.checkerframework.shaded.dataflow.cfg.node.StringConcatenateAssignmentNode; +import org.checkerframework.shaded.dataflow.cfg.node.StringConcatenateNode; +import org.checkerframework.shaded.dataflow.cfg.node.StringConversionNode; +import org.checkerframework.shaded.dataflow.cfg.node.StringLiteralNode; +import org.checkerframework.shaded.dataflow.cfg.node.SuperNode; +import org.checkerframework.shaded.dataflow.cfg.node.SynchronizedNode; +import org.checkerframework.shaded.dataflow.cfg.node.TernaryExpressionNode; +import org.checkerframework.shaded.dataflow.cfg.node.ThrowNode; +import org.checkerframework.shaded.dataflow.cfg.node.TypeCastNode; +import org.checkerframework.shaded.dataflow.cfg.node.UnsignedRightShiftNode; +import org.checkerframework.shaded.dataflow.cfg.node.VariableDeclarationNode; +import org.checkerframework.shaded.dataflow.cfg.node.WideningConversionNode; /** * A default implementation of a transfer function for nullability analysis with more convenient diff --git a/check_api/src/main/java/com/google/errorprone/dataflow/nullnesspropagation/Nullness.java b/check_api/src/main/java/com/google/errorprone/dataflow/nullnesspropagation/Nullness.java index 28053963e67..db868ae13a1 100644 --- a/check_api/src/main/java/com/google/errorprone/dataflow/nullnesspropagation/Nullness.java +++ b/check_api/src/main/java/com/google/errorprone/dataflow/nullnesspropagation/Nullness.java @@ -16,7 +16,7 @@ package com.google.errorprone.dataflow.nullnesspropagation; -import org.checkerframework.dataflow.analysis.AbstractValue; +import org.checkerframework.shaded.dataflow.analysis.AbstractValue; /** * Represents one of the possible nullness values in our nullness analysis. diff --git a/check_api/src/main/java/com/google/errorprone/dataflow/nullnesspropagation/NullnessPropagationTransfer.java b/check_api/src/main/java/com/google/errorprone/dataflow/nullnesspropagation/NullnessPropagationTransfer.java index 5138a6d3f65..0bd4840a7ea 100644 --- a/check_api/src/main/java/com/google/errorprone/dataflow/nullnesspropagation/NullnessPropagationTransfer.java +++ b/check_api/src/main/java/com/google/errorprone/dataflow/nullnesspropagation/NullnessPropagationTransfer.java @@ -25,8 +25,8 @@ import static com.google.errorprone.dataflow.nullnesspropagation.Nullness.NULLABLE; import static com.sun.tools.javac.code.TypeTag.BOOLEAN; import static javax.lang.model.element.ElementKind.EXCEPTION_PARAMETER; -import static org.checkerframework.javacutil.TreeUtils.elementFromDeclaration; -import static org.checkerframework.javacutil.TreeUtils.enclosingOfClass; +import static org.checkerframework.shaded.javacutil.TreeUtils.elementFromDeclaration; +import static org.checkerframework.shaded.javacutil.TreeUtils.enclosingOfClass; import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Preconditions; @@ -89,23 +89,23 @@ import javax.annotation.Nullable; import javax.lang.model.element.VariableElement; import javax.lang.model.type.TypeVariable; -import org.checkerframework.dataflow.analysis.Analysis; -import org.checkerframework.dataflow.cfg.CFGBuilder; -import org.checkerframework.dataflow.cfg.ControlFlowGraph; -import org.checkerframework.dataflow.cfg.UnderlyingAST; -import org.checkerframework.dataflow.cfg.node.ArrayAccessNode; -import org.checkerframework.dataflow.cfg.node.ArrayCreationNode; -import org.checkerframework.dataflow.cfg.node.AssignmentNode; -import org.checkerframework.dataflow.cfg.node.EqualToNode; -import org.checkerframework.dataflow.cfg.node.FieldAccessNode; -import org.checkerframework.dataflow.cfg.node.FunctionalInterfaceNode; -import org.checkerframework.dataflow.cfg.node.InstanceOfNode; -import org.checkerframework.dataflow.cfg.node.LocalVariableNode; -import org.checkerframework.dataflow.cfg.node.MethodInvocationNode; -import org.checkerframework.dataflow.cfg.node.Node; -import org.checkerframework.dataflow.cfg.node.NotEqualNode; -import org.checkerframework.dataflow.cfg.node.TypeCastNode; -import org.checkerframework.dataflow.cfg.node.VariableDeclarationNode; +import org.checkerframework.shaded.dataflow.analysis.Analysis; +import org.checkerframework.shaded.dataflow.cfg.CFGBuilder; +import org.checkerframework.shaded.dataflow.cfg.ControlFlowGraph; +import org.checkerframework.shaded.dataflow.cfg.UnderlyingAST; +import org.checkerframework.shaded.dataflow.cfg.node.ArrayAccessNode; +import org.checkerframework.shaded.dataflow.cfg.node.ArrayCreationNode; +import org.checkerframework.shaded.dataflow.cfg.node.AssignmentNode; +import org.checkerframework.shaded.dataflow.cfg.node.EqualToNode; +import org.checkerframework.shaded.dataflow.cfg.node.FieldAccessNode; +import org.checkerframework.shaded.dataflow.cfg.node.FunctionalInterfaceNode; +import org.checkerframework.shaded.dataflow.cfg.node.InstanceOfNode; +import org.checkerframework.shaded.dataflow.cfg.node.LocalVariableNode; +import org.checkerframework.shaded.dataflow.cfg.node.MethodInvocationNode; +import org.checkerframework.shaded.dataflow.cfg.node.Node; +import org.checkerframework.shaded.dataflow.cfg.node.NotEqualNode; +import org.checkerframework.shaded.dataflow.cfg.node.TypeCastNode; +import org.checkerframework.shaded.dataflow.cfg.node.VariableDeclarationNode; /** * The {@code TransferFunction} for our nullability analysis. This analysis determines, for all @@ -832,7 +832,7 @@ private Nullness fieldInitializerNullnessIfAvailable(ClassAndField accessed) { /*assumeAssertionsDisabled=*/ false, javacEnv); Analysis, NullnessPropagationTransfer> analysis = - new Analysis<>(this, javacEnv); + new Analysis<>(this); analysis.performAnalysis(cfg); return analysis.getValue(initializerPath.getLeaf()); } finally { diff --git a/check_api/src/main/java/com/google/errorprone/dataflow/nullnesspropagation/TrustingNullnessAnalysis.java b/check_api/src/main/java/com/google/errorprone/dataflow/nullnesspropagation/TrustingNullnessAnalysis.java index 4908ed8c8b7..b2a75f2f92d 100644 --- a/check_api/src/main/java/com/google/errorprone/dataflow/nullnesspropagation/TrustingNullnessAnalysis.java +++ b/check_api/src/main/java/com/google/errorprone/dataflow/nullnesspropagation/TrustingNullnessAnalysis.java @@ -31,10 +31,10 @@ import com.sun.tools.javac.util.Context; import java.io.Serializable; import javax.lang.model.element.ElementKind; -import org.checkerframework.dataflow.analysis.Analysis; -import org.checkerframework.dataflow.cfg.CFGBuilder; -import org.checkerframework.dataflow.cfg.ControlFlowGraph; -import org.checkerframework.dataflow.cfg.UnderlyingAST; +import org.checkerframework.shaded.dataflow.analysis.Analysis; +import org.checkerframework.shaded.dataflow.cfg.CFGBuilder; +import org.checkerframework.shaded.dataflow.cfg.ControlFlowGraph; +import org.checkerframework.shaded.dataflow.cfg.UnderlyingAST; /** * An interface to the "trusting" nullness analysis. This variant "trusts" {@code Nullable} diff --git a/core/pom.xml b/core/pom.xml index 00d4fb23237..b3bec8d2e7e 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -111,7 +111,7 @@ org.checkerframework - dataflow + dataflow-shaded ${dataflow.version} diff --git a/pom.xml b/pom.xml index 12357e85383..912324455ab 100644 --- a/pom.xml +++ b/pom.xml @@ -38,7 +38,7 @@ 9+181-r4173-1 1.5.3 4.13-beta-1 - 3.0.0 + 3.1.2 2.25.0 0.18 2.7.0 diff --git a/test_helpers/pom.xml b/test_helpers/pom.xml index dc4b5cd1d63..6ff0bb651c9 100644 --- a/test_helpers/pom.xml +++ b/test_helpers/pom.xml @@ -68,7 +68,7 @@ org.checkerframework - dataflow + dataflow-shaded ${dataflow.version}