From 3087acb92951fa4e4805761dfe34c0245588303b Mon Sep 17 00:00:00 2001 From: Arturo Bernal Date: Sun, 21 Aug 2022 14:51:09 +0200 Subject: [PATCH] Simplifiable conditional expression. (#941) --- src/main/java/org/apache/commons/lang3/reflect/MemberUtils.java | 2 +- src/main/java/org/apache/commons/lang3/stream/Streams.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/apache/commons/lang3/reflect/MemberUtils.java b/src/main/java/org/apache/commons/lang3/reflect/MemberUtils.java index eb62b56da..769cb2f8d 100644 --- a/src/main/java/org/apache/commons/lang3/reflect/MemberUtils.java +++ b/src/main/java/org/apache/commons/lang3/reflect/MemberUtils.java @@ -101,7 +101,7 @@ final class MemberUtils { * @return {@code true} if {@code m} is accessible */ static boolean isAccessible(final Member member) { - return member != null && isPublic(member) && !member.isSynthetic(); + return isPublic(member) && !member.isSynthetic(); } /** diff --git a/src/main/java/org/apache/commons/lang3/stream/Streams.java b/src/main/java/org/apache/commons/lang3/stream/Streams.java index 29a00a726..c8455003d 100644 --- a/src/main/java/org/apache/commons/lang3/stream/Streams.java +++ b/src/main/java/org/apache/commons/lang3/stream/Streams.java @@ -165,7 +165,7 @@ public class Streams { @Override public boolean tryAdvance(final Consumer action) { - return enumeration.hasMoreElements() ? next(action) : false; + return enumeration.hasMoreElements() && next(action); } }