polygene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From paulmer...@apache.org
Subject [2/8] zest-java git commit: redis-entitystore: remove usage of deprecated methods
Date Sat, 03 Dec 2016 11:05:58 GMT
redis-entitystore: remove usage of deprecated methods


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

Branch: refs/heads/develop
Commit: c574cd02e113dc0ac023d0d684b96035e9669c7b
Parents: 85f2eb5
Author: Paul Merlin <paulmerlin@apache.org>
Authored: Fri Dec 2 17:58:28 2016 +0100
Committer: Paul Merlin <paulmerlin@apache.org>
Committed: Fri Dec 2 17:58:28 2016 +0100

----------------------------------------------------------------------
 .../entitystore/redis/RedisMapEntityStoreMixin.java   | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zest-java/blob/c574cd02/extensions/entitystore-redis/src/main/java/org/apache/zest/entitystore/redis/RedisMapEntityStoreMixin.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-redis/src/main/java/org/apache/zest/entitystore/redis/RedisMapEntityStoreMixin.java
b/extensions/entitystore-redis/src/main/java/org/apache/zest/entitystore/redis/RedisMapEntityStoreMixin.java
index dc43d97..4113e39 100644
--- a/extensions/entitystore-redis/src/main/java/org/apache/zest/entitystore/redis/RedisMapEntityStoreMixin.java
+++ b/extensions/entitystore-redis/src/main/java/org/apache/zest/entitystore/redis/RedisMapEntityStoreMixin.java
@@ -89,8 +89,7 @@ public class RedisMapEntityStoreMixin
     public Reader get( EntityReference entityReference )
         throws EntityStoreException
     {
-        Jedis jedis = pool.getResource();
-        try
+        try( Jedis jedis = pool.getResource() )
         {
             String jsonState = jedis.get( entityReference.identity().toString() );
             if( notFound( jsonState ) )
@@ -99,18 +98,13 @@ public class RedisMapEntityStoreMixin
             }
             return new StringReader( jsonState );
         }
-        finally
-        {
-            pool.returnResource( jedis );
-        }
     }
 
     @Override
     public void applyChanges( MapChanges changes )
         throws IOException
     {
-        final Jedis jedis = pool.getResource();
-        try
+        try( Jedis jedis = pool.getResource() )
         {
             changes.visitMap( new MapChanger()
             {
@@ -167,10 +161,6 @@ public class RedisMapEntityStoreMixin
                 }
             } );
         }
-        finally
-        {
-            pool.returnResource( jedis );
-        }
     }
 
     @Override


Mime
View raw message