From 91d6bd74fa358fdc8d7cb7681c76c509fd9a8e7d Mon Sep 17 00:00:00 2001 From: pascalschumacher Date: Fri, 21 Oct 2016 21:07:10 +0200 Subject: [PATCH] LANG-1278: BooleanUtils javadoc issues --- src/changes/changes.xml | 1 + .../org/apache/commons/lang3/BooleanUtils.java | 15 ++++++--------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/changes/changes.xml b/src/changes/changes.xml index 4d31ea2c3..29f172576 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -46,6 +46,7 @@ The type attribute can be add,update,fix,remove. + BooleanUtils javadoc issues StringUtils#getLevenshteinDistance reduce memory consumption ArrayUtils#add confusing example in javadoc StringUtils#isAnyEmpty and #isAnyBlank should return false for an empty array diff --git a/src/main/java/org/apache/commons/lang3/BooleanUtils.java b/src/main/java/org/apache/commons/lang3/BooleanUtils.java index 2c46d5bd3..8238ebb1c 100644 --- a/src/main/java/org/apache/commons/lang3/BooleanUtils.java +++ b/src/main/java/org/apache/commons/lang3/BooleanUtils.java @@ -48,7 +48,7 @@ public BooleanUtils() { * *

If {@code null} is passed in, {@code null} will be returned.

* - *

NOTE: This returns null and will throw a NullPointerException if autoboxed to a boolean.

+ *

NOTE: This returns null and will throw a NullPointerException if unboxed to a boolean.

* *
      *   BooleanUtils.negate(Boolean.TRUE)  = Boolean.FALSE;
@@ -222,7 +222,7 @@ public static Boolean toBooleanObject(final int value) {
      *
      * 

{@code null} will be converted to {@code null}.

* - *

NOTE: This returns null and will throw a NullPointerException if autoboxed to a boolean.

+ *

NOTE: This returns null and will throw a NullPointerException if unboxed to a boolean.

* *
      *   BooleanUtils.toBoolean(Integer.valueOf(0))    = Boolean.FALSE
@@ -305,7 +305,7 @@ public static boolean toBoolean(final Integer value, final Integer trueValue, fi
     /**
      * 

Converts an int to a Boolean specifying the conversion values.

* - *

NOTE: This returns null and will throw a NullPointerException if autoboxed to a boolean.

+ *

NOTE: This returns null and will throw a NullPointerException if unboxed to a boolean.

* *
      *   BooleanUtils.toBooleanObject(0, 0, 2, 3) = Boolean.TRUE
@@ -337,7 +337,7 @@ public static Boolean toBooleanObject(final int value, final int trueValue, fina
     /**
      * 

Converts an Integer to a Boolean specifying the conversion values.

* - *

NOTE: This returns null and will throw a NullPointerException if autoboxed to a boolean.

+ *

NOTE: This returns null and will throw a NullPointerException if unboxed to a boolean.

* *
      *   BooleanUtils.toBooleanObject(Integer.valueOf(0), Integer.valueOf(0), Integer.valueOf(2), Integer.valueOf(3)) = Boolean.TRUE
@@ -518,7 +518,7 @@ public static Integer toIntegerObject(final Boolean bool, final Integer trueValu
      * (case insensitive) will return {@code false}.
      * Otherwise, {@code null} is returned.

* - *

NOTE: This returns null and will throw a NullPointerException if autoboxed to a boolean.

+ *

NOTE: This returns null and will throw a NullPointerException if unboxed to a boolean.

* *
      *   // N.B. case is not significant
@@ -636,7 +636,7 @@ public static Boolean toBooleanObject(final String str) {
     /**
      * 

Converts a String to a Boolean throwing an exception if no match.

* - *

NOTE: This returns null and will throw a NullPointerException if autoboxed to a boolean.

+ *

NOTE: This returns null and will throw a NullPointerException if unboxed to a boolean.

* *
      *   BooleanUtils.toBooleanObject("true", "true", "false", "null")  = Boolean.TRUE
@@ -1026,9 +1026,6 @@ public static Boolean or(final Boolean... array) {
      *   BooleanUtils.xor(true, true)   = false
      *   BooleanUtils.xor(false, false) = false
      *   BooleanUtils.xor(true, false)  = true
-     *   BooleanUtils.xor(true, true)   = false
-     *   BooleanUtils.xor(false, false) = false
-     *   BooleanUtils.xor(true, false)  = true
      * 
* * @param array an array of {@code boolean}s