Skip to content

SpringSaLaD: exporting an application with no reactions reports success and writes a 0-byte file #2070

Description

@jcschaff

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.

  1. MathDescription.isLangevin() decides from the first ParticleJumpProcess. With no
    reactions there is no jump process, so a SpringSaLaD model is classified as not
    Langevin.
  2. 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).
  3. 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

  1. New BioModel; three structures named Extracellular / Membrane / Intracellular.
  2. One or more molecules and matching seed species. No reaction rules.
  3. New Application > SpringSaLaD.
  4. 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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions