usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject usergrid git commit: Use StringUtils.isEmpty() to determine if region is not set.
Date Thu, 01 Sep 2016 16:59:48 GMT
Repository: usergrid
Updated Branches:
  refs/heads/hotfix-20160819 69cfbbd15 -> 9bb0ae6d0


Use StringUtils.isEmpty() to determine if region is not set.


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

Branch: refs/heads/hotfix-20160819
Commit: 9bb0ae6d099968079675cecb92e034b978f89006
Parents: 69cfbbd
Author: Dave Johnson <snoopdave@apache.org>
Authored: Thu Sep 1 12:59:39 2016 -0400
Committer: Dave Johnson <snoopdave@apache.org>
Committed: Thu Sep 1 12:59:39 2016 -0400

----------------------------------------------------------------------
 .../persistence/collection/mvcc/stage/write/WriteCommit.java    | 5 +++--
 .../collection/mvcc/stage/write/WriteUniqueVerify.java          | 5 +++--
 2 files changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/9bb0ae6d/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteCommit.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteCommit.java
b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteCommit.java
index 5b98ca5..553ac4c 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteCommit.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteCommit.java
@@ -22,6 +22,7 @@ import java.util.HashMap;
 import java.util.Map;
 import java.util.UUID;
 
+import org.apache.commons.lang3.StringUtils;
 import org.apache.usergrid.persistence.actorsystem.ActorSystemFig;
 import org.apache.usergrid.persistence.collection.exception.WriteUniqueVerifyException;
 import org.apache.usergrid.persistence.collection.uniquevalues.UniqueValueException;
@@ -136,10 +137,10 @@ public class WriteCommit implements Func1<CollectionIoEvent<MvccEntity>,
Collect
         // akkaFig may be null when this is called from JUnit tests
         if ( actorSystemFig != null && actorSystemFig.getEnabled() ) {
             String region = ioEvent.getRegion();
-            if ( region == null ) {
+            if ( StringUtils.isEmpty(region) ) {
                 region = uniqueValuesFig.getAuthoritativeRegion();
             }
-            if ( region == null ) {
+            if ( StringUtils.isEmpty(region) ) {
                 region = actorSystemFig.getRegionLocal();
             }
             confirmUniqueFieldsAkka( mvccEntity, version, applicationScope, region );

http://git-wip-us.apache.org/repos/asf/usergrid/blob/9bb0ae6d/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteUniqueVerify.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteUniqueVerify.java
b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteUniqueVerify.java
index a3565ea..7a63061 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteUniqueVerify.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteUniqueVerify.java
@@ -29,6 +29,7 @@ import com.netflix.hystrix.HystrixCommand;
 import com.netflix.hystrix.HystrixCommandGroupKey;
 import com.netflix.hystrix.HystrixCommandProperties;
 import com.netflix.hystrix.HystrixThreadPoolProperties;
+import org.apache.commons.lang3.StringUtils;
 import org.apache.usergrid.persistence.actorsystem.ActorSystemFig;
 import org.apache.usergrid.persistence.collection.MvccEntity;
 import org.apache.usergrid.persistence.collection.exception.WriteUniqueVerifyException;
@@ -124,10 +125,10 @@ public class WriteUniqueVerify implements Action1<CollectionIoEvent<MvccEntity>>
         final ApplicationScope applicationScope = ioevent.getEntityCollection();
 
         String region = ioevent.getRegion();
-        if ( region == null ) {
+        if ( StringUtils.isEmpty(region) ) {
             region = uniqueValuesFig.getAuthoritativeRegion();
         }
-        if ( region == null ) {
+        if ( StringUtils.isEmpty(region) ) {
             region = actorSystemFig.getRegionLocal();
         }
         try {


Mime
View raw message