From 0e3add215e53d9bfd832ff4a1aa180d4f8eec5ad Mon Sep 17 00:00:00 2001 From: "Charles P. Wright" Date: Tue, 5 Dec 2023 14:38:25 -0500 Subject: [PATCH] Fix existingOrBuild. --- .../deephaven/engine/updategraph/impl/BaseUpdateGraph.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/engine/table/src/main/java/io/deephaven/engine/updategraph/impl/BaseUpdateGraph.java b/engine/table/src/main/java/io/deephaven/engine/updategraph/impl/BaseUpdateGraph.java index a7d0aa0974f..d4cb74e7cfd 100644 --- a/engine/table/src/main/java/io/deephaven/engine/updategraph/impl/BaseUpdateGraph.java +++ b/engine/table/src/main/java/io/deephaven/engine/updategraph/impl/BaseUpdateGraph.java @@ -1066,6 +1066,10 @@ public static T buildOrThrow(final String name, final Su * @return the UpdateGraph */ public static T existingOrBuild(final String name, Supplier construct) { - return INSTANCES.putIfAbsent(name, construct.get()).cast(); + return INSTANCES.putIfAbsent(name, (nameToInsert) -> { + final T newGraph = construct.get(); + Assert.equals(newGraph.getName(), "newGraph.getName()", nameToInsert, "name"); + return newGraph; + }).cast(); } }