curator-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From randg...@apache.org
Subject curator git commit: Check that response stat is not null
Date Tue, 02 Feb 2016 14:33:07 GMT
Repository: curator
Updated Branches:
  refs/heads/CURATOR-3.0 6acf09871 -> ec858f282


Check that response stat is not null


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

Branch: refs/heads/CURATOR-3.0
Commit: ec858f2829c7adff93fd57749b3e303bb733a6d0
Parents: 6acf098
Author: randgalt <randgalt@apache.org>
Authored: Tue Feb 2 09:32:58 2016 -0500
Committer: randgalt <randgalt@apache.org>
Committed: Tue Feb 2 09:32:58 2016 -0500

----------------------------------------------------------------------
 .../framework/imps/CreateBuilderImpl.java       | 28 +++++++++++---------
 1 file changed, 15 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/ec858f28/curator-framework/src/main/java/org/apache/curator/framework/imps/CreateBuilderImpl.java
----------------------------------------------------------------------
diff --git a/curator-framework/src/main/java/org/apache/curator/framework/imps/CreateBuilderImpl.java
b/curator-framework/src/main/java/org/apache/curator/framework/imps/CreateBuilderImpl.java
index 2eca53c..57adae3 100644
--- a/curator-framework/src/main/java/org/apache/curator/framework/imps/CreateBuilderImpl.java
+++ b/curator-framework/src/main/java/org/apache/curator/framework/imps/CreateBuilderImpl.java
@@ -572,19 +572,21 @@ class CreateBuilderImpl implements CreateBuilder, BackgroundOperation<PathAndByt
                     @Override
                     public void processResult(int rc, String path, Object ctx, String name,
Stat stat) {
                         trace.commit();
-                        
-                        //Need to manually populate the provided stat here.
-                        storingStat.setAversion(stat.getAversion());
-                        storingStat.setCtime(stat.getCtime());
-                        storingStat.setCversion(stat.getCversion());
-                        storingStat.setCzxid(stat.getCzxid());
-                        storingStat.setDataLength(stat.getDataLength());
-                        storingStat.setEphemeralOwner(stat.getEphemeralOwner());
-                        storingStat.setMtime(stat.getMtime());
-                        storingStat.setMzxid(stat.getMzxid());
-                        storingStat.setNumChildren(stat.getNumChildren());
-                        storingStat.setPzxid(stat.getPzxid());
-                        storingStat.setVersion(stat.getVersion());
+
+                        if ( stat != null )
+                        {
+                            storingStat.setAversion(stat.getAversion());
+                            storingStat.setCtime(stat.getCtime());
+                            storingStat.setCversion(stat.getCversion());
+                            storingStat.setCzxid(stat.getCzxid());
+                            storingStat.setDataLength(stat.getDataLength());
+                            storingStat.setEphemeralOwner(stat.getEphemeralOwner());
+                            storingStat.setMtime(stat.getMtime());
+                            storingStat.setMzxid(stat.getMzxid());
+                            storingStat.setNumChildren(stat.getNumChildren());
+                            storingStat.setPzxid(stat.getPzxid());
+                            storingStat.setVersion(stat.getVersion());
+                        }
 
                         if ( (rc == KeeperException.Code.NONODE.intValue()) && createParentsIfNeeded
)
                         {


Mime
View raw message