TEXT-69: simplifying ternary that returns boolean value
Project: http://git-wip-us.apache.org/repos/asf/commons-text/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-text/commit/4bc51591 Tree: http://git-wip-us.apache.org/repos/asf/commons-text/tree/4bc51591 Diff: http://git-wip-us.apache.org/repos/asf/commons-text/diff/4bc51591 Branch: refs/heads/master Commit: 4bc51591fe9d482a7fdbb21373b51f3f70765bac Parents: 867c38f Author: Rob Tompkins <chtom...@apache.org> Authored: Wed Feb 22 13:23:36 2017 -0500 Committer: Rob Tompkins <chtom...@apache.org> Committed: Wed Feb 22 13:23:36 2017 -0500 ---------------------------------------------------------------------- .../apache/commons/text/translate/NumericEntityUnescaper.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/commons-text/blob/4bc51591/src/main/java/org/apache/commons/text/translate/NumericEntityUnescaper.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/text/translate/NumericEntityUnescaper.java b/src/main/java/org/apache/commons/text/translate/NumericEntityUnescaper.java index e8f59c6..4a89153 100644 --- a/src/main/java/org/apache/commons/text/translate/NumericEntityUnescaper.java +++ b/src/main/java/org/apache/commons/text/translate/NumericEntityUnescaper.java @@ -32,7 +32,7 @@ import java.util.EnumSet; public class NumericEntityUnescaper extends CharSequenceTranslator { /** NumericEntityUnescaper option enum. */ - public static enum OPTION { semiColonRequired, semiColonOptional, errorIfNoSemiColon } + public enum OPTION { semiColonRequired, semiColonOptional, errorIfNoSemiColon } /** EnumSet of OPTIONS, given from the constructor. */ private final EnumSet<OPTION> options; @@ -68,7 +68,7 @@ public class NumericEntityUnescaper extends CharSequenceTranslator { * @return whether the option is set */ public boolean isSet(final OPTION option) { - return options == null ? false : options.contains(option); + return options != null && options.contains(option); } /**