Skip to content

Commit

Permalink
Rebase cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephan202 committed Jan 1, 2024
1 parent 5568d91 commit 3ee3a4e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,10 @@ private boolean isEmptyCollectionConstructor(ExpressionTree tree, VisitorState s
}

private static boolean isEmptyArrayCreation(ExpressionTree tree) {
if (!(tree instanceof NewArrayTree)) {
if (!(tree instanceof NewArrayTree newArray)) {
return false;
}

NewArrayTree newArray = (NewArrayTree) tree;
return (!newArray.getDimensions().isEmpty()
&& ASTHelpers.constValue(newArray.getDimensions().get(0), Integer.class) == 0)
|| (newArray.getInitializers() != null && newArray.getInitializers().isEmpty());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ private static boolean isMethodSelect(ExpressionTree tree, TreePath path) {
}

Tree parentTree = parentPath.getLeaf();
return parentTree instanceof MethodInvocationTree
&& ((MethodInvocationTree) parentTree).getMethodSelect().equals(tree);
return parentTree instanceof MethodInvocationTree methodInvocation
&& methodInvocation.getMethodSelect().equals(tree);
}
}

0 comments on commit 3ee3a4e

Please sign in to comment.