This Bug was intruduced in #139 to fix #134, but the code suggested in #134 was not entirely correct.
When building a Pojo with an optional Property like this:
public class Pojo {
public Pojo(Optional<Integer> myInt) {
// ...
}
}
the constructor/factory method should be called with null if and only if PojoBuilder.withMyInt((Integer) null) or PojoBuilder.withMyInt((Optional<Integer>) null) was called.
As of version 4.0.0 the constructor/factory method is also called with null if myInt was never specified. This is a bug, because it should be set to Optional.absent() instead.
This causes the bug.
This Bug was intruduced in #139 to fix #134, but the code suggested in #134 was not entirely correct. When building a Pojo with an optional Property like this:
the constructor/factory method should be called with
null
if and only ifPojoBuilder.withMyInt((Integer) null)
orPojoBuilder.withMyInt((Optional<Integer>) null)
was called. As of version 4.0.0 the constructor/factory method is also called withnull
ifmyInt
was never specified. This is a bug, because it should be set toOptional.absent()
instead. This causes the bug.