Hello,
I discovered a threading problem in JSVGCanvas. When I load a new SVG
document into an existing canvas showing an SVG and move the mouse over it
during the rendering, then often I get an exception. It can be an
IllegalArgumentException, an ArrayIndexOutOfBoundsException, a
StringIndexOutOfBoundsException or a NullPointerException, but it always
occurs somewhere in the text processing (see stack traces below). It looks
like the mouse event handling thread interferes with the rendering thread.
The problem does not occur if I use JSVGCanvas.loadSVGDocument instead of
setSVGDocument.
Is there a solution for that?
Thanks,
Lukasz
Thread [AWT-EventQueue-0] (Suspended (exception IllegalArgumentException))
AttributedString.addAttributes(Map<Attribute,?>, int, int) line:
not available
BidiAttributedCharacterIterator.<init>(AttributedCharacterIterator,
FontRenderContext, int) line: 115
StrokingTextPainter.computeTextRuns(TextNode,
AttributedCharacterIterator, AttributedCharacterIterator[]) line: 219
StrokingTextPainter.getTextRuns(TextNode,
AttributedCharacterIterator) line: 198
StrokingTextPainter.getOutline(TextNode) line: 1016
StrokingTextPainter(BasicTextPainter).getGeometryBounds(TextNode)
line: 91
TextNode.getGeometryBounds() line: 260
TextNode.getSensitiveBounds() line: 272
TextNode(AbstractGraphicsNode).getTransformedSensitiveBounds(AffineTransform)
line: 902
CompositeGraphicsNode.getSensitiveBounds() line: 402
CompositeGraphicsNode.getTransformedSensitiveBounds(AffineTransform)
line: 435
CompositeGraphicsNode.getSensitiveBounds() line: 402
CompositeGraphicsNode.getTransformedSensitiveBounds(AffineTransform)
line: 435
CanvasGraphicsNode(CompositeGraphicsNode).getSensitiveBounds()
line: 398
CanvasGraphicsNode(CompositeGraphicsNode).getTransformedSensitiveBounds(AffineTransform)
line: 435
CanvasGraphicsNode(CompositeGraphicsNode).getSensitiveBounds()
line: 398
CanvasGraphicsNode(CompositeGraphicsNode).getTransformedSensitiveBounds(AffineTransform)
line: 435
CanvasGraphicsNode(CompositeGraphicsNode).getSensitiveBounds()
line: 398
CanvasGraphicsNode(CompositeGraphicsNode).getTransformedSensitiveBounds(AffineTransform)
line: 435
RootGraphicsNode(CompositeGraphicsNode).getSensitiveBounds() line:
398
RootGraphicsNode(CompositeGraphicsNode).nodeHitAt(Point2D) line:
490
AWTEventDispatcher(AbstractAWTEventDispatcher).dispatchMouseEvent(MouseEvent)
line: 470
AWTEventDispatcher(AbstractAWTEventDispatcher).dispatchEvent(EventObject)
line: 387
AWTEventDispatcher.dispatchEvent(EventObject) line: 73
AWTEventDispatcher(AbstractAWTEventDispatcher).mouseEntered(MouseEvent)
line: 183
JSVGCanvas$CanvasSVGListener(AbstractJGVTComponent$Listener).dispatchMouseEntered(MouseEvent)
line: 1125
JSVGCanvas$CanvasSVGListener(AbstractJSVGComponent$SVGListener).dispatchMouseEntered(MouseEvent)
line: 2157
JSVGCanvas$CanvasSVGListener(AbstractJGVTComponent$Listener).mouseEntered(MouseEvent)
line: 1117
AWTEventMulticaster.mouseEntered(MouseEvent) line: not available
JSVGCanvas(Component).processMouseEvent(MouseEvent) line: not
available
JSVGCanvas(JComponent).processMouseEvent(MouseEvent) line: not
available
JSVGCanvas(Component).processEvent(AWTEvent) line: not available
JSVGCanvas(Container).processEvent(AWTEvent) line: not available
JSVGCanvas(Component).dispatchEventImpl(AWTEvent) line: not
available
JSVGCanvas(Container).dispatchEventImpl(AWTEvent) line: not
available
JSVGCanvas(Component).dispatchEvent(AWTEvent) line: not available
LightweightDispatcher.retargetMouseEvent(Component, int,
MouseEvent) line: not available
LightweightDispatcher.trackMouseEnterExit(Component, MouseEvent)
line: not available
LightweightDispatcher.processMouseEvent(MouseEvent) line: not
available
LightweightDispatcher.dispatchEvent(AWTEvent) line: not available
JFrame(Container).dispatchEventImpl(AWTEvent) line: not available
JFrame(Window).dispatchEventImpl(AWTEvent) line: not available
JFrame(Component).dispatchEvent(AWTEvent) line: not available
EventQueue.dispatchEvent(AWTEvent) line: not available
EventDispatchThread.pumpOneEventForFilters(int) line: not
available
EventDispatchThread.pumpEventsForFilter(int, Conditional,
EventFilter) line: not available
EventDispatchThread.pumpEventsForHierarchy(int, Conditional,
Component) line: not available
EventDispatchThread.pumpEvents(int, Conditional) line: not
available
EventDispatchThread.pumpEvents(Conditional) line: not available
EventDispatchThread.run() line: not available
Thread [Thread-16] (Suspended)
HashMap<K,V>.put(K, V) line: not available
HashSet<E>.add(E) line: not available
AttributedString$AttributeMap.entrySet() line: not available
AttributedString$AttributeMap(AbstractMap<K,V>).size() line: not
available
BidiAttributedCharacterIterator.<init>(AttributedCharacterIterator,
FontRenderContext, int) line: 101
StrokingTextPainter.computeTextRuns(TextNode,
AttributedCharacterIterator, AttributedCharacterIterator[]) line: 219
StrokingTextPainter.getTextRuns(TextNode,
AttributedCharacterIterator) line: 198
StrokingTextPainter.getBounds2D(TextNode) line: 1085
TextNode.getPrimitiveBounds() line: 245
TextNode(AbstractGraphicsNode).getTransformedPrimitiveBounds(AffineTransform)
line: 854
TextNode(AbstractGraphicsNode).getTransformedBounds(AffineTransform)
line: 820
CompositeGraphicsNode.getPrimitiveBounds() line: 224
CompositeGraphicsNode.getTransformedPrimitiveBounds(AffineTransform)
line: 295
CompositeGraphicsNode(AbstractGraphicsNode).getTransformedBounds(AffineTransform)
line: 820
CompositeGraphicsNode.getPrimitiveBounds() line: 224
CompositeGraphicsNode.getTransformedPrimitiveBounds(AffineTransform)
line: 295
CompositeGraphicsNode(AbstractGraphicsNode).getTransformedBounds(AffineTransform)
line: 820
CanvasGraphicsNode(CompositeGraphicsNode).getPrimitiveBounds()
line: 207
CanvasGraphicsNode(CompositeGraphicsNode).getTransformedPrimitiveBounds(AffineTransform)
line: 295
CanvasGraphicsNode(AbstractGraphicsNode).getTransformedBounds(AffineTransform)
line: 820
CanvasGraphicsNode(CompositeGraphicsNode).getPrimitiveBounds()
line: 207
CanvasGraphicsNode(CompositeGraphicsNode).getTransformedPrimitiveBounds(AffineTransform)
line: 295
CanvasGraphicsNode(AbstractGraphicsNode).getTransformedBounds(AffineTransform)
line: 820
CanvasGraphicsNode(CompositeGraphicsNode).getPrimitiveBounds()
line: 207
CanvasGraphicsNode(CompositeGraphicsNode).getTransformedPrimitiveBounds(AffineTransform)
line: 295
CanvasGraphicsNode(AbstractGraphicsNode).getTransformedBounds(AffineTransform)
line: 820
RootGraphicsNode(CompositeGraphicsNode).getPrimitiveBounds() line:
207
GraphicsNodeRable8Bit.getBounds2D() line: 156
GraphicsNodeRable8Bit.createRendering(RenderContext) line: 261
StaticRenderer.renderGNR() line: 481
StaticRenderer.updateWorkingBuffers() line: 508
StaticRenderer.clearOffScreen() line: 307
GVTTreeRenderer.run() line: 108