From f5fc60ac678432fded7cd64548dbb9dc4bb01d52 Mon Sep 17 00:00:00 2001 From: Uwe Schindler Date: Fri, 20 May 2016 11:05:40 +0200 Subject: [PATCH] Add utility type constant --- .../src/main/java/org/elasticsearch/painless/Definition.java | 1 + .../src/main/java/org/elasticsearch/painless/node/EComp.java | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/lang-painless/src/main/java/org/elasticsearch/painless/Definition.java b/modules/lang-painless/src/main/java/org/elasticsearch/painless/Definition.java index 6e38bf2b7a4..8013361dd9b 100644 --- a/modules/lang-painless/src/main/java/org/elasticsearch/painless/Definition.java +++ b/modules/lang-painless/src/main/java/org/elasticsearch/painless/Definition.java @@ -69,6 +69,7 @@ public final class Definition { public static final Type defobjType = INSTANCE.getType("Def"); public static final Type stringType = INSTANCE.getType("String"); public static final Type exceptionType = INSTANCE.getType("Exception"); + public static final Type utilityType = INSTANCE.getType("Utility"); public enum Sort { VOID( void.class , 0 , true , false , false , false ), diff --git a/modules/lang-painless/src/main/java/org/elasticsearch/painless/node/EComp.java b/modules/lang-painless/src/main/java/org/elasticsearch/painless/node/EComp.java index 9d7862e404a..82033124e1c 100644 --- a/modules/lang-painless/src/main/java/org/elasticsearch/painless/node/EComp.java +++ b/modules/lang-painless/src/main/java/org/elasticsearch/painless/node/EComp.java @@ -493,7 +493,7 @@ public final class EComp extends AExpression { if (right.isNull) { adapter.ifNull(jump); } else if (operation == Operation.EQ) { - adapter.invokeStatic(definition.getType("Utility").type, CHECKEQUALS); + adapter.invokeStatic(Definition.utilityType.type, CHECKEQUALS); if (branch) { adapter.ifZCmp(MethodWriter.NE, jump); @@ -507,7 +507,7 @@ public final class EComp extends AExpression { if (right.isNull) { adapter.ifNonNull(jump); } else if (operation == Operation.NE) { - adapter.invokeStatic(definition.getType("Utility").type, CHECKEQUALS); + adapter.invokeStatic(Definition.utilityType.type, CHECKEQUALS); adapter.ifZCmp(MethodWriter.EQ, jump); } else { adapter.ifCmp(rtype, MethodWriter.NE, jump);