From d60c3e69362cce2760361796edca717b186780fd Mon Sep 17 00:00:00 2001 From: ju Date: Thu, 13 Sep 2018 16:13:26 +0800 Subject: [PATCH 1/2] =?UTF-8?q?REPORT-11216=2010.0=E8=BF=9C=E7=A8=8B?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E9=97=AE=E9=A2=98=E8=A7=A3=E5=86=B3=20isRoot?= =?UTF-8?q?=E7=BC=93=E5=AD=98=E4=B8=8B=EF=BC=8C=E4=B8=8D=E7=94=A8=E6=AF=8F?= =?UTF-8?q?=E6=AC=A1=E9=83=BDrpc?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/env/RemoteWorkspace.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/env/RemoteWorkspace.java b/designer-base/src/main/java/com/fr/design/env/RemoteWorkspace.java index fb8bc80a7..65a277a0f 100644 --- a/designer-base/src/main/java/com/fr/design/env/RemoteWorkspace.java +++ b/designer-base/src/main/java/com/fr/design/env/RemoteWorkspace.java @@ -21,6 +21,8 @@ public class RemoteWorkspace implements Workspace { private final WorkspaceConnectionInfo connection; + private volatile Boolean isRoot = null; + RemoteWorkspace(WorkspaceClient client, WorkspaceConnectionInfo connection) { this.client = client; @@ -54,11 +56,15 @@ public class RemoteWorkspace implements Workspace { @Override public boolean isRoot() { - try { - return WorkContext.getCurrent().get(DecisionOperator.class).isRoot(getConnection().getUserName()); - } catch (Exception e) { - return false; + + if (isRoot == null) { + synchronized (this) { + if (isRoot == null) { + isRoot = WorkContext.getCurrent().get(DecisionOperator.class).isRoot(getConnection().getUserName()); + } + } } + return isRoot; } @Override From ccaf797fd825664428b34735ff346fd63552be63 Mon Sep 17 00:00:00 2001 From: ju Date: Thu, 13 Sep 2018 16:14:35 +0800 Subject: [PATCH 2/2] =?UTF-8?q?REPORT-11216=2010.0=E8=BF=9C=E7=A8=8B?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E9=97=AE=E9=A2=98=E8=A7=A3=E5=86=B3=20isRoot?= =?UTF-8?q?=E7=BC=93=E5=AD=98=E4=B8=8B=EF=BC=8C=E4=B8=8D=E7=94=A8=E6=AF=8F?= =?UTF-8?q?=E6=AC=A1=E9=83=BDrpc?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/env/RemoteWorkspace.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/env/RemoteWorkspace.java b/designer-base/src/main/java/com/fr/design/env/RemoteWorkspace.java index 65a277a0f..36d8e7f7a 100644 --- a/designer-base/src/main/java/com/fr/design/env/RemoteWorkspace.java +++ b/designer-base/src/main/java/com/fr/design/env/RemoteWorkspace.java @@ -94,6 +94,6 @@ public class RemoteWorkspace implements Workspace { @Override public boolean equals(Object obj) { - return obj != null && obj instanceof RemoteWorkspace && AssistUtils.equals(((RemoteWorkspace) obj).connection, this.connection); + return obj instanceof RemoteWorkspace && AssistUtils.equals(((RemoteWorkspace) obj).connection, this.connection); } }