Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow static imports of ZERO and ONE identifiers #996

Merged
merged 1 commit into from
Jan 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading