Iv'e managed to refactor a large portion of the class. About a 1/3 of the (repetitious) code was removed.
On Tue, Feb 6, 2018 at 1:08 AM, Nir Lisker <nlis...@gmail.com> wrote: > Hi, > > I was looking at https://bugs.openjdk.java.net/browse/JDK-8089579, which > prompted me to have a look at When. There are a few points I would like to > address: > > * StringConditionBuilder#otherwise(ObservableStringValue) does not check > for null as other condition builders do. This results in a deeper NPE > when StringCondition tries to register a listener to the > ObservableStringValue. > > * I would like a (re)evaluation on the above bug ticket and thoughts on > the proposal of "on demand evaluation" using a Supplier or a similar > method. The behavior of the intended implementation would be to evaluate > 'then' and 'otherwise' whenever their condition is met, and only then. > > * The class can benefit from some small refactoring, such as using > Objects.requireNonNull for null checks and some code reuse to reduce the > chance of bugs such as the missing null check of StringConditionBuilder. > > * There are a few Javadoc corrections and some clarifications of the > current behavior could be beneficial as well. > > I can work on all of the above. How to proceed? > > - Nir >