Fix but in app exists logic. All tests pass with app ID cache changes.

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

Branch: refs/heads/9f45130_app_cache_fix
Commit: 7fbe8c8ce316d8bd3d6aed00c33034ea131ecf98
Parents: 84bea77
Author: Dave Johnson <[email protected]>
Authored: Mon Apr 11 08:42:21 2016 -0400
Committer: Mike Dunker <[email protected]>
Committed: Wed Apr 20 08:55:04 2016 -0700

----------------------------------------------------------------------
 .../apache/usergrid/corepersistence/CpEntityManagerFactory.java  | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/7fbe8c8c/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManagerFactory.java
----------------------------------------------------------------------
diff --git 
a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManagerFactory.java
 
b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManagerFactory.java
index 6e5fe5b..bd0ed77 100644
--- 
a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManagerFactory.java
+++ 
b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManagerFactory.java
@@ -216,7 +216,7 @@ public class CpEntityManagerFactory implements 
EntityManagerFactory, Application
 
         final UUID appId = applicationIdCache.getApplicationId( appName );
 
-        if ( appId == null ) {
+        if ( appId != null ) {
             throw new ApplicationAlreadyExistsException( name );
         }
 
@@ -254,7 +254,7 @@ public class CpEntityManagerFactory implements 
EntityManagerFactory, Application
 
         // check for pre-existing application
 
-        if ( lookupApplication( appName ) == null ) {
+        if ( lookupApplication( appName ) != null ) {
             throw new ApplicationAlreadyExistsException( appName );
         }
 

Reply via email to