Author: tv
Date: Thu Oct 4 19:28:30 2018
New Revision: 1842846
URL: http://svn.apache.org/viewvc?rev=1842846&view=rev
Log:
Too complicated
Modified:
commons/proper/jcs/trunk/commons-jcs-core/src/main/java/org/apache/commons/jcs/auxiliary/AbstractAuxiliaryCache.java
Modified:
commons/proper/jcs/trunk/commons-jcs-core/src/main/java/org/apache/commons/jcs/auxiliary/AbstractAuxiliaryCache.java
URL:
http://svn.apache.org/viewvc/commons/proper/jcs/trunk/commons-jcs-core/src/main/java/org/apache/commons/jcs/auxiliary/AbstractAuxiliaryCache.java?rev=1842846&r1=1842845&r2=1842846&view=diff
==============================================================================
---
commons/proper/jcs/trunk/commons-jcs-core/src/main/java/org/apache/commons/jcs/auxiliary/AbstractAuxiliaryCache.java
(original)
+++
commons/proper/jcs/trunk/commons-jcs-core/src/main/java/org/apache/commons/jcs/auxiliary/AbstractAuxiliaryCache.java
Thu Oct 4 19:28:30 2018
@@ -59,22 +59,20 @@ public abstract class AbstractAuxiliaryC
if ( keys != null && !keys.isEmpty() )
{
Map<K, ICacheElement<K, V>> elements = keys.stream()
+ .map(key -> {
+ try
+ {
+ return get(key);
+ }
+ catch (IOException e)
+ {
+ return null;
+ }
+ })
+ .filter(element -> element != null)
.collect(Collectors.toMap(
- key -> key,
- key -> {
- try
- {
- return get(key);
- }
- catch (IOException e)
- {
- return null;
- }
- })).entrySet().stream()
- .filter(entry -> entry.getValue() != null)
- .collect(Collectors.toMap(
- entry -> entry.getKey(),
- entry -> entry.getValue()));
+ element -> element.getKey(),
+ element -> element));
return elements;
}