ignite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Denis Magda (JIRA)" <j...@apache.org>
Subject [jira] [Created] (IGNITE-2430) BinaryObject: Inconsistent field type name is returned for Collections
Date Thu, 21 Jan 2016 15:53:40 GMT
Denis Magda created IGNITE-2430:
-----------------------------------

             Summary: BinaryObject: Inconsistent field type name is returned for Collections
                 Key: IGNITE-2430
                 URL: https://issues.apache.org/jira/browse/IGNITE-2430
             Project: Ignite
          Issue Type: Bug
    Affects Versions: 1.5
            Reporter: Denis Magda
             Fix For: 1.6


Run this code below and you will see that different field type name is returned for objects
of the same type. There is a bug in {{BinaryObjectBuilderImpl.serializeTo}} method.

{noformat}
        BinaryObjectBuilder root = ignite.binary().builder("some_objects");
        root.setField("bi", new BigInteger(String.valueOf(Long.MAX_VALUE) + "1"), BigInteger.class);
        root.setField("bd", new BigDecimal(String.valueOf(Long.MAX_VALUE) + "1.1"), BigDecimal.class);

        List<Integer> list = new ArrayList<>();
        list.add(Integer.MAX_VALUE);

        root.setField("l", list); //<- here: Collection
        root.setField("al", Arrays.<Integer>asList(Integer.MAX_VALUE)); //<- here:
Object

        BinaryObject binaryObject = root.build();

        System.out.println(binaryObject.type().fieldTypeName("l"));
        System.out.println(binaryObject.type().fieldTypeName("al"));
{noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message