]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.document.server/src/org/simantics/document/server/handler/AbstractResponseHandler.java
AbstractResponseHandler uses wrong identity
[simantics/platform.git] / bundles / org.simantics.document.server / src / org / simantics / document / server / handler / AbstractResponseHandler.java
index cf20ca670f444e0a28dbaa48df83e1ea7bbf987e..a9118604fb1d11fdb1adca1898c823473ebeb7d9 100644 (file)
@@ -1,18 +1,22 @@
 package org.simantics.document.server.handler;
 
+import org.simantics.document.server.io.CommandContext;
+import org.simantics.document.server.io.CommandResult;
+import org.simantics.scl.runtime.function.Function1;
+
 public abstract class AbstractResponseHandler extends AbstractEventHandler {
 
-       private String expression;
+       private Function1<CommandContext, CommandResult> fn;
        
-       public AbstractResponseHandler(String expression) {
-               this.expression = expression;
+       public AbstractResponseHandler(Function1<CommandContext, CommandResult> fn) {
+               this.fn = fn;
        }
 
        @Override
        public int hashCode() {
                final int prime = 31;
                int result = 1;
-               result = prime * result + ((expression == null) ? 0 : expression.hashCode());
+               result = prime * result + ((fn == null) ? 0 : fn.hashCode());
                return result;
        }
 
@@ -25,10 +29,10 @@ public abstract class AbstractResponseHandler extends AbstractEventHandler {
                if (getClass() != obj.getClass())
                        return false;
                AbstractResponseHandler other = (AbstractResponseHandler) obj;
-               if (expression == null) {
-                       if (other.expression != null)
+               if (fn == null) {
+                       if (other.fn != null)
                                return false;
-               } else if (!expression.equals(other.expression))
+               } else if (!fn.equals(other.fn))
                        return false;
                return true;
        }