Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » JDT Compiler: Inherited annotations are not visible on bridge methods (works in older version)
JDT Compiler: Inherited annotations are not visible on bridge methods (works in older version) [message #1733811] Wed, 01 June 2016 07:08 Go to next message
Ralf Thaenert is currently offline Ralf ThaenertFriend
Messages: 2
Registered: June 2016
Location: Germany
Junior Member
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
Re: JDT Compiler: Inherited annotations are not visible on bridge methods (works in older version) [message #1733972 is a reply to message #1733811] Thu, 02 June 2016 14:31 Go to previous messageGo to next message
Stephan Herrmann is currently offline Stephan HerrmannFriend
Messages: 1853
Registered: July 2009
Senior Member
Ralf Thaenert wrote on Wed, 01 June 2016 09:08

I assume this is pretty much the same issue which was fixed for the OpenJDK Compiler with issue JDK-6695379.


Thanks for the reference. This would map to https://bugs.eclipse.org/437446 which was closed as a dup of https://bugs.eclipse.org/427745 which in turn was marked as resolved for Eclipse 4.4.

Quote:

Is this something known already?


As we thought this issue is resolved, can you please file a bug with
- the source code that triggers this
- a link to the two above bugs for comparison


Quote:

When using an older version of the JDT plugin this does not happen (Version 3.10.1.v20150204-1700)


That's an odd version, in that range I have 3.10.1.v20140902-0626 and 3.10.2.v20150120-1634
But in fact using a similar example (from the JDK-bug) I didn't see annotations on the bridge with any of these ecj version.

Thanks,
Stephan

Re: JDT Compiler: Inherited annotations are not visible on bridge methods (works in older version) [message #1734064 is a reply to message #1733972] Fri, 03 June 2016 12:57 Go to previous message
Ralf Thaenert is currently offline Ralf ThaenertFriend
Messages: 2
Registered: June 2016
Location: Germany
Junior Member
Hey Stephan,

i put in https://bugs.eclipse.org/495396 and attached a sample project to that bug.
Thank you for the quick response!

Best Regards
Ralf
Previous Topic:Can Eclipse Mars communicate with RaspBerry pi 2 like NetBean can
Next Topic:How to get rid of special characters in the console output?
Goto Forum:
  


Current Time: Sat Apr 27 04:00:20 GMT 2024

Powered by FUDForum. Page generated in 0.02733 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top