Skip to content

Commit

Permalink
Got rid of Long.compare(...). Not in Java 6.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gray Watson committed May 10, 2017
1 parent 9cbcf3a commit d7ad068
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,19 @@ private LoggingEvent makeEvent(Level level, String message, Throwable th) {
private static class InputLogEventComparator implements Comparator<InputLogEvent> {
@Override
public int compare(InputLogEvent o1, InputLogEvent o2) {
return Long.compare(o1.getTimestamp(), o2.getTimestamp());
if (o1.getTimestamp() == null) {
if (o2.getTimestamp() == null) {
return 0;
} else {
// null - long
return -1;
}
} else if (o2.getTimestamp() == null) {
// long - null
return 1;
} else {
return o1.getTimestamp().compareTo(o2.getTimestamp());
}
}
}
}
3 changes: 3 additions & 0 deletions src/main/javadoc/doc-files/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
1.10: 5/10/2017
* Got rid of Long.compare(...). Not in Java 6.

1.9: 5/10/2017
* Create the Cloudwatch log-group and log-stream using reflection to hack around the AWS SDK incompatibility.

Expand Down

0 comments on commit d7ad068

Please sign in to comment.