Uploaded image for project: 'yangtools'
  1. yangtools
  2. YANGTOOLS-908

DeclaredStatement.argument() nullness is ambiguous

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Done
    • Icon: Medium Medium
    • 5.0.0
    • None
    • parser
    • None

      Statement being argument does not play with utility methods, where we expect the argument to be present. The vast majority of statements are required to have an argument, but there a few (like input/output) which do not.

      When @Nullable annotation comes into play this creates a rather nice conundrum in DeclaredStatement.findFirstDeclaredSubstatementArgument() – we really want to allow only searching for statements which have an argument, otherwise the optional could be interpreted in differing ways.

      We either capture the non-null of argument in an intermediate interface, or move the method completely into a sub-interface. This may be sticky as the class hierarchy will get more complicated, hence this should be part of the next release.

            rovarga Robert Varga
            rovarga Robert Varga
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: