Remove TypeBuilder @Nullable annotation 96/88496/7
authorRobert Varga <robert.varga@pantheon.tech>
Wed, 18 Mar 2020 14:23:17 +0000 (15:23 +0100)
committerRobert Varga <nite@hq.sk>
Fri, 14 Aug 2020 18:51:26 +0000 (18:51 +0000)
SpotBugs is getting a bit confused and Eclipse also reports errors
around our use of base type here -- we cannot reasonably express
nullness without sacrificing method finality. Remove annotations
for now, we'll figure out this detail later.

Change-Id: If2f9d4925a2e3815be0e64d912dd14ebd886b6fe
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
yang/yang-model-util/src/main/java/org/opendaylight/yangtools/yang/model/util/type/TypeBuilder.java

index 19071d0697263a4404603a642069fb70ef2b11c9..c9bd64ed42538427343a0f22917c53fe46c8deaa 100644 (file)
@@ -12,7 +12,6 @@ import static java.util.Objects.requireNonNull;
 import com.google.common.collect.ImmutableList;
 import java.util.Collection;
 import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.jdt.annotation.Nullable;
 import org.opendaylight.yangtools.concepts.Builder;
 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
 import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
@@ -21,14 +20,14 @@ import org.opendaylight.yangtools.yang.model.api.UnknownSchemaNode;
 public abstract class TypeBuilder<T extends TypeDefinition<T>> implements Builder<T> {
     private final ImmutableList.Builder<UnknownSchemaNode> unknownSchemaNodes = ImmutableList.builder();
     private final @NonNull SchemaPath path;
-    private final @Nullable T baseType;
+    private final T baseType;
 
-    TypeBuilder(final @Nullable T baseType, final SchemaPath path) {
+    TypeBuilder(final T baseType, final SchemaPath path) {
         this.path = requireNonNull(path);
         this.baseType = baseType;
     }
 
-    final @Nullable T getBaseType() {
+    final T getBaseType() {
         return baseType;
     }