Skip to content

Commit

Permalink
PSM-1165 StaticImportCheck handle package-info.java files
Browse files Browse the repository at this point in the history
  • Loading branch information
rickie committed Jan 2, 2022
1 parent 269bde3 commit 49d614f
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import static com.sun.source.tree.Tree.Kind.MEMBER_SELECT;
import static com.sun.source.tree.Tree.Kind.METHOD_INVOCATION;
import static com.sun.source.tree.Tree.Kind.PACKAGE;
import static java.util.Objects.requireNonNull;

import com.google.auto.service.AutoService;
Expand Down Expand Up @@ -184,7 +185,8 @@ private static boolean isCandidate(VisitorState state) {
private static boolean isExempted(VisitorState state) {
Tree currentTree = state.getPath().getLeaf();
Tree parentTree = state.getPath().getParentPath().getLeaf();
if (currentTree.getKind() != MEMBER_SELECT && parentTree.getKind() != METHOD_INVOCATION) {
if ((currentTree.getKind() != MEMBER_SELECT && parentTree.getKind() != METHOD_INVOCATION)
|| parentTree.getKind() == PACKAGE) {
return false;
}

Expand Down

0 comments on commit 49d614f

Please sign in to comment.