From d7cadefc265be6ddd4dadb5d201777cb7a284904 Mon Sep 17 00:00:00 2001 From: txiang61 Date: Wed, 25 Mar 2020 00:17:35 -0400 Subject: [PATCH] revert unrelated changes --- src/checkers/inference/InferenceVisitor.java | 4 +--- src/checkers/inference/VariableAnnotator.java | 5 +---- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/checkers/inference/InferenceVisitor.java b/src/checkers/inference/InferenceVisitor.java index 4adfdc3a1..e76cd9468 100644 --- a/src/checkers/inference/InferenceVisitor.java +++ b/src/checkers/inference/InferenceVisitor.java @@ -664,9 +664,7 @@ public boolean maybeAddRefinementVariableConstraints(final AnnotatedTypeMirror v logger.fine("InferenceVisitor::commonAssignmentCheck: Equality constraint for qualifiers sub: " + sub + " sup: " + sup); // Equality between the refvar and the value - if (sub != null) { - constraintManager.addEqualityConstraint(sup, sub); - } + constraintManager.addEqualityConstraint(sup, sub); // Refinement variable still needs to be a subtype of its declared type value constraintManager.addSubtypeConstraint(sup, diff --git a/src/checkers/inference/VariableAnnotator.java b/src/checkers/inference/VariableAnnotator.java index aad071ad5..01e496b74 100644 --- a/src/checkers/inference/VariableAnnotator.java +++ b/src/checkers/inference/VariableAnnotator.java @@ -1106,10 +1106,7 @@ private void annotateNewArray(AnnotatedTypeMirror type, Tree tree, int level, Tr // Create a variable from an ASTPath final TreePath pathToTree = inferenceTypeFactory.getPath(topLevelTree); ASTRecord astRec = ASTPathUtil.getASTRecordForPath(inferenceTypeFactory, pathToTree); - if (astRec != null) { - astRec = astRec.newArrayLevel(level); - replaceOrCreateEquivalentVarAnno(type, tree, new AstPathLocation(astRec)); - } + replaceOrCreateEquivalentVarAnno(type, tree, new AstPathLocation(astRec)); } else if (!(tree.getKind() == Tree.Kind.NEW_ARRAY || tree.getKind() == Tree.Kind.ARRAY_TYPE)) {