When using the JavaLocalDateToDateConversion we generate a code that looks like:
if ( as.getPromotionDate() != null ) {
article.setPromotionDate( java.time.LocalDateTime.ofInstant( as.getPromotionDate().toInstant(), ZoneOffset.UTC ).toLocalDate() );
}
The code should look like:
if ( as.getPromotionDate() != null ) {
article.setPromotionDate( LocalDateTime.ofInstant( as.getPromotionDate().toInstant(), ZoneOffset.UTC ).toLocalDate() );
}
The java.time.LocalDateTime is not necessary to be FQN, as it is the only LocalDateTime. The actual problem is that when Joda time is present than the Joda types are loaded in the Conversion which leads to them being part of the importedQualifiedTypesBySimpleName in our TypeFactory. Seems that we use the Type in the Conversion Key. However, looking into that code it seems that we can easily use the FQN of the types (without the need to load the Type).
I see 2 ways to solve this:
- Add a flag to the
TypeFactory to load a type without marking it as imported
- Use
String in the Conversion Key
When using the
JavaLocalDateToDateConversionwe generate a code that looks like:The code should look like:
The
java.time.LocalDateTimeis not necessary to be FQN, as it is the onlyLocalDateTime. The actual problem is that when Joda time is present than the Joda types are loaded in theConversionwhich leads to them being part of theimportedQualifiedTypesBySimpleNamein ourTypeFactory. Seems that we use theTypein the ConversionKey. However, looking into that code it seems that we can easily use the FQN of the types (without the need to load theType).I see 2 ways to solve this:
TypeFactoryto load a type without marking it as importedStringin the ConversionKey