Grammar-Kit icon indicating copy to clipboard operation
Grammar-Kit copied to clipboard

Erroneous @Nullable annotation on generated getter

Open Alphasite opened this issue 10 years ago • 1 comments

In my grammar the automatically generated getter seems to be producing a slightly odd result for getUpperBound, which is marked as @Nullable, when it should be @NotNull just like its twin getLowerBound.

range ::= LSB string RANGE_OPERATOR string RSB {
    methods = [
        getLowerBound="/string[0]"
        getUpperBound="/string[1]"
    ]
}

generates:

@NotNull
List<EBNFString> getStringList();

@NotNull
EBNFString getGetLowerBound();

@Nullable
EBNFString getGetUpperBound();

For the interface and unless I'm mistaken that last method should definitely be @NotNull like the lower bound is.

Alphasite avatar Jan 29 '15 21:01 Alphasite

Right. For lists the exact quantity logic is not currently implemented.

gregsh avatar Jul 09 '15 22:07 gregsh