[YANGTOOLS-908] DeclaredStatement.argument() nullness is ambiguous Created: 05/Oct/18  Updated: 03/Feb/21  Resolved: 25/Mar/20

Status: Resolved
Project: yangtools
Component/s: parser
Affects Version/s: None
Fix Version/s: 5.0.0

Type: Improvement Priority: Medium
Reporter: Robert Varga Assignee: Robert Varga
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Blocks
is blocked by YANGTOOLS-912 {Input,Output}Statement definition vi... Resolved
Issue split
split to YANGTOOLS-1220 Switch non-existent arguments to Empt... Resolved
Relates
relates to YANGTOOLS-907 Get rid of javax.annotation nullness ... Resolved

 Description   

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.


Generated at Wed Feb 07 20:54:39 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.