Do not use Optional in yang-data-tree-ri operations

Description

We are using Optional<? extends TreeNode> as baseline metadata against we validate the tree – throughout ModificationApplyOperation – both as an argument and as a return value.

While the return value might be appropriate, the use as arguments is not (as we are not religious about them as some others.

This also leads us to store Optionals as fields, which leaks them to the heap, which means we have some amount of overhead unless the JVM can prove an InMemoryModification does not leak to heap. That always happens by the very design.

Convert use of Optional<? extends TreeNode> to @Nullable TreeNode and explicitly annotate pre-existing uses of plain TreeNode references as @NonNull.

Activity

Show:
Done

Details

Assignee

Reporter

Labels

Components

Fix versions

Priority

Created September 4, 2023 at 10:12 PM
Updated October 20, 2023 at 4:44 PM
Resolved October 20, 2023 at 4:44 PM