ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [12/50] [abbrv] incubator-ignite git commit: ignite-sprint-3 - portable class fix
Date Tue, 07 Apr 2015 09:35:10 GMT
ignite-sprint-3 - portable class fix


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/a7ba0bea
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/a7ba0bea
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/a7ba0bea

Branch: refs/heads/ignite-684
Commit: a7ba0bea463648031bb7b2afb626a63ef2215f96
Parents: 5421701
Author: S.Vladykin <svladykin@gridgain.com>
Authored: Mon Apr 6 15:55:21 2015 +0300
Committer: S.Vladykin <svladykin@gridgain.com>
Committed: Mon Apr 6 15:55:21 2015 +0300

----------------------------------------------------------------------
 .../ignite/internal/processors/query/GridQueryProcessor.java | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a7ba0bea/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
index ba8479f..0ea0b99 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
@@ -402,7 +402,9 @@ public class GridQueryProcessor extends GridProcessorAdapter {
 
             TypeId id;
 
-            if (ctx.cacheObjects().isPortableObject(val)) {
+            boolean portableVal = ctx.cacheObjects().isPortableObject(val);
+
+            if (portableVal) {
                 int typeId = ctx.cacheObjects().typeId(val);
 
                 id = new TypeId(space, typeId);
@@ -415,12 +417,12 @@ public class GridQueryProcessor extends GridProcessorAdapter {
             if (desc == null || !desc.registered())
                 return;
 
-            if (!desc.valueClass().isAssignableFrom(valCls))
+            if (!portableVal && !desc.valueClass().isAssignableFrom(valCls))
                 throw new IgniteCheckedException("Failed to update index due to class name
conflict" +
                     "(multiple classes with same simple name are stored in the same cache)
" +
                     "[expCls=" + desc.valueClass().getName() + ", actualCls=" + valCls.getName()
+ ']');
 
-            if (!desc.keyClass().isAssignableFrom(key.getClass()))
+            if (!ctx.cacheObjects().isPortableObject(key) && !desc.keyClass().isAssignableFrom(key.getClass()))
                 throw new IgniteCheckedException("Failed to update index, incorrect key class
[expCls=" +
                     desc.keyClass().getName() + ", actualCls=" + key.getClass().getName()
+ "]");
 


Mime
View raw message