Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#412 Fix for the SMARTSQueryTool

Needs_Review
closed
master (162)
5
2012-10-28
2011-09-12
No

The SMARTSParser throws a CDK exception if there is a Parse Exception when parsing a smarts query as a string. The SQT needs to handle this somehow, as the current code doesn't compile (in Eclipse, anyway).

The fix catches CDKExceptions in the SQT constructor, and then throws an IllegalArgumentException, as the whole thing should fail at this point.

Discussion

  • Looks fine to me.

     
  • Gilleain, can you please add a unit test, that causes an exception to be throw triggering the proper catching mechanism?

    In JUnit, you can do something like:

    @Test(expected = NumberFormatException.class)

     
  • This is already done in the testLexicalError method.

     
  • Excellent. Pushed to master.