Skip to content

Commit 8d5fe04

Browse files
static var refactors
1 parent 187ac27 commit 8d5fe04

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

apps/excel-diff-checker.jar

1.34 KB
Binary file not shown.

src/main/java/edu/abhi/poi/excel/ExcelDiffChecker.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@
1616
*/
1717
public class ExcelDiffChecker {
1818

19-
static boolean diffFound = false;
20-
static boolean commentFlag = true;
19+
private static boolean success = true;
20+
private static boolean diffFound = false;
21+
private static boolean commentFlag = true;
2122

2223
public static void main(String[] args) {
2324

@@ -27,8 +28,6 @@ public static void main(String[] args) {
2728

2829
String RESULT_FILE = FILE_NAME1.substring(0, FILE_NAME1.lastIndexOf(".")) + " vs " + FILE_NAME2;
2930

30-
boolean success = true;
31-
3231
File resultFile = new File(RESULT_FILE);
3332
if(resultFile.exists())
3433
resultFile.delete();
@@ -81,14 +80,17 @@ public static void main(String[] args) {
8180
if(Utility.hasContent(cell2)) {
8281
if(cell1 == null)
8382
cell1 = row1.createCell(columnIndex);
84-
83+
84+
diffFound = true;
8585
Utility.processDiff(cell1, cell2, commentFlag);
8686
}
8787
} else if(Utility.hasNoContent(cell2)) {
8888
if(Utility.hasContent(cell1)) {
89+
diffFound = true;
8990
Utility.processDiff(cell1, null, commentFlag);
9091
}
9192
} else if(!cell1.getRawValue().equals(cell2.getRawValue())) {
93+
diffFound = true;
9294
Utility.processDiff(cell1, cell2, commentFlag);
9395
}
9496
}

src/main/java/edu/abhi/poi/excel/Utility.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ public static void processDiff(XSSFCell cell1, XSSFCell cell2, boolean commentFl
3333

3434
System.out.println(String.format("Diff at cell[%s] of sheet[%s]", cell1.getReference(), sheet.getSheetName()));
3535

36-
ExcelDiffChecker.diffFound = true;
37-
3836
if(!commentFlag) {
3937
System.out.println(String.format("Expected: [%s], Found: [%s]", getCellValue(cell1), getCellValue(cell2)));
4038
return;

0 commit comments

Comments
 (0)