diff --git a/modules/lang-painless/src/main/java/org/elasticsearch/painless/DynamicCallSite.java b/modules/lang-painless/src/main/java/org/elasticsearch/painless/DynamicCallSite.java index 8222465c0ad..116f52836a4 100644 --- a/modules/lang-painless/src/main/java/org/elasticsearch/painless/DynamicCallSite.java +++ b/modules/lang-painless/src/main/java/org/elasticsearch/painless/DynamicCallSite.java @@ -29,8 +29,9 @@ import java.lang.invoke.MutableCallSite; /** * Painless invokedynamic call site. *

- * Has 3 flavors (passed as static bootstrap parameters): dynamic method call, - * dynamic field load (getter), and dynamic field store (setter). + * Has 5 flavors (passed as static bootstrap parameters): dynamic method call, + * dynamic field load (getter), and dynamic field store (setter), dynamic array load, + * and dynamic array store. *

* When a new type is encountered at the call site, we lookup from the appropriate * whitelist, and cache with a guard. If we encounter too many types, we stop caching. diff --git a/modules/lang-painless/src/main/java/org/elasticsearch/painless/Writer.java b/modules/lang-painless/src/main/java/org/elasticsearch/painless/Writer.java index 36cfb91ac4d..2c60d3ad113 100644 --- a/modules/lang-painless/src/main/java/org/elasticsearch/painless/Writer.java +++ b/modules/lang-painless/src/main/java/org/elasticsearch/painless/Writer.java @@ -84,7 +84,6 @@ import static org.elasticsearch.painless.WriterConstants.MAP_GET; import static org.elasticsearch.painless.WriterConstants.MAP_TYPE; import static org.elasticsearch.painless.WriterConstants.SCORE_ACCESSOR_FLOAT; import static org.elasticsearch.painless.WriterConstants.SCORE_ACCESSOR_TYPE; -import static org.elasticsearch.painless.WriterConstants.SIGNATURE; class Writer extends PainlessParserBaseVisitor { static byte[] write(Metadata metadata) { @@ -116,7 +115,7 @@ class Writer extends PainlessParserBaseVisitor { writeBegin(); writeConstructor(); - execute = new GeneratorAdapter(Opcodes.ACC_PUBLIC, EXECUTE, SIGNATURE, null, writer); + execute = new GeneratorAdapter(Opcodes.ACC_PUBLIC, EXECUTE, null, null, writer); final WriterUtility utility = new WriterUtility(metadata, execute); final WriterCaster caster = new WriterCaster(execute); diff --git a/modules/lang-painless/src/main/java/org/elasticsearch/painless/WriterConstants.java b/modules/lang-painless/src/main/java/org/elasticsearch/painless/WriterConstants.java index 42c709da969..a7cc7346229 100644 --- a/modules/lang-painless/src/main/java/org/elasticsearch/painless/WriterConstants.java +++ b/modules/lang-painless/src/main/java/org/elasticsearch/painless/WriterConstants.java @@ -38,7 +38,6 @@ class WriterConstants { final static Method CONSTRUCTOR = getAsmMethod(void.class, "", Definition.class, String.class, String.class); final static Method EXECUTE = getAsmMethod(Object.class, "execute", Map.class); - final static String SIGNATURE = "(Ljava/util/Map;)Ljava/lang/Object;"; final static Type PAINLESS_ERROR_TYPE = Type.getType(PainlessError.class); diff --git a/modules/lang-painless/src/test/java/org/elasticsearch/painless/NeedsScoreTests.java b/modules/lang-painless/src/test/java/org/elasticsearch/painless/NeedsScoreTests.java index 561e9202c1e..8861514e9bc 100644 --- a/modules/lang-painless/src/test/java/org/elasticsearch/painless/NeedsScoreTests.java +++ b/modules/lang-painless/src/test/java/org/elasticsearch/painless/NeedsScoreTests.java @@ -42,19 +42,23 @@ public class NeedsScoreTests extends ESSingleNodeTestCase { SearchLookup lookup = new SearchLookup(index.mapperService(), index.fieldData(), null); Object compiled = service.compile("1.2", Collections.emptyMap()); - SearchScript ss = service.search(new CompiledScript(ScriptType.INLINE, "randomName", "painless", compiled), lookup, Collections.emptyMap()); + SearchScript ss = service.search(new CompiledScript(ScriptType.INLINE, "randomName", "painless", compiled), + lookup, Collections.emptyMap()); assertFalse(ss.needsScores()); compiled = service.compile("input.doc['d'].value", Collections.emptyMap()); - ss = service.search(new CompiledScript(ScriptType.INLINE, "randomName", "painless", compiled), lookup, Collections.emptyMap()); + ss = service.search(new CompiledScript(ScriptType.INLINE, "randomName", "painless", compiled), + lookup, Collections.emptyMap()); assertFalse(ss.needsScores()); compiled = service.compile("1/_score", Collections.emptyMap()); - ss = service.search(new CompiledScript(ScriptType.INLINE, "randomName", "painless", compiled), lookup, Collections.emptyMap()); + ss = service.search(new CompiledScript(ScriptType.INLINE, "randomName", "painless", compiled), + lookup, Collections.emptyMap()); assertTrue(ss.needsScores()); compiled = service.compile("input.doc['d'].value * _score", Collections.emptyMap()); - ss = service.search(new CompiledScript(ScriptType.INLINE, "randomName", "painless", compiled), lookup, Collections.emptyMap()); + ss = service.search(new CompiledScript(ScriptType.INLINE, "randomName", "painless", compiled), + lookup, Collections.emptyMap()); assertTrue(ss.needsScores()); }