diff --git a/modules/lang-painless/src/main/java/org/elasticsearch/painless/ScriptClassInfo.java b/modules/lang-painless/src/main/java/org/elasticsearch/painless/ScriptClassInfo.java index d5b5b4646bd..df83471c371 100644 --- a/modules/lang-painless/src/main/java/org/elasticsearch/painless/ScriptClassInfo.java +++ b/modules/lang-painless/src/main/java/org/elasticsearch/painless/ScriptClassInfo.java @@ -84,8 +84,7 @@ public class ScriptClassInfo { componentType -> "Painless can only implement execute methods returning a whitelisted type but [" + baseClass.getName() + "#execute] returns [" + componentType.getName() + "] which isn't whitelisted."); - // Look up the argument names - Set argumentNames = new LinkedHashSet<>(); + // Look up the argument List arguments = new ArrayList<>(); String[] argumentNamesConstant = readArgumentNamesConstant(baseClass); Class[] types = executeMethod.getParameterTypes(); @@ -95,7 +94,6 @@ public class ScriptClassInfo { } for (int arg = 0; arg < types.length; arg++) { arguments.add(methodArgument(definition, types[arg], argumentNamesConstant[arg])); - argumentNames.add(argumentNamesConstant[arg]); } this.executeArguments = unmodifiableList(arguments); this.needsMethods = unmodifiableList(needsMethods);