From: Brian M. <bm...@iu...> - 2011-04-28 14:16:43
|
There is an apparent bug, or at least over-sensitivity in the way Jmol reads in a state script for a small molecule which contains calculated hydrogen bonds. I attach two scripts derived from Bob's sucrose example ("load sucrose.cif {1 1 1}; hbonds calculate;"). The first is as written out by the signed applet with "Save script with state"; the second is identical excepte for some white-space changes (most notably the inclusion of a blank line within the data "connect_atoms" block). The first loads and renders fine; the second causes the applet to crash and the Java console shows the following error trace: Exception in thread "QueueThread0" java.lang.ArrayIndexOutOfBoundsException: 0 at org.jmol.modelset.ModelSet.connect(Unknown Source) at org.jmol.viewer.Viewer.connect(Unknown Source) at org.jmol.script.ScriptEvaluator.data(Unknown Source) at org.jmol.script.ScriptEvaluator.instructionDispatchLoop(Unknown Source) at org.jmol.script.ScriptEvaluator.runFunction(Unknown Source) at org.jmol.script.ScriptEvaluator.runFunction(Unknown Source) at org.jmol.script.ScriptEvaluator.function(Unknown Source) at org.jmol.script.ScriptEvaluator.instructionDispatchLoop(Unknown Source) at org.jmol.script.ScriptEvaluator.runFunction(Unknown Source) at org.jmol.script.ScriptEvaluator.runFunction(Unknown Source) at org.jmol.script.ScriptEvaluator.function(Unknown Source) at org.jmol.script.ScriptEvaluator.instructionDispatchLoop(Unknown Source) at org.jmol.script.ScriptEvaluator.evaluateCompiledScript(Unknown Source) at org.jmol.viewer.Viewer.evalStringWaitStatus(Unknown Source) at org.jmol.viewer.ScriptManager$ScriptQueueRunnable.runScript(Unknown Source) at org.jmol.viewer.ScriptManager$ScriptQueueRunnable.runNextScript(Unknown Source) at org.jmol.viewer.ScriptManager$ScriptQueueRunnable.run(Unknown Source) at java.lang.Thread.run(Unknown Source Can this be easily fixed? (The IUCr enhanced figure toolkit saves scripts is a manner that is not guaranteed to preserve whitespace.) The problem appears to have been present since at least Jmol 12.0.10, but is still present in 12.1.44. Thanks Brian |