You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by Sebastian Queißer <s....@freenet.de> on 2009/02/20 18:10:51 UTC
UnsupportedOperationException in SVN revision 746293
Hello,
while playing with batik from the SVN repository (rev 746293) I noticed
that in some situations there is an UnsupportedOperationException
thrown. The traceback
java.lang.UnsupportedOperationException
at org.apache.batik.gvt.CompositeGraphicsNode.addAll(Unknown Source)
at org.apache.batik.gvt.MarkerShapePainter.buildMarkerGroup(Unknown Source)
at org.apache.batik.gvt.MarkerShapePainter.getPaintedBounds2D(Unknown Source)
at org.apache.batik.gvt.CompositeShapePainter.getPaintedBounds2D(Unknown Source)
at org.apache.batik.gvt.ShapeNode.getPrimitiveBounds(Unknown Source)
at org.apache.batik.gvt.AbstractGraphicsNode.getTransformedPrimitiveBounds(Unknown Source)
at org.apache.batik.gvt.AbstractGraphicsNode.getTransformedBounds(Unknown Source)
at org.apache.batik.gvt.CompositeGraphicsNode.getPrimitiveBounds(Unknown Source)
at org.apache.batik.gvt.CompositeGraphicsNode.getTransformedPrimitiveBounds(Unknown Source)
at org.apache.batik.gvt.AbstractGraphicsNode.getTransformedBounds(Unknown Source)
at org.apache.batik.gvt.CompositeGraphicsNode.getPrimitiveBounds(Unknown Source)
at org.apache.batik.gvt.CompositeGraphicsNode.getTransformedPrimitiveBounds(Unknown Source)
at org.apache.batik.gvt.AbstractGraphicsNode.getTransformedBounds(Unknown Source)
at org.apache.batik.gvt.CompositeGraphicsNode.getPrimitiveBounds(Unknown Source)
at org.apache.batik.gvt.filter.GraphicsNodeRable8Bit.getBounds2D(Unknown Source)
at org.apache.batik.gvt.filter.GraphicsNodeRable8Bit.createRendering(Unknown Source)
at org.apache.batik.gvt.renderer.StaticRenderer.renderGNR(Unknown Source)
at org.apache.batik.gvt.renderer.DynamicRenderer.updateWorkingBuffers(Unknown Source)
at org.apache.batik.gvt.renderer.StaticRenderer.clearOffScreen(Unknown Source)
at org.apache.batik.swing.gvt.GVTTreeRenderer.run(Unknown Source)
indicates that the method CompositeGraphicsNode.addAll is called by
MarkerShapePainter.buildMarkerGroup (line 304). This call seems to be
not yet? supported (see line 764 in CompositeGraphicsNode). Perhaps
someone forgot to merge the code for addAll from a branch...
Regards,
Sebastian
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
Re: UnsupportedOperationException in SVN revision 746293
Posted by th...@kodak.com.
Hi All,
Helder Magalhães <he...@gmail.com> wrote on 02/25/2009 04:17:51
PM:
> > I took the revision before this line was inserted where the call to
> > addAll is emulated by some single add calls everything is fine.
Right this is a regression. It's a bug and it should be fixed.
I actually don't like the call to addAll since it requires creating
a List from an Array which will likely be more expensive than the
loop since we use a linked list.
Re: UnsupportedOperationException in SVN revision 746293
Posted by Helder Magalhães <he...@gmail.com>.
Hi all,
> @Dieter von Holten: could this be taken a look at? Given that you have
> introduced the change, considering Thomas argumentation (two messages
> ago) and that several "addAll" were introduced in revision 720261, I'm
> not sure if the regression extension was to "MarkerShapePainter.java"
> or if something else was affected... :-|
As this wasn't replied to in a couple of weeks, I've created bug 46861
[1] to make sure this doesn't get lost. :-)
I've also checked that running regard would probably catch this as
files "paint-markers-BE-03.svg" and "paint-markers-BE-04.svg" make use
of "marker-mid" as suggested by Sebastian in a previous message.
Hope this helps,
Helder Magalhães
[1] https://issues.apache.org/bugzilla/show_bug.cgi?id=46861
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
Re: UnsupportedOperationException in SVN revision 746293
Posted by Helder Magalhães <he...@gmail.com>.
Hi Sebastian and Thomas,
Thomas DeWeese wrote:
> Right this is a regression. It's a bug and it should be fixed.
> I actually don't like the call to addAll since it requires creating
> a List from an Array which will likely be more expensive than the
> loop since we use a linked list.
@Dieter von Holten: could this be taken a look at? Given that you have
introduced the change, considering Thomas argumentation (two messages
ago) and that several "addAll" were introduced in revision 720261, I'm
not sure if the regression extension was to "MarkerShapePainter.java"
or if something else was affected... :-|
Sebastian Queißer wrote:
> Thank you for your detailed explanation, now I understand your concerns.
> But I'm not quite sure if unit testing really makes sense in this case.
I'm pretty convinced it does -- at least, to try helping avoid
regressions... ;-) I'm currently trying to setup regard for regular
runs of the tool and apparently the test was already covered: at
least, I got several exceptions (apart from the image comparison
alarms) thrown in a single execution. To be further investigated...
Regards,
Helder
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
Re: UnsupportedOperationException in SVN revision 746293
Posted by Sebastian Queißer <s....@freenet.de>.
Hi Helder,
On Mi, Feb 25, 2009 at 09:17:51 +0000, you wrote:
>
> [...]
>
> > I would have attached an example file, if my SVG file didn't have a size
> > of about 2Mb;-)
>
> That's why I asked for a reduced test case [1]. ;-) I'm pretty
> convinced that you'll be able to track this down to a 1-2Kb file -- it
> would be valuable when added to regard [3] as this appears to be a
> regression. If you aren't able to reduce it, you may send it to me
> directly and I'll do my best whenever time permits. :-)
Thank you for your detailed explanation, now I understand your concerns.
But I'm not quite sure if unit testing really makes sense in this case.
However I've managed to find another simple example that reproduces the
bug:
http://www.w3.org/TR/SVG11/images/painting/marker.svg (a little bit
modified, "maker-end" replaced by "marker-mid", see the attachment)
I hope it will help you!
Regards,
Sebastian
>
> Regards,
> Helder
>
>
> [1] http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/gvt/MarkerShapePainter.java?r1=504084&r2=720261&diff_format=h
> [2] http://webkit.org/quality/reduction.html
> [3] http://xmlgraphics.apache.org/batik/dev/test.html#regard
>
> [...]
>
Re: UnsupportedOperationException in SVN revision 746293
Posted by Helder Magalhães <he...@gmail.com>.
Hi Sebastian,
> I took the revision before this line was inserted where the call to
> addAll is emulated by some single add calls everything is fine.
Yeah, revision 720261 [1] might be the guilty. ;-)
> I would have attached an example file, if my SVG file didn't have a size
> of about 2Mb;-)
That's why I asked for a reduced test case [1]. ;-) I'm pretty
convinced that you'll be able to track this down to a 1-2Kb file -- it
would be valuable when added to regard [3] as this appears to be a
regression. If you aren't able to reduce it, you may send it to me
directly and I'll do my best whenever time permits. :-)
Regards,
Helder
[1] http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/gvt/MarkerShapePainter.java?r1=504084&r2=720261&diff_format=h
[2] http://webkit.org/quality/reduction.html
[3] http://xmlgraphics.apache.org/batik/dev/test.html#regard
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
Re: UnsupportedOperationException in SVN revision 746293
Posted by Sebastian Queißer <s....@freenet.de>.
Hi!
On Wed, Feb 25, 2009 at 11:13:52AM +0000, you wrote:
> I didn't check myself nor tried to reproduce but, as I never stumbled
> across this, I'm guessing that this may be due to some very specific
> Batik usage pattern. Could you try to create a reduced test case
> (small, single SVG file if possible) and attach it to this thread? It
> would surely help isolating a potential problem and/or even help you
> figure out if you are misusing Batik in some way... ;-)
Thanks for your answer, but I'm 100% sure that I'm not misusing Batik.
The error is obvious if you have a look at the source code. There is
this call to the method addAll that directly throws the exception. When
I took the revision before this line was inserted where the call to
addAll is emulated by some single add calls everything is fine. So in my
opinion, as I already said, somebody forgot to commit or merge the
implementation of the addAll method.
I would have attached an example file, if my SVG file didn't have a size
of about 2Mb;-)
>
> Hope this helps,
> Helder
Kind regards,
Sebastian
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
Re: UnsupportedOperationException in SVN revision 746293
Posted by Helder Magalhães <he...@gmail.com>.
> while playing with batik from the SVN repository (rev 746293) I noticed
> that in some situations there is an UnsupportedOperationException
> thrown. The traceback
[...]
> indicates that the method CompositeGraphicsNode.addAll is called by
> MarkerShapePainter.buildMarkerGroup (line 304). This call seems to be
> not yet? supported (see line 764 in CompositeGraphicsNode). Perhaps
> someone forgot to merge the code for addAll from a branch...
I didn't check myself nor tried to reproduce but, as I never stumbled
across this, I'm guessing that this may be due to some very specific
Batik usage pattern. Could you try to create a reduced test case
(small, single SVG file if possible) and attach it to this thread? It
would surely help isolating a potential problem and/or even help you
figure out if you are misusing Batik in some way... ;-)
Hope this helps,
Helder
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org