1
0
mirror of https://github.com/octoleo/plantuml.git synced 2024-12-22 02:49:06 +00:00

fix: minor issue on nesting packages

https://github.com/plantuml/plantuml/issues/1550
This commit is contained in:
Arnaud Roques 2023-10-04 19:11:39 +02:00
parent c72487595b
commit 5d38bb6ef4
2 changed files with 17 additions and 16 deletions

View File

@ -134,28 +134,25 @@ public class CommandPackageWithUSymbol extends SingleLineCommand2<AbstractEntity
@Override
protected CommandExecutionResult executeArg(AbstractEntityDiagram diagram, LineLocation location, RegexResult arg)
throws NoSuchColorException {
final String codeRaw = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(arg.getLazzy("CODE", 0));
final String displayRaw = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(arg.getLazzy("DISPLAY", 0));
final String codeArg = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(arg.getLazzy("CODE", 0));
final Quark<Entity> ident = diagram.quarkInContext(false,
diagram.cleanId(codeArg.length() == 0 ? diagram.getUniqueSequence("##") : codeArg));
final String displayArg = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(arg.getLazzy("DISPLAY", 0));
final String display;
final String idShort;
if (codeRaw.length() == 0) {
idShort = diagram.getUniqueSequence("##");
if (codeArg.length() == 0)
display = null;
} else {
idShort = codeRaw;
if (displayRaw == null)
display = idShort;
else
display = displayRaw;
}
final Quark<Entity> ident = diagram.quarkInContext(false, diagram.cleanId(idShort));
else if (displayArg == null)
display = ident.getName();
else
display = displayArg;
final CommandExecutionResult status = diagram.gotoGroup(ident, Display.getWithNewlines(display),
GroupType.PACKAGE);
if (status.isOk() == false)
return status;
final Entity p = diagram.getCurrentGroup();
final String symbol = arg.get("SYMBOL", 0);

View File

@ -133,7 +133,11 @@ public class StateDiagram extends AbstractEntityDiagram {
final Entity g = getCurrentGroup();
final String tmp = "*historical*" + g.getName();
final Quark<Entity> ident = quarkInContext(true, tmp);
final Entity result = reallyCreateLeaf(ident, Display.getWithNewlines(ident), LeafType.PSEUDO_STATE, null);
final Entity result;
if (ident.getData() == null)
result = reallyCreateLeaf(ident, Display.getWithNewlines(ident), LeafType.PSEUDO_STATE, null);
else
result = ident.getData();
endGroup();
return result;
}