Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add additional null-safe split methods in KiwiStrings #910

Closed
sleberknight opened this issue Mar 9, 2023 · 0 comments · Fixed by #911
Closed

Add additional null-safe split methods in KiwiStrings #910

sleberknight opened this issue Mar 9, 2023 · 0 comments · Fixed by #911
Assignees
Labels
new feature A new feature such as a new class, method, package, group of classes, etc.
Milestone

Comments

@sleberknight
Copy link
Member

KiwiStrings contains nine methods that split a CharSequence to either Iterable<String> or List<String>. These methods do not accept null values and will throw an exception if null is given as the argument. We have one "null-safe" method, nullSafeSplitOnCommas which corresponds to splitOnCommas but does not throw an exception if given null or blank input.

This task is to create null-safe methods corresponding to the existing methods, but which return an empty result if given null or blank input. While this does increase the API surface area, this is not a huge problem since it's just a utility class, and more importantly does not change the existing API or its behavior, and therefore existing code does not need to change at all.

@sleberknight sleberknight added the new feature A new feature such as a new class, method, package, group of classes, etc. label Mar 9, 2023
@sleberknight sleberknight added this to the 2.6.0 milestone Mar 9, 2023
@sleberknight sleberknight self-assigned this Mar 9, 2023
sleberknight added a commit that referenced this issue Mar 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature A new feature such as a new class, method, package, group of classes, etc.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant