#248 Patch to prevent NPE in XYShapeRenderer.java

closed
None
5
2009-05-12
2009-05-12
No

In three places in the equals method of org.jfree.chart.renderer.xy.XYShapeRenderer, a NullPointerException was possible. It could occur if both XYShapeRenderers' paintScale, guideLinePaint, or guideLineStroke fields were identically null. This patch removes the possibility of a NPE.

Discussion

  • John Silberholz

    John Silberholz - 2009-05-12

    org.jfree.chart.renderer.xy.XYShapeRenderer

     
  • David Gilbert

    David Gilbert - 2009-05-12
    • assigned_to: nobody --> mungady
    • status: open --> closed
     
  • David Gilbert

    David Gilbert - 2009-05-12

    Hi John,

    Thanks for the patch. In fact, those attributes are set up with non-null values in the constructor, and the respective setters won't allow null values, so we should be safe not checking for null. It seems that the equals() method already has some null checks (insufficient, as you've noticed, IF nulls were allowed). I've committed a patch to Subversion to remove those checks.

    Best regards,

    Dave Gilbert
    JFreeChart Project Leader

     

Log in to post a comment.