Major bug: cell differences ignored fixed
This commit is contained in:
@@ -271,12 +271,16 @@ public class FileActions extends JFrame {
|
|||||||
}
|
}
|
||||||
|
|
||||||
WorkbookComparisonResult compareResult = excel1.compareTo(excel2);
|
WorkbookComparisonResult compareResult = excel1.compareTo(excel2);
|
||||||
|
|
||||||
ExcelWorkbook integratedTable = (ExcelWorkbook) compareResult.integrateDifferencesIntoMaster();
|
if (compareResult.tablesAreEquals()) {
|
||||||
|
System.out.printf("RESULT: Tables %s and %s are equal.\n", resultFilePath, pClientFilePath);
|
||||||
integratedTable.save();
|
} else {
|
||||||
|
ExcelWorkbook integratedTable = (ExcelWorkbook) compareResult.integrateDifferencesIntoMaster();
|
||||||
Desktop.getDesktop().open(resultFilePath.toFile());
|
|
||||||
|
integratedTable.save();
|
||||||
|
|
||||||
|
Desktop.getDesktop().open(resultFilePath.toFile());
|
||||||
|
}
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
JOptionPane.showMessageDialog(this, "Cannot open comparison result file.", "Error",
|
JOptionPane.showMessageDialog(this, "Cannot open comparison result file.", "Error",
|
||||||
JOptionPane.ERROR_MESSAGE);
|
JOptionPane.ERROR_MESSAGE);
|
||||||
|
|||||||
@@ -1180,12 +1180,8 @@ public abstract class AbstractTable implements Table {
|
|||||||
} else if (cmpValue instanceof String && !(thisValue instanceof String)) {
|
} else if (cmpValue instanceof String && !(thisValue instanceof String)) {
|
||||||
thisValue = thisValue.toString();
|
thisValue = thisValue.toString();
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
result.addCellDifference(thisKey, n, colName, cmpRowNo, colName);
|
|
||||||
rowsAreEqual = false;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!Objects.deepEquals(thisValue, cmpValue)) {
|
if (!Objects.deepEquals(thisValue, cmpValue)) {
|
||||||
result.addCellDifference(thisKey, n, colName, cmpRowNo, colName);
|
result.addCellDifference(thisKey, n, colName, cmpRowNo, colName);
|
||||||
totalNumberOfDifferentCells += 1;
|
totalNumberOfDifferentCells += 1;
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ public class WorkbookComparisonResult {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean tablesAreEquals() {
|
public boolean tablesAreEquals() {
|
||||||
boolean result = masterIncludesClientTables() && tablesToDeleteFromMaster.isEmpty();
|
boolean result = masterIncludesClientTables() && tablesToDeleteFromMaster.isEmpty();
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
Reference in New Issue
Block a user