Projects >> jackson-databind >>85f4bafb73b876a58919164cb4926b633e69725c

Chunk
Conflicting content
        assertEquals("{\"a\":3}", singleJson);
        // then lists
        List result = r.withType(List.class).readValue(quote(""));
        assertNull(result);
    }
<<<<<<< HEAD
=======

    // 24-May-2012, tatu: Comment out for 2.0.x to keep tests green; leave for 2.1 to fix
    
    /*
    // [JACKSON-822]: ensure that type can be coerced
    public void testTypedLists() throws Exception
    {
        ObjectMapper mapper = new ObjectMapper();
        List list = new ArrayList();
        String singleJson = mapper.writerWithType(Issue822Interface.class).writeValueAsString(new Issue822Impl());
        // start with specific value case:
        list.add(new Issue822Impl());
        String listJson = mapper.writerWithType(new TypeReference>(){})
                .writeValueAsString(list);
        assertEquals("[{\"a\":3}]", listJson);
    }

    // [JACKSON-822]: ensure that type can be coerced
    public void testTypedArrays() throws Exception
    {
        ObjectMapper mapper = new ObjectMapper();
        assertEquals("[{\"a\":3}]", mapper.writerWithType(Issue822Interface[].class).writeValueAsString(
                new Issue822Interface[] { new Issue822Impl() }));
    }
    */
>>>>>>> dc65cc043479dd03dad878b22a9e5864e2e53bd7
}
Solution content
        List result = r.withType(List.class).readValue(quote(""));
        assertNull(result);
    }

    // [JACKSON-822]: ensure that type can be coerced
    public void testTypedLists() throws Exception
    {
        ObjectMapper mapper = new ObjectMapper();
        List list = new ArrayList();
        String singleJson = mapper.writerWithType(Issue822Interface.class).writeValueAsString(new Issue822Impl());
        // start with specific value case:
        assertEquals("{\"a\":3}", singleJson);
        // then lists
        list.add(new Issue822Impl());
        String listJson = mapper.writerWithType(new TypeReference>(){})
                .writeValueAsString(list);
        assertEquals("[{\"a\":3}]", listJson);
    }

    // [JACKSON-822]: ensure that type can be coerced
    public void testTypedArrays() throws Exception
    {
        ObjectMapper mapper = new ObjectMapper();
        assertEquals("[{\"a\":3}]", mapper.writerWithType(Issue822Interface[].class).writeValueAsString(
                new Issue822Interface[] { new Issue822Impl() }));
    }
}
File
TestCollectionDeserialization.java
Developer's decision
Combination
Kind of conflict
Comment