#527 Fixes a ClassCastException by continuing with an IMolecule

Needs_Review
closed
nobody
cdk-1.4.x (181)
5
2012-10-28
2012-07-05
No

It does not fix a unit test, but removes this stacktrace from the unit test output:

------------- Standard Error -----------------
java.lang.ClassCastException: org.openscience.cdk.AtomContainer cannot be cast to org.openscience.cdk.interfaces.IMolecule
at org.openscience.cdk.charges.GasteigerPEPEPartialCharges.assignGasteigerPiPartialCharges(GasteigerPEPEPartialCharges.java:204)
at org.openscience.cdk.tools.IonizationPotentialTool.getQSARs(IonizationPotentialTool.java:257)
at org.openscience.cdk.tools.IonizationPotentialTool.predictIP(IonizationPotentialTool.java:83)
at org.openscience.cdk.qsar.descriptors.molecular.IPMolecularLearningDescriptor.calculatePlus(IPMolecularLearningDescriptor.java:181)
at org.openscience.cdk.qsar.descriptors.molecular.IPMolecularLearningDescriptor.calculate(IPMolecularLearningDescriptor.java:159)
at org.openscience.cdk.qsar.descriptors.molecular.MolecularDescriptorTest.testAtomContainerHandling(MolecularDescriptorTest.java:349)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:73)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:46)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:180)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:41)
at org.junit.runners.ParentRunner$1.evaluate(ParentRunner.java:173)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
at org.junit.runners.ParentRunner.run(ParentRunner.java:220)
at org.junit.runners.Suite.runChild(Suite.java:115)
at org.junit.runners.Suite.runChild(Suite.java:23)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:180)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:41)
at org.junit.runners.ParentRunner$1.evaluate(ParentRunner.java:173)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
at org.junit.runners.ParentRunner.run(ParentRunner.java:220)
at junit.framework.JUnit4TestAdapter.run(JUnit4TestAdapter.java:39)
at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:422)
at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:931)
at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:785)
------------- ---------------- ---------------

Discussion

  • Egon Willighagen

    Thanx, John! Applied and pushed to cdk-1.4.x.

    BTW, about the various fields... the bug Status should not be set to Closed until the patch is applied to the main branch. Also, when you like to see something fixed about a patch (e.g. attached the proper patch :) you can set the Group field to "Needs revision".

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks