From 4e0af3328c056d1727e33190bb4a222d223892cd Mon Sep 17 00:00:00 2001 From: Arnaud Roques Date: Tue, 14 Mar 2023 18:48:52 +0100 Subject: [PATCH] fix: improve port management https://github.com/plantuml/plantuml/discussions/1325 --- src/net/atmp/CucaDiagram.java | 4 +-- .../activitydiagram/ActivityDiagram.java | 10 +++---- .../command/CommandLinkActivity.java | 14 +++++----- .../command/CommandLinkLongActivity.java | 4 +-- .../command/CommandPartition.java | 2 +- .../command/CommandAddMethod.java | 2 +- .../command/CommandCreateClass.java | 2 +- .../command/CommandCreateClassMultilines.java | 6 ++--- .../command/CommandCreateElementFull2.java | 2 +- .../command/CommandDiamondAssociation.java | 2 +- .../command/CommandHideShowByGender.java | 4 +-- .../command/CommandLinkClass.java | 24 ++++++++--------- .../command/CommandLinkLollipop.java | 8 +++--- .../command/CommandStereotype.java | 2 +- .../classdiagram/command/CommandUrl.java | 2 +- .../plantuml/command/CommandNamespace.java | 2 +- .../plantuml/command/CommandNamespace2.java | 2 +- .../command/CommandNamespaceEmpty.java | 2 +- .../plantuml/command/CommandPackage.java | 4 +-- .../plantuml/command/CommandPackageEmpty.java | 2 +- .../command/note/CommandFactoryNote.java | 2 +- .../note/CommandFactoryNoteActivity.java | 4 +-- .../note/CommandFactoryNoteOnEntity.java | 4 +-- .../note/CommandFactoryTipOnEntity.java | 4 +-- .../command/CommandCreateBlock.java | 2 +- .../command/CommandCreatePackageBlock.java | 2 +- .../command/CommandLinkBlock.java | 4 +-- .../descdiagram/CommandCreateDomain.java | 2 +- .../descdiagram/command/CommandArchimate.java | 2 +- .../command/CommandArchimateMultilines.java | 2 +- .../command/CommandCreateElementFull.java | 2 +- .../CommandCreateElementMultilines.java | 2 +- .../CommandCreateElementParenthesis.java | 2 +- .../command/CommandLinkElement.java | 4 +-- .../command/CommandPackageWithUSymbol.java | 2 +- .../AbstractClassOrObjectDiagram.java | 2 +- .../objectdiagram/command/CommandAddData.java | 2 +- .../command/CommandCreateEntityObject.java | 2 +- .../CommandCreateEntityObjectMultilines.java | 2 +- .../command/CommandCreateJson.java | 2 +- .../command/CommandCreateJsonSingleLine.java | 2 +- .../command/CommandCreateMap.java | 4 +-- .../plantuml/statediagram/StateDiagram.java | 26 +++++++++---------- .../statediagram/command/CommandAddField.java | 2 +- .../command/CommandCreatePackage2.java | 2 +- .../command/CommandCreatePackageState.java | 2 +- .../command/CommandCreateState.java | 2 +- .../command/CommandLinkStateCommon.java | 4 +-- 48 files changed, 97 insertions(+), 97 deletions(-) diff --git a/src/net/atmp/CucaDiagram.java b/src/net/atmp/CucaDiagram.java index 13e76cd48..90d2a9d82 100644 --- a/src/net/atmp/CucaDiagram.java +++ b/src/net/atmp/CucaDiagram.java @@ -189,7 +189,7 @@ public abstract class CucaDiagram extends UmlDiagram implements GroupHierarchy, } - final public Quark quarkInContext(String full, boolean specialForCreateClass) { + final public Quark quarkInContext(boolean reuseExistingChild, String full) { final String sep = getNamespaceSeparator(); if (sep == null) { final Quark result = entityFactory.firstWithName(full); @@ -203,7 +203,7 @@ public abstract class CucaDiagram extends UmlDiagram implements GroupHierarchy, return entityFactory.root().child(full.substring(sep.length())); final int x = full.indexOf(sep); if (x == -1) { - if (specialForCreateClass == false && entityFactory.countByName(full) == 1) { + if (reuseExistingChild && entityFactory.countByName(full) == 1) { final Quark byName = entityFactory.firstWithName(full); assert byName != null; if (byName != currentQuark) diff --git a/src/net/sourceforge/plantuml/activitydiagram/ActivityDiagram.java b/src/net/sourceforge/plantuml/activitydiagram/ActivityDiagram.java index b906374aa..e55289515 100644 --- a/src/net/sourceforge/plantuml/activitydiagram/ActivityDiagram.java +++ b/src/net/sourceforge/plantuml/activitydiagram/ActivityDiagram.java @@ -68,7 +68,7 @@ public class ActivityDiagram extends CucaDiagram { public void startIf(String optionalCodeString) { final String idShort = optionalCodeString == null ? getAutoBranch() : optionalCodeString; - final Quark quark = quarkInContext(cleanId(idShort), false); + final Quark quark = quarkInContext(true, cleanId(idShort)); final Entity br = reallyCreateLeaf(quark, Display.create(""), LeafType.BRANCH, null); currentContext = new ConditionalContext(currentContext, br, Direction.DOWN); } @@ -78,7 +78,7 @@ public class ActivityDiagram extends CucaDiagram { } public Entity getStart() { - final Quark quark = quarkInContext("start", false); + final Quark quark = quarkInContext(true, "start"); if (quark.getData() == null) reallyCreateLeaf(quark, Display.getWithNewlines("start"), LeafType.CIRCLE_START, null); @@ -87,7 +87,7 @@ public class ActivityDiagram extends CucaDiagram { public Entity getEnd(String suppId) { final String tmp = suppId == null ? "end" : "end$" + suppId; - final Quark quark = quarkInContext(tmp, false); + final Quark quark = quarkInContext(true, tmp); if (quark.getData() == null) reallyCreateLeaf(quark, Display.getWithNewlines("end"), LeafType.CIRCLE_END, null); @@ -141,7 +141,7 @@ public class ActivityDiagram extends CucaDiagram { final String idShort = "##" + this.getUniqueSequence(); - final Quark quark = quarkInContext(idShort, false); + final Quark quark = quarkInContext(true, idShort); gotoGroup(quark, Display.getWithNewlines(quark.getName()), GroupType.INNER_ACTIVITY); final Entity g = getCurrentGroup(); @@ -160,7 +160,7 @@ public class ActivityDiagram extends CucaDiagram { if (getCurrentGroup().getGroupType() != GroupType.INNER_ACTIVITY) throw new IllegalStateException("type=" + getCurrentGroup().getGroupType()); - final Quark idNewLong = quarkInContext(idShort, false); + final Quark idNewLong = quarkInContext(true, idShort); gotoGroup(idNewLong, Display.getWithNewlines("code"), GroupType.CONCURRENT_ACTIVITY); lastEntityConsulted = null; lastEntityBrancheConsulted = null; diff --git a/src/net/sourceforge/plantuml/activitydiagram/command/CommandLinkActivity.java b/src/net/sourceforge/plantuml/activitydiagram/command/CommandLinkActivity.java index 4920eb6b6..6daa6844e 100644 --- a/src/net/sourceforge/plantuml/activitydiagram/command/CommandLinkActivity.java +++ b/src/net/sourceforge/plantuml/activitydiagram/command/CommandLinkActivity.java @@ -209,10 +209,10 @@ public class CommandLinkActivity extends SingleLineCommand2 { final String idShort = arg.get("CODE" + suf, 0); if (idShort != null) { if (partition != null) { - final Quark quark = diagram.quarkInContext(diagram.cleanId(partition), false); + final Quark quark = diagram.quarkInContext(true, diagram.cleanId(partition)); diagram.gotoGroup(quark, Display.getWithNewlines(quark), GroupType.PACKAGE); } - final Quark ident = diagram.quarkInContext(diagram.cleanId(idShort), false); + final Quark ident = diagram.quarkInContext(true, diagram.cleanId(idShort)); final LeafType type = getTypeIfExisting(diagram, ident); Entity result = ident.getData(); @@ -226,7 +226,7 @@ public class CommandLinkActivity extends SingleLineCommand2 { } final String bar = arg.get("BAR" + suf, 0); if (bar != null) { - final Quark quark = diagram.quarkInContext(diagram.cleanId(bar), false); + final Quark quark = diagram.quarkInContext(true, diagram.cleanId(bar)); Entity result = quark.getData(); if (result == null) result = diagram.reallyCreateLeaf(quark, Display.getWithNewlines(bar), LeafType.SYNCHRO_BAR, null); @@ -236,11 +236,11 @@ public class CommandLinkActivity extends SingleLineCommand2 { if (quoted.get(0) != null) { final String quotedString = quoted.get(1) == null ? quoted.get(0) : quoted.get(1); if (partition != null) { - final Quark quark = diagram.quarkInContext(diagram.cleanId(partition), false); + final Quark quark = diagram.quarkInContext(true, diagram.cleanId(partition)); diagram.gotoGroup(quark, Display.getWithNewlines(partition), GroupType.PACKAGE); } - final Quark quark = diagram.quarkInContext(diagram.cleanId(quotedString), false); + final Quark quark = diagram.quarkInContext(true, diagram.cleanId(quotedString)); final LeafType type = getTypeIfExisting(diagram, quark); Entity result = quark.getData(); @@ -254,10 +254,10 @@ public class CommandLinkActivity extends SingleLineCommand2 { final String quoteInvisibleString = arg.get("QUOTED_INVISIBLE" + suf, 0); if (quoteInvisibleString != null) { if (partition != null) { - final Quark quark = diagram.quarkInContext(diagram.cleanId(partition), false); + final Quark quark = diagram.quarkInContext(true, diagram.cleanId(partition)); diagram.gotoGroup(quark, Display.getWithNewlines(quark), GroupType.PACKAGE); } - final Quark identInvisible = diagram.quarkInContext(diagram.cleanId(quoteInvisibleString), false); + final Quark identInvisible = diagram.quarkInContext(true, diagram.cleanId(quoteInvisibleString)); Entity result = identInvisible.getData(); if (result == null) result = diagram.reallyCreateLeaf(identInvisible, Display.getWithNewlines(identInvisible.getName()), diff --git a/src/net/sourceforge/plantuml/activitydiagram/command/CommandLinkLongActivity.java b/src/net/sourceforge/plantuml/activitydiagram/command/CommandLinkLongActivity.java index 9eb59a682..4e008bac8 100644 --- a/src/net/sourceforge/plantuml/activitydiagram/command/CommandLinkLongActivity.java +++ b/src/net/sourceforge/plantuml/activitydiagram/command/CommandLinkLongActivity.java @@ -176,10 +176,10 @@ public class CommandLinkLongActivity extends CommandMultilines2 partition = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(partition); } if (partition != null) { - final Quark idNewLong = diagram.quarkInContext(diagram.cleanId(partition), false); + final Quark idNewLong = diagram.quarkInContext(true, diagram.cleanId(partition)); diagram.gotoGroup(idNewLong, Display.getWithNewlines(partition), GroupType.PACKAGE); } - final Quark ident = diagram.quarkInContext(diagram.cleanId(idShort), false); + final Quark ident = diagram.quarkInContext(true, diagram.cleanId(idShort)); Entity entity2 = ident.getData(); if (entity2 == null) diff --git a/src/net/sourceforge/plantuml/activitydiagram/command/CommandPartition.java b/src/net/sourceforge/plantuml/activitydiagram/command/CommandPartition.java index 043d3d873..488cff81b 100644 --- a/src/net/sourceforge/plantuml/activitydiagram/command/CommandPartition.java +++ b/src/net/sourceforge/plantuml/activitydiagram/command/CommandPartition.java @@ -83,7 +83,7 @@ public class CommandPartition extends SingleLineCommand2 { @Override protected CommandExecutionResult executeArg(ActivityDiagram diagram, LineLocation location, RegexResult arg) throws NoSuchColorException { - final Quark quark = diagram.quarkInContext(diagram.cleanId(arg.get("NAME", 0)), false); + final Quark quark = diagram.quarkInContext(true, diagram.cleanId(arg.get("NAME", 0))); diagram.gotoGroup(quark, Display.getWithNewlines(quark.getName()), GroupType.PACKAGE); final Entity p = diagram.getCurrentGroup(); diff --git a/src/net/sourceforge/plantuml/classdiagram/command/CommandAddMethod.java b/src/net/sourceforge/plantuml/classdiagram/command/CommandAddMethod.java index 908a2b7a9..589a5083e 100644 --- a/src/net/sourceforge/plantuml/classdiagram/command/CommandAddMethod.java +++ b/src/net/sourceforge/plantuml/classdiagram/command/CommandAddMethod.java @@ -70,7 +70,7 @@ public class CommandAddMethod extends SingleLineCommand2 { protected CommandExecutionResult executeArg(ClassDiagram diagram, LineLocation location, RegexResult arg) throws NoSuchColorException { final String idShort = arg.get("NAME", 0); - final Quark quark = diagram.quarkInContext(diagram.cleanId(idShort), false); + final Quark quark = diagram.quarkInContext(true, diagram.cleanId(idShort)); Entity entity = quark.getData(); if (entity == null) entity = diagram.reallyCreateLeaf(quark, Display.getWithNewlines(quark), LeafType.CLASS, null); diff --git a/src/net/sourceforge/plantuml/classdiagram/command/CommandCreateClass.java b/src/net/sourceforge/plantuml/classdiagram/command/CommandCreateClass.java index 44d147b1c..7f42d13f0 100644 --- a/src/net/sourceforge/plantuml/classdiagram/command/CommandCreateClass.java +++ b/src/net/sourceforge/plantuml/classdiagram/command/CommandCreateClass.java @@ -139,7 +139,7 @@ public class CommandCreateClass extends SingleLineCommand2 { final String stereo = arg.get("STEREO", 0); - final Quark quark = diagram.quarkInContext(idShort, true); + final Quark quark = diagram.quarkInContext(false, idShort); Entity entity = quark.getData(); diff --git a/src/net/sourceforge/plantuml/classdiagram/command/CommandCreateClassMultilines.java b/src/net/sourceforge/plantuml/classdiagram/command/CommandCreateClassMultilines.java index ea39f6cbe..2ddf84b86 100644 --- a/src/net/sourceforge/plantuml/classdiagram/command/CommandCreateClassMultilines.java +++ b/src/net/sourceforge/plantuml/classdiagram/command/CommandCreateClassMultilines.java @@ -167,7 +167,7 @@ public class CommandCreateClassMultilines extends CommandMultilines2 quark = diagram.quarkInContext(idShort, true); + final Quark quark = diagram.quarkInContext(false, idShort); Entity entity = quark.getData(); @@ -278,7 +278,7 @@ public class CommandCreateClassMultilines extends CommandMultilines2 quark = diagram.quarkInContext(diagram.cleanId(idShort), true); + final Quark quark = diagram.quarkInContext(false, diagram.cleanId(idShort)); Entity cl2 = quark.getData(); if (cl2 == null) cl2 = diagram.reallyCreateLeaf(quark, Display.getWithNewlines(quark.getName()), type2, null); @@ -313,7 +313,7 @@ public class CommandCreateClassMultilines extends CommandMultilines2 quark = diagram.quarkInContext(idShort, true); + final Quark quark = diagram.quarkInContext(false, idShort); Display display = Display.getWithNewlines(displayString); if (Display.isNull(display)) diff --git a/src/net/sourceforge/plantuml/classdiagram/command/CommandCreateElementFull2.java b/src/net/sourceforge/plantuml/classdiagram/command/CommandCreateElementFull2.java index 72bfb4541..906f0d877 100644 --- a/src/net/sourceforge/plantuml/classdiagram/command/CommandCreateElementFull2.java +++ b/src/net/sourceforge/plantuml/classdiagram/command/CommandCreateElementFull2.java @@ -206,7 +206,7 @@ public class CommandCreateElementFull2 extends SingleLineCommand2 final String idShort = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(codeRaw); final Display display = Display.getWithNewlines(displayRaw == null ? idShort : displayRaw); - final Quark quark = diagram.quarkInContext(idShort, false); + final Quark quark = diagram.quarkInContext(true, idShort); Entity entity = quark.getData(); if (entity == null) entity = diagram.reallyCreateLeaf(quark, display, type, usymbol); diff --git a/src/net/sourceforge/plantuml/classdiagram/command/CommandDiamondAssociation.java b/src/net/sourceforge/plantuml/classdiagram/command/CommandDiamondAssociation.java index 5c393f446..659d7884a 100644 --- a/src/net/sourceforge/plantuml/classdiagram/command/CommandDiamondAssociation.java +++ b/src/net/sourceforge/plantuml/classdiagram/command/CommandDiamondAssociation.java @@ -65,7 +65,7 @@ public class CommandDiamondAssociation extends SingleLineCommand2 @Override protected CommandExecutionResult executeArg(ClassDiagram diagram, LineLocation location, RegexResult arg) { final String idShort = arg.get("CODE", 0); - final Quark quark = diagram.quarkInContext(diagram.cleanId(idShort), false); + final Quark quark = diagram.quarkInContext(true, diagram.cleanId(idShort)); if (quark.getData() != null) return CommandExecutionResult.error("Already existing : " + quark.getName()); diff --git a/src/net/sourceforge/plantuml/classdiagram/command/CommandHideShowByGender.java b/src/net/sourceforge/plantuml/classdiagram/command/CommandHideShowByGender.java index 923a94a98..6e9e22219 100644 --- a/src/net/sourceforge/plantuml/classdiagram/command/CommandHideShowByGender.java +++ b/src/net/sourceforge/plantuml/classdiagram/command/CommandHideShowByGender.java @@ -144,7 +144,7 @@ public class CommandHideShowByGender extends SingleLineCommand2 { } else if (arg1.startsWith("<<")) { gender = EntityGenderUtils.byStereotype(arg1); } else { - final Quark quark = diagram.quarkInContext(diagram.cleanId(arg1), false); + final Quark quark = diagram.quarkInContext(true, diagram.cleanId(arg1)); if (quark.getData() == null) return CommandExecutionResult.error("No such element " + quark.getName()); final Entity entity = quark.getData(); @@ -189,7 +189,7 @@ public class CommandHideShowByGender extends SingleLineCommand2 { gender = EntityGenderUtils.byStereotype(arg1); } else { arg1 = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(arg1); - final Quark quark = diagram.quarkInContext(diagram.cleanId(arg1), false); + final Quark quark = diagram.quarkInContext(true, diagram.cleanId(arg1)); Entity entity = quark.getData(); if (entity == null) return CommandExecutionResult.error("No such element " + quark.getName()); diff --git a/src/net/sourceforge/plantuml/classdiagram/command/CommandLinkClass.java b/src/net/sourceforge/plantuml/classdiagram/command/CommandLinkClass.java index 4b6ffe2a8..0e253b7c1 100644 --- a/src/net/sourceforge/plantuml/classdiagram/command/CommandLinkClass.java +++ b/src/net/sourceforge/plantuml/classdiagram/command/CommandLinkClass.java @@ -197,8 +197,8 @@ final public class CommandLinkClass extends SingleLineCommand2 quark1 = diagram.quarkInContext(ent1String, false); - final Quark quark2 = diagram.quarkInContext(ent2String, false); + final Quark quark1 = diagram.quarkInContext(true, ent1String); + final Quark quark2 = diagram.quarkInContext(true, ent2String); Entity cl1 = quark1.getData(); if (cl1 == null) @@ -311,8 +311,8 @@ final public class CommandLinkClass extends SingleLineCommand2 quark1A = diagram.quarkInContext(name1A, false); - final Quark quark1B = diagram.quarkInContext(name1B, false); + final Quark quark1A = diagram.quarkInContext(true, name1A); + final Quark quark1B = diagram.quarkInContext(true, name1B); if (quark1A.getData() != null == false) return CommandExecutionResult.error("No class " + name1A); @@ -324,7 +324,7 @@ final public class CommandLinkClass extends SingleLineCommand2 ent2 = diagram.quarkInContext(id2, false); + final Quark ent2 = diagram.quarkInContext(true, id2); Entity cl2 = ent2.getData(); if (cl2 == null) @@ -344,8 +344,8 @@ final public class CommandLinkClass extends SingleLineCommand2 quark2A = diagram.quarkInContext(name2A, false); - final Quark quark2B = diagram.quarkInContext(name2B, false); + final Quark quark2A = diagram.quarkInContext(true, name2A); + final Quark quark2B = diagram.quarkInContext(true, name2B); if (quark2A.getData() != null == false) return CommandExecutionResult.error("No class " + name2A); @@ -357,7 +357,7 @@ final public class CommandLinkClass extends SingleLineCommand2 ent1 = diagram.quarkInContext(id1, false); + final Quark ent1 = diagram.quarkInContext(true, id1); Entity cl1 = (Entity) ent1.getData(); if (cl1 == null) @@ -380,10 +380,10 @@ final public class CommandLinkClass extends SingleLineCommand2 quark1A = diagram.quarkInContext(name1A, false); - final Quark quark1B = diagram.quarkInContext(name1B, false); - final Quark quark2A = diagram.quarkInContext(name2A, false); - final Quark quark2B = diagram.quarkInContext(name2B, false); + final Quark quark1A = diagram.quarkInContext(true, name1A); + final Quark quark1B = diagram.quarkInContext(true, name1B); + final Quark quark2A = diagram.quarkInContext(true, name2A); + final Quark quark2B = diagram.quarkInContext(true, name2B); if (quark1A.getData() != null == false) return CommandExecutionResult.error("No class " + name1A); diff --git a/src/net/sourceforge/plantuml/classdiagram/command/CommandLinkLollipop.java b/src/net/sourceforge/plantuml/classdiagram/command/CommandLinkLollipop.java index 172a9af9d..7e372f9c3 100644 --- a/src/net/sourceforge/plantuml/classdiagram/command/CommandLinkLollipop.java +++ b/src/net/sourceforge/plantuml/classdiagram/command/CommandLinkLollipop.java @@ -125,12 +125,12 @@ final public class CommandLinkLollipop extends SingleLineCommand2 quark = diagram.quarkInContext(diagram.cleanId(ent1), false); + final Quark quark = diagram.quarkInContext(true, diagram.cleanId(ent1)); cl1 = quark.getData(); if (cl1 == null) return CommandExecutionResult.error("No class " + quark.getName()); - final Quark idNewLong = diagram.quarkInContext(diagram.cleanId(ent1) + suffix, false); + final Quark idNewLong = diagram.quarkInContext(true, diagram.cleanId(ent1) + suffix); final LeafType type = getType(arg.get("ENT_THEN_LOL", 1)); cl2 = diagram.reallyCreateLeaf(idNewLong, Display.getWithNewlines(ent2), type, null); normalEntity = cl1; @@ -144,12 +144,12 @@ final public class CommandLinkLollipop extends SingleLineCommand2 quark = diagram.quarkInContext(diagram.cleanId(ent2), false); + final Quark quark = diagram.quarkInContext(true, diagram.cleanId(ent2)); cl2 = quark.getData(); if (cl2 == null) return CommandExecutionResult.error("No class " + quark.getName()); - final Quark idNewLong = diagram.quarkInContext(diagram.cleanId(ent2) + suffix, false); + final Quark idNewLong = diagram.quarkInContext(true, diagram.cleanId(ent2) + suffix); final LeafType type = getType(arg.get("LOL_THEN_ENT", 0)); cl1 = diagram.reallyCreateLeaf(idNewLong, Display.getWithNewlines(ent1), type, null); normalEntity = cl2; diff --git a/src/net/sourceforge/plantuml/classdiagram/command/CommandStereotype.java b/src/net/sourceforge/plantuml/classdiagram/command/CommandStereotype.java index 8448061b2..d4b8686b5 100644 --- a/src/net/sourceforge/plantuml/classdiagram/command/CommandStereotype.java +++ b/src/net/sourceforge/plantuml/classdiagram/command/CommandStereotype.java @@ -69,7 +69,7 @@ public class CommandStereotype extends SingleLineCommand2 { final String name = arg.get("NAME", 0); final String stereotype = arg.get("STEREO", 0); - final Quark quark = diagram.quarkInContext(diagram.cleanId(name), false); + final Quark quark = diagram.quarkInContext(true, diagram.cleanId(name)); final Entity entity = quark.getData(); if (entity == null) return CommandExecutionResult.error("No such class " + quark.getName()); diff --git a/src/net/sourceforge/plantuml/classdiagram/command/CommandUrl.java b/src/net/sourceforge/plantuml/classdiagram/command/CommandUrl.java index ce33f0eac..36263c7ee 100644 --- a/src/net/sourceforge/plantuml/classdiagram/command/CommandUrl.java +++ b/src/net/sourceforge/plantuml/classdiagram/command/CommandUrl.java @@ -75,7 +75,7 @@ public class CommandUrl extends SingleLineCommand2 { protected CommandExecutionResult executeArg(AbstractEntityDiagram diagram, LineLocation location, RegexResult arg) { final String idShort = arg.get("CODE", 0); - final Quark quark = diagram.quarkInContext(diagram.cleanId(idShort), false); + final Quark quark = diagram.quarkInContext(true, diagram.cleanId(idShort)); final Entity entity = quark.getData(); if (entity == null) return CommandExecutionResult.error(quark.getName() + " does not exist"); diff --git a/src/net/sourceforge/plantuml/command/CommandNamespace.java b/src/net/sourceforge/plantuml/command/CommandNamespace.java index f84c42de2..67cf02b22 100644 --- a/src/net/sourceforge/plantuml/command/CommandNamespace.java +++ b/src/net/sourceforge/plantuml/command/CommandNamespace.java @@ -82,7 +82,7 @@ public class CommandNamespace extends SingleLineCommand2 { protected CommandExecutionResult executeArg(ClassDiagram diagram, LineLocation location, RegexResult arg) throws NoSuchColorException { final String idShort = arg.get("NAME", 0); - final Quark quark = diagram.quarkInContext(diagram.cleanId(idShort), true); + final Quark quark = diagram.quarkInContext(false, diagram.cleanId(idShort)); final CommandExecutionResult status = diagram.gotoGroup(quark, Display.getWithNewlines(quark.getName()), GroupType.PACKAGE); if (status.isOk() == false) diff --git a/src/net/sourceforge/plantuml/command/CommandNamespace2.java b/src/net/sourceforge/plantuml/command/CommandNamespace2.java index b0796fbfd..768b1a181 100644 --- a/src/net/sourceforge/plantuml/command/CommandNamespace2.java +++ b/src/net/sourceforge/plantuml/command/CommandNamespace2.java @@ -86,7 +86,7 @@ public class CommandNamespace2 extends SingleLineCommand2 { protected CommandExecutionResult executeArg(ClassDiagram diagram, LineLocation location, RegexResult arg) throws NoSuchColorException { final String idShort = arg.get("NAME", 0); - final Quark quark = diagram.quarkInContext(diagram.cleanId(idShort), true); + final Quark quark = diagram.quarkInContext(false, diagram.cleanId(idShort)); final String disp = arg.getLazzy("DISPLAY", 0); final Display display = Display.getWithNewlines(disp); diff --git a/src/net/sourceforge/plantuml/command/CommandNamespaceEmpty.java b/src/net/sourceforge/plantuml/command/CommandNamespaceEmpty.java index c1c244a0a..6e9e9c81b 100644 --- a/src/net/sourceforge/plantuml/command/CommandNamespaceEmpty.java +++ b/src/net/sourceforge/plantuml/command/CommandNamespaceEmpty.java @@ -82,7 +82,7 @@ public class CommandNamespaceEmpty extends SingleLineCommand2 { throws NoSuchColorException { final String idShort = arg.get("NAME", 0); - final Quark quark = diagram.quarkInContext(diagram.cleanId(idShort), true); + final Quark quark = diagram.quarkInContext(false, diagram.cleanId(idShort)); if (quark.getData() != null) return CommandExecutionResult.error("Already exists " + quark.getName()); diff --git a/src/net/sourceforge/plantuml/command/CommandPackage.java b/src/net/sourceforge/plantuml/command/CommandPackage.java index e834456b9..89f36e0bb 100644 --- a/src/net/sourceforge/plantuml/command/CommandPackage.java +++ b/src/net/sourceforge/plantuml/command/CommandPackage.java @@ -123,10 +123,10 @@ public class CommandPackage extends SingleLineCommand2 { final Quark quark; if (arg.get("AS", 0) == null) { - quark = diagram.quarkInContext(diagram.cleanId(name), true); + quark = diagram.quarkInContext(false, diagram.cleanId(name)); display = quark.getName(); } else { - quark = diagram.quarkInContext(diagram.cleanId(arg.get("AS", 0)), true); + quark = diagram.quarkInContext(false, diagram.cleanId(arg.get("AS", 0))); display = name; } diff --git a/src/net/sourceforge/plantuml/command/CommandPackageEmpty.java b/src/net/sourceforge/plantuml/command/CommandPackageEmpty.java index 9803e75fb..1f17a6482 100644 --- a/src/net/sourceforge/plantuml/command/CommandPackageEmpty.java +++ b/src/net/sourceforge/plantuml/command/CommandPackageEmpty.java @@ -94,7 +94,7 @@ public class CommandPackageEmpty extends SingleLineCommand2 quark = diagram.quarkInContext(diagram.cleanId(idShort), true); + final Quark quark = diagram.quarkInContext(false, diagram.cleanId(idShort)); final CommandExecutionResult status = diagram.gotoGroup(quark, Display.getWithNewlines(display), GroupType.PACKAGE); if (status.isOk() == false) diff --git a/src/net/sourceforge/plantuml/command/note/CommandFactoryNote.java b/src/net/sourceforge/plantuml/command/note/CommandFactoryNote.java index b21f97da1..2b0f5a9c1 100644 --- a/src/net/sourceforge/plantuml/command/note/CommandFactoryNote.java +++ b/src/net/sourceforge/plantuml/command/note/CommandFactoryNote.java @@ -136,7 +136,7 @@ public final class CommandFactoryNote implements SingleMultiFactoryCommand quark = diagram.quarkInContext(diagram.cleanId(idShort), false); + final Quark quark = diagram.quarkInContext(true, diagram.cleanId(idShort)); if (quark.getData() != null) return CommandExecutionResult.error("Note already created: " + quark.getName()); diff --git a/src/net/sourceforge/plantuml/command/note/CommandFactoryNoteActivity.java b/src/net/sourceforge/plantuml/command/note/CommandFactoryNoteActivity.java index 8ec7b5394..298a73402 100644 --- a/src/net/sourceforge/plantuml/command/note/CommandFactoryNoteActivity.java +++ b/src/net/sourceforge/plantuml/command/note/CommandFactoryNoteActivity.java @@ -118,7 +118,7 @@ public final class CommandFactoryNoteActivity implements SingleMultiFactoryComma strings = strings.subList(1, strings.size()); final String codeString = diagram.getUniqueSequence("GMN"); - final Quark quark = diagram.quarkInContext(codeString, false); + final Quark quark = diagram.quarkInContext(true, codeString); final Entity note = diagram.reallyCreateLeaf(quark, strings, LeafType.NOTE, null); if (url != null) note.addUrl(url); @@ -135,7 +135,7 @@ public final class CommandFactoryNoteActivity implements SingleMultiFactoryComma protected CommandExecutionResult executeArg(final ActivityDiagram diagram, LineLocation location, RegexResult arg) throws NoSuchColorException { final String tmp = diagram.getUniqueSequence("GN"); - final Quark quark = diagram.quarkInContext(diagram.cleanId(tmp), false); + final Quark quark = diagram.quarkInContext(true, diagram.cleanId(tmp)); final Entity note = diagram.createNote(quark, tmp, Display.getWithNewlines(arg.get("NOTE", 0))); return executeInternal(diagram, arg, note); diff --git a/src/net/sourceforge/plantuml/command/note/CommandFactoryNoteOnEntity.java b/src/net/sourceforge/plantuml/command/note/CommandFactoryNoteOnEntity.java index 2c1a9a20e..363f8809e 100644 --- a/src/net/sourceforge/plantuml/command/note/CommandFactoryNoteOnEntity.java +++ b/src/net/sourceforge/plantuml/command/note/CommandFactoryNoteOnEntity.java @@ -219,7 +219,7 @@ public final class CommandFactoryNoteOnEntity implements SingleMultiFactoryComma return CommandExecutionResult.error("Nothing to note to"); } else { - final Quark quark = diagram.quarkInContext(idShort, false); + final Quark quark = diagram.quarkInContext(true, idShort); cl1 = quark.getData(); if (cl1 == null) return CommandExecutionResult.error("Not known: " + idShort); @@ -243,7 +243,7 @@ public final class CommandFactoryNoteOnEntity implements SingleMultiFactoryComma } final String tmp = diagram.getUniqueSequence("GMN"); - final Quark quark = diagram.quarkInContext(tmp, false); + final Quark quark = diagram.quarkInContext(true, tmp); final Entity note = diagram.reallyCreateLeaf(quark, strings.toDisplay(), LeafType.NOTE, null); if (stereotypeString != null) diff --git a/src/net/sourceforge/plantuml/command/note/CommandFactoryTipOnEntity.java b/src/net/sourceforge/plantuml/command/note/CommandFactoryTipOnEntity.java index 04ce7eae0..bdfac6571 100644 --- a/src/net/sourceforge/plantuml/command/note/CommandFactoryTipOnEntity.java +++ b/src/net/sourceforge/plantuml/command/note/CommandFactoryTipOnEntity.java @@ -171,7 +171,7 @@ public final class CommandFactoryTipOnEntity implements SingleMultiFactoryComman final String idShort = line0.get("ENTITY", 0); final String member = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(line0.get("ENTITY", 1)); - final Quark quark = diagram.quarkInContext(idShort, false); + final Quark quark = diagram.quarkInContext(true, idShort); final Entity cl1 = quark.getData(); if (cl1 == null) return CommandExecutionResult.error("Nothing to note to"); @@ -180,7 +180,7 @@ public final class CommandFactoryTipOnEntity implements SingleMultiFactoryComman .withRankdir(diagram.getSkinParam().getRankdir()); final String tmp = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(idShort + "$$$" + position.name()); - final Quark identTip = diagram.quarkInContext(tmp, false); + final Quark identTip = diagram.quarkInContext(true, tmp); Entity tips = identTip.getData(); if (tips == null) { diff --git a/src/net/sourceforge/plantuml/compositediagram/command/CommandCreateBlock.java b/src/net/sourceforge/plantuml/compositediagram/command/CommandCreateBlock.java index f0ff1057c..19897872c 100644 --- a/src/net/sourceforge/plantuml/compositediagram/command/CommandCreateBlock.java +++ b/src/net/sourceforge/plantuml/compositediagram/command/CommandCreateBlock.java @@ -74,7 +74,7 @@ public class CommandCreateBlock extends SingleLineCommand2 { protected CommandExecutionResult executeArg(CompositeDiagram diagram, LineLocation location, RegexResult arg) { String display = arg.get("DISPLAY", 0); final String idShort = arg.get("CODE", 0); - final Quark quark = diagram.quarkInContext(idShort, false); + final Quark quark = diagram.quarkInContext(true, idShort); if (display == null) display = quark.getName(); diff --git a/src/net/sourceforge/plantuml/compositediagram/command/CommandCreatePackageBlock.java b/src/net/sourceforge/plantuml/compositediagram/command/CommandCreatePackageBlock.java index c382f4bb1..1a31748a3 100644 --- a/src/net/sourceforge/plantuml/compositediagram/command/CommandCreatePackageBlock.java +++ b/src/net/sourceforge/plantuml/compositediagram/command/CommandCreatePackageBlock.java @@ -75,7 +75,7 @@ public class CommandCreatePackageBlock extends SingleLineCommand2 quark = diagram.quarkInContext(idShort, false); + final Quark quark = diagram.quarkInContext(true, idShort); if (display == null) display = quark.getName(); diff --git a/src/net/sourceforge/plantuml/compositediagram/command/CommandLinkBlock.java b/src/net/sourceforge/plantuml/compositediagram/command/CommandLinkBlock.java index 6818db287..05f5b9e4e 100644 --- a/src/net/sourceforge/plantuml/compositediagram/command/CommandLinkBlock.java +++ b/src/net/sourceforge/plantuml/compositediagram/command/CommandLinkBlock.java @@ -79,8 +79,8 @@ public class CommandLinkBlock extends SingleLineCommand2 { protected CommandExecutionResult executeArg(CompositeDiagram diagram, LineLocation location, RegexResult arg) { final String ent1 = arg.get("ENT1", 0); final String ent2 = arg.get("ENT2", 0); - final Quark quark1 = diagram.quarkInContext(diagram.cleanId(ent1), false); - final Quark quark2 = diagram.quarkInContext(diagram.cleanId(ent2), false); + final Quark quark1 = diagram.quarkInContext(true, diagram.cleanId(ent1)); + final Quark quark2 = diagram.quarkInContext(true, diagram.cleanId(ent2)); final Entity cl1 = quark1.getData(); if (cl1 == null) return CommandExecutionResult.error("No such element " + quark1.getName()); diff --git a/src/net/sourceforge/plantuml/descdiagram/CommandCreateDomain.java b/src/net/sourceforge/plantuml/descdiagram/CommandCreateDomain.java index 8feeac5a0..10e4f354c 100644 --- a/src/net/sourceforge/plantuml/descdiagram/CommandCreateDomain.java +++ b/src/net/sourceforge/plantuml/descdiagram/CommandCreateDomain.java @@ -94,7 +94,7 @@ public class CommandCreateDomain extends SingleLineCommand2 final GroupType type = typeString.equalsIgnoreCase("domain") ? GroupType.DOMAIN : GroupType.REQUIREMENT; final LeafType type2 = typeString.equalsIgnoreCase("domain") ? LeafType.DOMAIN : LeafType.REQUIREMENT; - final Quark quark = diagram.quarkInContext(diagram.cleanId(codeString), false); + final Quark quark = diagram.quarkInContext(true, diagram.cleanId(codeString)); if (quark.getData() != null) return CommandExecutionResult.error("Object already exists : " + codeString); diff --git a/src/net/sourceforge/plantuml/descdiagram/command/CommandArchimate.java b/src/net/sourceforge/plantuml/descdiagram/command/CommandArchimate.java index 85db2f08f..7bc02b008 100644 --- a/src/net/sourceforge/plantuml/descdiagram/command/CommandArchimate.java +++ b/src/net/sourceforge/plantuml/descdiagram/command/CommandArchimate.java @@ -123,7 +123,7 @@ public class CommandArchimate extends SingleLineCommand2 { throws NoSuchColorException { final String codeRaw = arg.getLazzy("CODE", 0); - final Quark quark = diagram.quarkInContext(diagram.cleanId(codeRaw), false); + final Quark quark = diagram.quarkInContext(true, diagram.cleanId(codeRaw)); String display = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(arg.getLazzy("DISPLAY", 0)); if (display == null) diff --git a/src/net/sourceforge/plantuml/descdiagram/command/CommandArchimateMultilines.java b/src/net/sourceforge/plantuml/descdiagram/command/CommandArchimateMultilines.java index fcbff674a..11cccd9bc 100644 --- a/src/net/sourceforge/plantuml/descdiagram/command/CommandArchimateMultilines.java +++ b/src/net/sourceforge/plantuml/descdiagram/command/CommandArchimateMultilines.java @@ -104,7 +104,7 @@ public class CommandArchimateMultilines extends CommandMultilines2 quark = diagram.quarkInContext(diagram.cleanId(codeRaw), true); + final Quark quark = diagram.quarkInContext(false, diagram.cleanId(codeRaw)); if (quark.getData() != null) return CommandExecutionResult.error("Already exists " + quark.getName()); diff --git a/src/net/sourceforge/plantuml/descdiagram/command/CommandCreateElementFull.java b/src/net/sourceforge/plantuml/descdiagram/command/CommandCreateElementFull.java index dd90c5a76..732434db2 100644 --- a/src/net/sourceforge/plantuml/descdiagram/command/CommandCreateElementFull.java +++ b/src/net/sourceforge/plantuml/descdiagram/command/CommandCreateElementFull.java @@ -225,7 +225,7 @@ public class CommandCreateElementFull extends SingleLineCommand2 quark = diagram.quarkInContext(diagram.cleanId(codeRaw), false); + final Quark quark = diagram.quarkInContext(false, diagram.cleanId(codeRaw)); if (diagram.isGroup(quark)) return CommandExecutionResult.error("This element (" + quark.getName() + ") is already defined"); diff --git a/src/net/sourceforge/plantuml/descdiagram/command/CommandCreateElementMultilines.java b/src/net/sourceforge/plantuml/descdiagram/command/CommandCreateElementMultilines.java index 29f412c46..3dc3a4665 100644 --- a/src/net/sourceforge/plantuml/descdiagram/command/CommandCreateElementMultilines.java +++ b/src/net/sourceforge/plantuml/descdiagram/command/CommandCreateElementMultilines.java @@ -162,7 +162,7 @@ public class CommandCreateElementMultilines extends CommandMultilines2 quark = diagram.quarkInContext(diagram.cleanId(idShort), false); + final Quark quark = diagram.quarkInContext(true, diagram.cleanId(idShort)); Entity result = quark.getData(); if (quark.getData() == null) result = diagram.reallyCreateLeaf(quark, display, type, usymbol); diff --git a/src/net/sourceforge/plantuml/descdiagram/command/CommandCreateElementParenthesis.java b/src/net/sourceforge/plantuml/descdiagram/command/CommandCreateElementParenthesis.java index ce254a793..33c0ae586 100644 --- a/src/net/sourceforge/plantuml/descdiagram/command/CommandCreateElementParenthesis.java +++ b/src/net/sourceforge/plantuml/descdiagram/command/CommandCreateElementParenthesis.java @@ -149,7 +149,7 @@ public class CommandCreateElementParenthesis extends SingleLineCommand2 quark = diagram.quarkInContext(diagram.cleanId(codeRaw), true); + final Quark quark = diagram.quarkInContext(false, diagram.cleanId(codeRaw)); if (quark.getData() != null) return CommandExecutionResult.error("This element (" + quark.getName() + ") is already defined"); diff --git a/src/net/sourceforge/plantuml/descdiagram/command/CommandLinkElement.java b/src/net/sourceforge/plantuml/descdiagram/command/CommandLinkElement.java index 69f48f068..b607964eb 100644 --- a/src/net/sourceforge/plantuml/descdiagram/command/CommandLinkElement.java +++ b/src/net/sourceforge/plantuml/descdiagram/command/CommandLinkElement.java @@ -302,7 +302,7 @@ public class CommandLinkElement extends SingleLineCommand2 { private Entity getDummy(DescriptionDiagram diagram, String ident) { if (ident.startsWith("()")) { ident = diagram.cleanId(ident); - final Quark quark = diagram.quarkInContext(ident, false); + final Quark quark = diagram.quarkInContext(true, ident); if (quark.getData() != null) return quark.getData(); return diagram.reallyCreateLeaf(quark, Display.getWithNewlines(quark.getName()), LeafType.DESCRIPTION, @@ -312,7 +312,7 @@ public class CommandLinkElement extends SingleLineCommand2 { final char codeChar = ident.length() > 2 ? ident.charAt(0) : 0; final boolean endWithSlash = ident.endsWith("/"); ident = diagram.cleanId(ident); - final Quark quark = diagram.quarkInContext(ident, false); + final Quark quark = diagram.quarkInContext(true, ident); if (diagram.isGroup(quark)) return quark.getData(); diff --git a/src/net/sourceforge/plantuml/descdiagram/command/CommandPackageWithUSymbol.java b/src/net/sourceforge/plantuml/descdiagram/command/CommandPackageWithUSymbol.java index c53cb75c7..77710a5e7 100644 --- a/src/net/sourceforge/plantuml/descdiagram/command/CommandPackageWithUSymbol.java +++ b/src/net/sourceforge/plantuml/descdiagram/command/CommandPackageWithUSymbol.java @@ -150,7 +150,7 @@ public class CommandPackageWithUSymbol extends SingleLineCommand2 ident = diagram.quarkInContext(diagram.cleanId(idShort), true); + final Quark ident = diagram.quarkInContext(false, diagram.cleanId(idShort)); final CommandExecutionResult status = diagram.gotoGroup(ident, Display.getWithNewlines(display), GroupType.PACKAGE); diff --git a/src/net/sourceforge/plantuml/objectdiagram/AbstractClassOrObjectDiagram.java b/src/net/sourceforge/plantuml/objectdiagram/AbstractClassOrObjectDiagram.java index 65b1be765..b789f0339 100644 --- a/src/net/sourceforge/plantuml/objectdiagram/AbstractClassOrObjectDiagram.java +++ b/src/net/sourceforge/plantuml/objectdiagram/AbstractClassOrObjectDiagram.java @@ -225,7 +225,7 @@ public abstract class AbstractClassOrObjectDiagram extends AbstractEntityDiagram if (entity1.getQuark().getParent() == entity2.getQuark().getParent()) quark = entity1.getQuark().getParent().child(idShort); else - quark = quarkInContext(cleanId(idShort), false); + quark = quarkInContext(true, cleanId(idShort)); point = reallyCreateLeaf(quark, Display.getWithNewlines(""), LeafType.POINT_FOR_ASSOCIATION, null); } diff --git a/src/net/sourceforge/plantuml/objectdiagram/command/CommandAddData.java b/src/net/sourceforge/plantuml/objectdiagram/command/CommandAddData.java index 59bfcc551..aada812ae 100644 --- a/src/net/sourceforge/plantuml/objectdiagram/command/CommandAddData.java +++ b/src/net/sourceforge/plantuml/objectdiagram/command/CommandAddData.java @@ -68,7 +68,7 @@ public class CommandAddData extends SingleLineCommand2 quark = diagram.quarkInContext(diagram.cleanId(name), false); + final Quark quark = diagram.quarkInContext(true, diagram.cleanId(name)); final Entity entity = quark.getData(); if (entity == null) return CommandExecutionResult.error("No such entity " + quark.getName()); diff --git a/src/net/sourceforge/plantuml/objectdiagram/command/CommandCreateEntityObject.java b/src/net/sourceforge/plantuml/objectdiagram/command/CommandCreateEntityObject.java index d25afaafe..403e67b21 100644 --- a/src/net/sourceforge/plantuml/objectdiagram/command/CommandCreateEntityObject.java +++ b/src/net/sourceforge/plantuml/objectdiagram/command/CommandCreateEntityObject.java @@ -81,7 +81,7 @@ public class CommandCreateEntityObject extends SingleLineCommand2 quark = diagram.quarkInContext(diagram.cleanId(idShort), false); + final Quark quark = diagram.quarkInContext(true, diagram.cleanId(idShort)); final String displayString = arg.get("NAME", 0); final String stereotype = arg.get("STEREO", 0); diff --git a/src/net/sourceforge/plantuml/objectdiagram/command/CommandCreateEntityObjectMultilines.java b/src/net/sourceforge/plantuml/objectdiagram/command/CommandCreateEntityObjectMultilines.java index d668a6a39..ec7457a56 100644 --- a/src/net/sourceforge/plantuml/objectdiagram/command/CommandCreateEntityObjectMultilines.java +++ b/src/net/sourceforge/plantuml/objectdiagram/command/CommandCreateEntityObjectMultilines.java @@ -108,7 +108,7 @@ public class CommandCreateEntityObjectMultilines extends CommandMultilines2 quark = diagram.quarkInContext(diagram.cleanId(name), false); + final Quark quark = diagram.quarkInContext(true, diagram.cleanId(name)); final String displayString = line0.get("NAME", 0); final String stereotype = line0.get("STEREO", 0); diff --git a/src/net/sourceforge/plantuml/objectdiagram/command/CommandCreateJson.java b/src/net/sourceforge/plantuml/objectdiagram/command/CommandCreateJson.java index 26c1fb003..94f3c4c13 100644 --- a/src/net/sourceforge/plantuml/objectdiagram/command/CommandCreateJson.java +++ b/src/net/sourceforge/plantuml/objectdiagram/command/CommandCreateJson.java @@ -144,7 +144,7 @@ public class CommandCreateJson extends CommandMultilines2 private Entity executeArg0(AbstractEntityDiagram diagram, RegexResult line0) throws NoSuchColorException { final String name = line0.get("NAME", 1); - final Quark quark = diagram.quarkInContext(diagram.cleanId(name), false); + final Quark quark = diagram.quarkInContext(true, diagram.cleanId(name)); if (quark.getData() != null) return null; final String displayString = line0.get("NAME", 0); diff --git a/src/net/sourceforge/plantuml/objectdiagram/command/CommandCreateJsonSingleLine.java b/src/net/sourceforge/plantuml/objectdiagram/command/CommandCreateJsonSingleLine.java index eb1a7b1ff..fbdc4aa76 100644 --- a/src/net/sourceforge/plantuml/objectdiagram/command/CommandCreateJsonSingleLine.java +++ b/src/net/sourceforge/plantuml/objectdiagram/command/CommandCreateJsonSingleLine.java @@ -113,7 +113,7 @@ public class CommandCreateJsonSingleLine extends SingleLineCommand2 quark = diagram.quarkInContext(diagram.cleanId(name), true); + final Quark quark = diagram.quarkInContext(false, diagram.cleanId(name)); if (quark.getData() != null) return null; diff --git a/src/net/sourceforge/plantuml/objectdiagram/command/CommandCreateMap.java b/src/net/sourceforge/plantuml/objectdiagram/command/CommandCreateMap.java index 5763cad0e..8e2cbe564 100644 --- a/src/net/sourceforge/plantuml/objectdiagram/command/CommandCreateMap.java +++ b/src/net/sourceforge/plantuml/objectdiagram/command/CommandCreateMap.java @@ -122,7 +122,7 @@ public class CommandCreateMap extends CommandMultilines2 final int x = line.indexOf(linkStr); final String key = line.substring(0, x).trim(); final String dest = line.substring(x + linkStr.length()).trim(); - final Quark ident2 = diagram.quarkInContext(dest, false); + final Quark ident2 = diagram.quarkInContext(true, dest); final Entity entity2 = ident2.getData(); if (entity2 == null) return CommandExecutionResult.error("No such entity " + ident2.getName()); @@ -141,7 +141,7 @@ public class CommandCreateMap extends CommandMultilines2 private Entity executeArg0(AbstractEntityDiagram diagram, RegexResult line0) throws NoSuchColorException { final String name = line0.get("NAME", 1); - final Quark quark = diagram.quarkInContext(diagram.cleanId(name), false); + final Quark quark = diagram.quarkInContext(true, diagram.cleanId(name)); final String displayString = line0.get("NAME", 0); final String stereotype = line0.get("STEREO", 0); diff --git a/src/net/sourceforge/plantuml/statediagram/StateDiagram.java b/src/net/sourceforge/plantuml/statediagram/StateDiagram.java index 7a6e2ea21..62b38c72d 100644 --- a/src/net/sourceforge/plantuml/statediagram/StateDiagram.java +++ b/src/net/sourceforge/plantuml/statediagram/StateDiagram.java @@ -82,13 +82,13 @@ public class StateDiagram extends AbstractEntityDiagram { final Entity g = getCurrentGroup(); if (g.isRoot()) { final String idShort = "*start*"; - final Quark quark = quarkInContext(cleanId(idShort), false); + final Quark quark = quarkInContext(true, cleanId(idShort)); if (quark.getData() == null) reallyCreateLeaf(quark, Display.getWithNewlines(""), LeafType.CIRCLE_START, null); return quark.getData(); } final String idShort = "*start*" + g.getName(); - final Quark quark = quarkInContext(cleanId(idShort), false); + final Quark quark = quarkInContext(true, cleanId(idShort)); if (quark.getData() == null) reallyCreateLeaf(quark, Display.getWithNewlines(""), LeafType.CIRCLE_START, null); return quark.getData(); @@ -98,13 +98,13 @@ public class StateDiagram extends AbstractEntityDiagram { final Entity p = getCurrentGroup(); if (p.isRoot()) { final String idShort = "*end*"; - final Quark quark = quarkInContext(cleanId(idShort), false); + final Quark quark = quarkInContext(true, cleanId(idShort)); if (quark.getData() == null) reallyCreateLeaf(quark, Display.getWithNewlines(""), LeafType.CIRCLE_END, null); return quark.getData(); } final String idShort = "*end*" + p.getName(); - final Quark quark = quarkInContext(cleanId(idShort), false); + final Quark quark = quarkInContext(true, cleanId(idShort)); if (quark.getData() == null) reallyCreateLeaf(quark, Display.getWithNewlines(""), LeafType.CIRCLE_END, null); return quark.getData(); @@ -114,24 +114,24 @@ public class StateDiagram extends AbstractEntityDiagram { final Entity g = getCurrentGroup(); if (g.isRoot()) { final String idShort = "*historical*"; - final Quark quark = quarkInContext(cleanId(idShort), false); + final Quark quark = quarkInContext(true, cleanId(idShort)); if (quark.getData() == null) reallyCreateLeaf(quark, Display.getWithNewlines(""), LeafType.PSEUDO_STATE, null); return quark.getData(); } final String idShort = "*historical*" + g.getName(); - final Quark quark = quarkInContext(cleanId(idShort), false); + final Quark quark = quarkInContext(true, cleanId(idShort)); if (quark.getData() == null) reallyCreateLeaf(quark, Display.getWithNewlines(""), LeafType.PSEUDO_STATE, null); return quark.getData(); } public Entity getHistorical(String idShort) { - final Quark quark = quarkInContext(cleanId(idShort), false); + final Quark quark = quarkInContext(true, cleanId(idShort)); gotoGroup(quark, Display.getWithNewlines(quark), GroupType.STATE); final Entity g = getCurrentGroup(); final String tmp = "*historical*" + g.getName(); - final Quark ident = quarkInContext(tmp, false); + final Quark ident = quarkInContext(true, tmp); final Entity result = reallyCreateLeaf(ident, Display.getWithNewlines(ident), LeafType.PSEUDO_STATE, null); endGroup(); return result; @@ -141,14 +141,14 @@ public class StateDiagram extends AbstractEntityDiagram { final Entity g = getCurrentGroup(); if (g.isRoot()) { final String idShort = "*deephistory*"; - final Quark quark = quarkInContext(cleanId(idShort), false); + final Quark quark = quarkInContext(true, cleanId(idShort)); if (quark.getData() == null) reallyCreateLeaf(quark, Display.getWithNewlines(""), LeafType.DEEP_HISTORY, null); return quark.getData(); } final String idShort = "*deephistory*" + g.getName(); - final Quark quark = quarkInContext(cleanId(idShort), false); + final Quark quark = quarkInContext(true, cleanId(idShort)); if (quark.getData() == null) reallyCreateLeaf(quark, Display.getWithNewlines(""), LeafType.DEEP_HISTORY, null); return quark.getData(); @@ -156,12 +156,12 @@ public class StateDiagram extends AbstractEntityDiagram { } public Entity getDeepHistory(String idShort) { - final Quark quark = quarkInContext(cleanId(idShort), false); + final Quark quark = quarkInContext(true, cleanId(idShort)); gotoGroup(quark, Display.getWithNewlines(quark), GroupType.STATE); final Entity g = getCurrentGroup(); final String tmp = "*deephistory*" + g.getName(); - final Quark ident = quarkInContext(cleanId(tmp), false); + final Quark ident = quarkInContext(true, cleanId(tmp)); final Entity result = reallyCreateLeaf(ident, Display.getWithNewlines(""), LeafType.DEEP_HISTORY, null); endGroup(); return result; @@ -175,7 +175,7 @@ public class StateDiagram extends AbstractEntityDiagram { super.endGroup(); final String tmp1 = this.getUniqueSequence(CONCURRENT_PREFIX); - final Quark ident1 = quarkInContext(cleanId(tmp1), false); + final Quark ident1 = quarkInContext(true, cleanId(tmp1)); gotoGroup(ident1, Display.create(""), GroupType.CONCURRENT_STATE); getCurrentGroup().setConcurrentSeparator(direction); diff --git a/src/net/sourceforge/plantuml/statediagram/command/CommandAddField.java b/src/net/sourceforge/plantuml/statediagram/command/CommandAddField.java index 834f3b157..7ca2ba0aa 100644 --- a/src/net/sourceforge/plantuml/statediagram/command/CommandAddField.java +++ b/src/net/sourceforge/plantuml/statediagram/command/CommandAddField.java @@ -76,7 +76,7 @@ public class CommandAddField extends SingleLineCommand2 { if (diagram.getCurrentGroup().getName().equals(codeString)) quark = diagram.getCurrentGroup().getQuark(); else - quark = diagram.quarkInContext(diagram.cleanId(codeString), false); + quark = diagram.quarkInContext(true, diagram.cleanId(codeString)); Entity entity = quark.getData(); if (entity == null) diff --git a/src/net/sourceforge/plantuml/statediagram/command/CommandCreatePackage2.java b/src/net/sourceforge/plantuml/statediagram/command/CommandCreatePackage2.java index f5759b7e5..a683fe5b7 100644 --- a/src/net/sourceforge/plantuml/statediagram/command/CommandCreatePackage2.java +++ b/src/net/sourceforge/plantuml/statediagram/command/CommandCreatePackage2.java @@ -110,7 +110,7 @@ public class CommandCreatePackage2 extends SingleLineCommand2 { throws NoSuchColorException { final String idShort = getNotNull(arg, "CODE1", "CODE2"); - final Quark quark = diagram.quarkInContext(diagram.cleanId(idShort), false); + final Quark quark = diagram.quarkInContext(true, diagram.cleanId(idShort)); String display = getNotNull(arg, "DISPLAY1", "DISPLAY2"); if (display == null) display = quark.getName(); diff --git a/src/net/sourceforge/plantuml/statediagram/command/CommandCreatePackageState.java b/src/net/sourceforge/plantuml/statediagram/command/CommandCreatePackageState.java index 8ba112999..6a8e408aa 100644 --- a/src/net/sourceforge/plantuml/statediagram/command/CommandCreatePackageState.java +++ b/src/net/sourceforge/plantuml/statediagram/command/CommandCreatePackageState.java @@ -115,7 +115,7 @@ public class CommandCreatePackageState extends SingleLineCommand2 throws NoSuchColorException { final String idShort = getNotNull(arg, "CODE1", "CODE2"); - final Quark quark = diagram.quarkInContext(idShort, false); + final Quark quark = diagram.quarkInContext(true, idShort); final String display = getNotNull(arg, "DISPLAY1", "DISPLAY2"); diff --git a/src/net/sourceforge/plantuml/statediagram/command/CommandCreateState.java b/src/net/sourceforge/plantuml/statediagram/command/CommandCreateState.java index 058954637..1de76f5f1 100644 --- a/src/net/sourceforge/plantuml/statediagram/command/CommandCreateState.java +++ b/src/net/sourceforge/plantuml/statediagram/command/CommandCreateState.java @@ -113,7 +113,7 @@ public class CommandCreateState extends SingleLineCommand2 { throws NoSuchColorException { final String idShort = arg.getLazzy("CODE", 0); - final Quark quark = diagram.quarkInContext(diagram.cleanId(idShort), false); + final Quark quark = diagram.quarkInContext(true, diagram.cleanId(idShort)); String display = arg.getLazzy("DISPLAY", 0); if (display == null) diff --git a/src/net/sourceforge/plantuml/statediagram/command/CommandLinkStateCommon.java b/src/net/sourceforge/plantuml/statediagram/command/CommandLinkStateCommon.java index 8f0b5441f..1e9bf54a8 100644 --- a/src/net/sourceforge/plantuml/statediagram/command/CommandLinkStateCommon.java +++ b/src/net/sourceforge/plantuml/statediagram/command/CommandLinkStateCommon.java @@ -167,7 +167,7 @@ abstract class CommandLinkStateCommon extends SingleLineCommand2 { if (code.startsWith("=") && code.endsWith("=")) { final String codeString1 = removeEquals(code); - final Quark quark = diagram.quarkInContext(diagram.cleanId(codeString1), false); + final Quark quark = diagram.quarkInContext(true, diagram.cleanId(codeString1)); if (quark.getData() != null) return quark.getData(); return diagram.reallyCreateLeaf(quark, Display.getWithNewlines(quark), LeafType.SYNCHRO_BAR, null); @@ -176,7 +176,7 @@ abstract class CommandLinkStateCommon extends SingleLineCommand2 { if (diagram.getCurrentGroup().getName().equals(code)) return diagram.getCurrentGroup(); - final Quark quark = diagram.quarkInContext(diagram.cleanId(code), false); + final Quark quark = diagram.quarkInContext(true, diagram.cleanId(code)); if (diagram.checkConcurrentStateOk(quark) == false) return null;