This is an automated email from the ASF dual-hosted git repository. erans pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-numbers.git
commit c3c7c1d3a987b0c26bbea38b3970fbf50758b01f Author: Gilles Sadowski <[email protected]> AuthorDate: Sun Sep 29 16:06:22 2019 +0200 Simplify. Reported by "SonarQube". --- .../apache/commons/numbers/complex/Complex.java | 24 ++++++++-------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/commons-numbers-complex/src/main/java/org/apache/commons/numbers/complex/Complex.java b/commons-numbers-complex/src/main/java/org/apache/commons/numbers/complex/Complex.java index b0e71ef..9c55c53 100644 --- a/commons-numbers-complex/src/main/java/org/apache/commons/numbers/complex/Complex.java +++ b/commons-numbers-complex/src/main/java/org/apache/commons/numbers/complex/Complex.java @@ -188,32 +188,24 @@ public final class Complex implements Serializable { /** * Returns true if either real or imaginary component of the Complex - * is NaN + * is NaN. * - * @return {@code boolean} + * @return {@code true} is this instance contains NaN. */ public boolean isNaN() { - if (Double.isNaN(real) || - Double.isNaN(imaginary)) { - return true; - } else { - return false; - } + return Double.isNaN(real) || + Double.isNaN(imaginary); } /** * Returns true if either real or imaginary component of the Complex - * is Infinite + * is infinite. * - * @return {@code boolean} + * @return {@code true} if this instance contains an infinite value. */ public boolean isInfinite() { - if (Double.isInfinite(real) || - Double.isInfinite(imaginary)) { - return true; - } else { - return false; - } + return Double.isInfinite(real) || + Double.isInfinite(imaginary); } /**
