From d9223a7fa71054008450450fadb48cdd169ba60b Mon Sep 17 00:00:00 2001 From: Jussi Koskela Date: Tue, 11 Jun 2019 09:24:38 +0300 Subject: [PATCH] Remove version identifier from the proposed name gitlab #301 Change-Id: I7d55a55d4102517011f871a5c8d2d9ed15da5a33 --- .../simantics/modeling/services/ComponentNamingUtil.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bundles/org.simantics.modeling/src/org/simantics/modeling/services/ComponentNamingUtil.java b/bundles/org.simantics.modeling/src/org/simantics/modeling/services/ComponentNamingUtil.java index 387b3a41a..1ac81874e 100644 --- a/bundles/org.simantics.modeling/src/org/simantics/modeling/services/ComponentNamingUtil.java +++ b/bundles/org.simantics.modeling/src/org/simantics/modeling/services/ComponentNamingUtil.java @@ -22,6 +22,7 @@ import org.simantics.db.Resource; import org.simantics.db.common.primitiverequest.PossibleRelatedValueImplied2; import org.simantics.db.common.procedure.adapter.TransientCacheListener; import org.simantics.db.common.utils.NameUtils; +import org.simantics.db.common.utils.Versions; import org.simantics.db.exception.DatabaseException; import org.simantics.layer0.Layer0; import org.simantics.operation.Layer0X; @@ -191,9 +192,11 @@ public final class ComponentNamingUtil { String componentPrefix = graph.getPossibleRelatedValue(componentType, L0X.HasGeneratedNamePrefix, Bindings.STRING); if (componentPrefix == null || "".equals(componentPrefix)) { Layer0 L0 = Layer0.getInstance(graph); - componentPrefix = graph.getPossibleRelatedValue(componentType, L0.HasName); - if (componentPrefix == null) + String name = graph.getPossibleRelatedValue(componentType, L0.HasName); + if (name == null) componentPrefix = "Entity"; + else + componentPrefix = Versions.getBaseName(name); } proposition.append(componentPrefix); return proposition.toString(); -- 2.47.1