| Summary: | [1.8] type annotation on abbreviated inner class is not marked as inner type | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Stephan Herrmann <stephan.herrmann> | ||||
| Component: | Core | Assignee: | Andrew Clement <aclement> | ||||
| Status: | RESOLVED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | srikanth_sankaran | ||||
| Version: | 4.3 | Flags: | srikanth_sankaran:
review+
|
||||
| Target Milestone: | BETA J8 | ||||||
| Hardware: | PC | ||||||
| OS: | Linux | ||||||
| Whiteboard: | |||||||
| Bug Depends on: | |||||||
| Bug Blocks: | 409235 | ||||||
| Attachments: |
|
||||||
Andy, do you want to take a look? I'll check in the test case in a little while (as part of bug 392384). If you think the bug is a must fix for the GA, please set the target to "BETA J8" show this bug shows up in various cached queries that may use target milestone in criteria. Andy, as of date, this is the only bug open against your name. Thanks. Created attachment 234668 [details]
test and fix
Variation of testcode created as a test case. Small fix addresses it.
apply fix after patch on bug 415470 (to minimize chance of merge conflicts) This contribution complies with http://www.eclipse.org/legal/CoO.php Patch looks good. Fixed a new compile time warning that inadvertently got introduced by the patch and released the fix and tests here: http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/?h=BETA_JAVA8&id=8499ee1311c075235e045f23469dcc5f2d30119d, Thanks Andy. |
Given the following class: package p; import org.foo.*; // here we have type annotations for nullity public abstract class X1 { public class Inner {} public void nesting(@NonNull Inner i1, @NonNull X1.@Nullable Inner i2) { } } This currently generates the following byte code: public void nesting(p.X1$Inner, p.X1$Inner); ... RuntimeInvisibleTypeAnnotations: 0: #19(): METHOD_FORMAL_PARAMETER, param_index=0 1: #19(): METHOD_FORMAL_PARAMETER, param_index=1 2: #27(): METHOD_FORMAL_PARAMETER, param_index=1, location=[INNER_TYPE] ... AFAICS the first annotation is wrong, it should have the same shape as the last one. In 3.4 the spec says: "The type path that is stored in the class file is with respect to the full type, not the source code representation. ..." ... and goes on explaining. The full type of the first formal parameter is correctly rendered as p.X1$Inner (see the method signature), accordingly the type annotation for Inner should be marked with "location=[INNER_TYPE]", no?