[josm-dev] Catch NullpointerException

Sebastian Waschik sebastian.waschik at gmx.de
Fri Aug 21 14:29:02 BST 2009


Hello,

in ExtededDialog.findMaxDialogSize NullPointerExceptions are ignored.
Is there reason for this?  There is no comment for this.  I would
suggest to remove this.  Sample solution is attached.  <ironic>If
there is a reason for this catch the test for this.parent==null could
be removed.</ironic>

Maybe the test frame==null could be removed.  Because
getFrameForComponent would return a frame or a default frame [1] and I
think there should always be a default frame.

See also Ticket #3312 [2].

Greetings
Sebastian Waschik


[1] http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/JOptionPane.html#getFrameForComponent(java.awt.Component)
[2] https://josm.openstreetmap.de/ticket/3312
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nullpointer-exception-in-extended-dialog.patch
Type: text/x-diff
Size: 892 bytes
Desc: not available
URL: <http://lists.openstreetmap.org/pipermail/josm-dev/attachments/20090821/a3eab698/attachment.patch>


More information about the josm-dev mailing list