-
-
Notifications
You must be signed in to change notification settings - Fork 355
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
static import not written out by Spoon #3214
Comments
Thanks a lot for the bug report. Could you share a link to the source file you're analyzing? |
Just the latest commons-io version: 2.6 You can also download it manually: https://repo1.maven.org/maven2/commons-io/commons-io/2.6 I also use the latest Spoon. |
Would you be able to isolate the bug in a failing test case in a pull request? That would be super
useful. Thanks!
|
I did now several other tests read/writing sources from big libraries. I always have issues with static imports not written out. I will prepare a minimal project for you showing the bug. I am not very familiar with Github ;) [UPDATE]: I forgot that this problems happens when using launcher.getEnvironment().setAutoImports(true); With this setting Spoon removes the static import in the written out source code: If I use setAutoImports(false), Spoon removes the static import BUT also writes the full qualified name for EVERY import in the source code: I would prefer using setAutoImports(true) because otherwise the source code is cluttered with qualified names. |
excellent, looking forward to it!
|
|
Did you have time looking into this? |
Not yet. If you could reproduce the bug in a failing test case in a pull request, that would be super useful. Thanks! |
Sorry. I am not really familiar with Git. The zip project is super simple though. You can reproduce the problem in seconds. |
I just did a little test reading in and writing out commons-io-2.6-sources.jar with Spoon.
IOUtils defines: public static final int EOF = -1;
This is statically imported by org.apache.commons.io.output.ByteArrayOutputStream and org.apache.commons.io.EndianUtils
Spoon just adds this static import to ByteArrayOutputStream but NOT EndianUtils
The text was updated successfully, but these errors were encountered: