Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/stefan-niedermann/nextcloud-deck.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Niedermann <info@niedermann.it>2020-09-04 14:53:37 +0300
committerStefan Niedermann <info@niedermann.it>2020-09-04 14:53:37 +0300
commitc35fbf3221f45423fe323fd78040d8c443029e95 (patch)
treee81ef8a9907bf6a2715cffba49d231127e608087 /app/src/main/java/it/niedermann/nextcloud/deck/util
parentda1c9fcaf12a914522fc4ffb17ccd301190a7b44 (diff)
Remove not needed null checks
Signed-off-by: Stefan Niedermann <info@niedermann.it>
Diffstat (limited to 'app/src/main/java/it/niedermann/nextcloud/deck/util')
-rw-r--r--app/src/main/java/it/niedermann/nextcloud/deck/util/ProjectUtil.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/util/ProjectUtil.java b/app/src/main/java/it/niedermann/nextcloud/deck/util/ProjectUtil.java
index 1ff2d3460..2721f05c4 100644
--- a/app/src/main/java/it/niedermann/nextcloud/deck/util/ProjectUtil.java
+++ b/app/src/main/java/it/niedermann/nextcloud/deck/util/ProjectUtil.java
@@ -3,6 +3,7 @@ package it.niedermann.nextcloud.deck.util;
import android.net.Uri;
import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
import java.net.URL;
@@ -40,7 +41,7 @@ public class ProjectUtil {
* @param url to extract from
* @return extracted and parsed values as long[] with length 1-2
*/
- public static long[] extractBoardIdAndCardIdFromUrl(@NonNull String url) {
+ public static long[] extractBoardIdAndCardIdFromUrl(@Nullable String url) {
if (url == null) {
throw new IllegalArgumentException("provided url is null");
}
@@ -48,7 +49,7 @@ public class ProjectUtil {
// extract important part
String[] splitByPrefix = url.split(".*index\\.php/apps/deck/#/board/");
// split into board- and card part
- if (splitByPrefix == null || splitByPrefix.length < 2) {
+ if (splitByPrefix.length < 2) {
throw new IllegalArgumentException("this doesn't seem to be an URL containing the board ID");
}
String[] splitBySeparator = splitByPrefix[1].split("/card/");
@@ -61,7 +62,7 @@ public class ProjectUtil {
splitBySeparator[0] = splitBySeparator[0].split("/")[0];
}
- if (splitBySeparator == null || splitBySeparator.length < 1) {
+ if (splitBySeparator.length < 1) {
throw new IllegalArgumentException("this doesn't seem to be a valid URL containing the board ID");
}