JDT Compiler: Inherited annotations are not visible on bridge methods (works in older version) [message #1733811] |
Wed, 01 June 2016 03:08  |
Eclipse User |
|
|
|
Since upgrading to Eclipse Version Mars.1 Release (4.5.1) i'm facing a problem where the code being generated by the Eclipse compiler is missing annotations from the base class. When compiling with the OpenJDK compiler these annotations are created correctly. The JDT plugin version is: 3.11.1.v20150904-0015.
I assume this is pretty much the same issue which was fixed for the OpenJDK Compiler with issue JDK-6695379.
The class files generated via the Eclipse compiler are missing annotations for inherited public methods which were set on the base class.
In particular this fails for the @TransactionAttribute in a JEE project.
Differences in the class files:
On the superclass (with package visibility) of the given file @TransactionAttribute(NOT_SUPPORTED) was set on method doSomething():
#13 = Utf8 RuntimeVisibleAnnotations
#14 = Utf8 Ljavax/ejb/TransactionAttribute;
#15 = Utf8 value
#16 = Utf8 Ljavax/ejb/TransactionAttributeType;
#17 = Utf8 NOT_SUPPORTED
public void doSomething();
descriptor: ()V
flags: ACC_PUBLIC, ACC_BRIDGE, ACC_SYNTHETIC
Code:
stack=1, locals=1, args_size=1
0: aload_0
1: invokespecial #2 // Method de/thaenert/test/BeanSuperclass.doSomething:()V
4: return
LineNumberTable:
line 10: 0
LocalVariableTable:
Start Length Slot Name Signature
0 5 0 this Lde/thaenert/test/Bean;
RuntimeVisibleAnnotations:
0: #14(#15=e#16.#17)
}
For the compiled code from the Eclipse compiler with the same source code and java version the annotation is missing:
public void doSomething();
descriptor: ()V
flags: ACC_PUBLIC, ACC_BRIDGE, ACC_SYNTHETIC
Code:
stack=1, locals=1, args_size=1
0: aload_0
1: invokespecial #15 // Method de/thaenert/test/BeanSuperclass.doSomething:()V
4: return
LineNumberTable:
line 1: 0
LocalVariableTable:
Start Length Slot Name Signature
}
As specified in JSR 318: EJB 3.1 section 13.3.7.1 i would have expected that this annotation is also visible on the subclass.
Is this something known already?
When using an older version of the JDT plugin this does not happen (Version 3.10.1.v20150204-1700)
Best Regards
Ralf Thaenert
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03759 seconds