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

IllegalStateException in JavaOutputProcessor#createJavaFile with the default source positioning #885

Closed
seintur opened this issue Oct 6, 2016 · 0 comments

Comments

@seintur
Copy link
Contributor

seintur commented Oct 6, 2016

Dear all,

The default source positioning of a CtElement is created with a null compilation unit. If ones tries to create the Java file associated with such a element with JavaOutputProcessor#createJavaFile an IllegalStateException is raised.

The following test illustrates the issue:

https://github.com/seintur/spoon/blob/nullCompilationUnit_bug/src/test/java/spoon/test/sourcePosition/SourcePositionTest.java#L53

I'm not sure how to proceed.

In any case, IMHO, one should be able to generate the Java file for a CtClass created by the factory without having to bother about this.

Lionel.

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

1 participant