Skip to content

FAIL_ON_NULL_FOR_PRIMITIVES not working with AfterburnerModule #35

@Qnzvna

Description

@Qnzvna

Hi,
I've tried to used AfterburnerModule with Jackson DeserializationFeature.FAIL_ON_NULL_FOR_PRIMITIVES but it look like it doesn't work for long and int primitives. Double works fine.

Here is the code scratch to reproduce the problem.

class Test
{
    public static void main(String[] args)
    {
        final ObjectMapper mapper = new ObjectMapper()
                .registerModule(new AfterburnerModule())
                .enable(DeserializationFeature.FAIL_ON_NULL_FOR_PRIMITIVES);
        try {
            final LongWrapper longWrapper = mapper.readValue("{\"value\": null}", LongWrapper.class);
            System.out.println(longWrapper);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    static class LongWrapper
    {
        public long value;
    }
}

I'm using Jackson 2.9.1 with Dropwizard 1.2.0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions