<div dir="ltr"><div><div><div><div><div>Hi,<br><br></div>We are refining the value extraction work and one of the remaining tasks is to throw a proper exception if we have ValueExtractors defined in parallel hierarchies for a given type.<br><br></div>This led to discovering the below issue with the JavaFX collection types.<br><br></div>Let&#39;s take the ListProperty example (we have the same issue with Set and Map): ListProperty inherits from ObservableValue and from List.<br><br></div>For now, it uses (by chance) the ObservableValue extractor which unwraps the value by default. So basically:<br></div>@NotNull<br><div>private ListProperty&lt;String&gt; listProperty = new ReadOnlyListWrapper&lt;String&gt;( null );<br></div><div>will return a violation.<br><br></div><div>With the new conflict detection, it will throw an exception as it&#39;s unable to find ONE most specific ValueExtractor as there are 2 valid candidates: ObservableValueValueExtractor and ListValueExtractor.<br></div><div><br>If we want to solve the conflict, we need to introduce a specific ValueExtractor for ListProperty and decide of its behavior.<br><br></div><div>We have 2 possibilities:<br></div><div>1/ consider ListProperty as an ObservableValue and thus simply unwrap the list and validate the constraint against the list. In the above example, @NotNull would then apply to the inner list. Same behavior as explained above.<br></div><div>2/ consider ListProperty as a List. Thus the value extractor would iterate over the element of the list. In the above case, it won&#39;t return a violation. In the below example, the @NotNull would refer to listProperty itself and the constraints on the elements of the list would be validated:<br>@NotNull<br>private ListProperty&lt;@Size(min = 3) String&gt; listProperty = new ReadOnlyListWrapper&lt;String&gt;( null );<br><br></div><div>Gunnar and I are in favor of 2/ but it changes the current behavior as the @NotNull would refer to the container instead of referring to the wrapped value.<br><br></div><div>We would really like to have some feedback from people using JavaFX.<br><br></div><div>Thanks!<br><br>-- <br></div><div>Guillaume<br></div></div>