From 05b427316d71e7d03bcf2dd8f33fe249b62c5ba1 Mon Sep 17 00:00:00 2001 From: TomyLobo Date: Thu, 24 Nov 2011 20:50:07 +0100 Subject: [PATCH] Changed signature of the optimize() method to return an RValue. --- .../java/com/sk89q/worldedit/expression/runtime/Function.java | 2 +- src/main/java/com/sk89q/worldedit/expression/runtime/Node.java | 2 +- .../java/com/sk89q/worldedit/expression/runtime/RValue.java | 2 +- .../java/com/sk89q/worldedit/expression/runtime/Sequence.java | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/sk89q/worldedit/expression/runtime/Function.java b/src/main/java/com/sk89q/worldedit/expression/runtime/Function.java index 82bf77471..8cc7e7fb6 100644 --- a/src/main/java/com/sk89q/worldedit/expression/runtime/Function.java +++ b/src/main/java/com/sk89q/worldedit/expression/runtime/Function.java @@ -84,7 +84,7 @@ public class Function extends Node { } @Override - public Node optimize() throws EvaluationException { + public RValue optimize() throws EvaluationException { final RValue[] optimizedArgs = new RValue[args.length]; boolean optimizable = !method.isAnnotationPresent(Dynamic.class); int position = getPosition(); diff --git a/src/main/java/com/sk89q/worldedit/expression/runtime/Node.java b/src/main/java/com/sk89q/worldedit/expression/runtime/Node.java index 11e56ed4d..4d38a12b6 100644 --- a/src/main/java/com/sk89q/worldedit/expression/runtime/Node.java +++ b/src/main/java/com/sk89q/worldedit/expression/runtime/Node.java @@ -34,7 +34,7 @@ public abstract class Node implements RValue { @Override public abstract String toString(); - public Node optimize() throws EvaluationException { + public RValue optimize() throws EvaluationException { return this; } diff --git a/src/main/java/com/sk89q/worldedit/expression/runtime/RValue.java b/src/main/java/com/sk89q/worldedit/expression/runtime/RValue.java index 33bf0f4df..299a159eb 100644 --- a/src/main/java/com/sk89q/worldedit/expression/runtime/RValue.java +++ b/src/main/java/com/sk89q/worldedit/expression/runtime/RValue.java @@ -29,5 +29,5 @@ import com.sk89q.worldedit.expression.Identifiable; public interface RValue extends Identifiable { public double getValue() throws EvaluationException; - public Node optimize() throws EvaluationException; + public RValue optimize() throws EvaluationException; } diff --git a/src/main/java/com/sk89q/worldedit/expression/runtime/Sequence.java b/src/main/java/com/sk89q/worldedit/expression/runtime/Sequence.java index 3f7f153e1..8da1db87d 100644 --- a/src/main/java/com/sk89q/worldedit/expression/runtime/Sequence.java +++ b/src/main/java/com/sk89q/worldedit/expression/runtime/Sequence.java @@ -66,7 +66,7 @@ public class Sequence extends Node { } @Override - public Node optimize() throws EvaluationException { + public RValue optimize() throws EvaluationException { List newSequence = new ArrayList(); RValue droppedLast = null;