From b84adb7fa1c951cad12e9eaf67bb081ef8ecceac Mon Sep 17 00:00:00 2001 From: Pontus Melke Date: Thu, 24 May 2018 22:04:32 +0200 Subject: [PATCH] Rename class --- .../{AnyValueMath.java => ExpressionMethods.java} | 7 +++++-- .../expressions/IntermediateCodeGeneration.scala | 14 +++++++------- 2 files changed, 12 insertions(+), 9 deletions(-) rename enterprise/cypher/compiled-expressions/src/main/java/org/neo4j/cypher/internal/runtime/compiled/expressions/{AnyValueMath.java => ExpressionMethods.java} (98%) diff --git a/enterprise/cypher/compiled-expressions/src/main/java/org/neo4j/cypher/internal/runtime/compiled/expressions/AnyValueMath.java b/enterprise/cypher/compiled-expressions/src/main/java/org/neo4j/cypher/internal/runtime/compiled/expressions/ExpressionMethods.java similarity index 98% rename from enterprise/cypher/compiled-expressions/src/main/java/org/neo4j/cypher/internal/runtime/compiled/expressions/AnyValueMath.java rename to enterprise/cypher/compiled-expressions/src/main/java/org/neo4j/cypher/internal/runtime/compiled/expressions/ExpressionMethods.java index 289a7cca35da7..a84c59ea19e5d 100644 --- a/enterprise/cypher/compiled-expressions/src/main/java/org/neo4j/cypher/internal/runtime/compiled/expressions/AnyValueMath.java +++ b/enterprise/cypher/compiled-expressions/src/main/java/org/neo4j/cypher/internal/runtime/compiled/expressions/ExpressionMethods.java @@ -51,9 +51,12 @@ import static org.neo4j.values.storable.Values.doubleValue; import static org.neo4j.values.storable.Values.stringValue; -public final class AnyValueMath +/** + * This class contains static helper methods used by the compiled expressions + */ +public final class ExpressionMethods { - private AnyValueMath() + private ExpressionMethods() { throw new UnsupportedOperationException( "Do not instantiate" ); } diff --git a/enterprise/cypher/compiled-expressions/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/expressions/IntermediateCodeGeneration.scala b/enterprise/cypher/compiled-expressions/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/expressions/IntermediateCodeGeneration.scala index ce371ac266b3e..124645b04f836 100644 --- a/enterprise/cypher/compiled-expressions/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/expressions/IntermediateCodeGeneration.scala +++ b/enterprise/cypher/compiled-expressions/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/expressions/IntermediateCodeGeneration.scala @@ -44,24 +44,24 @@ object IntermediateCodeGeneration { case c: FunctionInvocation if c.function == functions.Round => compile(c.args.head) match { case Some(arg) => - Some(invokeStatic(method[AnyValueMath, DoubleValue, AnyValue]("round"), arg)) + Some(invokeStatic(method[ExpressionMethods, DoubleValue, AnyValue]("round"), arg)) case _ => None } case c: FunctionInvocation if c.function == functions.Sin => compile(c.args.head) match { case Some(arg) => - Some(invokeStatic(method[AnyValueMath, DoubleValue, AnyValue]("sin"), arg)) + Some(invokeStatic(method[ExpressionMethods, DoubleValue, AnyValue]("sin"), arg)) case _ => None } case c: FunctionInvocation if c.function == functions.Rand => - Some(invokeStatic(method[AnyValueMath, DoubleValue]("rand"))) + Some(invokeStatic(method[ExpressionMethods, DoubleValue]("rand"))) case Multiply(lhs, rhs) => (compile(lhs), compile(rhs)) match { case (Some(l), Some(r)) => - Some(invokeStatic(method[AnyValueMath, AnyValue, AnyValue, AnyValue]("multiply"), l, r)) + Some(invokeStatic(method[ExpressionMethods, AnyValue, AnyValue, AnyValue]("multiply"), l, r)) case _ => None } @@ -69,14 +69,14 @@ object IntermediateCodeGeneration { case Add(lhs, rhs) => (compile(lhs), compile(rhs)) match { case (Some(l), Some(r)) => - Some(invokeStatic(method[AnyValueMath, AnyValue, AnyValue, AnyValue]("add"), l, r)) + Some(invokeStatic(method[ExpressionMethods, AnyValue, AnyValue, AnyValue]("add"), l, r)) case _ => None } case Subtract(lhs, rhs) => (compile(lhs), compile(rhs)) match { case (Some(l), Some(r)) => - Some(invokeStatic(method[AnyValueMath, AnyValue, AnyValue, AnyValue]("subtract"), l, r)) + Some(invokeStatic(method[ExpressionMethods, AnyValue, AnyValue, AnyValue]("subtract"), l, r)) case _ => None } @@ -91,7 +91,7 @@ object IntermediateCodeGeneration { case _: False => Some(falsy) case NodeProperty(offset, token, _) => - Some(invokeStatic(method[AnyValueMath, Value, Transaction, Long, Int]("nodeProperty"), + Some(invokeStatic(method[ExpressionMethods, Value, Transaction, Long, Int]("nodeProperty"), load("tx"), invoke(load("context"), method[ExecutionContext, Long, Int]("getLongAt"), constantJavaValue(offset)), constantJavaValue(token)))