Misc cleanups of AST node API
- changed field names and a couple accessors to consistently use full words ("statement" instead of "stmt")
- applied several local analyzers (from IntelliJ) to remove redundant modifiers, unnecessary explicit types (yay Java 8), etc.
RELNOTES: None
PiperOrigin-RevId: 161551096
diff --git a/src/main/java/com/google/devtools/build/lib/syntax/DotExpression.java b/src/main/java/com/google/devtools/build/lib/syntax/DotExpression.java
index 9333e29..e04bdf0 100644
--- a/src/main/java/com/google/devtools/build/lib/syntax/DotExpression.java
+++ b/src/main/java/com/google/devtools/build/lib/syntax/DotExpression.java
@@ -23,17 +23,17 @@
/** Syntax node for a dot expression. e.g. obj.field, but not obj.method() */
public final class DotExpression extends Expression {
- private final Expression obj;
+ private final Expression object;
private final Identifier field;
- public DotExpression(Expression obj, Identifier field) {
- this.obj = obj;
+ public DotExpression(Expression object, Identifier field) {
+ this.object = object;
this.field = field;
}
- public Expression getObj() {
- return obj;
+ public Expression getObject() {
+ return object;
}
public Identifier getField() {
@@ -42,14 +42,14 @@
@Override
public void prettyPrint(Appendable buffer) throws IOException {
- obj.prettyPrint(buffer);
+ object.prettyPrint(buffer);
buffer.append('.');
field.prettyPrint(buffer);
}
@Override
Object doEval(Environment env) throws EvalException, InterruptedException {
- Object objValue = obj.eval(env);
+ Object objValue = object.eval(env);
String name = field.getName();
Object result = eval(objValue, name, getLocation(), env);
return checkResult(objValue, result, name, getLocation());
@@ -127,6 +127,6 @@
@Override
void validate(ValidationEnvironment env) throws EvalException {
- obj.validate(env);
+ object.validate(env);
}
}