Skip to content

Commit

Permalink
Allow static import of `{ZERO,ONE}
Browse files Browse the repository at this point in the history
  • Loading branch information
rickie committed Jan 28, 2024
1 parent e65e2ce commit 8596e88
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,8 @@ public final class NonStaticImport extends BugChecker implements CompilationUnit
"newBuilder",
"newInstance",
"of",
"ONE",
"parse",
"valueOf",
"ZERO");
"valueOf");

/** Instantiates a new {@link NonStaticImport} instance. */
public NonStaticImport() {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ void identification() {
"import java.time.ZoneOffset;",
"import java.util.Locale;",
"import java.util.Map;",
"import pkg.A.Wrapper.ZERO;",
"import pkg.A.Wrapper.INSTANCE;",
"",
"class A {",
" private Integer MIN_VALUE = 12;",
Expand All @@ -92,7 +92,7 @@ void identification() {
" empty();",
"",
" list();",
" new ZERO();",
" new INSTANCE();",
" }",
"",
" static final class WithMethodThatIsSelectivelyFlagged {",
Expand All @@ -102,7 +102,7 @@ void identification() {
" }",
"",
" static final class Wrapper {",
" static final class ZERO {}",
" static final class INSTANCE {}",
" }",
"}")
.doTest();
Expand Down

0 comments on commit 8596e88

Please sign in to comment.