curator-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From randg...@apache.org
Subject [2/5] git commit: Remove Java 8 Collections.emptySortedSet().
Date Thu, 31 Jul 2014 15:03:23 GMT
Remove Java 8 Collections.emptySortedSet().


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

Branch: refs/heads/CURATOR-33
Commit: f31c1f9a31c0c12ac2886ed1c7edf0dfd4fe0fb0
Parents: 547a7e2
Author: Scott Blum <scottb@squareup.com>
Authored: Wed Jul 23 21:10:35 2014 -0400
Committer: Scott Blum <scottb@squareup.com>
Committed: Wed Jul 23 21:10:35 2014 -0400

----------------------------------------------------------------------
 .../org/apache/curator/framework/recipes/cache/TreeCache.java | 3 +--
 .../apache/curator/framework/recipes/cache/TestTreeCache.java | 7 +++----
 2 files changed, 4 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/f31c1f9a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/TreeCache.java
----------------------------------------------------------------------
diff --git a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/TreeCache.java
b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/TreeCache.java
index 31bff1e..735d5e7 100644
--- a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/TreeCache.java
+++ b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/TreeCache.java
@@ -40,7 +40,6 @@ import org.slf4j.LoggerFactory;
 import java.io.Closeable;
 import java.io.IOException;
 import java.util.ArrayList;
-import java.util.Collections;
 import java.util.List;
 import java.util.SortedSet;
 import java.util.concurrent.ConcurrentMap;
@@ -470,7 +469,7 @@ public class TreeCache implements Closeable
         SortedSet<String> result;
         if ( map == null )
         {
-            result = Collections.emptySortedSet();
+            result = ImmutableSortedSet.of();
         }
         else
         {

http://git-wip-us.apache.org/repos/asf/curator/blob/f31c1f9a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/cache/TestTreeCache.java
----------------------------------------------------------------------
diff --git a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/cache/TestTreeCache.java
b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/cache/TestTreeCache.java
index b8a009b..2922d40 100644
--- a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/cache/TestTreeCache.java
+++ b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/cache/TestTreeCache.java
@@ -34,7 +34,6 @@ import org.testng.annotations.AfterMethod;
 import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
 import java.util.ArrayList;
-import java.util.Collections;
 import java.util.List;
 import java.util.concurrent.BlockingQueue;
 import java.util.concurrent.LinkedBlockingQueue;
@@ -141,7 +140,7 @@ public class TestTreeCache extends BaseClassForTests
         assertNoMoreEvents();
 
         Assert.assertEquals(cache.getCurrentChildren("/test"), ImmutableSortedSet.of("1",
"2", "3"));
-        Assert.assertEquals(cache.getCurrentChildren("/test/1"), Collections.emptySet());
+        Assert.assertEquals(cache.getCurrentChildren("/test/1"), ImmutableSortedSet.of());
         Assert.assertEquals(cache.getCurrentChildren("/test/2"), ImmutableSortedSet.of("sub"));
         Assert.assertNull(cache.getCurrentChildren("/test/non_exist"));
     }
@@ -292,7 +291,7 @@ public class TestTreeCache extends BaseClassForTests
         cache.start();
         assertEvent(TreeCacheEvent.Type.NODE_ADDED, "/test");
         assertEvent(TreeCacheEvent.Type.INITIALIZED);
-        Assert.assertEquals(cache.getCurrentChildren("/test"), Collections.emptySortedSet());
+        Assert.assertEquals(cache.getCurrentChildren("/test"), ImmutableSortedSet.of());
 
         client.create().forPath("/test/one", "hey there".getBytes());
         assertEvent(TreeCacheEvent.Type.NODE_ADDED, "/test/one");
@@ -306,7 +305,7 @@ public class TestTreeCache extends BaseClassForTests
 
         client.delete().forPath("/test/one");
         assertEvent(TreeCacheEvent.Type.NODE_REMOVED, "/test/one");
-        Assert.assertEquals(cache.getCurrentChildren("/test"), Collections.emptySortedSet());
+        Assert.assertEquals(cache.getCurrentChildren("/test"), ImmutableSortedSet.of());
 
         assertNoMoreEvents();
     }


Mime
View raw message