JDK-8027264 : Bytecode annotations missing for constructor invocations
  • Type: Sub-task
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 8
  • Priority: P3
  • Status: Closed
  • Resolution: Not an Issue
  • Submitted: 2013-10-24
  • Updated: 2013-10-29
  • Resolved: 2013-10-29
Description
For the following code:

Thing t = new @X Thing();

The corresponding new instruction in bytecode will have an @X annotation.  However, the corresponding constructor invocation will not.
Comments
8-defer-request: See parent task for justification.
29-10-2013

The JSR 308 design document in Section 3.3.9 contained: "The offset field denotes the offset (i.e., within the bytecodes of the containing method) of the instanceof bytecode emitted for the type tests, the new bytecode emitted for the object creation expression, or the instruction that implements a method/constructor reference. These annotations are attached to a single bytecode, not a bytecode range (or ranges): the annotation provides information about the type of a single value, not about the behavior of a code block." This states that @X should be attached to the single bytecode of the "new" instruction. So this bug report seems invalid.
24-10-2013