INRIA / INRIA/spoon

Can Spoon deal the .class file

Open
#4,510 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
2k
Forks
392
Avg merge
11h 24m
Merged PRs (30d)
36

Description

Spoon is a nice job, thanks for your contribution.
I have a `.java` file, and I can derive the FQN with the following code: (e.g., `StringBuffer` in ` StringBuffer tabs = new StringBuffer();` will be derived into `java.lang.StringBuilder`.
```
Launcher launcher = new Launcher();
launcher.getEnvironment().setPrettyPrintingMode(Environment.PRETTY_PRINTING_MODE.FULLYQUALIFIED);
launcher.addInputResource(java_file_path);
CtModel model = launcher.buildModel();

String output = model.getAllTypes()
.stream()
.map(Object::toString)
.collect(Collectors.joining("\n\n", "", "\n"));
return output;
```
But, when I input the **java_file_path** is the **.class** file, the return output is the **Null**. How can I fix it? Thank you. :)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.