Skip to content

Commit

Permalink
add call to enter and exit
Browse files Browse the repository at this point in the history
  • Loading branch information
monperrus committed Sep 18, 2017
1 parent a84bfce commit c256281
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions src/main/java/spoon/reflect/visitor/DefaultJavaPrettyPrinter.java
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ public void computeImports(CtElement element) {
@Override
public void scan(CtElement e) {
if (e != null) {
enter(e);
context.elementStack.push(e);
if (env.isPreserveLineNumbers()) {
if (!(e instanceof CtNamedElement)) {
Expand All @@ -318,6 +319,7 @@ public void scan(CtElement e) {
throw new SpoonException("Printing of " + elementInfo + "failed", ex);
}
context.elementStack.pop();
exit(e);
}
}

Expand All @@ -344,16 +346,6 @@ private static void addParentPath(StringBuilder sb, CtElement ele) {
}
}

/**
* The generic scan method for a reference.
*/
public DefaultJavaPrettyPrinter scan(CtReference ref) {
if (ref != null) {
ref.accept(this);
}
return this;
}

private boolean shouldSetBracket(CtExpression<?> e) {
if (e.getTypeCasts().size() != 0) {
return true;
Expand Down

0 comments on commit c256281

Please sign in to comment.