Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public int compare(final Cookie c1, final Cookie c2) {
final Instant d1 = c1.getCreationInstant();
final Instant d2 = c2.getCreationInstant();
if (d1 != null && d2 != null) {
return (int) (d1.toEpochMilli() - d2.toEpochMilli());
return d1.compareTo(d2);
}
}
return result;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ public void setHttpOnly(final boolean httpOnly) {
public boolean isExpired(final Date date) {
Args.notNull(date, "Date");
return (cookieExpiryDate != null
&& cookieExpiryDate.toEpochMilli() <= DateUtils.toInstant(date).toEpochMilli());
&& cookieExpiryDate.compareTo(DateUtils.toInstant(date)) <= 0);
}

/**
Expand All @@ -282,7 +282,7 @@ public boolean isExpired(final Date date) {
public boolean isExpired(final Instant instant) {
Args.notNull(instant, "Instant");
return (cookieExpiryDate != null
&& cookieExpiryDate.toEpochMilli() <= instant.toEpochMilli());
&& cookieExpiryDate.compareTo(instant) <= 0);
}

/**
Expand Down