Skip to content

Commit

Permalink
fix: fix col header mismatch logic
Browse files Browse the repository at this point in the history
  • Loading branch information
r4tylmz committed Nov 9, 2024
1 parent 88b73b0 commit 4c47b39
Showing 1 changed file with 1 addition and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,7 @@ public Map<Integer, String> validate(Sheet sheet, BPSheet bpSheet) {
BPColumn bpColumn = bpSheet.columns()[colNo];
String expectedHeader = ColUtil.getHeaderTitle(bpColumn);

Cell cell = headerRow.getCell(colNo);
String actualHeader = Optional.ofNullable(cell)
.map(dataFormatter::formatCellValue)
.orElse("");

if (!actualHeader.equals(expectedHeader)) {
if (!colHeaders.contains(expectedHeader)) {
String violation = String.format("Expected header: %s but not found in headers %s", expectedHeader, colHeaders);
violationMap.put(colNo, violation);
}
Expand Down

0 comments on commit 4c47b39

Please sign in to comment.