Skip to content

Commit

Permalink
handle NULL_OBJECT inside NearCache
Browse files Browse the repository at this point in the history
  • Loading branch information
enesakar committed Dec 16, 2013
1 parent ca70bbb commit 7ce0d4c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
4 changes: 2 additions & 2 deletions hazelcast/src/main/java/com/hazelcast/map/NearCache.java
Expand Up @@ -35,7 +35,7 @@

public class NearCache {

public static final Object NULL_OBJECT = new Object();
private static final Object NULL_OBJECT = new Object();

private static final int evictionPercentage = 20;
private static final int cleanupInterval = 5000;
Expand Down Expand Up @@ -163,7 +163,7 @@ public Object get(Data key) {
updateSizeEstimator(-calculateCost(record));
return null;
}
return record.value;
return record.value.equals(NULL_OBJECT) ? null : record.value;
} else {
return null;
}
Expand Down
Expand Up @@ -116,9 +116,6 @@ protected Object getInternal(Data key) {
if (nearCacheEnabled) {
Object cached = mapService.getFromNearCache(name, key);
if (cached != null) {
if (cached.equals(NearCache.NULL_OBJECT)) {
return null;
}
mapService.interceptAfterGet(name, cached);
return cached;
}
Expand Down

0 comments on commit 7ce0d4c

Please sign in to comment.