File tree Expand file tree Collapse file tree 1 file changed +9
-12
lines changed
blazingcache-core/src/main/java/blazingcache/client Expand file tree Collapse file tree 1 file changed +9
-12
lines changed Original file line number Diff line number Diff line change @@ -719,18 +719,15 @@ public void accept(EntryHandle t) {
719719 }
720720 };
721721
722- try {
723- cache .values ().stream ().sorted ((EntryHandle o1 , EntryHandle o2 ) -> {
724- long diff = o1 .getLastGetTime () - o2 .getLastGetTime ();
725- if (diff == 0 ) {
726- return 0 ;
727- }
728- return diff > 0 ? 1 : -1 ;
729- }).forEachOrdered (accumulator );
730- } catch (Exception dataChangedDuringSort ) {
731- LOGGER .severe ("dataChangedDuringSort: " + dataChangedDuringSort );
732- return ;
733- }
722+ List <EntryHandle > snapshot = new ArrayList <>(cache .values ());
723+ snapshot .sort ((EntryHandle o1 , EntryHandle o2 ) -> {
724+ long diff = o1 .getLastGetTime () - o2 .getLastGetTime ();
725+ if (diff == 0 ) {
726+ return 0 ;
727+ }
728+ return diff > 0 ? 1 : -1 ;
729+ });
730+ snapshot .forEach (accumulator );
734731
735732 if (!evictable .isEmpty ()) {
736733 LOGGER .log (Level .INFO , "found {0} evictable entries" , evictable .size ());
You can’t perform that action at this time.
0 commit comments