Found while writing a SpringSaLaD tutorial script. A SpringSaLaD application that has a
complete physiology and geometry but no reaction rules yet cannot be exported to
.ssld — which is reasonable — but the failure is invisible: the client reports
"Export saved as <path>" and leaves an empty file where the model should be.
What happens
Three defects stack up, and each one on its own would have been survivable.
MathDescription.isLangevin() decides from the first ParticleJumpProcess. With no
reactions there is no jump process, so a SpringSaLaD model is classified as not
Langevin.
LangevinLngvWriter.writeTimeInformation then throws "Langevin Math expected.",
and SpringSaLaDExporter.getDocumentAsString swallows it in a catch-all that
returns null rather than rethrowing
(vcell-core/src/main/java/cbit/vcell/export/SpringSaLaDExporter.java:350-353).
- The caller passes that
null on to writeStringToFile, which NPEs — but the export
task still reports success, and the 0-byte file it created stays on disk.
Reproduction
- New BioModel; three structures named
Extracellular / Membrane / Intracellular.
- One or more molecules and matching seed species. No reaction rules.
New Application > SpringSaLaD.
File > Export..., choose SpringSaLaD format<Version2.2> (.ssld), pick a path.
The dialog reports the export was saved. The file is 0 bytes.
Suggested fixes, in order of value
- Do not report success when nothing was written. The catch-all returning
null is the
step that turns an exception into a silent wrong answer; letting it propagate would
surface the real message.
isLangevin() on a reaction-less model. Deciding "is this a Langevin math" from the
presence of a jump process means an empty model is indistinguishable from a non-Langevin
one. The SimulationContext's application type already knows the answer.
- A plain "this application has no reactions to export" would be better than either.
Found while writing a SpringSaLaD tutorial script. A SpringSaLaD application that has a
complete physiology and geometry but no reaction rules yet cannot be exported to
.ssld— which is reasonable — but the failure is invisible: the client reports"Export saved as <path>" and leaves an empty file where the model should be.
What happens
Three defects stack up, and each one on its own would have been survivable.
MathDescription.isLangevin()decides from the firstParticleJumpProcess. With noreactions there is no jump process, so a SpringSaLaD model is classified as not
Langevin.
LangevinLngvWriter.writeTimeInformationthen throws"Langevin Math expected.",and
SpringSaLaDExporter.getDocumentAsStringswallows it in a catch-all thatreturns
nullrather than rethrowing(
vcell-core/src/main/java/cbit/vcell/export/SpringSaLaDExporter.java:350-353).nullon towriteStringToFile, which NPEs — but the exporttask still reports success, and the 0-byte file it created stays on disk.
Reproduction
Extracellular/Membrane/Intracellular.New Application > SpringSaLaD.File > Export..., chooseSpringSaLaD format<Version2.2> (.ssld), pick a path.The dialog reports the export was saved. The file is 0 bytes.
Suggested fixes, in order of value
nullis thestep that turns an exception into a silent wrong answer; letting it propagate would
surface the real message.
isLangevin()on a reaction-less model. Deciding "is this a Langevin math" from thepresence of a jump process means an empty model is indistinguishable from a non-Langevin
one. The
SimulationContext's application type already knows the answer.