aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/syntax/BuiltinFunction.java
diff options
context:
space:
mode:
authorGravatar Francois-Rene Rideau <tunes@google.com>2015-03-31 21:47:03 +0000
committerGravatar Han-Wen Nienhuys <hanwen@google.com>2015-04-01 13:42:58 +0000
commit0b6fdcd2fe959984e3e386ff758aafc0ba88ace9 (patch)
treefab10326c1abf5bfc672af1ec15ebb61b45c0175 /src/main/java/com/google/devtools/build/lib/syntax/BuiltinFunction.java
parent08050a32f4422c22ee4dc269bc5e3c5f9e45cca0 (diff)
Debug BuiltinFunction
-- MOS_MIGRATED_REVID=90004683
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/syntax/BuiltinFunction.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/syntax/BuiltinFunction.java10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/syntax/BuiltinFunction.java b/src/main/java/com/google/devtools/build/lib/syntax/BuiltinFunction.java
index 23b5c7dd03..c9f49ee390 100644
--- a/src/main/java/com/google/devtools/build/lib/syntax/BuiltinFunction.java
+++ b/src/main/java/com/google/devtools/build/lib/syntax/BuiltinFunction.java
@@ -154,10 +154,10 @@ public class BuiltinFunction extends BaseFunction {
|| e instanceof ClassCastException
|| e instanceof ExecutionException
|| e instanceof IllegalStateException) {
- throw new EvalException(loc, e.getMessage(), e);
+ throw new EvalException(loc, e);
} else if (e instanceof IllegalArgumentException) {
// Assume it was thrown by SkylarkType.cast and has a good message.
- throw new EvalException(loc, String.format("%s\nin call to %s", e.getMessage(), this), e);
+ throw new EvalException(loc, "Illegal argument in call to " + getName(), e);
} else {
throw badCallException(loc, e, args);
}
@@ -168,12 +168,12 @@ public class BuiltinFunction extends BaseFunction {
final Class<?>[] types = invokeMethod.getParameterTypes();
for (int i = 0; i < args.length; i++) {
if (args[i] != null && !types[i].isAssignableFrom(args[i].getClass())) {
- final String paramName = i < len
+ String paramName = i < len
? signature.getSignature().getNames().get(i) : extraArgs[i - len].name();
throw new EvalException(loc, String.format(
"expected %s for '%s' while calling %s but got %s instead",
EvalUtils.getDataTypeNameFromClass(types[i]), paramName, getName(),
- EvalUtils.getDataTypeName(args[i])), e);
+ EvalUtils.getDataTypeName(args[i])));
}
}
throw badCallException(loc, e, args);
@@ -209,7 +209,7 @@ public class BuiltinFunction extends BaseFunction {
for (Method method : this.getClass().getDeclaredMethods()) {
method.setAccessible(true);
if (name.equals(method.getName())) {
- if (method != null) {
+ if (found != null) {
throw new IllegalArgumentException(String.format(
"function %s has more than one method named %s", getName(), name));
}