Add a few 3.0.0 FIXMEs 33/72133/2
authorRobert Varga <robert.varga@pantheon.tech>
Mon, 21 May 2018 20:09:42 +0000 (22:09 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Tue, 22 May 2018 00:45:40 +0000 (02:45 +0200)
Clarify thrown exceptions and nullness, as well as the need to use
Optional.

Change-Id: I8a960b2593b87552f24d0de3d28cb75a1d4fb040
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/tree/DataTreeCandidateNode.java
yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/tree/DataTreeTip.java
yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/tree/StoreTreeNode.java
yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/tree/spi/MutableTreeNode.java
yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/tree/spi/TreeNode.java

index 1f5ec6a47a0b82766d63596cd3247348c41aaa46..3f525aa0f245ce8a9095b7772d3705f46bbd032d 100644 (file)
@@ -15,13 +15,12 @@ import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgum
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 
 /**
- * A single node within a {@link DataTreeCandidate}. The nodes are organized
- * in tree hierarchy, reflecting the modification from which this candidate
- * was created. The node itself exposes the before- and after-image of the
- * tree restricted to the modified nodes.
+ * A single node within a {@link DataTreeCandidate}. The nodes are organized in tree hierarchy, reflecting
+ * the modification from which this candidate was created. The node itself exposes the before- and after-image
+ * of the tree restricted to the modified nodes.
  */
+// FIXME: 3.0.0: Use @NonNullByDefault
 public interface DataTreeCandidateNode {
-
     /**
      * Get the node identifier.
      *
@@ -43,6 +42,8 @@ public interface DataTreeCandidateNode {
      * @param childIdentifier Identifier of child node
      * @return Modified child or null if child was not modified.
      */
+    // FIXME: 3.0.0: document NullPointerException being thrown
+    // FIXME: 3.0.0: return an Optional
     @Nullable DataTreeCandidateNode getModifiedChild(PathArgument childIdentifier);
 
     /**
index 8f23488474a79e81c6542a8171a3ba30975352b6..77c3142c5f7cf11b0bda5386c5a9bc075eaf84f6 100644 (file)
@@ -10,27 +10,30 @@ package org.opendaylight.yangtools.yang.data.api.schema.tree;
 import com.google.common.annotations.Beta;
 
 /**
- * Tip of a data tree instance. It acts as a point to which modifications can
- * be applied.
+ * Tip of a data tree instance. It acts as a point to which modifications can be applied.
  */
+// FIXME: 3.0.0: Use @NonNullByDefault
 @Beta
 public interface DataTreeTip {
     /**
      * Validate whether a particular modification can be applied to the data tree.
-     * @param modification
-     *                  Data tree modification.
-     * @throws DataValidationFailedException
-     *                  If modification data is not valid.
+     *
+     * @param modification Data tree modification.
+     * @throws DataValidationFailedException If modification data is not valid.
      */
+    // FIXME: 3.0.0: document NullPointerException being thrown
+    // FIXME: 3.0.0: document IllegalArgumentException being thrown
     void validate(DataTreeModification modification) throws DataValidationFailedException;
 
     /**
      * Prepare a modification for commit.
      *
-     * @param modification
-     *                  Data tree modification.
+     * @param modification Data tree modification.
      * @return candidate data tree
      */
+    // FIXME: 3.0.0: document NullPointerException being thrown
+    // FIXME: 3.0.0: document IllegalArgumentException being thrown
+    // FIXME: 3.0.0: throw DataValidationFailedException or similar
     DataTreeCandidateTip prepare(DataTreeModification modification);
 
     /**
index 541dc60a8b5936c75075049b3a46093c07e5ca42..c8778f4377dcba183b0ddfe74c3e3c4d3ace72c8 100644 (file)
@@ -11,18 +11,19 @@ import java.util.Optional;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
 
 /**
- * A tree node which has references to its child leaves. This are typically
- * internal non-data leaves, such as containers, lists, etc.
+ * A tree node which has references to its child leaves. This are typically internal non-data leaves, such as
+ * containers, lists, etc.
  *
  * @param <C> Final node type
  */
+// FIXME: 3.0.0: Use @NonNullByDefault
 public interface StoreTreeNode<C extends StoreTreeNode<C>> {
-
     /**
      * Returns a direct child of the node.
      *
      * @param child Identifier of child
      * @return Optional with node if the child is existing, {@link Optional#empty()} otherwise.
      */
+    // FIXME: 3.0.0: document NullPointerException being thrown
     Optional<C> getChild(PathArgument child);
 }
index 933b7a1fdf954510667699ce40d1a97629b11198..abdffe906897301c116f2febe4669538643c627e 100644 (file)
@@ -12,16 +12,17 @@ import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 import org.opendaylight.yangtools.yang.data.api.schema.tree.StoreTreeNode;
 
 /**
- * A mutable tree node. This is a transient view materialized from a pre-existing
- * node. Modifications are isolated. Once this object is {@link #seal()}-ed,
- * any interactions with it will result in undefined behavior.
+ * A mutable tree node. This is a transient view materialized from a pre-existing node. Modifications are isolated. Once
+ * this object is {@link #seal()}ed, any interactions with it will result in undefined behavior.
  */
+// FIXME: 3.0.0: Use @NonNullByDefault
 public interface MutableTreeNode extends StoreTreeNode<TreeNode> {
     /**
      * Set the data component of the node.
      *
      * @param data New data component, may not be null.
      */
+    // FIXME: 3.0.0: document NullPointerException being thrown
     void setData(NormalizedNode<?, ?> data);
 
     /**
@@ -30,6 +31,7 @@ public interface MutableTreeNode extends StoreTreeNode<TreeNode> {
      *
      * @param subtreeVersion New subtree version.
      */
+    // FIXME: 3.0.0: document NullPointerException being thrown
     void setSubtreeVersion(Version subtreeVersion);
 
     /**
@@ -38,6 +40,7 @@ public interface MutableTreeNode extends StoreTreeNode<TreeNode> {
      *
      * @param child New child node.
      */
+    // FIXME: 3.0.0: document NullPointerException being thrown
     void addChild(TreeNode child);
 
     /**
@@ -46,6 +49,7 @@ public interface MutableTreeNode extends StoreTreeNode<TreeNode> {
      *
      * @param id Child identificator.
      */
+    // FIXME: 3.0.0: document NullPointerException being thrown
     void removeChild(PathArgument id);
 
     /**
index d8adb3b676a163724f6fc8b37983e07350ecc4e9..805c82d6f7567afe9328b01a5e49a12ebb897308 100644 (file)
@@ -29,6 +29,7 @@ import org.opendaylight.yangtools.yang.data.api.schema.tree.StoreTreeNode;
  */
 // FIXME: BUG-2399: clarify that versioning rules are not enforced for non-presence containers, as they are not
 //                  considered to be data nodes.
+// FIXME: 3.0.0: Use @NonNullByDefault
 public interface TreeNode extends Identifiable<PathArgument>, StoreTreeNode<TreeNode> {
     /**
      * Get the data node version. This version is updated whenever the data representation of this particular node