Skip to content

Commit

Permalink
Suggestions 2
Browse files Browse the repository at this point in the history
  • Loading branch information
rickie committed Sep 9, 2022
1 parent d4e18bc commit ee7a386
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,9 @@ Predicate<T> after() {
}

/**
* Prefer the <code>==</code> operator over {@link java.util.Objects#isNull(Object)} for null
* checks.
* Prefer the {@code ==} operator over {@link java.util.Objects#isNull(Object)} for null checks.
*/
static final class ObjectEqualsNull {
static final class IsNull {
@BeforeTemplate
boolean before(@Nullable Object object) {
return Objects.isNull(object);
Expand All @@ -74,10 +73,9 @@ boolean after(@Nullable Object object) {
}

/**
* Prefer the <code>!=</code> operator over {@link java.util.Objects#isNull(Object)} for null
* checks.
* Prefer the {@code !=} operator over {@link java.util.Objects#isNull(Object)} for null checks.
*/
static final class ObjectNotEqualsNull {
static final class IsNotNull {
@BeforeTemplate
boolean before(@Nullable Object object) {
return Objects.nonNull(object);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ long testNonNullFunction() {
return Stream.of("foo").filter(s -> s != null).count();
}

boolean testObjectEqualsNull() {
boolean testIsNull() {
return Objects.isNull("foo");
}

boolean testObjectNotEqualsNull() {
boolean testIsNotNull() {
return Objects.nonNull("foo");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ long testNonNullFunction() {
return Stream.of("foo").filter(Objects::nonNull).count();
}

boolean testObjectEqualsNull() {
boolean testIsNull() {
return "foo" == null;
}

boolean testObjectNotEqualsNull() {
boolean testIsNotNull() {
return "foo" != null;
}
}

0 comments on commit ee7a386

Please sign in to comment.