IGNITE-8255 Possible name collisions in WorkersRegistry. Signed-off-by: Andrey Gura <ag...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/b810bd44 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/b810bd44 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/b810bd44 Branch: refs/heads/ignite-7708 Commit: b810bd44805b04aa9c6fb3797ecd48b259fa3a8c Parents: d79c640 Author: Dmitriy Sorokin <sbt.sorokin....@gmail.com> Authored: Tue Apr 17 14:48:44 2018 +0300 Committer: Andrey Gura <ag...@apache.org> Committed: Tue Apr 17 14:48:44 2018 +0300 ---------------------------------------------------------------------- .../java/org/apache/ignite/internal/worker/WorkersRegistry.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/b810bd44/modules/core/src/main/java/org/apache/ignite/internal/worker/WorkersRegistry.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/worker/WorkersRegistry.java b/modules/core/src/main/java/org/apache/ignite/internal/worker/WorkersRegistry.java index e8d46fb..16676c8 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/worker/WorkersRegistry.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/worker/WorkersRegistry.java @@ -36,7 +36,7 @@ public class WorkersRegistry implements GridWorkerListener { * @param w Worker. */ public void register(GridWorker w) { - if (registeredWorkers.putIfAbsent(w.name(), w) != null) + if (registeredWorkers.putIfAbsent(w.runner().getName(), w) != null) throw new IllegalStateException("Worker is already registered [worker=" + w + ']'); } @@ -75,6 +75,6 @@ public class WorkersRegistry implements GridWorkerListener { /** {@inheritDoc} */ @Override public void onStopped(GridWorker w) { - unregister(w.name()); + unregister(w.runner().getName()); } }