Remove wasteful function.toString() call in evalArgs. Also remove functions that were public because of skylark compilation.
@@ -514,10 +514,8 @@ public final class FuncallExpression extends Expression {
/**
* Add one argument to the keyword map, registering a duplicate in case of conflict.
- *
- * <p>public for reflection by the compiler and calls from compiled functions
*/
- public static void addKeywordArg(
+ private static void addKeywordArg(
Map<String, Object> kwargs,
String name,
Object value,
@@ -529,10 +527,8 @@ public final class FuncallExpression extends Expression {
/**
* Add multiple arguments to the keyword map (**kwargs), registering duplicates
- *
- * <p>public for reflection by the compiler and calls from compiled functions
*/
- public static void addKeywordArgs(
+ private static void addKeywordArgs(
Map<String, Object> kwargs,
Object items,
ImmutableList.Builder<String> duplicates,
@@ -556,11 +552,9 @@ public final class FuncallExpression extends Expression {
/**
* Checks whether the given object is a {@link BaseFunction}.
*
- * <p>Public for reflection by the compiler and access from generated byte code.
- *
* @throws EvalException If not a BaseFunction.
*/
- public static BaseFunction checkCallable(Object functionValue, Location location)
+ private static BaseFunction checkCallable(Object functionValue, Location location)
throws EvalException {
if (functionValue instanceof BaseFunction) {
return (BaseFunction) functionValue;
@@ -572,11 +566,9 @@ public final class FuncallExpression extends Expression {
/**
* Check the list from the builder and report an {@link EvalException} if not empty.
- *
- * <p>public for reflection by the compiler and calls from compiled functions
*/
- public static void checkDuplicates(
- ImmutableList.Builder<String> duplicates, String function, Location location)
+ private static void checkDuplicates(
+ ImmutableList.Builder<String> duplicates, Expression function, Location location)
throws EvalException {
List<String> dups = duplicates.build();
if (!dups.isEmpty()) {
@@ -594,12 +586,10 @@ public final class FuncallExpression extends Expression {
/**
* Call a method depending on the type of an object it is called on.
*
- * <p>Public for reflection by the compiler and access from generated byte code.
- *
* @param positionals The first object is expected to be the object the method is called on.
* @param call the original expression that caused this call, needed for rules especially
*/
- public Object invokeObjectMethod(
+ private Object invokeObjectMethod(
String method,
ImmutableList<Object> positionals,
ImmutableMap<String, Object> keyWordArgs,
@@ -689,7 +679,7 @@ public final class FuncallExpression extends Expression {
addKeywordArg(kwargs, arg.getName(), value, duplicates);
}
}
- checkDuplicates(duplicates, function.toString(), getLocation());
+ checkDuplicates(duplicates, function, getLocation());
}
@VisibleForTesting
