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

fix: auto-import works for compilation units with multiple classes #1322

Merged
merged 7 commits into from May 29, 2017

Conversation

Projects
None yet
2 participants
@monperrus
Collaborator

monperrus commented May 24, 2017

No description provided.

Show outdated Hide outdated src/main/java/spoon/reflect/visitor/DefaultJavaPrettyPrinter.java
@@ -207,9 +172,6 @@ public void scan(CtElement element) {
@Override
public Collection<CtReference> computeAllImports(CtType<?> simpleType) {
classImports.clear();
fieldImports.clear();
methodImports.clear();

This comment has been minimized.

@surli

surli May 29, 2017

Collaborator

I added them by security if computeAllImports was called multiple times with the same instance.

@surli

surli May 29, 2017

Collaborator

I added them by security if computeAllImports was called multiple times with the same instance.

@@ -224,11 +186,7 @@ public void scan(CtElement element) {
@Override
public Collection<CtTypeReference<?>> computeImports(CtElement element) {
classImports.clear();
fieldImports.clear();
methodImports.clear();

This comment has been minimized.

@surli

surli May 29, 2017

Collaborator

This one is used to for toString so it can really be used multiple times with the same instance, it would be safer to keep it that way, don't you think?

@surli

surli May 29, 2017

Collaborator

This one is used to for toString so it can really be used multiple times with the same instance, it would be safer to keep it that way, don't you think?

Show outdated Hide outdated src/main/java/spoon/reflect/visitor/ImportScannerImpl.java

@monperrus monperrus merged commit 0b96506 into INRIA:master May 29, 2017

4 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage decreased (-0.02%) to 81.808%
Details
pull_request-INRIA-spoon-master-docker exec in /tmp/tmpenfzvwtw
Details
pull_request-INRIA-spoon-master-revapi no API change
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment