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/19 04:54:38 UTC

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

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



##########
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:
       Hi @tvand 
   I don't know why but i prefer using comparator. Of course it's a personal choice. I rollback this change 
   TY




-- 
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