JDK 1.6.0.45 java.lang.IllegalArgumentException: Illegal pattern character 'u'

0 votes
asked May 20, 2016 in bug by Meo (910 points)

Since version 8037

rendering with a syntax error does not return a nice error image, but fails on 

 

java.lang.IllegalArgumentException: Illegal pattern character 'u'
 
at java.text.SimpleDateFormat.compile(SimpleDateFormat.java:768)
at java.text.SimpleDateFormat.initialize(SimpleDateFormat.java:575)
at java.text.SimpleDateFormat.<init>(SimpleDateFormat.java:500)
at java.text.SimpleDateFormat.<init>(SimpleDateFormat.java:475)
at net.sourceforge.plantuml.graphic.DateEventUtils.addEvent(DateEventUtils.java:60)
at net.sourceforge.plantuml.graphic.GraphicStrings.getTextBlock(GraphicStrings.java:130)
at net.sourceforge.plantuml.graphic.GraphicStrings.calculateDimension(GraphicStrings.java:152)
at net.sourceforge.plantuml.graphic.GraphicStrings.drawU(GraphicStrings.java:135)
at net.sourceforge.plantuml.ugraphic.ImageBuilder.getFinalDimension(ImageBuilder.java:159)
at net.sourceforge.plantuml.ugraphic.ImageBuilder.writeImageInternal(ImageBuilder.java:128)
at net.sourceforge.plantuml.ugraphic.ImageBuilder.writeImageTOBEMOVED(ImageBuilder.java:123)
at net.sourceforge.plantuml.PSystemError.exportDiagram(PSystemError.java:118)
at net.sourceforge.plantuml.SourceStringReader.generateImage(SourceStringReader.java:113)
 
 
example:
 
    SourceStringReader reader = new SourceStringReader("@startuml\n" +
    "xxx\n" +
    "@enduml");
    ByteArrayOutputStream os = new ByteArrayOutputStream();
    reader.generateImage(os, 0, new FileFormatOption(FileFormat.PNG));

 

JDK 1.7+ works fine, JDK 1.6.0.45 fails

1 Answer

0 votes
answered May 21, 2016 by plantuml (134,570 points)
selected Jun 8, 2016 by Meo
 
Best answer
Thanks for the feedback.

It's an issue with the Locale.

This has been fixed in last beta https://dl.dropboxusercontent.com/u/13064071/plantuml.jar

Tell us if it's working for you.

Regards,
commented May 21, 2016 by Meo (910 points)
It does not, new SimpleDateFormat("MM-dd-u", Locale.US) does not work for me - Illegal pattern character 'u'
commented May 21, 2016 by plantuml (134,570 points)
Could you try : new SimpleDateFormat("MM-dd-u", Locale.ENGLISH)
Thanks!
commented May 21, 2016 by Meo (910 points)
same, I looked into docs, and 'u' is not in the table in JDK 1.6...
commented May 21, 2016 by plantuml (134,570 points)
Ok, let's not use this 'u' anymore.
You'll find a new corrected beta here https://dl.dropboxusercontent.com/u/13064071/plantuml.jar
If you need the patched class, it's here
https://dl.dropboxusercontent.com/u/13064071/DateEventUtils.java

Tell us if it's still not working for you!
commented May 21, 2016 by Meo (910 points)
that works fine, thanks!
...