Closed Bananeweizen closed 4 years ago
@Bananeweizen great Q but I've no idea actually... :smile:
maybe @maggu2810 or @sylvainlaurent or @kwin know more.
it's weird those plusses. @vorburger do you remember how https://github.com/lastnpe/eclipse-null-eea-augments/blob/master/libraries/java/java/util/Collection.eea#L7 had been created ? is it using eclipse quick fix? which version?
It's easily reproducible with the current JDT. Delete the Collection.eea file, and then start annotating that method again. Look for the preview in the tooltip of the "Mark @NonNull" quickfix, there you see it adds "1" and "+" together. Then you use the "Remove annotation" quickfix afterwards, that removes only the "1". Voila, single "+" left.
My observations has been the ones that has already been commented here: https://github.com/lastnpe/eclipse-null-eea-augments/pull/26
But I assume the one that writes the nullness checking code and EEA language syntax does know that better :wink:
@Bananeweizen : I did just like you said and I don't have the + sign. Using eclipse Oxygen.1
@brychcy could probably shed more light on this, if he has the time..
"+" and "-" are for wildcards. "+" is for a wildcard of the form "? extends BOUND" and "-" for "? super BOUND" and "*" is for an unbound wildcard
The syntax is based on the jvm signature syntax (which doesn't seem to explain which is which) see https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.7.9.1
Ah, so this is similar to 23.1.4 here https://checkerframework.org/manual/#generics Correct?
That's my understanding. I think this question has been answered.
I'm currently merging some EEA files and wonder about the additional "+" sign in EEA files, for example https://github.com/lastnpe/eclipse-null-eea-augments/blob/master/libraries/java/java/util/Collection.eea#L7. I noticed this "+" is added together with the normal "0" or "1" when using the menus to annotate something. But what is the exact meaning? And under which circumstances does it get added?
Addendum: And should we consider it a bug that the newly added "+" sign is not deleted again when removing the nullness/nonnull annotation? That is how such a single "+" sign as shown above get's into the EEA files: Add an annotation and remove it again, and only the + remains...