| Summary: | [1.8][null] better combine null type annotations on substitution of parameterized type | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Stephan Herrmann <stephan.herrmann> | ||||
| Component: | Core | Assignee: | Stephan Herrmann <stephan.herrmann> | ||||
| Status: | VERIFIED DUPLICATE | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | jarthana, manoj.palat, shankhba | ||||
| Version: | 4.4 | ||||||
| Target Milestone: | 4.5 M2 | ||||||
| Hardware: | PC | ||||||
| OS: | Linux | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
(In reply to Stephan Herrmann from comment #0) > Function TypeBinding.unannotated(boolean) from 438458 is over-eager as can > be shown by this test: clickable ref: bug 438458 Created attachment 245800 [details]
patch under test
This is the change I'm currently testing on top of all my changes pending for 4.4.1.
The additional changes in BoundSet simply enhance safety not to unnecessarily produce contradictory annotations.
Modified patch passed all tests in R4_4_maintenance. Tests released via http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/?id=dc74cb9ccf05bc2089bda4773412bb0387d8bf2f Other than that this bug has been subsumed by bug 441693 *** This bug has been marked as a duplicate of bug 441693 *** Verified for Mars 4.5M2 using I20140915-2000 build. |
Function TypeBinding.unannotated(boolean) from 438458 is over-eager as can be shown by this test: interface I2<T,U extends List<T>> { @NonNull U getU(); } class Main { static String test (I2<@Nullable String, @Nullable ArrayList<@Nullable String>> i2) { return i2.getU().get(0).toUpperCase(); } } While '@NonNull U' overrides the '@Nullable' annotation on the ArrayList type argument for I2, the detail '@Nullable String' must be kept to produce the proper error against the final toUpperCase(). IOW, the return type of i2.getU() must be: @NonNull ArrayList<@Nullable String> the inner @Nullable is currently dropped.