PuffinPlot issue tracker

Bug: a88/b89

ID : b89470aa-48a4-476b-82fa-2d38c1a3048a
Short name : a88/b89
Status : fixed
Severity : minor
Assigned :
Reporter : Pontus Lurcock <pont@talvi.net>
Creator : Pontus Lurcock <pont@talvi.net>
Created : Mon, 25 May 2009 01:13:34 +0000
Target : 1.0
Summary : Puffin crashes when no empty slot is selected [60]

Comment: --------- Comment ---------
ID: 25f7ee5e-e8bd-4a14-967d-017625e9e6df
Short name: a88/b89/25f
From: Pontus Lurcock <pont@talvi.net>
Date: Mon, 25 May 2009 01:13:34 +0000

If the empty slot correction is applied when no empty slot has
been set, Puffin bombs out with a NullPointerException.

Comment: --------- Comment ---------
ID: 2c5655f7-0bdb-4c6d-949c-d5e028556ce4
Short name: a88/b89/2c5
From: Pontus Lurcock <pont@talvi.net>
Date: Mon, 25 May 2009 01:40:36 +0000

Can't reproduce this; think Christian may be using an old version,
and the bug has since been fixed. Waiting for confirmation of this from C.

Comment: --------- Comment ---------
ID: b0b39251-608c-4634-a2d5-a1b59cfc1470
Short name: a88/b89/b0b
From: Pontus Lurcock <pont@talvi.net>
Date: Mon, 25 May 2009 04:10:35 +0000

Still can't reproduce on my data; waiting for C to send his. From the
backtrace, looks as though a datum isn't getting its sample field set:
the exception is raised at
` if (d.getSample().isEmptySlot()) return d; '
(line 36 of Line.java)

Comment: --------- Comment ---------
ID: 10729170-ff6a-431d-b387-78de90ac55d1
Short name: a88/b89/107
From: Pontus Lurcock <pont@talvi.net>
Date: Tue, 26 May 2009 00:04:08 +0000

Nasty one, this. Cause: PP ignores ARM and MS lines on loading -- 
they don't even get added to a sample, they're just left for the
garbage collector to clear up after creation. At least that's what's
meant to happen. What actually happened is that Datum's constructor
inserts them into a Line object (introduced for the empty-slot 
correction). When the empty-slot correction is activated, Datum.getUc()
checks for each Datum in its Line whether its sample is in an empty
slot. But if any Datums are ARM or MS, they don't have an associated
sample, and PP bombs out with a null pointer exception.

Ideally, it should be made impossible to construct a Datum without a
Sample, but it's inconvenient in the current implementation, because
the Sample is created after the Datum. As it was, I fixed it by
getting Datum not to add itself to a Line if it's an ARM or MS 
measurement.