| Summary: | [null] The "Inherit null annotations" feature should be stronger than @NonNullByDefault | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Michael Vorburger <mike> |
| Component: | Core | Assignee: | JDT-Core-Inbox <jdt-core-inbox> |
| Status: | CLOSED WONTFIX | QA Contact: | |
| Severity: | critical | ||
| Priority: | P3 | CC: | stephan.herrmann |
| Version: | 4.6 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| Whiteboard: | stalebug | ||
|
Description
Michael Vorburger
The current design of null annotation inheritance is a compromise. The background can be studied in bug 388281. Summary: Coming from bug 385440 there was a common understanding that annotation inheritance would be particularly important for migration scenarii: if super class gets annotated, this shouldn't force all "legacy" subclasses to react immediately. By means of annotation inheritance those subclasses could still be legal without changes. Discussion regarding "conflicts" between inheritance and @NNBD starts in bug 388281 comment 7, were I argued that things could get quite confusing and "I don't want you to write this kind of code". The discussion also touches on showing effective null annotations in hovers, which at that point was not planned, but meanwhile I've implemented that feature. So regarding visualization we are in a better position by now (but others made a strong point that code needs to be understandable also without the tool). In bug 388281 comment 10 Sebastian proposed "the strongest annotation wins", which I answered by proposing "inheritance beats default". Till today I am not 100% convinced which of the two approaches would be more useful / match more people's intuition. Today's solution was introduced in bug 388281 comment 12. Since then we treat inheritance and @NNBD equally as mechanisms for "implicit" null annotations. In bug 388281 comment 20 Markus criticized that "this 'inheritance' is not well-defined and easily understood, and it carries UX problems with it..." Agreement was achieved in bug 388281 comment 24 f. This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie. |