Skip to content

Commit

Permalink
fix NPE
Browse files Browse the repository at this point in the history
  • Loading branch information
terence-yoo committed Mar 27, 2019
1 parent aed580d commit 5b28fc6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ private static Number diffRatioNumber(Number one, Number two) {
if (one == null) {
if (two == null) return null;
else {
if (two.intValue() == 0) {
if (two == 0) {
return RatioNumber.ZERO.doubleValue();
} else {
return -two.doubleValue();
Expand All @@ -409,7 +409,7 @@ private static Number diffRatioNumber(Number one, Number two) {
} else {
if (two == null) return one.doubleValue();
else {
if (two.intValue() == 0) {
if (two == 0) {
return one.doubleValue();
} else {
return one.doubleValue() - two.doubleValue();
Expand All @@ -432,7 +432,7 @@ private static Number addRatioNumber(Number one, Number two) {
if (one == null) {
if (two == null) return null;
else {
if (two.intValue() == 0) {
if (two == 0) {
return RatioNumber.ZERO;
} else {
return two;
Expand All @@ -441,9 +441,9 @@ private static Number addRatioNumber(Number one, Number two) {
} else {
if (two == null) return one;
else {
if (one.intValue() == 0) {
if (one == 0) {
return two;
} else if (two.intValue() == 0) {
} else if (two == 0) {
return one;
} else {
return ((RatioNumber) one).add((RatioNumber) two);
Expand Down Expand Up @@ -563,4 +563,4 @@ public String toString(Number value) {
public abstract int compare(Number one, Number two);

public abstract Number toNumber(String string);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ public boolean isRecordChanged(Level level) {
}

public boolean isSummaryChanged(LoadEntry loadEntry) {
return summaryChangeMap.get(loadEntry).intValue() == ChangeState.changed.ordinal();
return summaryChangeMap.get(loadEntry) == ChangeState.changed.ordinal();
}

public boolean isDiffFromStart() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,7 @@
import java.io.IOException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
import java.util.*;

public class LoadIO {
public static final String NO_SAVED_FILE = "There is no saved file.";
Expand Down Expand Up @@ -242,6 +239,7 @@ private String parseTimestamp(Args args, String fileName) {
List<String> savedFileNameList(Args args) {
List<String> fileNameList = new ArrayList<>();
listFiles(fileNameList, args);
Collections.sort(fileNameList);
return fileNameList;
}

Expand Down

0 comments on commit 5b28fc6

Please sign in to comment.