From d1d534d9ef2d35eb194a0caa9ce54ecf18e3404a Mon Sep 17 00:00:00 2001 From: Manu Sridharan Date: Mon, 7 Oct 2024 13:34:08 -0700 Subject: [PATCH] rename variables --- .../src/main/java/com/uber/nullaway/NullAway.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/nullaway/src/main/java/com/uber/nullaway/NullAway.java b/nullaway/src/main/java/com/uber/nullaway/NullAway.java index edc56a1fd2..cca6afbfc7 100644 --- a/nullaway/src/main/java/com/uber/nullaway/NullAway.java +++ b/nullaway/src/main/java/com/uber/nullaway/NullAway.java @@ -1528,14 +1528,17 @@ private static boolean isDeclarationAnnotation(Symbol anno) { } private void handleNullabilityOnNestedClass( - List annotations, Tree type, Tree tree, VisitorState state) { - if (!(type instanceof JCTree.JCFieldAccess)) { + List annotations, + Tree typeTree, + Tree errorReportingTree, + VisitorState state) { + if (!(typeTree instanceof JCTree.JCFieldAccess)) { return; } - JCTree.JCFieldAccess fieldAccess = (JCTree.JCFieldAccess) type; + JCTree.JCFieldAccess fieldAccess = (JCTree.JCFieldAccess) typeTree; int endOfOuterType = state.getEndPosition(fieldAccess.getExpression()); - int startOfType = ((JCTree) type).getStartPosition(); + int startOfType = ((JCTree) typeTree).getStartPosition(); for (AnnotationTree annotation : annotations) { Symbol sym = ASTHelpers.getSymbol(annotation); @@ -1564,7 +1567,8 @@ private void handleNullabilityOnNestedClass( "Type-use nullability annotations should be applied on inner class"); state.reportMatch( - errorBuilder.createErrorDescription(errorMessage, buildDescription(tree), state, null)); + errorBuilder.createErrorDescription( + errorMessage, buildDescription(errorReportingTree), state, null)); } } }