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

Aperta
#2,070 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
Mezza giornata
Idoneità per principianti
80/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
java
Ambito
backend

Direzione di ricerca

Start at the catch-all in vcell-core/src/main/java/cbit/vcell/export/SpringSaLaDExporter.java:350-353 that returns null instead of rethrowing, then trace upward to the caller invoking writeStringToFile and downstream to LangevinLngvWriter.writeTimeInformation. Also read MathDescription.isLangevin(), which classifies a reaction-less model by the first ParticleJumpProcess. Done means exporting a reaction-less SpringSaLaD application surfaces a clear error (or an explicit "no reactions to export" message) instead of reporting success and leaving a 0-byte .ssld file; verify with the reproduction steps in the issue.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.
Lingua principale
Java
Stelle
140
Fork
35
Merge medio
22h 6m
PR unite (30g)
14

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di virtualcell/vcell

Tutte le issue di virtualcell/vcell

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.