mirror of
https://github.com/nextcloud/notes-android.git
synced 2024-11-23 05:16:15 +03:00
Remove manual NPE and replace it with Objects#requireNonNull
This commit is contained in:
parent
b9f041332f
commit
b88429a200
1 changed files with 3 additions and 6 deletions
|
@ -3,6 +3,7 @@ package it.niedermann.owncloud.notes.util;
|
||||||
import androidx.annotation.VisibleForTesting;
|
import androidx.annotation.VisibleForTesting;
|
||||||
|
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
import java.util.Objects;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
@ -95,12 +96,8 @@ public class NoteLinksUtils {
|
||||||
* @see String#join(CharSequence, Iterable)
|
* @see String#join(CharSequence, Iterable)
|
||||||
*/
|
*/
|
||||||
private static String join(CharSequence delimiter, Iterable<String> elements) {
|
private static String join(CharSequence delimiter, Iterable<String> elements) {
|
||||||
if (delimiter == null) {
|
Objects.requireNonNull(delimiter);
|
||||||
throw new NullPointerException("Parameter delimiter must not be null");
|
Objects.requireNonNull(elements);
|
||||||
}
|
|
||||||
if (elements == null) {
|
|
||||||
throw new NullPointerException("Parameter elements must not be bull");
|
|
||||||
}
|
|
||||||
|
|
||||||
StringBuilder builder = new StringBuilder();
|
StringBuilder builder = new StringBuilder();
|
||||||
for (String item : elements) {
|
for (String item : elements) {
|
||||||
|
|
Loading…
Reference in a new issue