jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject [1/4] jena git commit: Clean code.
Date Thu, 07 May 2015 10:01:57 GMT
Repository: jena
Updated Branches:
  refs/heads/master fa3bae848 -> 18aaf7dac


Clean code.

Project: http://git-wip-us.apache.org/repos/asf/jena/repo
Commit: http://git-wip-us.apache.org/repos/asf/jena/commit/e81ee641
Tree: http://git-wip-us.apache.org/repos/asf/jena/tree/e81ee641
Diff: http://git-wip-us.apache.org/repos/asf/jena/diff/e81ee641

Branch: refs/heads/master
Commit: e81ee641d7ee7dbb7e4dbde792d7e79af4a7df72
Parents: fa3bae8
Author: Andy Seaborne <andy@apache.org>
Authored: Thu May 7 10:29:00 2015 +0100
Committer: Andy Seaborne <andy@apache.org>
Committed: Thu May 7 10:29:00 2015 +0100

----------------------------------------------------------------------
 .../apache/jena/atlas/lib/cache/CacheGuava.java | 20 ++++++++------------
 1 file changed, 8 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jena/blob/e81ee641/jena-base/src/main/java/org/apache/jena/atlas/lib/cache/CacheGuava.java
----------------------------------------------------------------------
diff --git a/jena-base/src/main/java/org/apache/jena/atlas/lib/cache/CacheGuava.java b/jena-base/src/main/java/org/apache/jena/atlas/lib/cache/CacheGuava.java
index a25faa0..9beffaf 100644
--- a/jena-base/src/main/java/org/apache/jena/atlas/lib/cache/CacheGuava.java
+++ b/jena-base/src/main/java/org/apache/jena/atlas/lib/cache/CacheGuava.java
@@ -21,31 +21,28 @@ package org.apache.jena.atlas.lib.cache;
 import java.util.Iterator ;
 import java.util.concurrent.Callable ;
 import java.util.concurrent.ExecutionException ;
-import java.util.function.BiConsumer;
+import java.util.function.BiConsumer ;
 
 import org.apache.jena.atlas.lib.Cache ;
 import org.apache.jena.atlas.logging.Log ;
 import org.apache.jena.ext.com.google.common.cache.CacheBuilder ;
 import org.apache.jena.ext.com.google.common.cache.RemovalListener ;
-import org.apache.jena.ext.com.google.common.cache.RemovalNotification ;
 
-/** Wrapper around com.google.common.cache */
+/** Wrapper around a shaded com.google.common.cache */
 final
 public class CacheGuava<K,V> implements Cache<K, V>
 {
     private BiConsumer<K, V> dropHandler = null ;
-    /*private*/ org.apache.jena.ext.com.google.common.cache.Cache<K,V> cache ;
+    private org.apache.jena.ext.com.google.common.cache.Cache<K,V> cache ;
 
     public CacheGuava(int size)
     {
-        RemovalListener<K,V> drop = new RemovalListener<K, V>() {
-            @Override
-            public void onRemoval(RemovalNotification<K, V> notification) {
-                if ( dropHandler != null )
-                    dropHandler.accept(notification.getKey(),
-                                      notification.getValue()) ;
-            }
+        RemovalListener<K,V> drop = (notification)-> {
+            if ( dropHandler != null )
+                dropHandler.accept(notification.getKey(),
+                                   notification.getValue()) ;
         } ;
+            
         cache = CacheBuilder.newBuilder()
             .maximumSize(size)
             .removalListener(drop)
@@ -54,7 +51,6 @@ public class CacheGuava<K,V> implements Cache<K, V>
             .build() ;
     }
 
-    // Change the interface to be ...
     @Override
     public V getOrFill(K key, Callable<V> filler) {
         try {


Mime
View raw message