Skip to content

Commit

Permalink
fix: minor issue on nesting packages
Browse files Browse the repository at this point in the history
  • Loading branch information
arnaudroques committed Oct 4, 2023
1 parent c724875 commit 5d38bb6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -134,28 +134,25 @@ private static ColorParser color() {
@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 display;
final String idShort;
if (codeRaw.length() == 0) {
idShort = diagram.getUniqueSequence("##");
display = null;
} else {
idShort = codeRaw;
if (displayRaw == null)
display = idShort;
else
display = displayRaw;
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 Quark<Entity> ident = diagram.quarkInContext(false, diagram.cleanId(idShort));
if (codeArg.length() == 0)
display = null;
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);

Expand Down
6 changes: 5 additions & 1 deletion src/net/sourceforge/plantuml/statediagram/StateDiagram.java
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,11 @@ public Entity getHistorical(String idShort) {
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;
}
Expand Down

0 comments on commit 5d38bb6

Please sign in to comment.