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

Lombok annotation handler class lombok.eclipse.handlers.HandleSuperBuilder failed #2767

Closed
linuskamb opened this issue Mar 3, 2021 · 3 comments

Comments

@linuskamb
Copy link

In trying to get lombok working with my GWT application, I updated from 1.18.12 to 1.18.18. While I was unsuccessful in getting the GWT part to work for client-side codes, I can still use some lombok features on the server-side.

What I have done is create a lombok-annotated object hierarchy with the base class as a shared (used both server and client side) DTO object which is extended on the server side with additional fields. (Whether this is a bad idea is perhaps another question, but it eliminates duplication and redundancy for what are client and server views of the same concept.) All objects in the hierarchy are annotated with @SuperBuilder. Because I have not yet succeeded in getting the GWT integration working, the base object has to have the no-arg and all-args constructors explicit as well as getters for all fields.

When I use lombok-1.18.12.jar, this all works fine. However, if use lombok-1.18.18.jar, I get a pile of HandleSuperBuilder failed errors. Below is the information from the eclipse error log.

eclipse.buildId=4.9.0.I20180906-0745
java.version=1.8.0_211
java.vendor=Oracle Corporation
BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=en_US
Framework arguments: -product org.eclipse.epp.package.java.product -keyring /Users/kamb/.eclipse_keyring
Command-line arguments: -os macosx -ws cocoa -arch x86_64 -product org.eclipse.epp.package.java.product -keyring /Users/kamb/.eclipse_keyring

org.eclipse.jdt.core
Error
Wed Mar 03 08:25:28 PST 2021
Lombok annotation handler class lombok.eclipse.handlers.HandleSuperBuilder failed

java.lang.NullPointerException
at lombok.eclipse.handlers.HandleSuperBuilder.constructorExists(HandleSuperBuilder.java:1198)
at lombok.eclipse.handlers.HandleSuperBuilder.handle(HandleSuperBuilder.java:316)
at lombok.eclipse.HandlerLibrary$AnnotationHandlerContainer.handle(HandlerLibrary.java:106)
at lombok.eclipse.HandlerLibrary.handleAnnotation(HandlerLibrary.java:237)
at lombok.eclipse.TransformEclipseAST$AnnotationVisitor.visitAnnotationOnType(TransformEclipseAST.java:267)
at lombok.eclipse.EclipseNode.traverse(EclipseNode.java:107)
at lombok.eclipse.EclipseAST.traverseChildren(EclipseAST.java:233)
at lombok.eclipse.EclipseNode.traverse(EclipseNode.java:74)
at lombok.eclipse.EclipseAST.traverseChildren(EclipseAST.java:233)
at lombok.eclipse.EclipseNode.traverse(EclipseNode.java:69)
at lombok.eclipse.EclipseAST.traverse(EclipseAST.java:226)
at lombok.eclipse.TransformEclipseAST.go(TransformEclipseAST.java:224)
at lombok.eclipse.TransformEclipseAST.transform(TransformEclipseAST.java:185)
at lombok.eclipse.TransformEclipseAST.transform_swapped(TransformEclipseAST.java:110)
at sun.reflect.GeneratedMethodAccessor38.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at lombok.launch.PatchFixesHider$Util.invokeMethod(PatchFixesHider.java:126)
at lombok.launch.PatchFixesHider$Transform.transform_swapped(PatchFixesHider.java:203)
at org.eclipse.jdt.internal.compiler.parser.Parser.endParse(Parser.java:10521)
at org.eclipse.jdt.internal.compiler.parser.Parser.parse(Parser.java:11702)
at org.eclipse.jdt.internal.compiler.parser.Parser.parse(Parser.java:11926)
at org.eclipse.jdt.internal.codeassist.select.SelectionParser.parse(SelectionParser.java:1582)
at org.eclipse.jdt.internal.compiler.parser.Parser.parse(Parser.java:11883)
at org.eclipse.jdt.internal.compiler.parser.Parser.dietParse(Parser.java:10293)
at org.eclipse.jdt.internal.codeassist.select.SelectionParser.dietParse(SelectionParser.java:1406)
at org.eclipse.jdt.internal.codeassist.SelectionEngine.select(SelectionEngine.java:981)
at org.eclipse.jdt.internal.core.Openable.codeSelect(Openable.java:168)
at org.eclipse.jdt.internal.core.CompilationUnit.codeSelect(CompilationUnit.java:390)
at org.eclipse.jdt.internal.core.CompilationUnit.codeSelect(CompilationUnit.java:383)
at org.eclipse.jdt.internal.ui.text.java.hover.AbstractJavaEditorTextHover.getJavaElementsAt(AbstractJavaEditorTextHover.java:124)
at org.eclipse.jdt.internal.ui.text.java.hover.JavadocHover.internalGetHoverInfo(JavadocHover.java:674)
at org.eclipse.jdt.internal.ui.text.java.hover.JavadocHover.getHoverInfo2(JavadocHover.java:670)
at org.eclipse.jdt.internal.ui.text.java.hover.BestMatchHover.getHoverInfo2(BestMatchHover.java:167)
at org.eclipse.jdt.internal.ui.text.java.hover.BestMatchHover.getHoverInfo2(BestMatchHover.java:133)
at org.eclipse.jdt.internal.ui.text.java.hover.JavaEditorTextHoverProxy.getHoverInfo2(JavaEditorTextHoverProxy.java:89)
at org.eclipse.jface.text.TextViewerHoverManager$4.run(TextViewerHoverManager.java:169)

@linuskamb
Copy link
Author

It appears that "this all works fine with 1.18.12" is not entirely accurate. The compile errors as described are not present when using 1.18.12, and I can take advantage on the server side of the SuperBuilder features, it seems GWT will not serialize just the base class, so the utility of this approach is somewhat diminished.

I'll leave this open for now in case this NPE is a valid bug.

@Rawi01
Copy link
Collaborator

Rawi01 commented Mar 3, 2021

The SuperBuilder problem is a duplicate of #2704

@linuskamb
Copy link
Author

Doh. My bad. Apologies for my github issue submission etiquette fail!

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