You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by GitBox <gi...@apache.org> on 2021/04/18 09:43:28 UTC

[GitHub] [commons-jcs] tvand commented on a change in pull request #62: JCS-220 - Java8 improvement

tvand commented on a change in pull request #62:
URL: https://github.com/apache/commons-jcs/pull/62#discussion_r615372186



##########
File path: commons-jcs-core/src/main/java/org/apache/commons/jcs3/auxiliary/disk/indexed/IndexedDiskCache.java
##########
@@ -1259,7 +1259,7 @@ private long defragFile(final IndexedDiskElementDescriptor[] defragList, final l
     private IndexedDiskElementDescriptor[] createPositionSortedDescriptorList()
     {
         final List<IndexedDiskElementDescriptor> defragList = new ArrayList<>(keyHash.values());
-        Collections.sort(defragList, (ded1, ded2) -> Long.compare(ded1.pos, ded2.pos));
+        Collections.sort(defragList, Comparator.comparingLong(ded -> ded.pos));

Review comment:
       Don't you think the previous version is easier to understand?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org