Skip to content

Commit

Permalink
fix(rf2): detect and report lines with single data points
Browse files Browse the repository at this point in the history
  • Loading branch information
cmark committed Apr 30, 2024
1 parent 846dd20 commit 70b6a06
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -382,9 +382,16 @@ private void readFile(ZipEntry entry, final InputStream in, final ObjectReader o

header = false;
} else {
final String effectiveTimeKey = getEffectiveTimeKey(line[1]);
final ImportDefectBuilder defectBuilder = defectAcceptor.on(Integer.toString(lineNumber));
resolver.register(line, effectiveTimeSlices.getOrCreate(effectiveTimeKey), defectBuilder);
if (line.length > 1) {
final String effectiveTimeKey = getEffectiveTimeKey(line[1]);
resolver.register(line, effectiveTimeSlices.getOrCreate(effectiveTimeKey), defectBuilder);
} else if (line.length == 1) {
// report error if line is not empty but there is no effective time column present
defectBuilder.error("Incorrect/broken RF2 line detected");
} else {
// line is empty, skip it (TODO do we need a warning here?)
}
}

lineNumber++;
Expand Down

0 comments on commit 70b6a06

Please sign in to comment.