Skip to content
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

ref: better debug for ElementPrinterEvent with toStringDebug #3234

Merged
merged 1 commit into from Feb 10, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -6,16 +6,17 @@
package spoon.support.sniper.internal;

import spoon.reflect.cu.SourcePositionHolder;
import spoon.reflect.declaration.CtElement;
import spoon.reflect.path.CtRole;

/**
* Represents an action of Printer, which prints whole element
*/
public abstract class ElementPrinterEvent implements PrinterEvent {
private final CtRole role;
private final SourcePositionHolder element;
private final CtElement element;

public ElementPrinterEvent(CtRole role, SourcePositionHolder element) {
public ElementPrinterEvent(CtRole role, CtElement element) {
this.role = role;
this.element = element;
}
Expand All @@ -40,7 +41,7 @@ public boolean isWhitespace() {
}
@Override
public String toString() {
return role.name() + "->" + element.toString();
return role.name() + "->" + element.toStringDebug();
}
}