#1236 Error handling in IsotopeFactory.configure()

cdk-1.4.x
closed
5
2013-05-25
2012-06-11
Ralf Stephan
No

calling IsotopeFactory.getInstance(atom.getBuilder()).configure(atom); leads to a NullPointerException whenever the Atom's symbol isn't recognized. This should be something more sensible.

Discussion

  • Ralf Stephan
    Ralf Stephan
    2012-06-11

    The dump:
    java.lang.NullPointerException
    at org.openscience.cdk.config.IsotopeFactory.configure(IsotopeFactory.java:347)
    at org.openscience.cdk.config.IsotopeFactory.configure(IsotopeFactory.java:332)
    at org.openscience.jchempaint.controller.ControllerHub.setSymbol(ControllerHub.java:993)

     
  • My rebuttal would be that in cdk-1.4.x throwing CDKException is not possible, as that would change the API... with the IllegalArgumentException I did not have to change the API by adding a throws clause...

     
  • Mmmm... wrong report... never mind that previous comment. That should have gone somewhere else :/

     
  • Rajarshi Guha
    Rajarshi Guha
    2012-07-02

    Oh, OK. that is reasonable.

     
  • John May
    John May
    2013-05-25

    Fixed by patch

     
  • John May
    John May
    2013-05-25

    • status: open --> closed