Skip to content

Commit

Permalink
Fix position of marker for dereference of nullable errors
Browse files Browse the repository at this point in the history
  • Loading branch information
TonyxSun committed Mar 20, 2023
1 parent 17826a7 commit a3bb7ac
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,8 @@ public Void visitMemberSelect(MemberSelectTree tree, Void p) {
|| tree.getExpression().getKind() == Tree.Kind.PARAMETERIZED_TYPE
// case 8. static member access
|| ElementUtils.isStatic(e))) {
checkForNullability(tree.getExpression(), DEREFERENCE_OF_NULLABLE);
AnnotatedTypeMirror type = atypeFactory.getAnnotatedType(tree.getExpression());
checkForNullability(type, tree.getExpression(), DEREFERENCE_OF_NULLABLE);
}

return super.visitMemberSelect(tree, p);
Expand Down Expand Up @@ -743,7 +744,8 @@ public Void visitForLoop(ForLoopTree tree, Void p) {
public Void visitNewClass(NewClassTree tree, Void p) {
ExpressionTree enclosingExpr = tree.getEnclosingExpression();
if (enclosingExpr != null) {
checkForNullability(enclosingExpr, DEREFERENCE_OF_NULLABLE);
AnnotatedTypeMirror type = atypeFactory.getAnnotatedType(enclosingExpr);
checkForNullability(type, enclosingExpr, DEREFERENCE_OF_NULLABLE);
}
AnnotatedDeclaredType type = atypeFactory.getAnnotatedType(tree);
ExpressionTree identifier = tree.getIdentifier();
Expand Down
1 change: 1 addition & 0 deletions docs/manual/contributors.tex
Original file line number Diff line number Diff line change
Expand Up @@ -136,4 +136,5 @@
Vlastimil Dort,
Weitian Xing,
Werner Dietl,
Wuyue (Tony) Sun,
Zhiping Cai.

0 comments on commit a3bb7ac

Please sign in to comment.