From 2d99dd4ad7984f9d9935cb5f67f28d23ff7536dc Mon Sep 17 00:00:00 2001 From: Antti Villberg Date: Tue, 6 Feb 2018 08:15:30 +0200 Subject: [PATCH] AbstractResponseHandler uses wrong identity refs #7743 Change-Id: I3faabdf8b096758a5fd67c5229a011601083de49 --- .../simantics/document/server/Functions.java | 6 +++--- .../handler/AbstractResponseHandler.java | 18 +++++++++++------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/bundles/org.simantics.document.server/src/org/simantics/document/server/Functions.java b/bundles/org.simantics.document.server/src/org/simantics/document/server/Functions.java index 0a7e004f7..979be3f26 100644 --- a/bundles/org.simantics.document.server/src/org/simantics/document/server/Functions.java +++ b/bundles/org.simantics.document.server/src/org/simantics/document/server/Functions.java @@ -756,12 +756,12 @@ public class Functions { final List effects = ServerSCLHandlerValueRequest.getEffects(graph, anyFunction); - final Function1 fn = anyFunction.getValue(graph); - String expression = anyFunction.getPropertyValue(graph, "expression"); + Function1 fn = anyFunction.getValue(graph); + //String expression = anyFunction.getPropertyValue(graph, "expression"); final Session session = graph.getSession(); - return new AbstractResponseHandler(expression) { + return new AbstractResponseHandler(fn) { private String formatError(RequestProcessor proc, Throwable t) { diff --git a/bundles/org.simantics.document.server/src/org/simantics/document/server/handler/AbstractResponseHandler.java b/bundles/org.simantics.document.server/src/org/simantics/document/server/handler/AbstractResponseHandler.java index cf20ca670..a9118604f 100644 --- a/bundles/org.simantics.document.server/src/org/simantics/document/server/handler/AbstractResponseHandler.java +++ b/bundles/org.simantics.document.server/src/org/simantics/document/server/handler/AbstractResponseHandler.java @@ -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 fn; - public AbstractResponseHandler(String expression) { - this.expression = expression; + public AbstractResponseHandler(Function1 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; } -- 2.47.1