aboutsummaryrefslogtreecommitdiffstats
path: root/config-lib
diff options
context:
space:
mode:
authorHarald Musum <musum@verizonmedia.com>2019-08-29 09:52:43 +0200
committerHarald Musum <musum@verizonmedia.com>2019-08-29 09:52:43 +0200
commit408ae127916b740cfff1620afdce0bc12ae632e9 (patch)
tree565f5dd2a9eaf995115ed66ce3a17d53c274ab18 /config-lib
parent640f1272a1800551f10b96321c82e75c41c6e54d (diff)
Remove use of Nullable and NotNull annotations
Different implementations and using OSGi makes it really hard to use these annotations and the value of using them is IMHO not very high.
Diffstat (limited to 'config-lib')
-rw-r--r--config-lib/src/main/java/com/yahoo/config/BooleanNode.java4
-rw-r--r--config-lib/src/main/java/com/yahoo/config/DoubleNode.java4
-rw-r--r--config-lib/src/main/java/com/yahoo/config/FileNode.java4
-rw-r--r--config-lib/src/main/java/com/yahoo/config/IntegerNode.java4
-rw-r--r--config-lib/src/main/java/com/yahoo/config/LeafNode.java4
-rwxr-xr-xconfig-lib/src/main/java/com/yahoo/config/LongNode.java4
-rw-r--r--config-lib/src/main/java/com/yahoo/config/PathNode.java4
-rw-r--r--config-lib/src/main/java/com/yahoo/config/ReferenceNode.java4
-rw-r--r--config-lib/src/main/java/com/yahoo/config/StringNode.java3
-rw-r--r--config-lib/src/main/java/com/yahoo/config/UrlNode.java4
-rw-r--r--config-lib/src/test/java/com/yahoo/config/EnumNodeTest.java4
11 files changed, 11 insertions, 32 deletions
diff --git a/config-lib/src/main/java/com/yahoo/config/BooleanNode.java b/config-lib/src/main/java/com/yahoo/config/BooleanNode.java
index 3674f98a2b6..34b3b13fba0 100644
--- a/config-lib/src/main/java/com/yahoo/config/BooleanNode.java
+++ b/config-lib/src/main/java/com/yahoo/config/BooleanNode.java
@@ -1,8 +1,6 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.config;
-import edu.umd.cs.findbugs.annotations.NonNull;
-
/**
* The BooleanNode class represents a boolean in a configuration tree.
*/
@@ -30,7 +28,7 @@ public class BooleanNode extends LeafNode<Boolean> {
}
@Override
- protected boolean doSetValue(@NonNull String value) {
+ protected boolean doSetValue(String value) {
if (! value.equalsIgnoreCase("false") && ! value.equalsIgnoreCase("true")) {
return false;
}
diff --git a/config-lib/src/main/java/com/yahoo/config/DoubleNode.java b/config-lib/src/main/java/com/yahoo/config/DoubleNode.java
index 0b0562565a2..7e1f75e29dd 100644
--- a/config-lib/src/main/java/com/yahoo/config/DoubleNode.java
+++ b/config-lib/src/main/java/com/yahoo/config/DoubleNode.java
@@ -1,8 +1,6 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.config;
-import edu.umd.cs.findbugs.annotations.NonNull;
-
/**
* The DoubleNode class represents a double in a configuration tree.
*/
@@ -30,7 +28,7 @@ public class DoubleNode extends LeafNode<Double> {
}
@Override
- protected boolean doSetValue(@NonNull String value) {
+ protected boolean doSetValue(String value) {
try {
this.value = Double.parseDouble(value);
return true;
diff --git a/config-lib/src/main/java/com/yahoo/config/FileNode.java b/config-lib/src/main/java/com/yahoo/config/FileNode.java
index f4846ad3c87..3e0355e3cb4 100644
--- a/config-lib/src/main/java/com/yahoo/config/FileNode.java
+++ b/config-lib/src/main/java/com/yahoo/config/FileNode.java
@@ -1,8 +1,6 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.config;
-import edu.umd.cs.findbugs.annotations.NonNull;
-
/**
* Represents a 'file' in a {@link ConfigInstance}, usually a filename.
*
@@ -33,7 +31,7 @@ public class FileNode extends LeafNode<FileReference> {
}
@Override
- protected boolean doSetValue(@NonNull String stringVal) {
+ protected boolean doSetValue(String stringVal) {
value = new FileReference(ReferenceNode.stripQuotes(stringVal));
return true;
}
diff --git a/config-lib/src/main/java/com/yahoo/config/IntegerNode.java b/config-lib/src/main/java/com/yahoo/config/IntegerNode.java
index e027eaf74a4..e19429b2ae6 100644
--- a/config-lib/src/main/java/com/yahoo/config/IntegerNode.java
+++ b/config-lib/src/main/java/com/yahoo/config/IntegerNode.java
@@ -1,8 +1,6 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.config;
-import edu.umd.cs.findbugs.annotations.NonNull;
-
/**
* The IntegerNode class represents an integer in a configuration tree.
*/
@@ -31,7 +29,7 @@ public class IntegerNode extends LeafNode<Integer> {
}
@Override
- protected boolean doSetValue(@NonNull String value) {
+ protected boolean doSetValue(String value) {
try {
this.value = Integer.parseInt(value);
return true;
diff --git a/config-lib/src/main/java/com/yahoo/config/LeafNode.java b/config-lib/src/main/java/com/yahoo/config/LeafNode.java
index 15575590314..81b2230006e 100644
--- a/config-lib/src/main/java/com/yahoo/config/LeafNode.java
+++ b/config-lib/src/main/java/com/yahoo/config/LeafNode.java
@@ -1,8 +1,6 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.config;
-import edu.umd.cs.findbugs.annotations.NonNull;
-
/**
* Superclass for all leaf nodes in a {@link ConfigInstance}.
* <p>
@@ -66,7 +64,7 @@ public abstract class LeafNode<T> extends Node implements Cloneable {
}
// TODO: should throw exception instead of return false.
- protected abstract boolean doSetValue(@NonNull String value);
+ protected abstract boolean doSetValue(String value);
/**
* This method is meant for internal use in the configuration
diff --git a/config-lib/src/main/java/com/yahoo/config/LongNode.java b/config-lib/src/main/java/com/yahoo/config/LongNode.java
index c1487fa23a2..8a569be234f 100755
--- a/config-lib/src/main/java/com/yahoo/config/LongNode.java
+++ b/config-lib/src/main/java/com/yahoo/config/LongNode.java
@@ -1,8 +1,6 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.config;
-import edu.umd.cs.findbugs.annotations.NonNull;
-
/**
* Represents a long in a configuration tree.
* @author gjoranv
@@ -32,7 +30,7 @@ public class LongNode extends LeafNode<Long> {
}
@Override
- protected boolean doSetValue(@NonNull String value) {
+ protected boolean doSetValue(String value) {
try {
this.value = Long.parseLong(value);
return true;
diff --git a/config-lib/src/main/java/com/yahoo/config/PathNode.java b/config-lib/src/main/java/com/yahoo/config/PathNode.java
index 9d73b5e23c2..17643758009 100644
--- a/config-lib/src/main/java/com/yahoo/config/PathNode.java
+++ b/config-lib/src/main/java/com/yahoo/config/PathNode.java
@@ -1,8 +1,6 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.config;
-import edu.umd.cs.findbugs.annotations.NonNull;
-
import java.io.File;
import java.nio.file.Path;
import java.util.ArrayList;
@@ -44,7 +42,7 @@ public class PathNode extends LeafNode<Path> {
}
@Override
- protected boolean doSetValue(@NonNull String stringVal) {
+ protected boolean doSetValue(String stringVal) {
throw new UnsupportedOperationException("doSetValue should not be necessary since the library anymore!");
}
diff --git a/config-lib/src/main/java/com/yahoo/config/ReferenceNode.java b/config-lib/src/main/java/com/yahoo/config/ReferenceNode.java
index 14146156865..8e9926db5c4 100644
--- a/config-lib/src/main/java/com/yahoo/config/ReferenceNode.java
+++ b/config-lib/src/main/java/com/yahoo/config/ReferenceNode.java
@@ -1,8 +1,6 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.config;
-import edu.umd.cs.findbugs.annotations.NonNull;
-
/**
* A ReferenceNode class represents a reference (that is a config-id)
* in a {@link ConfigInstance}.
@@ -44,7 +42,7 @@ public class ReferenceNode extends LeafNode<String> {
}
@Override
- protected boolean doSetValue(@NonNull String value) {
+ protected boolean doSetValue(String value) {
this.value = stripQuotes(value);
return true;
}
diff --git a/config-lib/src/main/java/com/yahoo/config/StringNode.java b/config-lib/src/main/java/com/yahoo/config/StringNode.java
index 50c16714f97..cd26fa3d63b 100644
--- a/config-lib/src/main/java/com/yahoo/config/StringNode.java
+++ b/config-lib/src/main/java/com/yahoo/config/StringNode.java
@@ -2,7 +2,6 @@
package com.yahoo.config;
import com.yahoo.config.text.StringUtilities;
-import edu.umd.cs.findbugs.annotations.NonNull;
/**
* A StringNode class represents a string in a {@link ConfigInstance}.
@@ -110,7 +109,7 @@ public class StringNode extends LeafNode<String> {
* @param value the new value of this node.
*/
@Override
- protected boolean doSetValue(@NonNull String value) {
+ protected boolean doSetValue(String value) {
if (value.startsWith("\"") && value.endsWith("\""))
this.value = unescapeQuotedString(value);
else {
diff --git a/config-lib/src/main/java/com/yahoo/config/UrlNode.java b/config-lib/src/main/java/com/yahoo/config/UrlNode.java
index 0ed70ce0f50..9726a62a739 100644
--- a/config-lib/src/main/java/com/yahoo/config/UrlNode.java
+++ b/config-lib/src/main/java/com/yahoo/config/UrlNode.java
@@ -1,8 +1,6 @@
// Copyright 2018 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.config;
-import edu.umd.cs.findbugs.annotations.NonNull;
-
import java.io.File;
import java.util.List;
import java.util.Map;
@@ -45,7 +43,7 @@ public class UrlNode extends LeafNode<File> {
}
@Override
- protected boolean doSetValue(@NonNull String value) {
+ protected boolean doSetValue(String value) {
throw new UnsupportedOperationException("doSetValue should not be necessary since the library anymore!");
}
diff --git a/config-lib/src/test/java/com/yahoo/config/EnumNodeTest.java b/config-lib/src/test/java/com/yahoo/config/EnumNodeTest.java
index 5feb5bc3b4f..65934e1cff3 100644
--- a/config-lib/src/test/java/com/yahoo/config/EnumNodeTest.java
+++ b/config-lib/src/test/java/com/yahoo/config/EnumNodeTest.java
@@ -1,7 +1,6 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.config;
-import edu.umd.cs.findbugs.annotations.NonNull;
import org.junit.Test;
import static org.hamcrest.CoreMatchers.is;
@@ -9,7 +8,6 @@ import static org.junit.Assert.*;
/**
* @author Ulf Lilleengen
- * @since 5.1
*/
public class EnumNodeTest {
private static class MyNode extends EnumNode<MyNode.Enum> {
@@ -18,7 +16,7 @@ public class EnumNodeTest {
public final static Enum TWO = Enum.TWO;
@Override
- protected boolean doSetValue(@NonNull String name) {
+ protected boolean doSetValue(String name) {
try {
value = Enum.valueOf(name);
return true;