-
-
Notifications
You must be signed in to change notification settings - Fork 352
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
ParentNotInitializedException when processing comments with -c #1073
Labels
Comments
surli
added a commit
to surli/spoon
that referenced
this issue
Dec 24, 2016
Thank you for the feedback, I just reproduce your bug in surli@7082dcf I will investigate for a fix. |
Thanks a lot. Here is another example for incorrect comments for -c .
The result is as follows.
|
surli
added a commit
to surli/spoon
that referenced
this issue
Jan 5, 2017
…of a static initialized array.
surli
added a commit
to surli/spoon
that referenced
this issue
Jan 5, 2017
monperrus
pushed a commit
to monperrus/spoon
that referenced
this issue
Jan 9, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am aware that comments can be processed using the command "-c" since Spoon 5.2.0. Thanks for this feature.
When using Spoon to process comments in either code snippet below, ParentNotInitializedException will be thrown. An empty processor can be used to reproduce this issue. This happens in both Spoon 5.2 and 5.4.
public class Comment_1 {
}
public class Comment2 {
}
Details of the exception are as follows.
spoon.reflect.declaration.ParentNotInitializedException: parent not initialized for class spoon.support.reflect.code.CtCommentImpl (/home/jifeng/workspace/Temp4/src/main/java/example/Comment1.java:17)
at spoon.support.reflect.declaration.CtElementImpl.getParent(CtElementImpl.java:284)
at spoon.support.compiler.jdt.JDTCommentBuilder.insertCommentInAST(JDTCommentBuilder.java:377)
at spoon.support.compiler.jdt.JDTCommentBuilder.buildComment(JDTCommentBuilder.java:131)
at spoon.support.compiler.jdt.JDTCommentBuilder.build(JDTCommentBuilder.java:96)
at spoon.support.compiler.jdt.JDTBasedSpoonCompiler.buildSources(JDTBasedSpoonCompiler.java:387)
at spoon.support.compiler.jdt.JDTBasedSpoonCompiler.build(JDTBasedSpoonCompiler.java:116)
at spoon.support.compiler.jdt.JDTBasedSpoonCompiler.build(JDTBasedSpoonCompiler.java:99)
at spoon.Launcher.buildModel(Launcher.java:712)
at spoon.Launcher.run(Launcher.java:663)
at spoon.Launcher.run(Launcher.java:106)
at spoon.Launcher.main(Launcher.java:99)
The text was updated successfully, but these errors were encountered: