rcv icon indicating copy to clipboard operation
rcv copied to clipboard

Tabulating by Precinct with a Clear Ballot based dataset results in a NullPointerException

Open dschonholtz opened this issue 4 years ago • 3 comments

When attempting to tabulate by precinct I am getting a NullPointerException no matter what with Clear Ballot style data.

The cause is that precinctTallyTransfers is an empty HashMap that is then attempted to be accessed by the get here: https://github.com/BrightSpots/rcv/blob/master/src/main/java/network/brightspots/rcv/Tabulator.java#L816

In turn, this is because the instantiation of precinctTallyTransfers is empty because precinctNames is empty meaning initPrecinctRoundTallies does nothing. https://github.com/BrightSpots/rcv/blob/d4ac2db002247072f1fa8257d35bfed9bfc1fc07/src/main/java/network/brightspots/rcv/Tabulator.java#L1034

This is because precinctIds is empty when instantiating the Tabulator object despite the precincts all being defined in the CVR correctly. https://github.com/BrightSpots/rcv/blob/d4ac2db002247072f1fa8257d35bfed9bfc1fc07/src/main/java/network/brightspots/rcv/TabulatorSession.java#L253

To reproduce this issue you can load in the following data file: UTAcceptedCBGFilePrecinct.zip

It has the json file to load in, and the cvr file as well.

Although to load the json config you will need to modify the paths described in it.

Any help here would be appreciated, please let me know if there is additional information you need or if there is any way I can help out.

dschonholtz avatar Aug 02 '21 16:08 dschonholtz

Thank you for the very thorough report! We'll try to look into this soon. Is this blocking you on something time-sensitive, or is it just something you'd like us to fix in the next release?

tarheel avatar Aug 05 '21 16:08 tarheel

It will hamper our ability to fully test viability of the tool for potential customers but we don't have any live election on the near term horizon. So sooner would be better so we could get you guys feedback. But we won't twist your arm.

dschonholtz avatar Aug 06 '21 15:08 dschonholtz

Seeing same issue w/ Dominion data, fwiw - as above, when tabulating by precinct.

bphilhour avatar Feb 22 '22 18:02 bphilhour