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] annotation in package-info.java throw java.lang.StackOverflowError #4351

Closed
doukai opened this issue Dec 14, 2021 · 0 comments · Fixed by #4356
Closed

[Bug] annotation in package-info.java throw java.lang.StackOverflowError #4351

doukai opened this issue Dec 14, 2021 · 0 comments · Fixed by #4356

Comments

@doukai
Copy link

doukai commented Dec 14, 2021

Describe the bug
annotation in package-info.java throw java.lang.StackOverflowError

To Reproduce

this is the package-info.java in r2dbc-spi
https://github.com/r2dbc/r2dbc-spi/blob/main/r2dbc-spi/src/main/java/io/r2dbc/spi/package-info.java

Input:

@NonNullApi
package io.r2dbc.spi;

Processing with Spoon:

        Environment environment = getEnvironment();
        environment.setAutoImports(true);
        environment.setEncoding(StandardCharsets.UTF_8);

Output:

cannot create shadow class: io.r2dbc.spi.Connection
java.lang.StackOverflowError
	at spoon.support.reflect.declaration.CtAnnotationImpl.setShadow(CtAnnotationImpl.java:454)
	at spoon.support.visitor.java.internal.AbstractRuntimeBuilderContext.<init>(AbstractRuntimeBuilderContext.java:30)
	at spoon.support.visitor.java.internal.AnnotationRuntimeBuilderContext.<init>(AnnotationRuntimeBuilderContext.java:20)
	at spoon.support.visitor.java.JavaReflectionTreeBuilder$4.<init>(JavaReflectionTreeBuilder.java:234)
	at spoon.support.visitor.java.JavaReflectionTreeBuilder.visitAnnotation(JavaReflectionTreeBuilder.java:234)
	at spoon.support.visitor.java.JavaReflectionVisitorImpl.visitPackage(JavaReflectionVisitorImpl.java:35)
	at spoon.support.visitor.java.JavaReflectionTreeBuilder.visitPackage(JavaReflectionTreeBuilder.java:138)
	at spoon.support.visitor.java.JavaReflectionVisitorImpl.visitTypeReference(JavaReflectionVisitorImpl.java:487)
	at spoon.support.visitor.java.JavaReflectionTreeBuilder.visitTypeReference(JavaReflectionTreeBuilder.java:503)
	at spoon.support.visitor.java.JavaReflectionVisitorImpl.visitAnnotation(JavaReflectionVisitorImpl.java:298)
	at spoon.support.visitor.java.JavaReflectionTreeBuilder.visitAnnotation(JavaReflectionTreeBuilder.java:257)
	at spoon.support.visitor.java.JavaReflectionVisitorImpl.visitPackage(JavaReflectionVisitorImpl.java:35)
	at spoon.support.visitor.java.JavaReflectionTreeBuilder.visitPackage(JavaReflectionTreeBuilder.java:138)
	at spoon.support.visitor.java.JavaReflectionVisitorImpl.visitTypeReference(JavaReflectionVisitorImpl.java:487)
	at spoon.support.visitor.java.JavaReflectionTreeBuilder.visitTypeReference(JavaReflectionTreeBuilder.java:503)
	at spoon.support.visitor.java.JavaReflectionVisitorImpl.visitAnnotation(JavaReflectionVisitorImpl.java:298)
	at spoon.support.visitor.java.JavaReflectionTreeBuilder.visitAnnotation(JavaReflectionTreeBuilder.java:257)
	at spoon.support.visitor.java.JavaReflectionVisitorImpl.visitPackage(JavaReflectionVisitorImpl.java:35)
	at spoon.support.visitor.java.JavaReflectionTreeBuilder.visitPackage(JavaReflectionTreeBuilder.java:138)
	at spoon.support.visitor.java.JavaReflectionVisitorImpl.visitTypeReference(JavaReflectionVisitorImpl.java:487)
	at spoon.support.visitor.java.JavaReflectionTreeBuilder.visitTypeReference(JavaReflectionTreeBuilder.java:503)
	at spoon.support.visitor.java.JavaReflectionVisitorImpl.visitAnnotation(JavaReflectionVisitorImpl.java:298)
	at spoon.support.visitor.java.JavaReflectionTreeBuilder.visitAnnotation(JavaReflectionTreeBuilder.java:257)
	at spoon.support.visitor.java.JavaReflectionVisitorImpl.visitPackage(JavaReflectionVisitorImpl.java:35)
	at spoon.support.visitor.java.JavaReflectionTreeBuilder.visitPackage(JavaReflectionTreeBuilder.java:138)
	at spoon.support.visitor.java.JavaReflectionVisitorImpl.visitTypeReference(JavaReflectionVisitorImpl.java:487)
	at spoon.support.visitor.java.JavaReflectionTreeBuilder.visitTypeReference(JavaReflectionTreeBuilder.java:503)
	at spoon.support.visitor.java.JavaReflectionVisitorImpl.visitAnnotation(JavaReflectionVisitorImpl.java:298)
	at spoon.support.visitor.java.JavaReflectionTreeBuilder.visitAnnotation(JavaReflectionTreeBuilder.java:257)
	at spoon.support.visitor.java.JavaReflectionVisitorImpl.visitPackage(JavaReflectionVisitorImpl.java:35)
	at spoon.support.visitor.java.JavaReflectionTreeBuilder.visitPackage(JavaReflectionTreeBuilder.java:138)
	at spoon.support.visitor.java.JavaReflectionVisitorImpl.visitTypeReference(JavaReflectionVisitorImpl.java:487)
	at spoon.support.visitor.java.JavaReflectionTreeBuilder.visitTypeReference(JavaReflectionTreeBuilder.java:503)
	at spoon.support.visitor.java.JavaReflectionVisitorImpl.visitAnnotation(JavaReflectionVisitorImpl.java:298)
	at spoon.support.visitor.java.JavaReflectionTreeBuilder.visitAnnotation(JavaReflectionTreeBuilder.java:257)
	at spoon.support.visitor.java.JavaReflectionVisitorImpl.visitPackage(JavaReflectionVisitorImpl.java:35)
	at spoon.support.visitor.java.JavaReflectionTreeBuilder.visitPackage(JavaReflectionTreeBuilder.java:138)
	at spoon.support.visitor.java.JavaReflectionVisitorImpl.visitTypeReference(JavaReflectionVisitorImpl.java:487)
	at spoon.support.visitor.java.JavaReflectionTreeBuilder.visitTypeReference(JavaReflectionTreeBuilder.java:503)
	at spoon.support.visitor.java.JavaReflectionVisitorImpl.visitAnnotation(JavaReflectionVisitorImpl.java:298)
	at spoon.support.visitor.java.JavaReflectionTreeBuilder.visitAnnotation(JavaReflectionTreeBuilder.java:257)
	at spoon.support.visitor.java.JavaReflectionVisitorImpl.visitPackage(JavaReflectionVisitorImpl.java:35)
	at spoon.support.visitor.java.JavaReflectionTreeBuilder.visitPackage(JavaReflectionTreeBuilder.java:138)
	at spoon.support.visitor.java.JavaReflectionVisitorImpl.visitTypeReference(JavaReflectionVisitorImpl.java:487)
	at spoon.support.visitor.java.JavaReflectionTreeBuilder.visitTypeReference(JavaReflectionTreeBuilder.java:503)
	at spoon.support.visitor.java.JavaReflectionVisitorImpl.visitAnnotation(JavaReflectionVisitorImpl.java:298)
	at spoon.support.visitor.java.JavaReflectionTreeBuilder.visitAnnotation(JavaReflectionTreeBuilder.java:257)
	at spoon.support.visitor.java.JavaReflectionVisitorImpl.visitPackage(JavaReflectionVisitorImpl.java:35)
	at spoon.support.visitor.java.JavaReflectionTreeBuilder.visitPackage(JavaReflectionTreeBuilder.java:138)
	at spoon.support.visitor.java.JavaReflectionVisitorImpl.visitTypeReference(JavaReflectionVisitorImpl.java:487)
	at spoon.support.visitor.java.JavaReflectionTreeBuilder.visitTypeReference(JavaReflectionTreeBuilder.java:503)

I think the interpretation of annotations is in an infinite loop
Operating system, JDK and Spoon version used

  • OS: WIndows 10
  • JDK: 11
  • Spoon version: 10.0.0
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

Successfully merging a pull request may close this issue.

1 participant