MCPcopy Create free account
hub / github.com/evant/android-retrolambda-lombok / AstException

Class AstException

src/main/lombok/ast/AstException.java:26–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24import lombok.EqualsAndHashCode;
25
26@EqualsAndHashCode(callSuper=false)
27public class AstException extends RuntimeException {
28 private final Node problemNode;
29 private final String message;
30
31 public AstException(Node problemNode, String message) {
32 super(message);
33 this.message = message;
34 this.problemNode = problemNode;
35 }
36
37 @Override public String toString() {
38 if (problemNode == null && getMessage() == null) return "AstException (unknown cause)";
39 if (problemNode == null) return "AstException: " + getMessage();
40 String nodeDescription = problemNode == null ? "(null)" : (problemNode.getClass().getName() + "(toString failed)");
41 try {
42 nodeDescription = problemNode.toString();
43 } catch (Throwable ignore) {
44 //throwing exceptions in toString() is bad.
45 }
46 if (getMessage() == null) return "AstException at " + nodeDescription;
47 return String.format("AstException: %s (at %s)", getMessage(), nodeDescription);
48 }
49}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected