<div dir="ltr">Hi,<br><br>hmmm, repost-try...disappeared somehow. My next remark is more a question and not really a bug report. Sry it's quite complex.<br><br><br>I understand how Arrays Type Annotations in Java and Bytecode work and I have now some interpretation that works fine for me. The other stuff is also quite clear.<br>
<br>What I find totally unintutive is that <br> @Notnull java.lang.Map<br>is not allowed and that I have to write <br> java.lang.@Notnull Map<br><br>Shure, we will use imports in such cases anyway, but I'm interested why this is necessary? Nobody would guess this syntax, even if I know that I have to write<br>
Map.@Notnull Entry<String, String> test;<br>for the inner type.<br><br>I think the last syntax for inner types (which is fine) doesn't really imply the other (for outest type with package-prefixes).<br>From my experience, I'm not really very unflexible with such stuff - all other new Java-syntax like lambdas etc. are totally fine with me, but this immediately was really strange to me and I did it wrong multiple times.<br>
<br>Is there some reason for language/parser consistency that I don't see?<br><br><br><br>Also I have a question about the presentation in bytecode for this inner types. I know it's really hard to describe / to follow here.<br>
<br>For array types I know, the Type Path kind of means that for each ARRAY step, I just go into the component type of the current type context.<br>If I annotate an array type T[][][] without an ARRAY step into the components, I just imply that the full dimension type T[][][] is meant.<br>
If I encounter 3 ARRAY steps, I imply that I want to annotate the innermost element type T and the resulting Java code is @A T[][][]. This is consistent.<br><br><br>For inner types, if I annotate an inner class like T0.T1.T2 without a Type Path with INNER steps, this means according to the spec: @A T0.T1.T2<br>
If I have 2 INNER steps, then I get: T0.T1.@A T2<br><br>This looks very strange to me. I would expect it exactly the other way around and would think that type systems are not very happy with this byte code encoding?!<br>
<br>For me it would be more clear that if I have no given Type Path with INNER and I add type annotation info to T0.T1.T2, then I would think that this information belongs to the outmost (the real) type T2. The other parts are just context.<br>
If I have one INNER Type Path step, I would expcect the outer type T0.T1 should get this annotation etc.<br><br><br>So this all is more a question or request to have some reasoning behind this.<br>May be there is a form of an interpretation or some constraints that make this decissions transparent to Java users and document it somewhere?<br>
<br>Sry if my terminology isn't exact in all parts, it's not my daily business.<br><br>Cheers,<br>André<br></div>