murat8505 / projectlombok

Automatically exported from code.google.com/p/projectlombok
0 stars 1 forks source link

onX bug with JDK8 #743

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. When compiling code like this:

@Getter(onMethod = @__(@XmlElement(name = "xmlName")))

the build breaks with the following error:

[ERROR] diagnostic: 
/home/carlos/Code/project/src/main/java/packages/MyClass.java:15: error: 
duplicate element '<any?>' in annotation @<any?>.
    @Getter(onMethod = @__(@XmlElement(name = "xmlName")))
                                       ^
[ERROR] error on execute: error during compilation

What is the expected output? What do you see instead?

Build success.

What version of the product are you using? On what operating system?

1.12.6

Please provide any additional information below.

Original issue reported on code.google.com by car...@contaazul.com on 15 Oct 2014 at 7:18

GoogleCodeExporter commented 9 years ago
I can confirm that it also happens in version 1.14.8.

Original comment by car...@contaazul.com on 15 Oct 2014 at 7:24

GoogleCodeExporter commented 9 years ago
We're trying to upgrade a project to building with Java 8 and get this problem 
too.

Works fine in Eclipse Luna, but fails with our Gradle 2.1 build.

I've tried with Lombok 1.16.2 and 1.16.4

Compiling with Oracle JDK 1.8.0_45 with source and target compatibility set to 
1.7 in our Gradle build works, but setting source and target compatibility set 
to 1.8 and we get:

  symbol:   class __
  location: class IVValMTDTransaction
C:\Users\sdick\git\hedgesphere-mt\HSMtApi\src\main\java\ch\hedgesphere\transacti
on\domain\InvestingPosUIVTrx.java:162: error: cannot find symbol
    @Getter(onMethod=@__({@XmlElement(name = "uInvestable")}))

As well as the same error as that originally reported:

C:\Users\sdick\git\hedgesphere-mt\HSMtApi\src\main\java\ch\hedgesphere\transacti
on\domain\InvestingPosUIVTrx.java:162: error: duplicate element '<any?>' in 
annotation @<any?>.
    @Getter(onMethod=@__({@XmlElement(name = "uInvestable")}))

I notice the problem is around the same JAXB annoation, @XmlElement.

Googling suggests the @<any?> error is related to applying the same annotation 
multiple times to the same element. That doesn't look like the case here.

Original comment by steven.d...@gmail.com on 10 Jun 2015 at 7:26