aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/syntax/EvalExceptionWithStackTrace.java
diff options
context:
space:
mode:
authorGravatar lberki <lberki@google.com>2017-09-05 16:01:44 +0200
committerGravatar Yun Peng <pcloudy@google.com>2017-09-06 10:09:53 +0200
commit0d8d4cf53963a7b870596a8daac85f32a2d51d69 (patch)
treeed60453947924c466854cdc217f949d49cfefb88 /src/main/java/com/google/devtools/build/lib/syntax/EvalExceptionWithStackTrace.java
parent3dd5683e84a2e37852d2aaf820116eead59abad5 (diff)
Fix assorted ErrorProne warnings.
RELNOTES: None. PiperOrigin-RevId: 167574104
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/syntax/EvalExceptionWithStackTrace.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/syntax/EvalExceptionWithStackTrace.java20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/syntax/EvalExceptionWithStackTrace.java b/src/main/java/com/google/devtools/build/lib/syntax/EvalExceptionWithStackTrace.java
index 713f57fafc..173f2f7ec9 100644
--- a/src/main/java/com/google/devtools/build/lib/syntax/EvalExceptionWithStackTrace.java
+++ b/src/main/java/com/google/devtools/build/lib/syntax/EvalExceptionWithStackTrace.java
@@ -25,7 +25,7 @@ import java.util.Objects;
*/
public class EvalExceptionWithStackTrace extends EvalException {
- private StackTraceElement mostRecentElement;
+ private StackFrame mostRecentElement;
public EvalExceptionWithStackTrace(Exception original, ASTNode culprit) {
super(extractLocation(original, culprit), getNonEmptyMessage(original), getCause(original));
@@ -119,7 +119,7 @@ public class EvalExceptionWithStackTrace extends EvalException {
if (mostRecentElement != null && isSameLocation(location, mostRecentElement.getLocation())) {
return;
}
- mostRecentElement = new StackTraceElement(label, location, mostRecentElement, canPrint);
+ mostRecentElement = new StackFrame(label, location, mostRecentElement, canPrint);
}
/**
@@ -178,13 +178,13 @@ public class EvalExceptionWithStackTrace extends EvalException {
* An element in the stack trace which contains the name of the offending function / rule /
* statement and its location.
*/
- protected static final class StackTraceElement {
+ protected static final class StackFrame {
private final String label;
private final Location location;
- private final StackTraceElement cause;
+ private final StackFrame cause;
private final boolean canPrint;
- StackTraceElement(String label, Location location, StackTraceElement cause, boolean canPrint) {
+ StackFrame(String label, Location location, StackFrame cause, boolean canPrint) {
this.label = label;
this.location = location;
this.cause = cause;
@@ -199,7 +199,7 @@ public class EvalExceptionWithStackTrace extends EvalException {
return location;
}
- StackTraceElement getCause() {
+ StackFrame getCause() {
return cause;
}
@@ -223,11 +223,11 @@ public class EvalExceptionWithStackTrace extends EvalException {
/**
* Turns the given message and StackTraceElements into a string.
*/
- public final String print(String message, StackTraceElement mostRecentElement) {
+ public final String print(String message, StackFrame mostRecentElement) {
Deque<String> output = new LinkedList<>();
// Adds dummy element for the rule call that uses the location of the top-most function.
- mostRecentElement = new StackTraceElement("", mostRecentElement.getLocation(),
+ mostRecentElement = new StackFrame("", mostRecentElement.getLocation(),
(mostRecentElement.getCause() == null) ? null : mostRecentElement, true);
while (mostRecentElement != null) {
@@ -248,14 +248,14 @@ public class EvalExceptionWithStackTrace extends EvalException {
/**
* Returns the location of the given element or Location.BUILTIN if the element is null.
*/
- private Location getLocation(StackTraceElement element) {
+ private Location getLocation(StackFrame element) {
return (element == null) ? Location.BUILTIN : element.getLocation();
}
/**
* Returns the string representation of the given element.
*/
- protected String print(StackTraceElement element) {
+ protected String print(StackFrame element) {
// Similar to Python, the first (most-recent) entry in the stack frame is printed only once.
// Consequently, we skip it here.
if (element.getCause() == null) {