ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [13/30] ignite git commit: ignite-1353: fixed type resolving conflicts between predefined and user types
Date Thu, 03 Sep 2015 11:13:34 GMT
ignite-1353: fixed type resolving conflicts between predefined and user types


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

Branch: refs/heads/ignite-1353
Commit: c1d60ad1644482992490146f768479d601b2d197
Parents: da29a70
Author: Denis Magda <dmagda@gridgain.com>
Authored: Wed Sep 2 16:32:08 2015 +0300
Committer: Denis Magda <dmagda@gridgain.com>
Committed: Wed Sep 2 16:32:08 2015 +0300

----------------------------------------------------------------------
 .../portable/PortableClassDescriptor.java       |  2 +-
 .../internal/portable/PortableContext.java      | 68 ++++++++++++------
 .../GridPortableMarshallerSelfTest.java         | 74 ++++++++++++++------
 .../portable/GridPortableWildcardsSelfTest.java | 60 ++++++++--------
 4 files changed, 129 insertions(+), 75 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/c1d60ad1/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableClassDescriptor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableClassDescriptor.java
b/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableClassDescriptor.java
index 7e4266c..bc4e0b2 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableClassDescriptor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableClassDescriptor.java
@@ -313,7 +313,7 @@ class PortableClassDescriptor {
     /**
      * @return Whether typeId has been successfully registered by MarshallerContext or not.
      */
-    public boolean isRegistered() {
+    public boolean registered() {
         return registered;
     }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/c1d60ad1/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableContext.java
b/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableContext.java
index 15b6433..71b52ef 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableContext.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableContext.java
@@ -115,6 +115,9 @@ public class PortableContext implements Externalizable {
     private final Set<Class> predefinedClasses = new HashSet<>();
 
     /** */
+    private final Map<String, Integer> predefinedTypeNames = new HashMap<>();
+
+    /** */
     private final Map<Class<? extends Collection>, Byte> colTypes = new HashMap<>();
 
     /** */
@@ -432,7 +435,7 @@ public class PortableContext implements Externalizable {
 
         PortableClassDescriptor desc = descByCls.get(cls);
 
-        if (desc == null || !desc.isRegistered())
+        if (desc == null || !desc.registered())
             desc = registerClassDescriptor(cls);
 
         return desc;
@@ -447,7 +450,16 @@ public class PortableContext implements Externalizable {
     public PortableClassDescriptor descriptorForTypeId(boolean userType, int typeId, ClassLoader
ldr) {
         assert typeId != GridPortableMarshaller.UNREGISTERED_TYPE_ID;
 
-        PortableClassDescriptor desc = userType ? userTypes.get(typeId) : predefinedTypes.get(typeId);
+        //TODO: IGNITE-1358 (uncomment when fixed)
+        //PortableClassDescriptor desc = userType ? userTypes.get(typeId) : predefinedTypes.get(typeId);
+
+        // As a workaround for IGNITE-1358 we always check the predefined map before.
+        PortableClassDescriptor desc = predefinedTypes.get(typeId);
+
+        if (desc != null)
+            return desc;
+
+        desc = userTypes.get(typeId);
 
         if (desc != null)
             return desc;
@@ -529,7 +541,8 @@ public class PortableContext implements Externalizable {
         try {
             registered = marshCtx.registerClass(typeId, cls);
 
-        } catch (IgniteCheckedException e) {
+        }
+        catch (IgniteCheckedException e) {
             throw new PortableException("Failed to register class.", e);
         }
 
@@ -584,18 +597,17 @@ public class PortableContext implements Externalizable {
      * @return Type ID.
      */
     public int typeId(String typeName) {
-        int id;
+        String shortTypeName = typeName(typeName);
 
-        if (marshCtx.isSystemType(typeName))
-            id = typeName.hashCode();
+        Integer id = predefinedTypeNames.get(shortTypeName);
 
-        else {
-            typeName = typeName(typeName);
+        if (id != null)
+            return id;
 
-            id = idMapper(typeName).typeId(typeName);
-        }
+        if (marshCtx.isSystemType(typeName))
+            return typeName.hashCode();
 
-        return id;
+        return idMapper(shortTypeName).typeId(shortTypeName);
     }
 
     /**
@@ -606,21 +618,21 @@ public class PortableContext implements Externalizable {
     public Type typeId(Class cls) throws PortableException {
         String clsName = cls.getName();
 
+        if (predefinedClasses.contains(cls))
+            return new Type(descByCls.get(cls).typeId(), true);
+
         if (marshCtx.isSystemType(clsName))
             return new Type(clsName.hashCode(), true);
 
-        if (predefinedClasses.contains(cls))
-            return new Type(DFLT_ID_MAPPER.typeId(typeName(clsName)), true);
-
         PortableClassDescriptor desc = descByCls.get(cls);
 
-        boolean registered = desc != null && desc.isRegistered();
+        boolean registered = desc != null && desc.registered();
 
         if (!registered)
             // forces to register the class and fill up all required data structures
             desc = registerUserClassDescriptor(cls);
 
-        return new Type(desc.typeId(), desc.isRegistered());
+        return new Type(desc.typeId(), desc.registered());
     }
 
     /**
@@ -692,12 +704,14 @@ public class PortableContext implements Externalizable {
      * @return GridPortableClassDescriptor.
      */
     public PortableClassDescriptor registerPredefinedType(Class<?> cls, int id) {
+        String typeName = typeName(cls.getName());
+
         PortableClassDescriptor desc = new PortableClassDescriptor(
             this,
             cls,
             false,
             id,
-            typeName(cls.getName()),
+            typeName,
             DFLT_ID_MAPPER,
             null,
             false,
@@ -706,8 +720,9 @@ public class PortableContext implements Externalizable {
         );
 
         predefinedClasses.add(cls);
-
+        predefinedTypeNames.put(typeName, id);
         predefinedTypes.put(id, desc);
+
         descByCls.put(cls, desc);
 
         return desc;
@@ -745,6 +760,10 @@ public class PortableContext implements Externalizable {
 
         int id = idMapper.typeId(clsName);
 
+        //Workaround for IGNITE-1358
+        if (predefinedTypes.get(id) != null)
+            throw new PortableException("Duplicate type ID [clsName=" + clsName + ", id="
+ id + ']');
+
         if (mappers.put(id, idMapper) != null)
             throw new PortableException("Duplicate type ID [clsName=" + clsName + ", id="
+ id + ']');
 
@@ -977,6 +996,7 @@ public class PortableContext implements Externalizable {
             return lowerCaseHashCode(fieldName);
         }
     }
+
     /**
      * Type descriptors.
      */
@@ -1113,21 +1133,27 @@ public class PortableContext implements Externalizable {
      * Type id wrapper.
      */
     static class Type {
-        /** Type id*/
-        private int id;
+        /** Type id */
+        private final int id;
 
         /** Whether the following type is registered in a cache or not */
-        private boolean registered;
+        private final boolean registered;
 
         public Type(int id, boolean registered) {
             this.id = id;
             this.registered = registered;
         }
 
+        /**
+         * @return Type ID.
+         */
         public int id() {
             return id;
         }
 
+        /**
+         * @return Registered flag value.
+         */
         public boolean registered() {
             return registered;
         }

http://git-wip-us.apache.org/repos/asf/ignite/blob/c1d60ad1/modules/core/src/test/java/org/apache/ignite/internal/portable/GridPortableMarshallerSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/portable/GridPortableMarshallerSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/portable/GridPortableMarshallerSelfTest.java
index 11e316a..5d186c8 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/portable/GridPortableMarshallerSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/portable/GridPortableMarshallerSelfTest.java
@@ -17,6 +17,7 @@
 
 package org.apache.ignite.internal.portable;
 
+import java.lang.reflect.Field;
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.math.BigDecimal;
@@ -33,6 +34,7 @@ import java.util.HashSet;
 import java.util.LinkedHashMap;
 import java.util.LinkedHashSet;
 import java.util.Map;
+import java.util.Set;
 import java.util.TreeMap;
 import java.util.TreeSet;
 import java.util.UUID;
@@ -68,6 +70,7 @@ import sun.misc.Unsafe;
 
 import static org.apache.ignite.internal.portable.PortableThreadLocalMemoryAllocator.THREAD_LOCAL_ALLOC;
 import static org.junit.Assert.assertArrayEquals;
+import static org.junit.Assert.assertTrue;
 
 /**
  * Portable marshaller tests.
@@ -1183,7 +1186,7 @@ public class GridPortableMarshallerSelfTest extends GridCommonAbstractTest
{
 
         customType1.setIdMapper(new PortableIdMapper() {
             @Override public int typeId(String clsName) {
-                return 100;
+                return 300;
             }
 
             @Override public int fieldId(int typeId, String fieldName) {
@@ -1195,7 +1198,7 @@ public class GridPortableMarshallerSelfTest extends GridCommonAbstractTest
{
 
         customType2.setIdMapper(new PortableIdMapper() {
             @Override public int typeId(String clsName) {
-                return 200;
+                return 400;
             }
 
             @Override public int fieldId(int typeId, String fieldName) {
@@ -1207,7 +1210,7 @@ public class GridPortableMarshallerSelfTest extends GridCommonAbstractTest
{
 
         customType3.setIdMapper(new PortableIdMapper() {
             @Override public int typeId(String clsName) {
-                return 300;
+                return 500;
             }
 
             @Override public int fieldId(int typeId, String fieldName) {
@@ -1243,9 +1246,9 @@ public class GridPortableMarshallerSelfTest extends GridCommonAbstractTest
{
         assertEquals("key".hashCode(), ctx.typeId("Key"));
         assertEquals("nonexistentclass3".hashCode(), ctx.typeId("NonExistentClass3"));
         assertEquals("nonexistentclass4".hashCode(), ctx.typeId("NonExistentClass4"));
-        assertEquals(100, ctx.typeId(getClass().getSimpleName() + "$Value"));
-        assertEquals(200, ctx.typeId("NonExistentClass1"));
-        assertEquals(300, ctx.typeId("NonExistentClass2"));
+        assertEquals(300, ctx.typeId(getClass().getSimpleName() + "$Value"));
+        assertEquals(400, ctx.typeId("NonExistentClass1"));
+        assertEquals(500, ctx.typeId("NonExistentClass2"));
         assertEquals("nonexistentclass5".hashCode(), ctx.typeId("NonExistentClass5"));
     }
 
@@ -1259,16 +1262,16 @@ public class GridPortableMarshallerSelfTest extends GridCommonAbstractTest
{
 
         customType1.setIdMapper(new PortableIdMapper() {
             @Override public int typeId(String clsName) {
-                return 100;
+                return 300;
             }
 
             @Override public int fieldId(int typeId, String fieldName) {
                 switch (fieldName) {
                     case "val1":
-                        return 101;
+                        return 301;
 
                     case "val2":
-                        return 102;
+                        return 302;
 
                     default:
                         return 0;
@@ -1280,16 +1283,16 @@ public class GridPortableMarshallerSelfTest extends GridCommonAbstractTest
{
 
         customType2.setIdMapper(new PortableIdMapper() {
             @Override public int typeId(String clsName) {
-                return 200;
+                return 400;
             }
 
             @Override public int fieldId(int typeId, String fieldName) {
                 switch (fieldName) {
                     case "val1":
-                        return 201;
+                        return 401;
 
                     case "val2":
-                        return 202;
+                        return 402;
 
                     default:
                         return 0;
@@ -1307,12 +1310,12 @@ public class GridPortableMarshallerSelfTest extends GridCommonAbstractTest
{
         assertEquals("val".hashCode(), ctx.fieldId("key".hashCode(), "val"));
         assertEquals("val".hashCode(), ctx.fieldId("nonexistentclass2".hashCode(), "val"));
         assertEquals("val".hashCode(), ctx.fieldId("notconfiguredclass".hashCode(), "val"));
-        assertEquals(101, ctx.fieldId(100, "val1"));
-        assertEquals(102, ctx.fieldId(100, "val2"));
-        assertEquals("val3".hashCode(), ctx.fieldId(100, "val3"));
-        assertEquals(201, ctx.fieldId(200, "val1"));
-        assertEquals(202, ctx.fieldId(200, "val2"));
-        assertEquals("val3".hashCode(), ctx.fieldId(200, "val3"));
+        assertEquals(301, ctx.fieldId(300, "val1"));
+        assertEquals(302, ctx.fieldId(300, "val2"));
+        assertEquals("val3".hashCode(), ctx.fieldId(300, "val3"));
+        assertEquals(401, ctx.fieldId(400, "val1"));
+        assertEquals(402, ctx.fieldId(400, "val2"));
+        assertEquals("val3".hashCode(), ctx.fieldId(400, "val3"));
     }
 
     /**
@@ -1547,11 +1550,11 @@ public class GridPortableMarshallerSelfTest extends GridCommonAbstractTest
{
 
         PortableObject copy = copy(po, F.<String, Object>asMap("bArr", new byte[]{1,
2, 3}));
 
-        assertArrayEquals(new byte[]{1, 2, 3}, copy.<byte[]>field("bArr"));
+        assertArrayEquals(new byte[] {1, 2, 3}, copy.<byte[]>field("bArr"));
 
         SimpleObject obj0 = copy.deserialize();
 
-        assertArrayEquals(new byte[]{1, 2, 3}, obj0.bArr);
+        assertArrayEquals(new byte[] {1, 2, 3}, obj0.bArr);
     }
 
     /**
@@ -1796,7 +1799,7 @@ public class GridPortableMarshallerSelfTest extends GridCommonAbstractTest
{
 
         assertEquals("str555", obj0.str);
         assertEquals(newObj, obj0.inner);
-        assertArrayEquals(new byte[]{6, 7, 9}, obj0.bArr);
+        assertArrayEquals(new byte[] {6, 7, 9}, obj0.bArr);
     }
 
     /**
@@ -1832,7 +1835,7 @@ public class GridPortableMarshallerSelfTest extends GridCommonAbstractTest
{
         assertEquals("str555", copy.<String>field("str"));
         assertEquals(newObj, copy.<PortableObject>field("inner").deserialize());
         assertEquals((short)2323, copy.<Short>field("s").shortValue());
-        assertArrayEquals(new byte[]{6, 7, 9}, copy.<byte[]>field("bArr"));
+        assertArrayEquals(new byte[] {6, 7, 9}, copy.<byte[]>field("bArr"));
         assertEquals((byte)111, copy.<Byte>field("b").byteValue());
 
         SimpleObject obj0 = copy.deserialize();
@@ -1841,7 +1844,7 @@ public class GridPortableMarshallerSelfTest extends GridCommonAbstractTest
{
         assertEquals("str555", obj0.str);
         assertEquals(newObj, obj0.inner);
         assertEquals((short)2323, obj0.s);
-        assertArrayEquals(new byte[]{6, 7, 9}, obj0.bArr);
+        assertArrayEquals(new byte[] {6, 7, 9}, obj0.bArr);
         assertEquals((byte)111, obj0.b);
     }
 
@@ -2239,6 +2242,31 @@ public class GridPortableMarshallerSelfTest extends GridCommonAbstractTest
{
     }
 
     /**
+     * @throws Exception If failed.
+     */
+    public void testPredefinedTypeIds() throws Exception {
+        PortableMarshaller marsh = new PortableMarshaller();
+
+        PortableContext pCtx = initPortableContext(marsh);
+
+        Field field = pCtx.getClass().getDeclaredField("predefinedClasses");
+
+        field.setAccessible(true);
+
+        Set<Class> value = (Set<Class>)field.get(pCtx);
+
+        assertTrue(value.size() > 0);
+
+        for (Class pCls : value) {
+            PortableClassDescriptor desc = pCtx.descriptorForClass(pCls);
+
+            assertEquals(desc.typeId(), pCtx.typeId(pCls).id());
+            assertEquals(desc.typeId(), pCtx.typeId(pCls.getName()));
+            assertEquals(desc.typeId(), pCtx.typeId(pCtx.typeName(pCls.getName())));
+        }
+    }
+
+    /**
      *
      */
     private static class ObjectWithClassFields {

http://git-wip-us.apache.org/repos/asf/ignite/blob/c1d60ad1/modules/core/src/test/java/org/apache/ignite/internal/portable/GridPortableWildcardsSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/portable/GridPortableWildcardsSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/portable/GridPortableWildcardsSelfTest.java
index 95dfbe8..349f152 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/portable/GridPortableWildcardsSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/portable/GridPortableWildcardsSelfTest.java
@@ -95,11 +95,11 @@ public class GridPortableWildcardsSelfTest extends GridCommonAbstractTest
{
             @SuppressWarnings("IfMayBeConditional")
             @Override public int typeId(String clsName) {
                 if (clsName.endsWith("1"))
-                    return 100;
+                    return 300;
                 else if (clsName.endsWith("2"))
-                    return 200;
+                    return 400;
                 else if (clsName.endsWith("InnerClass"))
-                    return 300;
+                    return 500;
                 else
                     return -500;
             }
@@ -120,9 +120,9 @@ public class GridPortableWildcardsSelfTest extends GridCommonAbstractTest
{
 
         assertEquals(3, typeMappers.size());
 
-        assertEquals(100, typeMappers.get("GridPortableTestClass1").typeId("GridPortableTestClass1"));
-        assertEquals(200, typeMappers.get("GridPortableTestClass2").typeId("GridPortableTestClass2"));
-        assertEquals(300, typeMappers.get("InnerClass").typeId("InnerClass"));
+        assertEquals(300, typeMappers.get("GridPortableTestClass1").typeId("GridPortableTestClass1"));
+        assertEquals(400, typeMappers.get("GridPortableTestClass2").typeId("GridPortableTestClass2"));
+        assertEquals(500, typeMappers.get("InnerClass").typeId("InnerClass"));
     }
 
     /**
@@ -161,11 +161,11 @@ public class GridPortableWildcardsSelfTest extends GridCommonAbstractTest
{
             @SuppressWarnings("IfMayBeConditional")
             @Override public int typeId(String clsName) {
                 if (clsName.endsWith("1"))
-                    return 100;
+                    return 300;
                 else if (clsName.endsWith("2"))
-                    return 200;
+                    return 400;
                 else if (clsName.endsWith("InnerClass"))
-                    return 300;
+                    return 500;
                 else
                     return -500;
             }
@@ -186,9 +186,9 @@ public class GridPortableWildcardsSelfTest extends GridCommonAbstractTest
{
 
         assertEquals(3, typeMappers.size());
 
-        assertEquals(100, typeMappers.get("GridPortableTestClass1").typeId("GridPortableTestClass1"));
-        assertEquals(200, typeMappers.get("GridPortableTestClass2").typeId("GridPortableTestClass2"));
-        assertEquals(300, typeMappers.get("InnerClass").typeId("InnerClass"));
+        assertEquals(300, typeMappers.get("GridPortableTestClass1").typeId("GridPortableTestClass1"));
+        assertEquals(400, typeMappers.get("GridPortableTestClass2").typeId("GridPortableTestClass2"));
+        assertEquals(500, typeMappers.get("InnerClass").typeId("InnerClass"));
     }
 
     /**
@@ -203,11 +203,11 @@ public class GridPortableWildcardsSelfTest extends GridCommonAbstractTest
{
             @SuppressWarnings("IfMayBeConditional")
             @Override public int typeId(String clsName) {
                 if (clsName.endsWith("1"))
-                    return 100;
+                    return 300;
                 else if (clsName.endsWith("2"))
-                    return 200;
+                    return 400;
                 else if (clsName.endsWith("InnerClass"))
-                    return 300;
+                    return 500;
                 else
                     return -500;
             }
@@ -228,9 +228,9 @@ public class GridPortableWildcardsSelfTest extends GridCommonAbstractTest
{
 
         assertEquals(3, typeMappers.size());
 
-        assertEquals(100, typeMappers.get("GridPortableTestClass1").typeId("GridPortableTestClass1"));
-        assertEquals(200, typeMappers.get("GridPortableTestClass2").typeId("GridPortableTestClass2"));
-        assertEquals(300, typeMappers.get("InnerClass").typeId("InnerClass"));
+        assertEquals(300, typeMappers.get("GridPortableTestClass1").typeId("GridPortableTestClass1"));
+        assertEquals(400, typeMappers.get("GridPortableTestClass2").typeId("GridPortableTestClass2"));
+        assertEquals(500, typeMappers.get("InnerClass").typeId("InnerClass"));
     }
 
     /**
@@ -310,9 +310,9 @@ public class GridPortableWildcardsSelfTest extends GridCommonAbstractTest
{
             @SuppressWarnings("IfMayBeConditional")
             @Override public int typeId(String clsName) {
                 if (clsName.endsWith("1"))
-                    return 100;
+                    return 300;
                 else if (clsName.endsWith("2"))
-                    return 200;
+                    return 400;
                 else
                     return -500;
             }
@@ -333,8 +333,8 @@ public class GridPortableWildcardsSelfTest extends GridCommonAbstractTest
{
 
         assertEquals(3, typeMappers.size());
 
-        assertEquals(100, typeMappers.get("GridPortableTestClass1").typeId("GridPortableTestClass1"));
-        assertEquals(200, typeMappers.get("GridPortableTestClass2").typeId("GridPortableTestClass2"));
+        assertEquals(300, typeMappers.get("GridPortableTestClass1").typeId("GridPortableTestClass1"));
+        assertEquals(400, typeMappers.get("GridPortableTestClass2").typeId("GridPortableTestClass2"));
     }
 
     /**
@@ -372,9 +372,9 @@ public class GridPortableWildcardsSelfTest extends GridCommonAbstractTest
{
             @SuppressWarnings("IfMayBeConditional")
             @Override public int typeId(String clsName) {
                 if (clsName.endsWith("1"))
-                    return 100;
+                    return 300;
                 else if (clsName.endsWith("2"))
-                    return 200;
+                    return 400;
                 else
                     return -500;
             }
@@ -395,8 +395,8 @@ public class GridPortableWildcardsSelfTest extends GridCommonAbstractTest
{
 
         assertEquals(3, typeMappers.size());
 
-        assertEquals(100, typeMappers.get("GridPortableTestClass1").typeId("GridPortableTestClass1"));
-        assertEquals(200, typeMappers.get("GridPortableTestClass2").typeId("GridPortableTestClass2"));
+        assertEquals(300, typeMappers.get("GridPortableTestClass1").typeId("GridPortableTestClass1"));
+        assertEquals(400, typeMappers.get("GridPortableTestClass2").typeId("GridPortableTestClass2"));
     }
 
     /**
@@ -411,9 +411,9 @@ public class GridPortableWildcardsSelfTest extends GridCommonAbstractTest
{
             @SuppressWarnings("IfMayBeConditional")
             @Override public int typeId(String clsName) {
                 if (clsName.endsWith("1"))
-                    return 100;
+                    return 300;
                 else if (clsName.endsWith("2"))
-                    return 200;
+                    return 400;
                 else
                     return -500;
             }
@@ -434,8 +434,8 @@ public class GridPortableWildcardsSelfTest extends GridCommonAbstractTest
{
 
         assertEquals(3, typeMappers.size());
 
-        assertEquals(100, typeMappers.get("GridPortableTestClass1").typeId("GridPortableTestClass1"));
-        assertEquals(200, typeMappers.get("GridPortableTestClass2").typeId("GridPortableTestClass2"));
+        assertEquals(300, typeMappers.get("GridPortableTestClass1").typeId("GridPortableTestClass1"));
+        assertEquals(400, typeMappers.get("GridPortableTestClass2").typeId("GridPortableTestClass2"));
     }
 
     /**


Mime
View raw message