modelmapper / modelmapper-module-java8

ModelMapper Module for Java8
Apache License 2.0
14 stars 15 forks source link

NPE using new Jsr310Module() #3

Closed gadton closed 4 years ago

gadton commented 5 years ago

Registering an instance of Jsr310Module using the default ctor results in a NPE during mapping from String to LocalDateTime as Jsr310ModuleConfig.dateTimePattern is null.

final FooDTO fooDto = new FooDTO();
fooDto.setBar( "2018-10-10 05:05:05" );
new ModelMapper().registerModule( new Jsr310Module() ).map( fooDto, Foo.class );

Passing a Jsr310ModuleConfig in the ctor explicitly using Jsr310ModuleConfig.builder().build() will solve the issue.

chhsiao90 commented 4 years ago

The issue was fixed in v1.2.0.