esteinberg / plantuml4idea

Intellij IDEA plugin for PlantUML
Apache License 2.0
633 stars 113 forks source link

PyCharm Exception while Editing Activity Diagram .puml file #398

Closed AMueckl closed 1 year ago

AMueckl commented 1 year ago

While I was editing an activity diagram and started inserting the following line:

!$highlight_TODOs = 1

PyCharm received an exception:

- imageSource: <?xml version="1.0" encoding="us-ascii" standalone="no"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" contentStyleType="text/css" height="425px" preserveAspectRatio="none" style="width:541px;height:425px;background:#000000;" version="1.1" viewBox="0 0 541 425" width="541px" zoomAndPan="magnify"><defs/><g><rect fill="#190514" height="1" style="stroke:#190514;stroke-width:1.0;" width="1" x="0" y="0"/><rect fill="#FFFFFF" height="235.2285" style="stroke:#FFFFFF;stroke-width:1.0;" width="540" x="0" y="0"/><text fill="#000000" font-family="sans-serif" font-size="12" font-weight="bold" lengthAdjust="spacing" textLength="128" x="5" y="17.9492">Welcome to PlantUML!</text><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacing" textLength="3" x="5" y="33.9102">&#160;</text><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacing" textLength="251" x="5" y="49.8711">You can start with a simple UML Diagram like:</text><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacing" textLength="3" x="5" y="65.832">&#160;</text><text fill="#000000" font-family="monospace" font-size="12" lengthAdjust="spacing" textLength="119" x="5" y="81.793">Bob-&gt;Alice:&#160;Hello</text><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacing" textLength="3" x="5" y="98.3457">&#160;</text><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacing" textLength="13" x="5" y="114.3066">Or</text><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacing" textLength="3" x="5" y="130.2676">&#160;</text><text fill="#000000" font-family="monospace" font-size="12" lengthAdjust="spacing" textLength="91" x="5" y="146.2285">class&#160;Example</text><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacing" textLength="3" x="5" y="162.7813">&#160;</text><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacing" textLength="306" x="5" y="178.7422">You will find more information about PlantUML syntax on</text><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacing" text-decoration="underline" textLength="111" x="314" y="178.7422">https://plantuml.com</text><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacing" textLength="3" x="5" y="194.7031">&#160;</text><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacing" textLength="93" x="5" y="211.2559">(Details by typing</text><text fill="#000000" font-family="monospace" font-size="12" lengthAdjust="spacing" textLength="49" x="101" y="210.6641">license</text><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacing" textLength="49" x="153" y="211.2559">keyword)</text><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacing" textLength="3" x="5" y="227.2168">&#160;</text><image height="71" width="80" x="454" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABHCAMAAACnHDC8AAADAFBMVEX///+BpbvD3u/f7vfPz8+nz+g3ksuZEDkWADr/ujlvsdpTodLCwsOLwOEbg8T//v6pqamZETnLysvT09To5+jqLS4VATj9/f27u7vDw8MTfsK+v7/j4+SOweJprdjL4/KxsbEri8jk8PgXa57c29uUETez1utQoNJ1tNtEmc9cptWBut6ayOW/3O6YEDjY6vUfhcXBwcHs7Ozw9/v83t79uTn7+/vX19ehoaHx8fG2tLXHx8fuVlfrNTYaBjn/vUH5+fmko6WXl5f/+fn95ub+9PT+8PD3qKidmaMxIUrnqDWcFj7n5eX09PTu7u2SkpKfnZ6rq6z0lJTm4tzJrHUfDT339/eFGDn6tjcrEzOvrbBuZ3l4eomSMS7Hz9Smpqasu8SFiYuQETfa2du1m6OOM051J0NWTWL5xse4uLj6zc33r6/4vb7ydHXqLi/72dntTE3tR0ijbn5jW3C+u8NANVQrG0XFubqRVGZza4GQGT2VaS7a0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j8fZzKLiDa317MqBQFbs+J3dcbSgo+H4D0kLOokJ82/NR8KZbp9eIZgllwKR8Ec1ejIX827POk/06HpYffGd5dkoZJXMqDAVXd1Nbhavlx4OyuAiPcyAF3Ick8faXAuE5WToApkMxykL1PbNRJ91SDkXOyymPFR1UMlw9GjRPKCrPsRSvUnbzbkELj2PSSRkQLiH1AvROTutlpryLHQAoCD+C2BBP4npMwd9zsIgzgaDsK+bctmVw3hetai5t9RS4PEqub4QnCvxteGzOZyQXxjscxkhHisWKMi72+T0p1dxGeGYkG0ez+eeG7In/n/oNOexC9fzIiLvPxVtKp84iza+AAAAAElFTkSuQmCC" y="6"/><rect fill="#000000" height="187.9297" style="stroke:#000000;stroke-width:1.0;" width="540" x="0" y="235.2285"/><text fill="#33FF02" font-family="sans-serif" font-size="12" font-style="italic" font-weight="bold" lengthAdjust="spacing" textLength="114" x="5" y="252.2285">PlantUML 1.2023.10</text><rect fill="#33FF02" height="23.6211" style="stroke:#33FF02;stroke-width:1.0;" width="295" x="5" y="264.1895"/><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacing" textLength="147" x="6" y="279.1895">[From string (line 5) ]</text><text fill="#33FF02" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacing" textLength="4" x="5" y="301.8105">&#160;</text><text fill="#33FF02" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacing" textLength="71" x="5" y="320.4316">@startuml</text><text fill="#33FF02" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacing" textLength="295" x="5" y="339.0527">'https://plantuml.com/activity-diagram-beta</text><text fill="#33FF02" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacing" textLength="4" x="5" y="357.6738">&#160;</text><text fill="#33FF02" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacing" textLength="196" x="5" y="376.2949">title Main Window Life Cycle</text><text fill="#33FF02" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacing" text-decoration="wavy underline" textLength="142" x="5" y="394.916">!$highlight_TODOs =</text><text fill="#FF0000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacing" textLength="138" x="9" y="413.5371">Missing expression</text><!--SRC=[VOx1Ri8m44Jl_eezmg4eDb2a74cYIY5HKMdXxCPBj99P8sUTYh-lUwXwwtNcpTC8YKVeBJ5SY5tuWewk2DLZyAZalr8TlMNvw3kOCKuK6FJA56QzqiNYWWxQv44RqBjokocB7LJDwHr-WALQl1mxc4AA0uAZII9z9ic6fMhjRE4jiT0DItYz8xVruJU0XcUAWM_8ejfp_mSyRvxs9732cB_0kLSrNctoaXT3SCHZ2TLTcwrHdUKnsJ7B7QegP75yb50ttm00]--></g></svg>

org.apache.batik.transcoder.TranscoderException: null Enclosed Exception: Index 239 out of bounds for length 80 at org.plantuml.idea.preview.image.svg.batik.MySvgTranscoder$Companion.createImage(MySvgTranscoder.kt:110) at org.plantuml.idea.preview.image.svg.batik.MySvgTranscoder$Companion.createImage$default(MySvgTranscoder.kt:73) at org.plantuml.idea.preview.image.svg.batik.MySvgTranscoder$Companion.createImage(MySvgTranscoder.kt) at org.plantuml.idea.preview.image.svg.batik.MySvgTranscoder.createImage(MySvgTranscoder.kt) at org.plantuml.idea.preview.image.svg.MyImageEditorImpl$MyScaledImageProvider.createImage(MyImageEditorImpl.java:247) at org.plantuml.idea.preview.image.svg.MyImageEditorImpl$MyScaledImageProvider.apply(MyImageEditorImpl.java:210) at org.plantuml.idea.preview.image.svg.MyImageEditorImpl$MyScaledImageProvider.apply(MyImageEditorImpl.java:187) at org.intellij.images.ui.ImageComponent$ImageDocumentImpl.lambda$setValue$2(ImageComponent.java:309) at org.intellij.images.ui.ImageComponent$ImageDocumentImpl.getValue(ImageComponent.java:296) at org.intellij.images.ui.ImageComponent$ImageDocumentImpl.getValue(ImageComponent.java:291) at org.plantuml.idea.preview.image.svg.MyImageEditorUI$DocumentChangeListener.stateChanged(MyImageEditorUI.java:634) at org.intellij.images.ui.ImageComponent$ImageDocumentImpl.fireChangeEvent(ImageComponent.java:330) at org.intellij.images.ui.ImageComponent$ImageDocumentImpl.setValue(ImageComponent.java:313) at org.plantuml.idea.preview.image.svg.MyImageEditorUI.setImageProvider(MyImageEditorUI.java:280) at org.plantuml.idea.preview.image.svg.MyImageEditorImpl.setValue(MyImageEditorImpl.java:95) at org.plantuml.idea.preview.image.svg.MyImageEditorImpl.(MyImageEditorImpl.java:89) at org.plantuml.idea.preview.image.ImageContainerSvg.initEditor(ImageContainerSvg.java:155) at org.plantuml.idea.rendering.ImageItem.initImage(ImageItem.java:189) at org.plantuml.idea.rendering.RenderCommand.lambda$displayResult$0(RenderCommand.java:173) at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183) at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625) at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) at java.base/java.util.stream.ForEachOps$ForEachTask.compute(ForEachOps.java:290) at java.base/java.util.concurrent.CountedCompleter.exec(CountedCompleter.java:754) at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373) at java.base/java.util.concurrent.ForkJoinTask.invoke(ForkJoinTask.java:686) at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateParallel(ForEachOps.java:159) at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateParallel(ForEachOps.java:173) at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:233) at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596) at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:765) at org.plantuml.idea.rendering.RenderCommand.lambda$displayResult$2(RenderCommand.java:171) at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183) at java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:992) at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) at java.base/java.util.stream.ForEachOps$ForEachTask.compute(ForEachOps.java:290) at java.base/java.util.concurrent.CountedCompleter.exec(CountedCompleter.java:754) at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373) at java.base/java.util.concurrent.ForkJoinTask.invoke(ForkJoinTask.java:686) at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateParallel(ForEachOps.java:159) at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateParallel(ForEachOps.java:173) at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:233) at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596) at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:765) at org.plantuml.idea.rendering.RenderCommand.displayResult(RenderCommand.java:170) at org.plantuml.idea.rendering.LazyApplicationPoolExecutor$MyRunnable.run(LazyApplicationPoolExecutor.java:131) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) at java.base/java.lang.Thread.run(Thread.java:833) Caused by: java.lang.ArrayIndexOutOfBoundsException: Index 239 out of bounds for length 80 at org.apache.batik.ext.awt.image.GraphicsUtil.copyData(GraphicsUtil.java:1169) at org.apache.batik.ext.awt.image.GraphicsUtil.copyData(GraphicsUtil.java:1095) at org.apache.batik.ext.awt.image.rendered.FormatRed.copyData(FormatRed.java:118) at org.apache.batik.ext.awt.image.rendered.AbstractRed.getData(AbstractRed.java:533) at org.apache.batik.ext.awt.image.GraphicsUtil.drawImage(GraphicsUtil.java:236) at org.apache.batik.ext.awt.image.GraphicsUtil.drawImage(GraphicsUtil.java:427) at org.apache.batik.gvt.RasterImageNode.primitivePaint(RasterImageNode.java:104) at org.apache.batik.gvt.AbstractGraphicsNode.paint(AbstractGraphicsNode.java:529) at org.apache.batik.gvt.CompositeGraphicsNode.primitivePaint(CompositeGraphicsNode.java:161) at org.apache.batik.gvt.AbstractGraphicsNode.paint(AbstractGraphicsNode.java:529) at org.apache.batik.gvt.ImageNode.paint(ImageNode.java:74) at org.apache.batik.gvt.CompositeGraphicsNode.primitivePaint(CompositeGraphicsNode.java:161) at org.apache.batik.gvt.AbstractGraphicsNode.paint(AbstractGraphicsNode.java:529) at org.apache.batik.gvt.CompositeGraphicsNode.primitivePaint(CompositeGraphicsNode.java:161) at org.apache.batik.gvt.CanvasGraphicsNode.primitivePaint(CanvasGraphicsNode.java:159) at org.apache.batik.gvt.AbstractGraphicsNode.paint(AbstractGraphicsNode.java:529) at org.apache.batik.gvt.CompositeGraphicsNode.primitivePaint(CompositeGraphicsNode.java:161) at org.apache.batik.gvt.AbstractGraphicsNode.paint(AbstractGraphicsNode.java:529) at org.plantuml.idea.preview.image.svg.batik.MySvgTranscoderKt.render(MySvgTranscoder.kt:290) at org.plantuml.idea.preview.image.svg.batik.MySvgTranscoderKt.access$render(MySvgTranscoder.kt:1) at org.plantuml.idea.preview.image.svg.batik.MySvgTranscoder$Companion.createImage(MySvgTranscoder.kt:100) ... 50 more

krasa commented 1 year ago

Please update and report back if it happens again. Thanks

AMueckl commented 1 year ago

Seems to be OK at first glance. Thank you very much!