You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@usergrid.apache.org by gr...@apache.org on 2016/05/02 19:54:52 UTC
[21/50] [abbrv] usergrid git commit: Ensure that applicationId cache
does not cache nulls.
Ensure that applicationId cache does not cache nulls.
Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/423c865c
Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/423c865c
Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/423c865c
Branch: refs/heads/USERGRID-1246-MASTER
Commit: 423c865c499dbe4bb599dadcf67a4ea905cc7376
Parents: 12f32eb
Author: Dave Johnson <sn...@apache.org>
Authored: Wed Apr 20 11:02:14 2016 -0400
Committer: George Reyes <gr...@apache.org>
Committed: Mon May 2 10:49:34 2016 -0700
----------------------------------------------------------------------
.../usergrid/corepersistence/ApplicationIdCacheImpl.java | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/usergrid/blob/423c865c/stack/core/src/main/java/org/apache/usergrid/corepersistence/ApplicationIdCacheImpl.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/ApplicationIdCacheImpl.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/ApplicationIdCacheImpl.java
index 7745359..7403c81 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/ApplicationIdCacheImpl.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/ApplicationIdCacheImpl.java
@@ -27,6 +27,7 @@ import org.apache.usergrid.persistence.EntityManager;
import org.apache.usergrid.persistence.Schema;
import org.apache.usergrid.persistence.collection.EntityCollectionManager;
import org.apache.usergrid.persistence.core.scope.ApplicationScopeImpl;
+import org.apache.usergrid.persistence.exceptions.PersistenceException;
import org.apache.usergrid.persistence.model.entity.Id;
import org.apache.usergrid.persistence.model.entity.SimpleId;
import org.apache.usergrid.persistence.model.field.StringField;
@@ -65,7 +66,11 @@ public class ApplicationIdCacheImpl implements ApplicationIdCache {
.build(new CacheLoader<String, UUID>() {
@Override
public UUID load(final String key) throws Exception {
- return fetchApplicationId(key);
+ UUID appId = fetchApplicationId(key);
+ if ( appId == null ) {
+ throw new PersistenceException("Error getting applicationId");
+ }
+ return appId;
}
});
}