Skip to content

Commit

Permalink
Merge pull request #334 from cbalster/fix_comparator
Browse files Browse the repository at this point in the history
Comparator is not available on API < 23
  • Loading branch information
cbalster committed Jul 2, 2023
2 parents 7ae1a1d + b0e6647 commit 055a26e
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ public void setFromJson(JSONArray jsonArray) throws JSONException,
receivedChatMessages.add(new ReceivedChatMessage(message, timestamp));
}

Collections.sort(receivedChatMessages, Comparator.comparing(ReceivedChatMessage::getTimestamp));
Collections.sort(receivedChatMessages,
(oneChatMessages, otherChatMessage) -> oneChatMessages.getTimestamp().compareTo(otherChatMessage.getTimestamp()));
}

public JSONObject createNewOutgoingMessage(String message) {
Expand Down

0 comments on commit 055a26e

Please sign in to comment.