Skip to content

NPE In TypeFactory. constructParametricType(...) #1725

@ctytgat

Description

@ctytgat

Used version: 2.9.0

We've got some code that executes:

new ObjectMapper().getTypeFactory().constructParametricType(List.class, HashMap.class);

This throws a NPE, depending on whether or not the type info is cached. Can easily be reproduced by executing just this statement.

Exception in thread "main" java.lang.NullPointerException
	at com.fasterxml.jackson.databind.type.TypeFactory._fromVariable(TypeFactory.java:1455)
	at com.fasterxml.jackson.databind.type.TypeFactory._fromAny(TypeFactory.java:1216)
	at com.fasterxml.jackson.databind.type.TypeFactory._fromParamType(TypeFactory.java:1438)
	at com.fasterxml.jackson.databind.type.TypeFactory._fromAny(TypeFactory.java:1206)
	at com.fasterxml.jackson.databind.type.TypeFactory._resolveSuperClass(TypeFactory.java:1339)
	at com.fasterxml.jackson.databind.type.TypeFactory._fromClass(TypeFactory.java:1298)
	at com.fasterxml.jackson.databind.type.TypeFactory.constructParametricType(TypeFactory.java:931)
	at be.awv.abbamelda.eminfra.application.atomium.DomainEventFeedPageCodec.main(DomainEventFeedPageCodec.java:119)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions