dxbjavid commented on code in PR #774:
URL: https://github.com/apache/commons-text/pull/774#discussion_r4366771114
##########
src/main/java/org/apache/commons/text/similarity/LongestCommonSubsequence.java:
##########
@@ -284,12 +284,16 @@ public CharSequence longestCommonSubsequence(final
CharSequence left, final Char
* @param left first character sequence.
* @param right second character sequence.
* @return longest common substring length array.
+ * @throws IllegalArgumentException if either String input {@code null}.
* @deprecated Deprecated as of 1.10. A more efficient implementation for
calculating LCS is now available.
* Use {@link #longestCommonSubsequence(CharSequence, CharSequence)}
instead to directly calculate the LCS.
* This method will be removed in 2.0.
*/
@Deprecated
public int[][] longestCommonSubstringLengthArray(final CharSequence left,
final CharSequence right) {
+ if (left == null || right == null) {
+ throw new IllegalArgumentException("Inputs must not be null");
Review Comment:
Done, it now uses Objects.requireNonNull(left, "left") and the same for
right, so a null argument throws NullPointerException with the parameter name.
I've updated the @throws tag and the three tests to expect NPE to match.
--
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]