Skip to content

Commit

Permalink
fix: fix more regressions after auto-import refactoring (#3127)
Browse files Browse the repository at this point in the history
  • Loading branch information
monperrus authored and nharrand committed Sep 26, 2019
1 parent 6d454d5 commit 9acb58c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
4 changes: 0 additions & 4 deletions src/main/java/spoon/reflect/visitor/ImportAnalyzer.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
*/
package spoon.reflect.visitor;

import spoon.SpoonException;
import spoon.processing.AbstractProcessor;
import spoon.processing.Processor;
import spoon.reflect.code.CtConstructorCall;
Expand Down Expand Up @@ -135,9 +134,6 @@ public ScanningMode enter(CtRole role, CtElement element) {
if (!((CtTypeReference) parent).getAccessType().equals(element)) {
return ScanningMode.SKIP_ALL;
}
} else {
//May be this can never happen
throw new SpoonException("Check this case. Is it relevant or not?");
}
}
if (role == CtRole.TYPE && element instanceof CtTypeReference) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/spoon/reflect/visitor/ImportCleaner.java
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ void addImport(CtReference ref) {
}
CtPackageReference packageRef = topLevelTypeRef.getPackage();
if (packageRef == null) {
throw new SpoonException("Type reference has no package");
return;
}
if ("java.lang".equals(packageRef.getQualifiedName())) {
//java.lang is always imported implicitly. Ignore it
Expand Down

0 comments on commit 9acb58c

Please sign in to comment.