http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/760182ea/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java
index 983b600..85bf527 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java
@@ -74,10 +74,17 @@ public class GridLocalAtomicCache<K, V> extends 
GridCacheAdapter<K, V> {
 
     /** {@inheritDoc} */
     @Override protected void init() {
-        map.setEntryFactory(new GridCacheMapEntryFactory<K, V>() {
-            @Override public GridCacheMapEntry<K, V> 
create(GridCacheContext<K, V> ctx, long topVer, K key, int hash,
-                V val, @Nullable GridCacheMapEntry<K, V> next, long ttl, int 
hdrId) {
-                return new GridLocalCacheEntry<K, V>(ctx, key, hash, val, 
next, ttl, hdrId);
+        map.setEntryFactory(new GridCacheMapEntryFactory() {
+            @Override public GridCacheMapEntry create(GridCacheContext ctx,
+                long topVer,
+                KeyCacheObject key,
+                int hash,
+                CacheObject val,
+                @Nullable GridCacheMapEntry next,
+                long ttl,
+                int hdrId)
+            {
+                return new GridLocalCacheEntry(ctx, key, hash, val, next, ttl, 
hdrId);
             }
         });
     }
@@ -201,22 +208,22 @@ public class GridLocalAtomicCache<K, V> extends 
GridCacheAdapter<K, V> {
     /** {@inheritDoc} */
     @SuppressWarnings("unchecked")
     @Override public V putIfAbsent(K key, V val) throws IgniteCheckedException 
{
-        return put(key, val, ctx.noPeekArray());
+        return put(key, val, ctx.<K, V>noPeekArray());
     }
 
     /** {@inheritDoc} */
     @Override public IgniteInternalFuture<V> putIfAbsentAsync(K key, V val) {
-        return putAsync(key, val, ctx.noPeekArray());
+        return putAsync(key, val, ctx.<K, V>noPeekArray());
     }
 
     /** {@inheritDoc} */
     @Override public boolean putxIfAbsent(K key, V val) throws 
IgniteCheckedException {
-        return putx(key, val, ctx.noPeekArray());
+        return putx(key, val, ctx.<K, V>noPeekArray());
     }
 
     /** {@inheritDoc} */
     @Override public IgniteInternalFuture<Boolean> putxIfAbsentAsync(K key, V 
val) {
-        return putxAsync(key, val, ctx.noPeekArray());
+        return putxAsync(key, val, ctx.<K, V>noPeekArray());
     }
 
     /** {@inheritDoc} */
@@ -260,7 +267,7 @@ public class GridLocalAtomicCache<K, V> extends 
GridCacheAdapter<K, V> {
 
     /** {@inheritDoc} */
     @SuppressWarnings("unchecked")
-    @Override public GridCacheReturn<V> replacex(K key, V oldVal, V newVal) 
throws IgniteCheckedException {
+    @Override public GridCacheReturn<CacheObject> replacex(K key, V oldVal, V 
newVal) throws IgniteCheckedException {
         A.notNull(key, "key", oldVal, "oldVal", newVal, "newVal");
 
         ctx.denyOnLocalRead();
@@ -268,7 +275,7 @@ public class GridLocalAtomicCache<K, V> extends 
GridCacheAdapter<K, V> {
         if (ctx.portableEnabled())
             oldVal = (V)ctx.marshalToPortable(oldVal);
 
-        return (GridCacheReturn<V>)updateAllInternal(UPDATE,
+        return (GridCacheReturn<CacheObject>)updateAllInternal(UPDATE,
             Collections.singleton(key),
             Collections.singleton(newVal),
             null,
@@ -281,7 +288,7 @@ public class GridLocalAtomicCache<K, V> extends 
GridCacheAdapter<K, V> {
 
     /** {@inheritDoc} */
     @SuppressWarnings("unchecked")
-    @Override public GridCacheReturn<V> removex(K key, V val) throws 
IgniteCheckedException {
+    @Override public GridCacheReturn<CacheObject> removex(K key, V val) throws 
IgniteCheckedException {
         A.notNull(key, "key", val, "val");
 
         ctx.denyOnLocalRead();
@@ -289,7 +296,7 @@ public class GridLocalAtomicCache<K, V> extends 
GridCacheAdapter<K, V> {
         if (ctx.portableEnabled())
             val = (V)ctx.marshalToPortable(val);
 
-        return (GridCacheReturn<V>)updateAllInternal(DELETE,
+        return (GridCacheReturn<CacheObject>)updateAllInternal(DELETE,
             Collections.singleton(key),
             null,
             null,
@@ -302,7 +309,7 @@ public class GridLocalAtomicCache<K, V> extends 
GridCacheAdapter<K, V> {
 
     /** {@inheritDoc} */
     @SuppressWarnings("unchecked")
-    @Override public IgniteInternalFuture<GridCacheReturn<V>> removexAsync(K 
key, V val) {
+    @Override public IgniteInternalFuture<GridCacheReturn<CacheObject>> 
removexAsync(K key, V val) {
         A.notNull(key, "key", val, "val");
 
         ctx.denyOnLocalRead();
@@ -315,7 +322,7 @@ public class GridLocalAtomicCache<K, V> extends 
GridCacheAdapter<K, V> {
 
     /** {@inheritDoc} */
     @SuppressWarnings("unchecked")
-    @Override public IgniteInternalFuture<GridCacheReturn<V>> replacexAsync(K 
key, V oldVal, V newVal) {
+    @Override public IgniteInternalFuture<GridCacheReturn<CacheObject>> 
replacexAsync(K key, V oldVal, V newVal) {
         A.notNull(key, "key", oldVal, "oldVal", newVal, "newVal");
 
         ctx.denyOnLocalRead();
@@ -626,12 +633,14 @@ public class GridLocalAtomicCache<K, V> extends 
GridCacheAdapter<K, V> {
 
             GridCacheEntryEx entry = null;
 
+            KeyCacheObject cacheKey = ctx.toCacheKeyObject(key);
+
             while (true) {
                 try {
-                    entry = swapOrOffheap ? entryEx(key) : peekEx(key);
+                    entry = swapOrOffheap ? entryEx(cacheKey) : 
peekEx(cacheKey);
 
                     if (entry != null) {
-                        V v = entry.innerGet(null,
+                        CacheObject v = entry.innerGet(null,
                             /*swap*/swapOrOffheap,
                             /*read-through*/false,
                             /*fail-fast*/false,
@@ -646,13 +655,14 @@ public class GridLocalAtomicCache<K, V> extends 
GridCacheAdapter<K, V> {
 
                         if (v != null) {
                             K key0 = key;
+                            Object val = v.value(ctx);
 
                             if (ctx.portableEnabled() && deserializePortable) {
-                                v = (V)ctx.unwrapPortableIfNeeded(v, false);
+                                val = ctx.unwrapPortableIfNeeded(val, false);
                                 key0 = (K)ctx.unwrapPortableIfNeeded(key, 
false);
                             }
 
-                            vals.put(key0, v);
+                            vals.put(key0, (V)val);
                         }
                         else
                             success = false;
@@ -965,6 +975,8 @@ public class GridLocalAtomicCache<K, V> extends 
GridCacheAdapter<K, V> {
         else
             ctx.checkSecurity(GridSecurityPermission.CACHE_PUT);
 
+        IgnitePredicate<Cache.Entry<Object, Object>>[] filter0 = 
(IgnitePredicate[])filter;
+
         String taskName = ctx.kernalContext().job().currentTaskName();
 
         GridCacheVersion ver = ctx.versions().next();
@@ -1000,20 +1012,18 @@ public class GridLocalAtomicCache<K, V> extends 
GridCacheAdapter<K, V> {
             if (val == null && op != DELETE)
                 throw new NullPointerException("Null value.");
 
-            if (ctx.portableEnabled()) {
-                key = (K)ctx.marshalToPortable(key);
+            KeyCacheObject cacheKey = ctx.toCacheKeyObject(key);
 
-                if (op == UPDATE)
-                    val = (V)ctx.marshalToPortable(val);
-            }
+            if (op == UPDATE)
+                val = ctx.toCacheObject(val);
 
             while (true) {
                 GridCacheEntryEx entry = null;
 
                 try {
-                    entry = entryEx(key);
+                    entry = entryEx(cacheKey);
 
-                    GridTuple3<Boolean, V, EntryProcessorResult<Object>> t = 
entry.innerUpdateLocal(
+                    GridTuple3<Boolean, CacheObject, 
EntryProcessorResult<Object>> t = entry.innerUpdateLocal(
                         ver,
                         val == null ? DELETE : op,
                         val,
@@ -1023,7 +1033,7 @@ public class GridLocalAtomicCache<K, V> extends 
GridCacheAdapter<K, V> {
                         expiryPlc,
                         true,
                         true,
-                        filter,
+                        filter0,
                         intercept,
                         subjId,
                         taskName);
@@ -1115,9 +1125,9 @@ public class GridLocalAtomicCache<K, V> extends 
GridCacheAdapter<K, V> {
         try {
             int size = locked.size();
 
-            Map<K, V> putMap = null;
+            Map<KeyCacheObject, CacheObject> putMap = null;
 
-            Collection<K> rmvKeys = null;
+            Collection<KeyCacheObject> rmvKeys = null;
 
             Map<K, EntryProcessorResult> invokeResMap =
                 op == TRANSFORM ? U.<K, EntryProcessorResult>newHashMap(size) 
: null;
@@ -1140,7 +1150,7 @@ public class GridLocalAtomicCache<K, V> extends 
GridCacheAdapter<K, V> {
 
                 try {
                     try {
-                        if (!ctx.isAll(entry.wrapFilterLocked(), filter)) {
+                        if (!ctx.isAll(entry.<K, V>wrapFilterLocked(), 
filter)) {
                             if (log.isDebugEnabled())
                                 log.debug("Entry did not pass the filter (will 
skip write) [entry=" + entry +
                                     ", filter=" + Arrays.toString(filter) + 
']');
@@ -1158,9 +1168,10 @@ public class GridLocalAtomicCache<K, V> extends 
GridCacheAdapter<K, V> {
                     }
 
                     if (op == TRANSFORM) {
-                        EntryProcessor<K, V, ?> entryProcessor = 
(EntryProcessor<K, V, ?>)val;
+                        EntryProcessor<Object, Object, Object> entryProcessor =
+                            (EntryProcessor<Object, Object, Object>)val;
 
-                        V old = entry.innerGet(null,
+                        CacheObject old = entry.innerGet(null,
                             /*swap*/true,
                             /*read-through*/true,
                             /*fail-fast*/false,
@@ -1173,18 +1184,21 @@ public class GridLocalAtomicCache<K, V> extends 
GridCacheAdapter<K, V> {
                             taskName,
                             null);
 
-                        CacheInvokeEntry<K, V> invokeEntry = new 
CacheInvokeEntry<>(ctx, entry.key(), old);
+                        Object keyVal = entry.key().value(ctx);
+                        Object oldVal = CU.value(old, ctx);
+
+                        CacheInvokeEntry<Object, Object> invokeEntry = new 
CacheInvokeEntry<>(ctx, keyVal, oldVal);
 
-                        V updated;
+                        CacheObject updated;
+                        Object updatedVal = null;
                         CacheInvokeResult invokeRes = null;
 
                         try {
                             Object computed = 
entryProcessor.process(invokeEntry, invokeArgs);
 
-                            updated = 
ctx.unwrapTemporary(invokeEntry.getValue());
+                            updatedVal = 
ctx.unwrapTemporary(invokeEntry.getValue());
 
-                            if (ctx.portableEnabled())
-                                updated = (V)ctx.marshalToPortable(updated);
+                            updated = ctx.toCacheObject(updatedVal);
 
                             if (computed != null)
                                 invokeRes = new 
CacheInvokeResult<>(ctx.unwrapTemporary(computed));
@@ -1196,12 +1210,12 @@ public class GridLocalAtomicCache<K, V> extends 
GridCacheAdapter<K, V> {
                         }
 
                         if (invokeRes != null)
-                            invokeResMap.put(entry.key(), invokeRes);
+                            invokeResMap.put((K)keyVal, invokeRes);
 
                         if (updated == null) {
                             if (intercept) {
                                 IgniteBiTuple<Boolean, ?> interceptorRes = 
ctx.config().getInterceptor().onBeforeRemove(
-                                    entry.key(), old);
+                                    keyVal, oldVal);
 
                                 if (ctx.cancelRemove(interceptorRes))
                                     continue;
@@ -1232,10 +1246,13 @@ public class GridLocalAtomicCache<K, V> extends 
GridCacheAdapter<K, V> {
                         }
                         else {
                             if (intercept) {
-                                updated = 
(V)ctx.config().getInterceptor().onBeforePut(entry.key(), old, updated);
+                                Object interceptorVal =
+                                    
ctx.config().getInterceptor().onBeforePut(keyVal, oldVal, updatedVal);
 
-                                if (updated == null)
+                                if (interceptorVal == null)
                                     continue;
+
+                                updated = 
ctx.toCacheObject(ctx.unwrapTemporary(interceptorVal));
                             }
 
                             // Update previous batch.
@@ -1258,12 +1275,14 @@ public class GridLocalAtomicCache<K, V> extends 
GridCacheAdapter<K, V> {
                             if (putMap == null)
                                 putMap = new LinkedHashMap<>(size, 1.0f);
 
-                            putMap.put(entry.key(), 
ctx.<V>unwrapTemporary(updated));
+                            putMap.put(entry.key(), updated);
                         }
                     }
                     else if (op == UPDATE) {
+                        CacheObject cacheVal = ctx.toCacheObject(val);
+
                         if (intercept) {
-                            V old = entry.innerGet(null,
+                            CacheObject old = entry.innerGet(null,
                                 /*swap*/true,
                                 /*read-through*/ctx.loadPreviousValue(),
                                 /*fail-fast*/false,
@@ -1276,27 +1295,27 @@ public class GridLocalAtomicCache<K, V> extends 
GridCacheAdapter<K, V> {
                                 taskName,
                                 null);
 
-                            val = 
ctx.config().getInterceptor().onBeforePut(entry.key(), old, val);
+                            Object interceptorVal = 
ctx.config().getInterceptor().onBeforePut(
+                                entry.key(),
+                                CU.value(old, ctx),
+                                val);
 
-                            if (val == null)
+                            if (interceptorVal == null)
                                 continue;
 
-                            val = ctx.unwrapTemporary(val);
+                            cacheVal = 
ctx.toCacheObject(ctx.unwrapTemporary(interceptorVal));
                         }
 
                         if (putMap == null)
                             putMap = new LinkedHashMap<>(size, 1.0f);
 
-                        if (ctx.portableEnabled())
-                            val = ctx.marshalToPortable(val);
-
-                        putMap.put(entry.key(), (V)val);
+                        putMap.put(entry.key(), cacheVal);
                     }
                     else {
                         assert op == DELETE;
 
                         if (intercept) {
-                            V old = entry.innerGet(null,
+                            CacheObject old = entry.innerGet(null,
                                 /*swap*/true,
                                 /*read-through*/ctx.loadPreviousValue(),
                                 /*fail-fast*/false,
@@ -1310,7 +1329,8 @@ public class GridLocalAtomicCache<K, V> extends 
GridCacheAdapter<K, V> {
                                 null);
 
                             IgniteBiTuple<Boolean, ?> interceptorRes = 
ctx.config().getInterceptor().onBeforeRemove(
-                                entry.key(), old);
+                                entry.key(),
+                                CU.value(old, ctx));
 
                             if (ctx.cancelRemove(interceptorRes))
                                 continue;
@@ -1378,8 +1398,8 @@ public class GridLocalAtomicCache<K, V> extends 
GridCacheAdapter<K, V> {
     @Nullable private CachePartialUpdateCheckedException updatePartialBatch(
         List<GridCacheEntryEx> entries,
         final GridCacheVersion ver,
-        @Nullable Map<K, V> putMap,
-        @Nullable Collection<K> rmvKeys,
+        @Nullable Map<KeyCacheObject, CacheObject> putMap,
+        @Nullable Collection<KeyCacheObject> rmvKeys,
         @Nullable ExpiryPolicy expiryPlc,
         @Nullable CachePartialUpdateCheckedException err,
         UUID subjId,
@@ -1393,8 +1413,8 @@ public class GridLocalAtomicCache<K, V> extends 
GridCacheAdapter<K, V> {
         try {
             if (putMap != null) {
                 try {
-                    ctx.store().putAllToStore(null, F.viewReadOnly(putMap, new 
C1<V, IgniteBiTuple<V, GridCacheVersion>>() {
-                        @Override public IgniteBiTuple<V, GridCacheVersion> 
apply(V v) {
+                    ctx.store().putAllToStore(null, F.viewReadOnly(putMap, new 
C1<CacheObject, IgniteBiTuple<CacheObject, GridCacheVersion>>() {
+                        @Override public IgniteBiTuple<CacheObject, 
GridCacheVersion> apply(CacheObject v) {
                             return F.t(v, ver);
                         }
                     }));
@@ -1437,11 +1457,11 @@ public class GridLocalAtomicCache<K, V> extends 
GridCacheAdapter<K, V> {
 
             try {
                 // We are holding java-level locks on entries at this point.
-                V writeVal = op == UPDATE ? putMap.get(entry.key()) : null;
+                CacheObject writeVal = op == UPDATE ? putMap.get(entry.key()) 
: null;
 
                 assert writeVal != null || op == DELETE : "null write value 
found.";
 
-                GridTuple3<Boolean, V, EntryProcessorResult<Object>> t = 
entry.innerUpdateLocal(
+                GridTuple3<Boolean, CacheObject, EntryProcessorResult<Object>> 
t = entry.innerUpdateLocal(
                     ver,
                     op,
                     writeVal,
@@ -1458,9 +1478,9 @@ public class GridLocalAtomicCache<K, V> extends 
GridCacheAdapter<K, V> {
 
                 if (intercept) {
                     if (op == UPDATE)
-                        ctx.config().getInterceptor().onAfterPut(entry.key(), 
writeVal);
+                        
ctx.config().getInterceptor().onAfterPut(entry.key().value(ctx), 
writeVal.value(ctx));
                     else
-                        
ctx.config().getInterceptor().onAfterRemove(entry.key(), t.get2());
+                        
ctx.config().getInterceptor().onAfterRemove(entry.key().value(ctx), 
CU.value(t.get2(), ctx));
                 }
             }
             catch (GridCacheEntryRemovedException ignore) {
@@ -1491,10 +1511,7 @@ public class GridLocalAtomicCache<K, V> extends 
GridCacheAdapter<K, V> {
                 if (key == null)
                     throw new NullPointerException("Null key.");
 
-                if (ctx.portableEnabled())
-                    key = (K)ctx.marshalToPortable(key);
-
-                GridCacheEntryEx entry = entryEx(key);
+                GridCacheEntryEx entry = entryEx(ctx.toCacheKeyObject(key));
 
                 locked.add(entry);
             }
@@ -1547,7 +1564,7 @@ public class GridLocalAtomicCache<K, V> extends 
GridCacheAdapter<K, V> {
     /** {@inheritDoc} */
     @Override public IgniteInternalFuture<Boolean> txLockAsync(Collection<? 
extends K> keys,
         long timeout,
-        IgniteTxLocalEx<K, V> tx,
+        IgniteTxLocalEx tx,
         boolean isRead,
         boolean retval,
         TransactionIsolation isolation,

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/760182ea/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheDistributedQueryFuture.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheDistributedQueryFuture.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheDistributedQueryFuture.java
index bd8385b..62ae9ae 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheDistributedQueryFuture.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheDistributedQueryFuture.java
@@ -101,7 +101,7 @@ public class GridCacheDistributedQueryFuture<K, V, R> 
extends GridCacheQueryFutu
                 subgrid.clear();
             }
 
-            final GridCacheQueryRequest<K, V> req = new 
GridCacheQueryRequest<>(cctx.cacheId(), reqId, fields());
+            final GridCacheQueryRequest req = new 
GridCacheQueryRequest(cctx.cacheId(), reqId, fields());
 
             // Process cancel query directly (without sending) for local node,
             cctx.closures().callLocalSafe(new Callable<Object>() {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/760182ea/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheDistributedQueryManager.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheDistributedQueryManager.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheDistributedQueryManager.java
index c08f047..62f48a2 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheDistributedQueryManager.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheDistributedQueryManager.java
@@ -70,8 +70,8 @@ public class GridCacheDistributedQueryManager<K, V> extends 
GridCacheQueryManage
     private Collection<Long> cancelled = new 
GridBoundedConcurrentOrderedSet<>(MAX_CANCEL_IDS);
 
     /** Query response handler. */
-    private IgniteBiInClosure<UUID,GridCacheQueryResponse<K,V>> resHnd = new 
CI2<UUID, GridCacheQueryResponse<K, V>>() {
-        @Override public void apply(UUID nodeId, GridCacheQueryResponse<K, V> 
res) {
+    private IgniteBiInClosure<UUID,GridCacheQueryResponse> resHnd = new 
CI2<UUID, GridCacheQueryResponse>() {
+        @Override public void apply(UUID nodeId, GridCacheQueryResponse res) {
             processQueryResponse(nodeId, res);
         }
     };
@@ -82,8 +82,8 @@ public class GridCacheDistributedQueryManager<K, V> extends 
GridCacheQueryManage
 
         assert cctx.config().getCacheMode() != LOCAL;
 
-        cctx.io().addHandler(cctx.cacheId(), GridCacheQueryRequest.class, new 
CI2<UUID, GridCacheQueryRequest<K, V>>() {
-            @Override public void apply(UUID nodeId, GridCacheQueryRequest<K, 
V> req) {
+        cctx.io().addHandler(cctx.cacheId(), GridCacheQueryRequest.class, new 
CI2<UUID, GridCacheQueryRequest>() {
+            @Override public void apply(UUID nodeId, GridCacheQueryRequest 
req) {
                 processQueryRequest(nodeId, req);
             }
         });
@@ -195,7 +195,7 @@ public class GridCacheDistributedQueryManager<K, V> extends 
GridCacheQueryManage
      * @return Query info.
      * @throws ClassNotFoundException If class not found.
      */
-    @Nullable private GridCacheQueryInfo distributedQueryInfo(UUID sndId, 
GridCacheQueryRequest<K, V> req)
+    @Nullable private GridCacheQueryInfo distributedQueryInfo(UUID sndId, 
GridCacheQueryRequest req)
         throws ClassNotFoundException {
         IgnitePredicate<Cache.Entry<Object, Object>> prjPred = 
req.projectionFilter() == null ?
             F.<Cache.Entry<Object, Object>>alwaysTrue() : 
req.projectionFilter();
@@ -252,7 +252,7 @@ public class GridCacheDistributedQueryManager<K, V> extends 
GridCacheQueryManage
      * @param timeout Message timeout.
      * @return {@code true} if response was sent, {@code false} otherwise.
      */
-    private boolean sendQueryResponse(UUID nodeId, GridCacheQueryResponse<K, 
V> res, long timeout) {
+    private boolean sendQueryResponse(UUID nodeId, GridCacheQueryResponse res, 
long timeout) {
         ClusterNode node = cctx.node(nodeId);
 
         if (node == null)
@@ -338,7 +338,11 @@ public class GridCacheDistributedQueryManager<K, V> 
extends GridCacheQueryManage
         if (fut != null)
             if (res.fields())
                 ((GridCacheDistributedFieldsQueryFuture)fut).onPage(
-                    sndId, res.metadata(), res.data(), res.error(), 
res.isFinished());
+                    sndId,
+                    res.metadata(),
+                    (Collection<Map<String, Object>>)((Collection)res.data()),
+                    res.error(),
+                    res.isFinished());
             else
                 fut.onPage(sndId, res.data(), res.error(), res.isFinished());
         else if (!cancelled.contains(res.requestId()))
@@ -395,7 +399,7 @@ public class GridCacheDistributedQueryManager<K, V> extends 
GridCacheQueryManage
                 fut.onPage(null, null, e, true);
             else
                 sendQueryResponse(qryInfo.senderId(),
-                    new GridCacheQueryResponse<K, V>(cctx.cacheId(), 
qryInfo.requestId(), e),
+                    new GridCacheQueryResponse(cctx.cacheId(), 
qryInfo.requestId(), e),
                     qryInfo.query().timeout());
 
             return true;
@@ -404,7 +408,7 @@ public class GridCacheDistributedQueryManager<K, V> extends 
GridCacheQueryManage
         if (loc)
             fut.onPage(null, data, null, finished);
         else {
-            GridCacheQueryResponse<K, V> res = new 
GridCacheQueryResponse<>(cctx.cacheId(), qryInfo.requestId(),
+            GridCacheQueryResponse res = new 
GridCacheQueryResponse(cctx.cacheId(), qryInfo.requestId(),
                 /*finished*/false, /*fields*/false);
 
             res.data(data);
@@ -434,7 +438,7 @@ public class GridCacheDistributedQueryManager<K, V> extends 
GridCacheQueryManage
             }
             else
                 sendQueryResponse(qryInfo.senderId(),
-                    new GridCacheQueryResponse<K, V>(cctx.cacheId(), 
qryInfo.requestId(), e),
+                    new GridCacheQueryResponse(cctx.cacheId(), 
qryInfo.requestId(), e),
                     qryInfo.query().timeout());
 
             return true;
@@ -446,7 +450,7 @@ public class GridCacheDistributedQueryManager<K, V> extends 
GridCacheQueryManage
             fut.onPage(null, metadata, data, null, finished);
         }
         else {
-            GridCacheQueryResponse<K, V> res = new 
GridCacheQueryResponse<>(cctx.cacheId(), qryInfo.requestId(),
+            GridCacheQueryResponse res = new 
GridCacheQueryResponse(cctx.cacheId(), qryInfo.requestId(),
                 finished, qryInfo.reducer() == null);
 
             res.metadata(metadata);
@@ -550,7 +554,7 @@ public class GridCacheDistributedQueryManager<K, V> extends 
GridCacheQueryManage
         assert fut != null;
 
         try {
-            GridCacheQueryRequest<K, V> req = new GridCacheQueryRequest<>(
+            GridCacheQueryRequest req = new GridCacheQueryRequest(
                 cctx.cacheId(),
                 id,
                 cctx.name(),
@@ -659,7 +663,7 @@ public class GridCacheDistributedQueryManager<K, V> extends 
GridCacheQueryManage
     @SuppressWarnings("unchecked")
     private void sendRequest(
         final GridCacheDistributedQueryFuture<?, ?, ?> fut,
-        final GridCacheQueryRequest<K, V> req,
+        final GridCacheQueryRequest req,
         Collection<ClusterNode> nodes
     ) throws IgniteCheckedException {
         assert fut != null;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/760182ea/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryManager.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryManager.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryManager.java
index b820686..17648b6 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryManager.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryManager.java
@@ -169,19 +169,24 @@ public class CacheContinuousQueryManager<K, V> extends 
GridCacheManagerAdapter<K
             if (!initialized) {
                 if (lsnr.oldValueRequired()) {
                     oldVal = cctx.unwrapTemporary(oldVal);
-
-                    if (oldVal == null && oldBytes != null && 
!oldBytes.isNull())
-                        oldVal = oldBytes.isPlain() ? (V)oldBytes.get() : 
cctx.marshaller().<V>unmarshal(oldBytes.get
-                            (), cctx.deploy().globalLoader());
+// TODO IGNITE-51.
+//                    if (oldVal == null && oldBytes != null && 
!oldBytes.isNull())
+//                        oldVal = oldBytes.isPlain() ? (V)oldBytes.get() : 
cctx.marshaller().<V>unmarshal(oldBytes.get
+//                            (), cctx.deploy().globalLoader());
                 }
 
-                if (newVal == null && newBytes != null && !newBytes.isNull())
-                    newVal = newBytes.isPlain() ? (V)newBytes.get() : 
cctx.marshaller().<V>unmarshal(newBytes.get(),
-                        cctx.deploy().globalLoader());
+                if (newVal == null && newBytes != null && !newBytes.isNull()) {
+// TODO IGNITE-51.
+//                    newVal = newBytes.isPlain() ? (V) newBytes.get() : 
cctx.marshaller().<V>unmarshal(newBytes.get(),
+//                        cctx.deploy().globalLoader());
+                }
             }
 
-            CacheContinuousQueryEntry<K, V> e0 = new 
CacheContinuousQueryEntry<>(key, newVal, newBytes,
-                lsnr.oldValueRequired() ? oldVal : null, 
lsnr.oldValueRequired() ? oldBytes : null);
+            CacheContinuousQueryEntry<K, V> e0 = new 
CacheContinuousQueryEntry<>(key.<K>value(cctx),
+                CU.<V>value(newVal, cctx),
+                newBytes,
+                lsnr.oldValueRequired() ? CU.<V>value(oldVal, cctx) : null,
+                lsnr.oldValueRequired() ? oldBytes : null);
 
             CacheContinuousQueryEvent<K, V> evt = new 
CacheContinuousQueryEvent<>(
                 cctx.kernalContext().cache().jcache(cctx.name()), evtType, e0);
@@ -221,14 +226,20 @@ public class CacheContinuousQueryManager<K, V> extends 
GridCacheManagerAdapter<K
                     if (lsnr.oldValueRequired()) {
                         oldVal = cctx.unwrapTemporary(oldVal);
 
-                        if (oldVal == null && oldBytes != null && 
!oldBytes.isNull())
-                            oldVal = oldBytes.isPlain() ? (V)oldBytes.get() :
-                                cctx.marshaller().<V>unmarshal(oldBytes.get(), 
cctx.deploy().globalLoader());
+                        if (oldVal == null && oldBytes != null && 
!oldBytes.isNull()) {
+// TODO IGNITE-51.
+//                            oldVal = oldBytes.isPlain() ? (V) oldBytes.get() 
:
+//                                
cctx.marshaller().<V>unmarshal(oldBytes.get(), cctx.deploy().globalLoader());
+                        }
                     }
                 }
 
-                CacheContinuousQueryEntry<K, V> e0 = new 
CacheContinuousQueryEntry<>(key, null, null,
-                    lsnr.oldValueRequired() ? oldVal : null, 
lsnr.oldValueRequired() ? oldBytes : null);
+               // TODO IGNITE-51.
+               CacheContinuousQueryEntry<K, V> e0 = new 
CacheContinuousQueryEntry<>(key.<K>value(cctx),
+                    null,
+                    null,
+                    lsnr.oldValueRequired() ? CU.<V>value(oldVal, cctx) : null,
+                    lsnr.oldValueRequired() ? oldBytes : null);
 
                 CacheContinuousQueryEvent<K, V> evt = new 
CacheContinuousQueryEvent<>(
                     cctx.kernalContext().cache().jcache(cctx.name()), EXPIRED, 
e0);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/760182ea/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
index 055770e..8f1007d 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
@@ -366,7 +366,7 @@ public class IgniteTxManager extends 
GridCacheSharedManagerAdapter {
 
         int taskNameHash = cctx.kernalContext().job().currentTaskNameHash();
 
-        GridNearTxLocal tx = new GridNearTxLocal<>(
+        GridNearTxLocal tx = new GridNearTxLocal(
             cctx,
             implicit,
             implicitSingle,

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/760182ea/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxRemoteEx.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxRemoteEx.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxRemoteEx.java
index a91c11f..9e9e5bf 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxRemoteEx.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxRemoteEx.java
@@ -24,7 +24,7 @@ import java.util.*;
 /**
  * Local transaction API.
  */
-public interface IgniteTxRemoteEx<K, V> extends IgniteInternalTx {
+public interface IgniteTxRemoteEx extends IgniteInternalTx {
     /**
      * @return Remote thread ID.
      */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/760182ea/modules/core/src/main/java/org/apache/ignite/internal/processors/dataload/IgniteDataLoaderImpl.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/dataload/IgniteDataLoaderImpl.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/dataload/IgniteDataLoaderImpl.java
index ced8d1d..71e0ea0 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/dataload/IgniteDataLoaderImpl.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/dataload/IgniteDataLoaderImpl.java
@@ -1407,19 +1407,26 @@ public class IgniteDataLoaderImpl<K, V> implements 
IgniteDataLoader<K, V>, Delay
 
             for (Map.Entry<K, V> e : entries) {
                 try {
-                    K key = e.getKey();
-                    V val = e.getValue();
+// TODO IGNITE-51.
+//                    K key = e.getKey();
+//                    V val = e.getValue();
+//
+//                    if (portable) {
+//                        key = (K)cctx.marshalToPortable(key);
+//                        val = (V)cctx.marshalToPortable(val);
+//                    }
 
-                    if (portable) {
-                        key = (K)cctx.marshalToPortable(key);
-                        val = (V)cctx.marshalToPortable(val);
-                    }
-
-                    GridCacheEntryEx<K, V> entry = internalCache.entryEx(key, 
topVer);
+                    GridCacheEntryEx entry = 
internalCache.entryEx(cctx.toCacheKeyObject(e.getKey()), topVer);
 
                     entry.unswap(true, false);
 
-                    entry.initialValue(val, null, ver, CU.TTL_ETERNAL, 
CU.EXPIRE_TIME_ETERNAL, false, topVer,
+                    entry.initialValue(cctx.toCacheObject(e.getValue()),
+                        null,
+                        ver,
+                        CU.TTL_ETERNAL,
+                        CU.EXPIRE_TIME_ETERNAL,
+                        false,
+                        topVer,
                         GridDrType.DR_LOAD);
 
                     cctx.evicts().touch(entry, topVer);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/760182ea/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/DataStructuresProcessor.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/DataStructuresProcessor.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/DataStructuresProcessor.java
index fdc4a7a..8ae709f 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/DataStructuresProcessor.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/DataStructuresProcessor.java
@@ -1004,14 +1004,17 @@ public final class DataStructuresProcessor extends 
GridProcessorAdapter {
 
             for (IgniteTxEntry entry : entries) {
                 // Check updated or created GridCacheInternalKey keys.
-                if ((entry.op() == CREATE || entry.op() == UPDATE) && 
entry.key() instanceof GridCacheInternalKey) {
+                if ((entry.op() == CREATE || entry.op() == UPDATE) && 
entry.key().internal()) {
                     GridCacheInternal key = (GridCacheInternal)entry.key();
 
-                    if (entry.value() instanceof GridCacheCountDownLatchValue) 
{
+                    // TODO IGNITE-51.
+                    Object val0 = CU.value(entry.value(), entry.context());
+
+                    if (val0 instanceof GridCacheCountDownLatchValue) {
                         // Notify latch on changes.
                         GridCacheRemovable latch = dsMap.get(key);
 
-                        GridCacheCountDownLatchValue val = 
(GridCacheCountDownLatchValue)entry.value();
+                        GridCacheCountDownLatchValue val = 
(GridCacheCountDownLatchValue)val0;
 
                         if (latch instanceof GridCacheCountDownLatchEx) {
                             GridCacheCountDownLatchEx latch0 = 
(GridCacheCountDownLatchEx)latch;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/760182ea/modules/core/src/main/java/org/apache/ignite/internal/processors/portable/os/GridOsPortableProcessor.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/portable/os/GridOsPortableProcessor.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/portable/os/GridOsPortableProcessor.java
index ca21545..a88fe2b 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/portable/os/GridOsPortableProcessor.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/portable/os/GridOsPortableProcessor.java
@@ -22,6 +22,7 @@ import org.apache.ignite.cluster.*;
 import org.apache.ignite.internal.*;
 import org.apache.ignite.internal.client.marshaller.*;
 import org.apache.ignite.internal.processors.*;
+import org.apache.ignite.internal.processors.cache.*;
 import org.apache.ignite.internal.processors.portable.*;
 import org.jetbrains.annotations.*;
 
@@ -117,4 +118,14 @@ public class GridOsPortableProcessor extends 
GridProcessorAdapter implements Gri
     @Override public boolean hasField(Object obj, String fieldName) {
         return false;
     }
+
+    /** {@inheritDoc} */
+    @Nullable @Override public KeyCacheObject toCacheKeyObject(@Nullable 
Object obj) {
+        return null;
+    }
+
+    /** {@inheritDoc} */
+    @Nullable @Override public CacheObject toCacheObject(@Nullable Object obj) 
{
+        return null;
+    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/760182ea/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
index c5b4dc8..1fb7a3f 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
@@ -2098,7 +2098,7 @@ public abstract class GridCacheAbstractFullApiSelfTest 
extends GridCacheAbstract
 
                     GridCacheContext<String, Integer> cctx = context(g);
 
-                    GridCacheEntryEx<String, Integer> entry = cctx.isNear() ? 
cctx.near().dht().peekEx(key) :
+                    GridCacheEntryEx entry = cctx.isNear() ? 
cctx.near().dht().peekEx(key) :
                         cctx.cache().peekEx(key);
 
                     if 
(grid(0).affinity(null).mapKeyToPrimaryAndBackups(key).contains(grid(g).localNode()))
 {
@@ -3091,7 +3091,7 @@ public abstract class GridCacheAbstractFullApiSelfTest 
extends GridCacheAbstract
                 if (cache.context().isNear())
                     cache = cache.context().near().dht();
 
-                GridCacheEntryEx<String, Integer> curEntry = cache.peekEx(key);
+                GridCacheEntryEx curEntry = cache.peekEx(key);
 
                 assertEquals(ttl, curEntry.ttl());
 
@@ -3124,7 +3124,7 @@ public abstract class GridCacheAbstractFullApiSelfTest 
extends GridCacheAbstract
                 if (cache.context().isNear())
                     cache = cache.context().near().dht();
 
-                GridCacheEntryEx<String, Integer> curEntry = cache.peekEx(key);
+                GridCacheEntryEx curEntry = cache.peekEx(key);
 
                 assertEquals(ttl, curEntry.ttl());
 
@@ -3157,7 +3157,7 @@ public abstract class GridCacheAbstractFullApiSelfTest 
extends GridCacheAbstract
                 if (cache.context().isNear())
                     cache = cache.context().near().dht();
 
-                GridCacheEntryEx<String, Integer> curEntry = cache.peekEx(key);
+                GridCacheEntryEx curEntry = cache.peekEx(key);
 
                 assertEquals(ttl, curEntry.ttl());
 
@@ -3194,7 +3194,7 @@ public abstract class GridCacheAbstractFullApiSelfTest 
extends GridCacheAbstract
                 if (cache.context().isNear())
                     cache = cache.context().near().dht();
 
-                GridCacheEntryEx<String, Integer> curEntry = cache.peekEx(key);
+                GridCacheEntryEx curEntry = cache.peekEx(key);
 
                 assertEquals(ttl, curEntry.ttl());
                 assertEquals(expireTimes[i], curEntry.expireTime());
@@ -3669,7 +3669,7 @@ public abstract class GridCacheAbstractFullApiSelfTest 
extends GridCacheAbstract
 
                 for (String key : keys) {
                     if (ctx.affinity().localNode(key, 
ctx.discovery().topologyVersion())) {
-                        GridCacheEntryEx<String, Integer> e =
+                        GridCacheEntryEx e =
                             ctx.isNear() ? ctx.near().dht().peekEx(key) : 
ctx.cache().peekEx(key);
 
                         assert e != null : "Entry is null [idx=" + i + ", 
key=" + key + ", ctx=" + ctx + ']';

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/760182ea/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractMetricsSelfTest.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractMetricsSelfTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractMetricsSelfTest.java
index d1c5e12..491ce7c 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractMetricsSelfTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractMetricsSelfTest.java
@@ -764,7 +764,7 @@ public abstract class GridCacheAbstractMetricsSelfTest 
extends GridCacheAbstract
                 if (c0.isNear())
                     c0 = c0.context().near().dht();
 
-                GridCacheEntryEx<Object, Object> curEntry = c0.peekEx(key);
+                GridCacheEntryEx curEntry = c0.peekEx(key);
 
                 assertEquals(ttl, curEntry.ttl());
 
@@ -794,7 +794,7 @@ public abstract class GridCacheAbstractMetricsSelfTest 
extends GridCacheAbstract
                 if (c0.isNear())
                     c0 = c0.context().near().dht();
 
-                GridCacheEntryEx<Object, Object> curEntry = c0.peekEx(key);
+                GridCacheEntryEx curEntry = c0.peekEx(key);
 
                 assertEquals(ttl, curEntry.ttl());
 
@@ -824,7 +824,7 @@ public abstract class GridCacheAbstractMetricsSelfTest 
extends GridCacheAbstract
                 if (c0.isNear())
                     c0 = c0.context().near().dht();
 
-                GridCacheEntryEx<Object, Object> curEntry = c0.peekEx(key);
+                GridCacheEntryEx curEntry = c0.peekEx(key);
 
                 assertEquals(ttl, curEntry.ttl());
 
@@ -858,7 +858,7 @@ public abstract class GridCacheAbstractMetricsSelfTest 
extends GridCacheAbstract
                 if (c0.isNear())
                     c0 = c0.context().near().dht();
 
-                GridCacheEntryEx<Object, Object> curEntry = c0.peekEx(key);
+                GridCacheEntryEx curEntry = c0.peekEx(key);
 
                 assertEquals(ttl, curEntry.ttl());
                 assertEquals(expireTimes[i], curEntry.expireTime());

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/760182ea/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentTxMultiNodeTest.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentTxMultiNodeTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentTxMultiNodeTest.java
index 6c21b28..46c0e89 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentTxMultiNodeTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentTxMultiNodeTest.java
@@ -581,20 +581,20 @@ public class GridCacheConcurrentTxMultiNodeTest extends 
GridCommonAbstractTest {
                             GridDhtCacheAdapter<CacheAffinityKey<String>, 
Object> dht = near.dht();
 
                             for (CacheAffinityKey<String> k : keys) {
-                                GridNearCacheEntry<?, ?> nearEntry = 
near.peekExx(k);
-                                GridDhtCacheEntry<?, ?> dhtEntry = 
dht.peekExx(k);
+                                GridNearCacheEntry nearEntry = 
(GridNearCacheEntry)near.peekEx(k);
+                                GridDhtCacheEntry dhtEntry = 
(GridDhtCacheEntry)dht.peekEx(k);
 
                                 X.println("Near entry [grid="+ g.name() + ", 
key=" + k + ", entry=" + nearEntry);
                                 X.println("DHT entry [grid=" + g.name() + ", 
key=" + k + ", entry=" + dhtEntry);
 
-                                GridCacheMvccCandidate<?> nearCand =
+                                GridCacheMvccCandidate nearCand =
                                     nearEntry == null ? null : 
F.first(nearEntry.localCandidates());
 
                                 if (nearCand != null)
                                     X.println("Near futures: " +
                                         
nearEntry.context().mvcc().futures(nearCand.version()));
 
-                                GridCacheMvccCandidate<?> dhtCand =
+                                GridCacheMvccCandidate dhtCand =
                                     dhtEntry == null ? null : 
F.first(dhtEntry.localCandidates());
 
                                 if (dhtCand != null)

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/760182ea/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheEntryMemorySizeSelfTest.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheEntryMemorySizeSelfTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheEntryMemorySizeSelfTest.java
index 777c2ab..c23b6eb 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheEntryMemorySizeSelfTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheEntryMemorySizeSelfTest.java
@@ -280,7 +280,7 @@ public class GridCacheEntryMemorySizeSelfTest extends 
GridCommonAbstractTest {
      * @return Extras size.
      * @throws Exception If failed.
      */
-    private int extrasSize(GridCacheEntryEx<?, ?> entry) throws Exception {
+    private int extrasSize(GridCacheEntryEx entry) throws Exception {
         Method mthd = GridCacheMapEntry.class.getDeclaredMethod("extrasSize");
 
         mthd.setAccessible(true);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/760182ea/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheEntryVersionSelfTest.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheEntryVersionSelfTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheEntryVersionSelfTest.java
index 03f15cd..efc0ee1 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheEntryVersionSelfTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheEntryVersionSelfTest.java
@@ -108,7 +108,7 @@ public class GridCacheEntryVersionSelfTest extends 
GridCommonAbstractTest {
                 for (Integer key : map.keySet()) {
                     GridCacheAdapter<Object, Object> cache = 
grid.internalCache();
 
-                    GridCacheEntryEx<Object, Object> entry = cache.peekEx(key);
+                    GridCacheEntryEx entry = cache.peekEx(key);
 
                     if (entry != null) {
                         GridCacheVersion ver = entry.version();
@@ -135,7 +135,7 @@ public class GridCacheEntryVersionSelfTest extends 
GridCommonAbstractTest {
                 for (Integer key : map.keySet()) {
                     GridCacheAdapter<Object, Object> cache = 
grid.internalCache();
 
-                    GridCacheEntryEx<Object, Object> entry = cache.peekEx(key);
+                    GridCacheEntryEx entry = cache.peekEx(key);
 
                     if (entry != null) {
                         GridCacheVersion ver = entry.version();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/760182ea/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheFinishPartitionsSelfTest.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheFinishPartitionsSelfTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheFinishPartitionsSelfTest.java
index 178ded8..9ce49e5 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheFinishPartitionsSelfTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheFinishPartitionsSelfTest.java
@@ -195,10 +195,13 @@ public class GridCacheFinishPartitionsSelfTest extends 
GridCacheAbstractSelfTest
 
             GridCacheAdapter<String, Integer> internal = grid.internalCache();
 
-            IgniteInternalFuture<?> nearFut = 
internal.context().mvcc().finishKeys(Collections.singletonList(key), 2);
+            KeyCacheObject cacheKey = internal.context().toCacheKeyObject(key);
+
+            IgniteInternalFuture<?> nearFut = 
internal.context().mvcc().finishKeys(
+                Collections.singletonList(cacheKey), 2);
 
             IgniteInternalFuture<?> dhtFut = 
internal.context().near().dht().context().mvcc().finishKeys(
-                Collections.singletonList(key), 2);
+                Collections.singletonList(cacheKey), 2);
 
             assert !nearFut.isDone();
             assert !dhtFut.isDone();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/760182ea/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheLeakTest.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheLeakTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheLeakTest.java
index 3903c6f..52ba62f 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheLeakTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheLeakTest.java
@@ -126,7 +126,7 @@ public class GridCacheLeakTest extends 
GridCommonAbstractTest {
 
                 if (i % 5000 == 0) {
                     for (int g = 0; g < 3; g++) {
-                        GridCacheConcurrentMap<Object, Object> map = 
((IgniteKernal)grid(g)).internalCache(CACHE_NAME).map();
+                        GridCacheConcurrentMap map = 
((IgniteKernal)grid(g)).internalCache(CACHE_NAME).map();
 
                         info("Map size for cache [g=" + g + ", size=" + 
map.size() +
                             ", pubSize=" + map.publicSize() + ']');

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/760182ea/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMvccFlagsTest.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMvccFlagsTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMvccFlagsTest.java
index 225da99..057c397 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMvccFlagsTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMvccFlagsTest.java
@@ -69,13 +69,13 @@ public class GridCacheMvccFlagsTest extends 
GridCommonAbstractTest {
     public void testAllTrueFlags() {
         GridCacheAdapter<String, String> cache = grid.internalCache();
 
-        GridCacheTestEntryEx<String, String> entry = new 
GridCacheTestEntryEx<>(cache.context(), "1");
+        GridCacheTestEntryEx entry = new GridCacheTestEntryEx(cache.context(), 
"1");
 
         UUID id = UUID.randomUUID();
 
         GridCacheVersion ver = new GridCacheVersion(1, 0, 0, 0, 0);
 
-        GridCacheMvccCandidate<String> c = new GridCacheMvccCandidate<>(
+        GridCacheMvccCandidate c = new GridCacheMvccCandidate(
             entry,
             id,
             id,
@@ -109,13 +109,13 @@ public class GridCacheMvccFlagsTest extends 
GridCommonAbstractTest {
     public void testAllFalseFlags() {
         GridCacheAdapter<String, String> cache = grid.internalCache();
 
-        GridCacheTestEntryEx<String, String> entry = new 
GridCacheTestEntryEx<>(cache.context(), "1");
+        GridCacheTestEntryEx entry = new GridCacheTestEntryEx(cache.context(), 
"1");
 
         UUID id = UUID.randomUUID();
 
         GridCacheVersion ver = new GridCacheVersion(1, 0, 0, 0, 0);
 
-        GridCacheMvccCandidate<String> c = new GridCacheMvccCandidate<>(
+        GridCacheMvccCandidate c = new GridCacheMvccCandidate(
             entry,
             id,
             id,

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/760182ea/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMvccPartitionedSelfTest.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMvccPartitionedSelfTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMvccPartitionedSelfTest.java
index 5935287..37638e8 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMvccPartitionedSelfTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMvccPartitionedSelfTest.java
@@ -86,18 +86,18 @@ public class GridCacheMvccPartitionedSelfTest extends 
GridCommonAbstractTest {
     public void testNearLocalsWithPending() {
         GridCacheAdapter<String, String> cache = grid.internalCache();
 
-        GridCacheTestEntryEx<String, String> entry = new 
GridCacheTestEntryEx<>(cache.context(), "1");
+        GridCacheTestEntryEx entry = new GridCacheTestEntryEx(cache.context(), 
"1");
 
         UUID node1 = UUID.randomUUID();
 
         GridCacheVersion ver1 = version(1);
         GridCacheVersion ver2 = version(2);
 
-        GridCacheMvccCandidate<String> c1 = entry.addRemote(node1, 1, ver1, 0, 
false, true);
-        GridCacheMvccCandidate<String> c2 = entry.addNearLocal(node1, 1, ver2, 
0, true);
+        GridCacheMvccCandidate c1 = entry.addRemote(node1, 1, ver1, 0, false, 
true);
+        GridCacheMvccCandidate c2 = entry.addNearLocal(node1, 1, ver2, 0, 
true);
 
-        Collection<GridCacheMvccCandidate<String>> rmtCands = 
entry.remoteMvccSnapshot();
-        Collection<GridCacheMvccCandidate<String>> nearLocCands = 
entry.localCandidates();
+        Collection<GridCacheMvccCandidate> rmtCands = 
entry.remoteMvccSnapshot();
+        Collection<GridCacheMvccCandidate> nearLocCands = 
entry.localCandidates();
 
         assertEquals(1, nearLocCands.size());
         assertEquals(ver2, nearLocCands.iterator().next().version());
@@ -120,18 +120,18 @@ public class GridCacheMvccPartitionedSelfTest extends 
GridCommonAbstractTest {
     public void testNearLocalsWithCommitted() {
         GridCacheAdapter<String, String> cache = grid.internalCache();
 
-        GridCacheTestEntryEx<String, String> entry = new 
GridCacheTestEntryEx<>(cache.context(), "1");
+        GridCacheTestEntryEx entry = new GridCacheTestEntryEx(cache.context(), 
"1");
 
         UUID node1 = UUID.randomUUID();
 
         GridCacheVersion ver1 = version(1);
         GridCacheVersion ver2 = version(2);
 
-        GridCacheMvccCandidate<String> c1 = entry.addNearLocal(node1, 1, ver1, 
0, true);
-        GridCacheMvccCandidate<String> c2 = entry.addRemote(node1, 1, ver2, 0, 
false, true);
+        GridCacheMvccCandidate c1 = entry.addNearLocal(node1, 1, ver1, 0, 
true);
+        GridCacheMvccCandidate c2 = entry.addRemote(node1, 1, ver2, 0, false, 
true);
 
-        Collection<GridCacheMvccCandidate<String>> rmtCands = 
entry.remoteMvccSnapshot();
-        Collection<GridCacheMvccCandidate<String>> nearLocCands = 
entry.localCandidates();
+        Collection<GridCacheMvccCandidate> rmtCands = 
entry.remoteMvccSnapshot();
+        Collection<GridCacheMvccCandidate> nearLocCands = 
entry.localCandidates();
 
         assertEquals(1, nearLocCands.size());
         assertEquals(ver1, nearLocCands.iterator().next().version());
@@ -153,18 +153,18 @@ public class GridCacheMvccPartitionedSelfTest extends 
GridCommonAbstractTest {
     public void testNearLocalsWithRolledback() {
         GridCacheAdapter<String, String> cache = grid.internalCache();
 
-        GridCacheTestEntryEx<String, String> entry = new 
GridCacheTestEntryEx<>(cache.context(), "1");
+        GridCacheTestEntryEx entry = new GridCacheTestEntryEx(cache.context(), 
"1");
 
         UUID node1 = UUID.randomUUID();
 
         GridCacheVersion ver1 = version(1);
         GridCacheVersion ver2 = version(2);
 
-        GridCacheMvccCandidate<String> c1 = entry.addNearLocal(node1, 1, ver1, 
0, true);
-        GridCacheMvccCandidate<String> c2 = entry.addRemote(node1, 1, ver2, 0, 
false, true);
+        GridCacheMvccCandidate c1 = entry.addNearLocal(node1, 1, ver1, 0, 
true);
+        GridCacheMvccCandidate c2 = entry.addRemote(node1, 1, ver2, 0, false, 
true);
 
-        Collection<GridCacheMvccCandidate<String>> rmtCands = 
entry.remoteMvccSnapshot();
-        Collection<GridCacheMvccCandidate<String>> nearLocCands = 
entry.localCandidates();
+        Collection<GridCacheMvccCandidate> rmtCands = 
entry.remoteMvccSnapshot();
+        Collection<GridCacheMvccCandidate> nearLocCands = 
entry.localCandidates();
 
         assertEquals(1, nearLocCands.size());
         assertEquals(ver1, nearLocCands.iterator().next().version());
@@ -186,22 +186,22 @@ public class GridCacheMvccPartitionedSelfTest extends 
GridCommonAbstractTest {
     public void testNearLocals() {
         GridCacheAdapter<String, String> cache = grid.internalCache();
 
-        GridCacheTestEntryEx<String, String> entry = new 
GridCacheTestEntryEx<>(cache.context(), "1");
+        GridCacheTestEntryEx entry = new GridCacheTestEntryEx(cache.context(), 
"1");
 
         UUID node1 = UUID.randomUUID();
 
         GridCacheVersion ver1 = version(1);
         GridCacheVersion ver2 = version(2);
 
-        GridCacheMvccCandidate<String> c1 = entry.addNearLocal(node1, 1, ver1, 
0, true);
-        GridCacheMvccCandidate<String> c2 = entry.addNearLocal(node1, 1, ver2, 
0, true);
+        GridCacheMvccCandidate c1 = entry.addNearLocal(node1, 1, ver1, 0, 
true);
+        GridCacheMvccCandidate c2 = entry.addNearLocal(node1, 1, ver2, 0, 
true);
 
         entry.readyNearLocal(ver2, ver2,  empty(), empty(), empty());
 
         checkLocalOwner(c2, ver2, false);
         checkLocal(c1, ver1, false, false, false);
 
-        Collection<GridCacheMvccCandidate<String>> cands = 
entry.localCandidates();
+        Collection<GridCacheMvccCandidate> cands = entry.localCandidates();
 
         assert cands.size() == 2;
         assert cands.iterator().next().version().equals(ver2);
@@ -216,18 +216,18 @@ public class GridCacheMvccPartitionedSelfTest extends 
GridCommonAbstractTest {
     public void testNearLocalsWithOwned() {
         GridCacheAdapter<String, String> cache = grid.internalCache();
 
-        GridCacheTestEntryEx<String, String> entry = new 
GridCacheTestEntryEx<>(cache.context(), "1");
+        GridCacheTestEntryEx entry = new GridCacheTestEntryEx(cache.context(), 
"1");
 
         UUID node1 = UUID.randomUUID();
 
         GridCacheVersion ver1 = version(1);
         GridCacheVersion ver2 = version(2);
 
-        GridCacheMvccCandidate<String> c1 = entry.addRemote(node1, 1, ver1, 0, 
false, true);
-        GridCacheMvccCandidate<String> c2 = entry.addNearLocal(node1, 1, ver2, 
0, true);
+        GridCacheMvccCandidate c1 = entry.addRemote(node1, 1, ver1, 0, false, 
true);
+        GridCacheMvccCandidate c2 = entry.addNearLocal(node1, 1, ver2, 0, 
true);
 
-        Collection<GridCacheMvccCandidate<String>> rmtCands = 
entry.remoteMvccSnapshot();
-        Collection<GridCacheMvccCandidate<String>> nearLocCands = 
entry.localCandidates();
+        Collection<GridCacheMvccCandidate> rmtCands = 
entry.remoteMvccSnapshot();
+        Collection<GridCacheMvccCandidate> nearLocCands = 
entry.localCandidates();
 
         assertEquals(1, nearLocCands.size());
         assertEquals(ver2, nearLocCands.iterator().next().version());
@@ -255,7 +255,7 @@ public class GridCacheMvccPartitionedSelfTest extends 
GridCommonAbstractTest {
     public void testAddPendingRemote0() throws Exception {
         GridCacheAdapter<String, String> cache = grid.internalCache();
 
-        GridCacheTestEntryEx<String, String> entry = new 
GridCacheTestEntryEx<>(cache.context(), "1");
+        GridCacheTestEntryEx entry = new GridCacheTestEntryEx(cache.context(), 
"1");
 
         UUID node1 = UUID.randomUUID();
 
@@ -268,8 +268,8 @@ public class GridCacheMvccPartitionedSelfTest extends 
GridCommonAbstractTest {
 
         entry.addRemote(node1, 1, ver0, 0, false, true);
 
-        Collection<GridCacheMvccCandidate<String>> rmtCands = 
entry.remoteMvccSnapshot();
-        Collection<GridCacheMvccCandidate<String>> nearLocCands = 
entry.localCandidates();
+        Collection<GridCacheMvccCandidate> rmtCands = 
entry.remoteMvccSnapshot();
+        Collection<GridCacheMvccCandidate> nearLocCands = 
entry.localCandidates();
 
         assertEquals(1, nearLocCands.size());
         assertEquals(ver1, nearLocCands.iterator().next().version());
@@ -287,7 +287,7 @@ public class GridCacheMvccPartitionedSelfTest extends 
GridCommonAbstractTest {
     public void testAddPendingRemote1() throws Exception {
         GridCacheAdapter<String, String> cache = grid.internalCache();
 
-        GridCacheTestEntryEx<String, String> entry = new 
GridCacheTestEntryEx<>(cache.context(), "1");
+        GridCacheTestEntryEx entry = new GridCacheTestEntryEx(cache.context(), 
"1");
 
         UUID node1 = UUID.randomUUID();
 
@@ -296,15 +296,15 @@ public class GridCacheMvccPartitionedSelfTest extends 
GridCommonAbstractTest {
         GridCacheVersion ver2 = version(2);
         GridCacheVersion ver3 = version(3);
 
-        GridCacheMvccCandidate<String> c3 = entry.addNearLocal(node1, 1, ver3, 
0, true);
+        GridCacheMvccCandidate c3 = entry.addNearLocal(node1, 1, ver3, 0, 
true);
 
         entry.readyNearLocal(ver3, ver3, empty(), empty(), Arrays.asList(ver0, 
ver1, ver2));
 
-        GridCacheMvccCandidate<String> c2 = entry.addRemote(node1, 1, ver2, 0, 
false, true);
-        GridCacheMvccCandidate<String> c1 = entry.addRemote(node1, 1, ver1, 0, 
false, true);
-        GridCacheMvccCandidate<String> c0 = entry.addRemote(node1, 1, ver0, 0, 
false, true);
+        GridCacheMvccCandidate c2 = entry.addRemote(node1, 1, ver2, 0, false, 
true);
+        GridCacheMvccCandidate c1 = entry.addRemote(node1, 1, ver1, 0, false, 
true);
+        GridCacheMvccCandidate c0 = entry.addRemote(node1, 1, ver0, 0, false, 
true);
 
-        Collection<GridCacheMvccCandidate<String>> rmtCands = 
entry.remoteMvccSnapshot();
+        Collection<GridCacheMvccCandidate> rmtCands = 
entry.remoteMvccSnapshot();
 
         assert rmtCands.size() == 3;
 
@@ -315,7 +315,7 @@ public class GridCacheMvccPartitionedSelfTest extends 
GridCommonAbstractTest {
 
         int i = 0;
 
-        for (GridCacheMvccCandidate<String> cand : rmtCands) {
+        for (GridCacheMvccCandidate cand : rmtCands) {
             assert cand == candArr[i] : "Invalid candidate in position " + i;
 
             i++;
@@ -330,7 +330,7 @@ public class GridCacheMvccPartitionedSelfTest extends 
GridCommonAbstractTest {
     public void testAddPendingRemote2() throws Exception {
         GridCacheAdapter<String, String> cache = grid.internalCache();
 
-        GridCacheTestEntryEx<String, String> entry = new 
GridCacheTestEntryEx<>(cache.context(), "1");
+        GridCacheTestEntryEx entry = new GridCacheTestEntryEx(cache.context(), 
"1");
 
         UUID node1 = UUID.randomUUID();
 
@@ -339,19 +339,19 @@ public class GridCacheMvccPartitionedSelfTest extends 
GridCommonAbstractTest {
         GridCacheVersion ver2 = version(2);
         GridCacheVersion ver3 = version(3);
 
-        GridCacheMvccCandidate<String> c3 = entry.addNearLocal(node1, 1, ver3, 
0, true);
+        GridCacheMvccCandidate c3 = entry.addNearLocal(node1, 1, ver3, 0, 
true);
         entry.addNearLocal(node1, 1, ver2, 0, true);
 
         entry.readyNearLocal(ver3, ver3, empty(), empty(), Arrays.asList(ver0, 
ver1, ver2));
 
-        GridCacheMvccCandidate<String> c1 = entry.addRemote(node1, 1, ver1, 0, 
false, true);
-        GridCacheMvccCandidate<String> c0 = entry.addRemote(node1, 1, ver0, 0, 
false, true);
+        GridCacheMvccCandidate c1 = entry.addRemote(node1, 1, ver1, 0, false, 
true);
+        GridCacheMvccCandidate c0 = entry.addRemote(node1, 1, ver0, 0, false, 
true);
 
-        Collection<GridCacheMvccCandidate<String>> rmtCands = 
entry.remoteMvccSnapshot();
+        Collection<GridCacheMvccCandidate> rmtCands = 
entry.remoteMvccSnapshot();
 
         assertEquals(2, rmtCands.size());
 
-        Collection<GridCacheMvccCandidate<String>> nearLocCands = 
entry.localCandidates();
+        Collection<GridCacheMvccCandidate> nearLocCands = 
entry.localCandidates();
 
         assertEquals(2, nearLocCands.size());
 
@@ -359,7 +359,7 @@ public class GridCacheMvccPartitionedSelfTest extends 
GridCommonAbstractTest {
 
         int i = 0;
 
-        for (GridCacheMvccCandidate<String> cand : rmtCands) {
+        for (GridCacheMvccCandidate cand : rmtCands) {
             assert cand == candArr[i] : "Invalid candidate in position " + i;
 
             i++;
@@ -374,7 +374,7 @@ public class GridCacheMvccPartitionedSelfTest extends 
GridCommonAbstractTest {
     public void testSalvageRemote() {
         GridCacheAdapter<String, String> cache = grid.internalCache();
 
-        GridCacheTestEntryEx<String, String> entry = new 
GridCacheTestEntryEx<>(cache.context(), "1");
+        GridCacheTestEntryEx entry = new GridCacheTestEntryEx(cache.context(), 
"1");
 
         UUID node1 = UUID.randomUUID();
 
@@ -387,17 +387,17 @@ public class GridCacheMvccPartitionedSelfTest extends 
GridCommonAbstractTest {
 
         entry.addRemote(node1, 1, ver1, 0, false, true);
         entry.addRemote(node1, 1, ver2, 0, false, true);
-        GridCacheMvccCandidate<String> c3 = entry.addNearLocal(node1, 1, ver3, 
0, true);
-        GridCacheMvccCandidate<String> c4 = entry.addRemote(node1, 1, ver4, 0, 
false, true);
+        GridCacheMvccCandidate c3 = entry.addNearLocal(node1, 1, ver3, 0, 
true);
+        GridCacheMvccCandidate c4 = entry.addRemote(node1, 1, ver4, 0, false, 
true);
         entry.addRemote(node1, 1, ver5, 0, false, true);
         entry.addRemote(node1, 1, ver6, 0, false, true);
 
-        Collection<GridCacheMvccCandidate<String>> rmtCands = 
entry.remoteMvccSnapshot();
+        Collection<GridCacheMvccCandidate> rmtCands = 
entry.remoteMvccSnapshot();
 
         assertEquals(5, rmtCands.size());
         assertEquals(ver1, rmtCands.iterator().next().version());
 
-        Collection<GridCacheMvccCandidate<String>> nearLocCands = 
entry.localCandidates();
+        Collection<GridCacheMvccCandidate> nearLocCands = 
entry.localCandidates();
 
         assertEquals(1, nearLocCands.size());
         assertEquals(ver3, nearLocCands.iterator().next().version());
@@ -408,7 +408,7 @@ public class GridCacheMvccPartitionedSelfTest extends 
GridCommonAbstractTest {
 
         boolean before = true;
 
-        for (GridCacheMvccCandidate<String> cand : rmtCands) {
+        for (GridCacheMvccCandidate cand : rmtCands) {
             if (cand == c4) {
                 before = false;
 
@@ -432,7 +432,7 @@ public class GridCacheMvccPartitionedSelfTest extends 
GridCommonAbstractTest {
     public void testNearRemoteConsistentOrdering0() throws Exception {
         GridCacheAdapter<String, String> cache = grid.internalCache();
 
-        GridCacheTestEntryEx<String, String> entry = new 
GridCacheTestEntryEx<>(cache.context(), "1");
+        GridCacheTestEntryEx entry = new GridCacheTestEntryEx(cache.context(), 
"1");
 
         UUID node1 = UUID.randomUUID();
 
@@ -445,8 +445,8 @@ public class GridCacheMvccPartitionedSelfTest extends 
GridCommonAbstractTest {
         entry.addNearLocal(node1, 1, nearVer2, 0, true);
         entry.addRemote(node1, 1, ver3, 0, false, true);
 
-        Collection<GridCacheMvccCandidate<String>> rmtCands = 
entry.remoteMvccSnapshot();
-        Collection<GridCacheMvccCandidate<String>> nearLocCands = 
entry.localCandidates();
+        Collection<GridCacheMvccCandidate> rmtCands = 
entry.remoteMvccSnapshot();
+        Collection<GridCacheMvccCandidate> nearLocCands = 
entry.localCandidates();
 
         assertEquals(1, nearLocCands.size());
         assertEquals(nearVer2, nearLocCands.iterator().next().version());
@@ -470,7 +470,7 @@ public class GridCacheMvccPartitionedSelfTest extends 
GridCommonAbstractTest {
     public void testNearRemoteConsistentOrdering1() throws Exception {
         GridCacheAdapter<String, String> cache = grid.internalCache();
 
-        GridCacheTestEntryEx<String, String> entry = new 
GridCacheTestEntryEx<>(cache.context(), "1");
+        GridCacheTestEntryEx entry = new GridCacheTestEntryEx(cache.context(), 
"1");
 
         UUID node1 = UUID.randomUUID();
 
@@ -483,8 +483,8 @@ public class GridCacheMvccPartitionedSelfTest extends 
GridCommonAbstractTest {
         entry.addNearLocal(node1, 1, nearVer2, 0, true);
         entry.addRemote(node1, 1, ver3, 0, false, true);
 
-        Collection<GridCacheMvccCandidate<String>> rmtCands = 
entry.remoteMvccSnapshot();
-        Collection<GridCacheMvccCandidate<String>> nearLocCands = 
entry.localCandidates();
+        Collection<GridCacheMvccCandidate> rmtCands = 
entry.remoteMvccSnapshot();
+        Collection<GridCacheMvccCandidate> nearLocCands = 
entry.localCandidates();
 
         assertEquals(1, nearLocCands.size());
         assertEquals(nearVer2, nearLocCands.iterator().next().version());
@@ -502,7 +502,7 @@ public class GridCacheMvccPartitionedSelfTest extends 
GridCommonAbstractTest {
         assertEquals(ver3, rmtCands.iterator().next().version());
         assertTrue(rmtCands.iterator().next().owner());
 
-        GridCacheMvccCandidate<String> cand = nearLocCands.iterator().next();
+        GridCacheMvccCandidate cand = nearLocCands.iterator().next();
 
         assertTrue(cand.ready());
         assertFalse(cand.owner());
@@ -515,7 +515,7 @@ public class GridCacheMvccPartitionedSelfTest extends 
GridCommonAbstractTest {
     public void testNearRemoteConsistentOrdering2() throws Exception {
         GridCacheAdapter<String, String> cache = grid.internalCache();
 
-        GridCacheTestEntryEx<String, String> entry = new 
GridCacheTestEntryEx<>(cache.context(), "1");
+        GridCacheTestEntryEx entry = new GridCacheTestEntryEx(cache.context(), 
"1");
 
         UUID node1 = UUID.randomUUID();
 
@@ -528,8 +528,8 @@ public class GridCacheMvccPartitionedSelfTest extends 
GridCommonAbstractTest {
         entry.addNearLocal(node1, 1, nearVer2, 0, true);
         entry.addRemote(node1, 1, ver3, 0, false, true);
 
-        Collection<GridCacheMvccCandidate<String>> rmtCands = 
entry.remoteMvccSnapshot();
-        Collection<GridCacheMvccCandidate<String>> nearLocCands = 
entry.localCandidates();
+        Collection<GridCacheMvccCandidate> rmtCands = 
entry.remoteMvccSnapshot();
+        Collection<GridCacheMvccCandidate> nearLocCands = 
entry.localCandidates();
 
         assertEquals(1, nearLocCands.size());
         assertEquals(nearVer2, nearLocCands.iterator().next().version());
@@ -547,7 +547,7 @@ public class GridCacheMvccPartitionedSelfTest extends 
GridCommonAbstractTest {
         assertEquals(ver1, rmtCands.iterator().next().version());
         assertTrue(rmtCands.iterator().next().owner());
 
-        GridCacheMvccCandidate<String> cand = nearLocCands.iterator().next();
+        GridCacheMvccCandidate cand = nearLocCands.iterator().next();
 
         assertTrue(cand.ready());
         assertFalse(cand.used());
@@ -560,7 +560,7 @@ public class GridCacheMvccPartitionedSelfTest extends 
GridCommonAbstractTest {
     public void testNearRemoteConsistentOrdering3() throws Exception {
         GridCacheAdapter<String, String> cache = grid.internalCache();
 
-        GridCacheTestEntryEx<String, String> entry = new 
GridCacheTestEntryEx<>(cache.context(), "1");
+        GridCacheTestEntryEx entry = new GridCacheTestEntryEx(cache.context(), 
"1");
 
         UUID node1 = UUID.randomUUID();
 
@@ -573,8 +573,8 @@ public class GridCacheMvccPartitionedSelfTest extends 
GridCommonAbstractTest {
         entry.addNearLocal(node1, 1, nearVer2, 0, true);
         entry.addRemote(node1, 1, ver3, 0, false, true);
 
-        Collection<GridCacheMvccCandidate<String>> rmtCands = 
entry.remoteMvccSnapshot();
-        Collection<GridCacheMvccCandidate<String>> nearLocCands = 
entry.localCandidates();
+        Collection<GridCacheMvccCandidate> rmtCands = 
entry.remoteMvccSnapshot();
+        Collection<GridCacheMvccCandidate> nearLocCands = 
entry.localCandidates();
 
         assertEquals(1, nearLocCands.size());
         assertEquals(nearVer2, nearLocCands.iterator().next().version());
@@ -619,7 +619,7 @@ public class GridCacheMvccPartitionedSelfTest extends 
GridCommonAbstractTest {
      * @param ver Cache version.
      * @param reentry Reentry flag.
      */
-    private void checkLocalOwner(GridCacheMvccCandidate<String> cand, 
GridCacheVersion ver, boolean reentry) {
+    private void checkLocalOwner(GridCacheMvccCandidate cand, GridCacheVersion 
ver, boolean reentry) {
         assert cand != null;
 
         info("Done candidate: " + cand);
@@ -642,7 +642,7 @@ public class GridCacheMvccPartitionedSelfTest extends 
GridCommonAbstractTest {
      * @param owner Owner flag.
      * @param used Done flag.
      */
-    private void checkRemote(GridCacheMvccCandidate<String> cand, 
GridCacheVersion ver, boolean owner, boolean used) {
+    private void checkRemote(GridCacheMvccCandidate cand, GridCacheVersion 
ver, boolean owner, boolean used) {
         assert cand != null;
 
         info("Done candidate: " + cand);
@@ -667,7 +667,7 @@ public class GridCacheMvccPartitionedSelfTest extends 
GridCommonAbstractTest {
      * @param owner Lock owner.
      * @param reentry Reentry flag.
      */
-    private void checkLocal(GridCacheMvccCandidate<String> cand, 
GridCacheVersion ver, boolean ready,
+    private void checkLocal(GridCacheMvccCandidate cand, GridCacheVersion ver, 
boolean ready,
         boolean owner, boolean reentry) {
         assert cand != null;
 

Reply via email to