An error when I generated the image using Java

0 votes
asked Jul 11, 2023 in Bug by allen


thank's for this great soft

There was an error when I generated the image using Java (according to Description). this error only occurs when I use the 'switch'.

my code:

public void Test() throws IOException {
    String outputFilePath = "/Users/dongdexuan/project/web-demo/src/test/java/com/codegenerate/uml/output.svg";
    OutputStream png = new FileOutputStream(new File(outputFilePath));
    String source = "@startuml\n"
            + "!pragma layout smetana"
            + "start\n"
            + "switch (测试?)\n"
            + "case ( 条件 A )\n"
            + "  :Text 1;\n"
            + "case ( 条件 B ) \n"
            + "  :Text 2;\n"
            + "case ( 条件 C )\n"
            + "  :Text 3;\n"
            + "case ( 条件 D )\n"
            + "  :Text 4;\n"
            + "case ( 条件 E )\n"
            + "  :Text 5;\n"
            + "endswitch\n"
            + "stop\n"
            + "@enduml";

    SourceStringReader reader = new SourceStringReader(source);
    // Write the first image to "svg"
    reader.generateImage(png, new FileFormatOption(FileFormat.SVG));
output.svg show:
Syntax Error? 
Did you mean: 
switch- (测试?)
thank's in advance

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:

[Antispam2 Feature: please please wait 1 or 2 minutes (this message will disappear) before pressing the button otherwise it will fail](--------)
To avoid this verification in future, please log in or register.