Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Java 6 compilation error when field has javadoc #2066

Closed
tiagocorreia86 opened this issue Mar 14, 2019 · 3 comments
Closed

Java 6 compilation error when field has javadoc #2066

tiagocorreia86 opened this issue Mar 14, 2019 · 3 comments

Comments

@tiagocorreia86
Copy link

tiagocorreia86 commented Mar 14, 2019

If the private field has javadoc then the javac (for Java 6) compilation fails.

The steps to reproduce it:

  • Have your code running with Java 6.
  • Use the latest lombok version (however the issue occurs with previous versions also)
  • Create a class like this:
import lombok.Getter;

@Getter
public class TestLombok {

    /**
     * The currency
     */
    private String currency;
    
}

When building the project (I use intellij Build tool) I get the following error:
Error:java: error: Lombok annotation handler class lombok.javac.handlers.HandleGetter failed on C:\Users\C60935\TestLombok\lombok\src\main\java\TestLombok.java: java.lang.NoSuchMethodError: java.util.Map.putIfAbsent(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

This happens because in Java 6 the Map class doesn't contain the method putIfAbsent.
The result is that it's not possible to use javadoc for fields when using Java 6.

@tiagocorreia86 tiagocorreia86 changed the title Java 6 compilation error when field has comment Java 6 compilation error when field has javadoc Mar 14, 2019
@rspilker
Copy link
Collaborator

I think I've fixed it. Can you please verify it in a soon to be released edge release?

@tiagocorreia86
Copy link
Author

It's fixed in the latest edge release!

@rspilker
Copy link
Collaborator

Thanks for the feedback!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants