ppkarwasz commented on code in PR #1417:
URL: https://github.com/apache/commons-lang/pull/1417#discussion_r2217720142
##########
src/main/java/org/apache/commons/lang3/ArrayUtils.java:
##########
@@ -9526,32 +9526,30 @@ public static String toString(final Object array, final
String stringIfNull) {
}
/**
- * Returns an array containing the string representation of each element
in the argument array.
- * <p>
- * This method returns {@code null} for a {@code null} input array.
- * </p>
- *
- * @param array the {@code Object[]} to be processed, may be {@code null}.
- * @return {@code String[]} of the same size as the source with its
element's string representation,
- * {@code null} if null array input
- * @since 3.6
- */
+ * <p>Converts an array of objects to an array of strings, handling {@code
null} values gracefully.</p>
+ * <p>If the input array is {@code null}, this method returns {@code null}.</p>
+ * <p>{@code null} elements in the input array are converted to the string
{@code "null"}.</p>
+ *
+ * @param array the array to convert, may be {@code null}
+ * @return a string array, or {@code null} if the input array is {@code null}
Review Comment:
Also, the first “paragraph” of a Javadoc is usually treated specially and is
not in `<p>` tags:
```
Converts an array of objects to an array of strings, handling {@code null}
values gracefully.
```
##########
src/main/java/org/apache/commons/lang3/ArrayUtils.java:
##########
@@ -9526,32 +9526,30 @@ public static String toString(final Object array, final
String stringIfNull) {
}
/**
- * Returns an array containing the string representation of each element
in the argument array.
- * <p>
- * This method returns {@code null} for a {@code null} input array.
- * </p>
- *
- * @param array the {@code Object[]} to be processed, may be {@code null}.
- * @return {@code String[]} of the same size as the source with its
element's string representation,
- * {@code null} if null array input
- * @since 3.6
- */
+ * <p>Converts an array of objects to an array of strings, handling {@code
null} values gracefully.</p>
+ * <p>If the input array is {@code null}, this method returns {@code null}.</p>
+ * <p>{@code null} elements in the input array are converted to the string
{@code "null"}.</p>
+ *
+ * @param array the array to convert, may be {@code null}
+ * @return a string array, or {@code null} if the input array is {@code null}
+ * @since 3.6
+ */
+
public static String[] toStringArray(final Object[] array) {
return toStringArray(array, "null");
}
- /**
- * Returns an array containing the string representation of each element
in the argument
- * array handling {@code null} elements.
- * <p>
- * This method returns {@code null} for a {@code null} input array.
- * </p>
+ /**
+ * <p>Converts the given array of objects to an array of strings.</p>
+ *
Review Comment:
```suggestion
* Converts the given array of objects to an array of strings.
* <p>If the input array is {@code null}, this method returns {@code
null}.</p>
```
If you added the second line to the Javadoc above, I think it should albo be
in this method for coherence.
##########
src/main/java/org/apache/commons/lang3/ArrayUtils.java:
##########
@@ -9526,32 +9526,30 @@ public static String toString(final Object array, final
String stringIfNull) {
}
/**
- * Returns an array containing the string representation of each element
in the argument array.
- * <p>
- * This method returns {@code null} for a {@code null} input array.
- * </p>
- *
- * @param array the {@code Object[]} to be processed, may be {@code null}.
- * @return {@code String[]} of the same size as the source with its
element's string representation,
- * {@code null} if null array input
- * @since 3.6
- */
+ * <p>Converts an array of objects to an array of strings, handling {@code
null} values gracefully.</p>
+ * <p>If the input array is {@code null}, this method returns {@code null}.</p>
+ * <p>{@code null} elements in the input array are converted to the string
{@code "null"}.</p>
+ *
+ * @param array the array to convert, may be {@code null}
+ * @return a string array, or {@code null} if the input array is {@code null}
Review Comment:
Formatting was OK in 3c70bff119595615652f8c8540aa950c1bc86bf5, but in
871b2b4400644dc0d15ee13554f501265bd1f08a you introduced a regression again.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]