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

[BUG] StackOverflowError when using lombok 1.18.36 #3781

Open
nimo23 opened this issue Nov 15, 2024 · 4 comments
Open

[BUG] StackOverflowError when using lombok 1.18.36 #3781

nimo23 opened this issue Nov 15, 2024 · 4 comments

Comments

@nimo23
Copy link

nimo23 commented Nov 15, 2024

Describe the bug
I upgraded from 1.18.34 (which worked fine) to 1.18.36 and now I get the following error in eclipse (Version: 2024-09 (4.33.0)) with java version 21:

Lombok has logged too many messages; to avoid memory issues, further lombok logs will be squelched for a while. Restart eclipse to start over.

java.lang.StackOverflowError
	at java.base/java.util.regex.Pattern$GroupTail.match(Pattern.java:5000)
	at java.base/java.util.regex.Pattern$LazyLoop.match(Pattern.java:5142)
	at java.base/java.util.regex.Pattern$GroupTail.match(Pattern.java:5000)
	at java.base/java.util.regex.Pattern$BranchConn.match(Pattern.java:4878)
	at java.base/java.util.regex.Pattern$CharProperty.match(Pattern.java:4110)
	at java.base/java.util.regex.Pattern$Branch.match(Pattern.java:4914)
	at java.base/java.util.regex.Pattern$GroupHead.match(Pattern.java:4969)
	at java.base/java.util.regex.Pattern$LazyLoop.match(Pattern.java:5146)
	at java.base/java.util.regex.Pattern$GroupTail.match(Pattern.java:5000)
	at java.base/java.util.regex.Pattern$BranchConn.match(Pattern.java:4878)
	at java.base/java.util.regex.Pattern$BmpCharProperty.match(Pattern.java:4134)
	at java.base/java.util.regex.Pattern$Branch.match(Pattern.java:4914)
	at java.base/java.util.regex.Pattern$GroupHead.match(Pattern.java:4969)
	at java.base/java.util.regex.Pattern$LazyLoop.match(Pattern.java:5146)
	at java.base/java.util.regex.Pattern$GroupTail.match(Pattern.java:5000)
	at java.base/java.util.regex.Pattern$BranchConn.match(Pattern.java:4878)
	at java.base/java.util.regex.Pattern$CharProperty.match(Pattern.java:4110)
	at java.base/java.util.regex.Pattern$Branch.match(Pattern.java:4914)
	at java.base/java.util.regex.Pattern$GroupHead.match(Pattern.java:4969)
	at java.base/java.util.regex.Pattern$LazyLoop.match(Pattern.java:5146)
	at java.base/java.util.regex.Pattern$GroupTail.match(Pattern.java:5000)
	at java.base/java.util.regex.Pattern$BranchConn.match(Pattern.java:4878)
	at java.base/java.util.regex.Pattern$CharProperty.match(Pattern.java:4110)
	at java.base/java.util.regex.Pattern$Branch.match(Pattern.java:4914)
	at java.base/
...
...
...

Expected behavior
No Stackoverflow Error

Version info (please complete the following information):

  • Lombok version: 1.18.36
  • Java version: openjdk version "21.0.2" 2024-01-16
  • Eclipse version: Version: 2024-09 (4.33.0)
@rspilker
Copy link
Collaborator

Hmm, no Lombok visible in the call stack... So you have any more information? Can you isolate the problem to a specific piece of source code?

@nimo23
Copy link
Author

nimo23 commented Nov 15, 2024

All classes included

@Getter
@Setter

no longer generates getters/setters.

I get this error at the top of a class:

Multiple markers at this line

- Lombok annotation handler class lombok.eclipse.handlers.HandleSetter failed - See error log.
	
- Lombok annotation handler class lombok.eclipse.handlers.HandleGetter failed - See error 
log.

The error log:

Lombok annotation handler class lombok.eclipse.handlers.HandleConstructor$HandleAllArgsConstructor failed
java.lang.NullPointerException: Cannot invoke "Object.getClass()" because "compilationUnit" is null
	at lombok.eclipse.handlers.EclipseHandlerUtil.setDocComment(EclipseHandlerUtil.java:2841)
	at lombok.eclipse.handlers.EclipseHandlerUtil.setDocComment(EclipseHandlerUtil.java:2830)
	at lombok.eclipse.handlers.HandleConstructor.generateConstructorJavadoc(HandleConstructor.java:609)
	at lombok.eclipse.handlers.HandleConstructor.generate(HandleConstructor.java:290)
	at lombok.eclipse.handlers.HandleConstructor.generateConstructor(HandleConstructor.java:246)
	at lombok.eclipse.handlers.HandleConstructor$HandleAllArgsConstructor.handle(HandleConstructor.java:165)
	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:269)
	at lombok.eclipse.EclipseNode.traverse(EclipseNode.java:107)
	at lombok.eclipse.EclipseAST.traverseChildren(EclipseAST.java:231)
	at lombok.eclipse.EclipseNode.traverse(EclipseNode.java:74)
	at lombok.eclipse.EclipseAST.traverseChildren(EclipseAST.java:231)
	at lombok.eclipse.EclipseNode.traverse(EclipseNode.java:69)
	at lombok.eclipse.EclipseAST.traverse(EclipseAST.java:224)
	at lombok.eclipse.TransformEclipseAST.go(TransformEclipseAST.java:226)
	at lombok.eclipse.TransformEclipseAST.transform(TransformEclipseAST.java:187)
	at lombok.eclipse.TransformEclipseAST.transform_swapped(TransformEclipseAST.java:104)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at lombok.launch.PatchFixesHider$Util.invokeMethod(PatchFixesHider.java:146)
	at lombok.launch.PatchFixesHider$Transform.transform_swapped(PatchFixesHider.java:272)
	at org.eclipse.jdt.internal.compiler.parser.Parser.endParse(Parser.java:11512)
	at org.eclipse.jdt.internal.compiler.parser.Parser.parse(Parser.java:12712)
	at org.eclipse.jdt.internal.compiler.parser.Parser.parse(Parser.java:12942)
	at org.eclipse.jdt.internal.compiler.parser.Parser.parse(Parser.java:12899)
	at org.eclipse.jdt.internal.compiler.parser.Parser.dietParse(Parser.java:11283)
	at org.eclipse.jdt.internal.compiler.parser.SourceTypeConverter.convert(SourceTypeConverter.java:152)
	at org.eclipse.jdt.internal.compiler.parser.SourceTypeConverter.buildCompilationUnit(SourceTypeConverter.java:99)
	at org.eclipse.jdt.internal.core.hierarchy.HierarchyResolver.accept(HierarchyResolver.java:186)
	at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.askForType(LookupEnvironment.java:384)
	at org.eclipse.jdt.internal.compiler.lookup.PackageBinding.getTypeOrPackage(PackageBinding.java:276)
	at org.eclipse.jdt.internal.compiler.lookup.Scope.getTypeOrPackage(Scope.java:3583)
	at org.eclipse.jdt.internal.compiler.lookup.Scope.getType(Scope.java:3282)
	at org.eclipse.jdt.internal.compiler.ast.SingleTypeReference.getTypeBinding(SingleTypeReference.java:60)
	at org.eclipse.jdt.internal.compiler.ast.TypeReference.internalResolveType(TypeReference.java:525)
	at org.eclipse.jdt.internal.compiler.ast.TypeReference.resolveType(TypeReference.java:631)
	at org.eclipse.jdt.internal.compiler.ast.TypeReference.resolveType(TypeReference.java:627)
	at org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.resolveTypesWithSuspendedTempErrorHandlingPolicy(SourceTypeBinding.java:2934)
	at org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.resolveTypesFor(SourceTypeBinding.java:2762)
	at org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.getExactMethod(SourceTypeBinding.java:1790)
	at org.eclipse.jdt.internal.compiler.lookup.Scope.findExactMethod(Scope.java:1332)
	at org.eclipse.jdt.internal.compiler.lookup.Scope.getMethod(Scope.java:3149)
	at org.eclipse.jdt.internal.compiler.ast.JavadocMessageSend.internalResolveType(JavadocMessageSend.java:94)
	at org.eclipse.jdt.internal.compiler.ast.JavadocMessageSend.resolveType(JavadocMessageSend.java:205)
	at org.eclipse.jdt.internal.compiler.ast.Javadoc.resolveReference(Javadoc.java:443)
	at org.eclipse.jdt.internal.compiler.ast.Javadoc.resolve(Javadoc.java:338)
	at org.eclipse.jdt.internal.compiler.ast.FieldDeclaration.resolveJavadoc(FieldDeclaration.java:361)
	at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:1544)
	at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:1643)
	at org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.resolve(CompilationUnitDeclaration.java:666)
	at org.eclipse.jdt.internal.core.hierarchy.HierarchyResolver.resolve(HierarchyResolver.java:861)
	at org.eclipse.jdt.internal.core.hierarchy.HierarchyResolver.resolve(HierarchyResolver.java:661)
	at org.eclipse.jdt.internal.core.hierarchy.HierarchyBuilder.buildSupertypes(HierarchyBuilder.java:132)
	at org.eclipse.jdt.internal.core.hierarchy.IndexBasedHierarchyBuilder.build(IndexBasedHierarchyBuilder.java:157)
	at org.eclipse.jdt.internal.core.hierarchy.TypeHierarchy.compute(TypeHierarchy.java:323)
	at org.eclipse.jdt.internal.core.hierarchy.TypeHierarchy.refresh(TypeHierarchy.java:1281)
	at org.eclipse.jdt.internal.core.CreateTypeHierarchyOperation.executeOperation(CreateTypeHierarchyOperation.java:94)
	at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:739)
	at org.eclipse.jdt.internal.core.JavaModelOperation.runOperation(JavaModelOperation.java:804)
	at org.eclipse.jdt.internal.core.SourceType.newSupertypeHierarchy(SourceType.java:862)
	at org.eclipse.jdt.internal.core.SourceType.newSupertypeHierarchy(SourceType.java:813)
	at org.eclipse.jdt.internal.corext.util.SuperTypeHierarchyCache.getTypeHierarchy(SuperTypeHierarchyCache.java:144)
	at org.eclipse.jdt.internal.corext.util.SuperTypeHierarchyCache.getTypeHierarchy(SuperTypeHierarchyCache.java:96)
	at org.eclipse.jdt.internal.corext.util.SuperTypeHierarchyCache.getMethodOverrideTester(SuperTypeHierarchyCache.java:105)
	at org.eclipse.jdt.ui.OverrideIndicatorLabelDecorator.getOverrideIndicators(OverrideIndicatorLabelDecorator.java:174)
	at org.eclipse.jdt.ui.OverrideIndicatorLabelDecorator.lambda$0(OverrideIndicatorLabelDecorator.java:138)
	at org.eclipse.jdt.internal.core.JavaModelManager.cacheZipFiles(JavaModelManager.java:5770)
	at org.eclipse.jdt.internal.core.JavaModelManager.callReadOnly(JavaModelManager.java:5759)
	at org.eclipse.jdt.core.JavaCore.callReadOnly(JavaCore.java:6188)
	at org.eclipse.jdt.ui.OverrideIndicatorLabelDecorator.computeAdornmentFlags(OverrideIndicatorLabelDecorator.java:129)
	at org.eclipse.jdt.ui.OverrideIndicatorLabelDecorator.decorate(OverrideIndicatorLabelDecorator.java:266)
	at org.eclipse.ui.internal.decorators.LightweightDecoratorDefinition.decorate(LightweightDecoratorDefinition.java:254)
	at org.eclipse.ui.internal.decorators.LightweightDecoratorManager$LightweightRunnable.run(LightweightDecoratorManager.java:105)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:47)
	at org.eclipse.ui.internal.decorators.LightweightDecoratorManager.decorate(LightweightDecoratorManager.java:359)
	at org.eclipse.ui.internal.decorators.LightweightDecoratorManager.getDecorations(LightweightDecoratorManager.java:345)
	at org.eclipse.ui.internal.decorators.DecorationScheduler$1.queue(DecorationScheduler.java:410)
	at org.eclipse.ui.internal.decorators.DecorationScheduler$1.run(DecorationScheduler.java:388)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

@vcrncic
Copy link

vcrncic commented Jan 21, 2025

I encountered a similar issue, receiving the same java.lang.StackOverflowError stack trace after Lombok version upgrade, along with the error message:

`Lombok annotation handler class lombok.eclipse.handlers.HandleData failed`

In my case, the problem appears to be caused by a long Javadoc comment (43 lines, see the attached source code). Removing at least 10 lines from the comment resolves the issue.

Version Information:
Lombok: 1.18.36
Java: 17
Eclipse: 2024-12

Source.txt

@jmax01
Copy link

jmax01 commented Jan 21, 2025

I have the same issue.


    /**
     * Realm representation.
     *
     * @param accessCodeLifespan                                        the access code lifespan
     * @param accessCodeLifespanLogin                                   the access code lifespan login
     * @param accessCodeLifespanUserAction                              the access code lifespan user action
     * @param accessTokenLifespan                                       the access token lifespan
     * @param accessTokenLifespanForImplicitFlow                        the access token lifespan for implicit flow
     * @param accountTheme                                              the account theme
     * @param actionTokenGeneratedByAdminLifespan                       the action token generated by admin lifespan
     * @param actionTokenGeneratedByUserLifespan                        the action token generated by user lifespan
     * @param adminEventsDetailsEnabled                                 the admin events details enabled
     * @param adminEventsEnabled                                        the admin events enabled
     * @param adminTheme                                                the admin theme
     * @param attributes                                                the attributes
     * @param authenticationFlows                                       the authentication flows
     * @param authenticatorConfigs                                      the authenticator configs
     * @param browserFlow                                               the browser flow
     * @param browserSecurityHeaders                                    the browser security headers
     * @param bruteForceProtected                                       the brute force protected
     * @param certificate                                               the certificate
     * @param clientAuthenticationFlow                                  the client authentication flow
     * @param clientOfflineSessionIdleTimeout                           the client offline session idle timeout
     * @param clientOfflineSessionMaxLifespan                           the client offline session max lifespan
     * @param clientScopeMappings                                       the client scope mappings
     * @param clientScopes                                              the client scopes
     * @param clientSessionIdleTimeout                                  the client session idle timeout
     * @param clientSessionMaxLifespan                                  the client session max lifespan
     * @param clients                                                   the clients
     * @param codeSecret                                                the code secret
     * @param components                                                the components
     * @param defaultDefaultClientScopes                                the default default client scopes
     * @param defaultGroups                                             the default groups
     * @param defaultLocale                                             the default locale
     * @param defaultOptionalClientScopes                               the default optional client scopes
     * @param defaultRole                                               the default role
     * @param defaultSignatureAlgorithm                                 the default signature algorithm
     * @param directGrantFlow                                           the direct grant flow
     * @param displayName                                               the display name
     * @param displayNameHtml                                           the display name html
     * @param duplicateEmailsAllowed                                    the duplicate emails allowed
     * @param editUsernameAllowed                                       the edit username allowed
     * @param emailTheme                                                the email theme
     * @param enabled                                                   the enabled
     * @param enabledEventTypes                                         the enabled event types
     * @param eventsEnabled                                             the events enabled
     * @param eventsExpiration                                          the events expiration
     * @param eventsListeners                                           the events listeners
     * @param failureFactor                                             the failure factor
     * @param federatedUsers                                            the federated users
     * @param groups                                                    the groups
     * @param id                                                        the id
     * @param identityProviderMappers                                   the identity provider mappers
     * @param identityProviders                                         the identity providers
     * @param internationalizationEnabled                               the internationalization enabled
     * @param loginTheme                                                the login theme
     * @param loginWithEmailAllowed                                     the login with email allowed
     * @param maxDeltaTimeSeconds                                       the max delta time seconds
     * @param maxFailureWaitSeconds                                     the max failure wait seconds
     * @param minimumQuickLoginWaitSeconds                              the minimum quick login wait seconds
     * @param notBefore                                                 the not before
     * @param oauth2DeviceCodeLifespan                                  the oauth 2 device code lifespan
     * @param oauth2DevicePollingInterval                               the oauth 2 device polling interval
     * @param offlineSessionIdleTimeout                                 the offline session idle timeout
     * @param offlineSessionMaxLifespan                                 the offline session max lifespan
     * @param offlineSessionMaxLifespanEnabled                          the offline session max lifespan enabled
     * @param otpPolicyAlgorithm                                        the otp policy algorithm
     * @param otpPolicyDigits                                           the otp policy digits
     * @param otpPolicyInitialCounter                                   the otp policy initial counter
     * @param otpPolicyLookAheadWindow                                  the otp policy look ahead window
     * @param otpPolicyPeriod                                           the otp policy period
     * @param otpPolicyType                                             the otp policy type
     * @param otpSupportedApplications                                  the otp supported applications
     * @param clientPolicies                                            the client policies
     * @param clientProfiles                                            the client profiles
     * @param passwordPolicy                                            the password policy
     * @param permanentLockout                                          the permanent lockout
     * @param privateKey                                                the private key
     * @param protocolMappers                                           the protocol mappers
     * @param publicKey                                                 the public key
     * @param quickLoginCheckMilliSeconds                               the quick login check milli seconds
     * @param realm                                                     the realm
     * @param refreshTokenMaxReuse                                      the refresh token max reuse
     * @param registrationAllowed                                       the registration allowed
     * @param registrationEmailAsUsername                               the registration email as username
     * @param registrationFlow                                          the registration flow
     * @param rememberMe                                                the remember me
     * @param requiredActions                                           the required actions
     * @param resetCredentialsFlow                                      the reset credentials flow
     * @param resetPasswordAllowed                                      the reset password
     * @param revokeRefreshToken                                        the revoke refresh token
     * @param roles                                                     the roles
     * @param smtpServers                                               the smtp servers
     * @param sslRequired                                               the ssl required
     * @param ssoSessionIdleTimeout                                     the sso session idle timeout
     * @param ssoSessionIdleTimeoutRememberMe                           the sso session idle timeout remember me
     * @param ssoSessionMaxLifespan                                     the sso session max lifespan
     * @param ssoSessionMaxLifespanRememberMe                           the sso session max lifespan remember me
     * @param supportedLocales                                          the supported locales
     * @param userFederationMappers                                     the user federation mappers
     * @param userFederationProviders                                   the user federation providers
     * @param userManagedAccessAllowed                                  the user managed access allowed
     * @param users                                                     the users
     * @param verifyEmail                                               the verify email
     * @param waitIncrementSeconds                                      the wait increment seconds
     * @param webAuthnPolicyAcceptableAaguids                           the web authn policy acceptable aaguids
     * @param webAuthnPolicyAttestationConveyancePreference             the web authn policy attestation conveyance
     *                                                                  preference
     * @param webAuthnPolicyAuthenticatorAttachment                     the web authn policy authenticator attachment
     * @param webAuthnPolicyAvoidSameAuthenticatorRegister              the web authn policy avoid same authenticator
     *                                                                  register
     * @param webAuthnPolicyCreateTimeout                               the web authn policy create timeout
     * @param webAuthnPolicyPasswordlessAcceptableAaguids               the web authn policy passwordless acceptable
     *                                                                  aaguids
     * @param webAuthnPolicyPasswordlessAttestationConveyancePreference the web authn policy passwordless attestation
     *                                                                  conveyance preference
     * @param webAuthnPolicyPasswordlessAuthenticatorAttachment         the web authn policy passwordless authenticator
     *                                                                  attachment
     * @param webAuthnPolicyPasswordlessAvoidSameAuthenticatorRegister  the web authn policy passwordless avoid same
     *                                                                  authenticator register
     * @param webAuthnPolicyPasswordlessCreateTimeout                   the web authn policy passwordless create timeout
     * @param webAuthnPolicyPasswordlessRequireResidentKey              the web authn policy passwordless require
     *                                                                  resident key
     * @param webAuthnPolicyPasswordlessRpEntityName                    the web authn policy passwordless rp entity name
     * @param webAuthnPolicyPasswordlessRpId                            the web authn policy passwordless rp id
     * @param webAuthnPolicyPasswordlessSignatureAlgorithms             the web authn policy passwordless signature
     *                                                                  algorithms
     * @param webAuthnPolicyPasswordlessUserVerificationRequirement     the web authn policy passwordless user
     *                                                                  verification requirement
     * @param webAuthnPolicyRequireResidentKey                          the web authn policy require resident key
     * @param webAuthnPolicyRpEntityName                                the web authn policy rp entity name
     * @param webAuthnPolicyRpId                                        the web authn policy rp id
     * @param webAuthnPolicySignatureAlgorithms                         the web authn policy signature algorithms
     * @param webAuthnPolicyUserVerificationRequirement                 the web authn policy user verification
     *                                                                  requirement
     *
     * @return the realm representation
     */
    @Builder(builderMethodName = "realmBuilder")
    // @formatter:off
    public static RealmRepresentation realmRepresentation(

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

4 participants