-
Bug
-
Resolution: Fixed
-
Neutral
-
5.4
-
-
Empty show more show less
-
Basel 11
-
8
SelectFieldOptionDefinition's implementation of compareTo is fishy, and assumes the label field is never null, when in fact it might be.
Example 1:
It was first encountered in UI tests when adding a page at root level (maybe since MGNLSTK-1500, instance with STK + templating-samples). Basically, if the TemplateDefinition has no title set, then the TemplateSelectorFieldFactory (in pages app) may set the SelectFieldOptionDefinition's label to null.
Note that super-factory SelectFieldFactory uses the value when label would otherwise be null. We may create a separate ticket to address that.
Example 2, Jan says:
you can run into it on creation of template when someone else is opening the selector ... so there is a race condition and we need to fix it in comparator
Results in the following NPE:
[INFO] [talledLocalContainer] Caused by: java.lang.NullPointerException [INFO] [talledLocalContainer] at info.magnolia.ui.form.field.definition.SelectFieldOptionDefinition.compareTo(SelectFieldOptionDefinition.java:100) [INFO] [talledLocalContainer] at info.magnolia.ui.form.field.definition.SelectFieldOptionDefinition.compareTo(SelectFieldOptionDefinition.java:43) [INFO] [talledLocalContainer] at java.util.ComparableTimSort.binarySort(ComparableTimSort.java:232) [INFO] [talledLocalContainer] at java.util.ComparableTimSort.sort(ComparableTimSort.java:176) [INFO] [talledLocalContainer] at java.util.ComparableTimSort.sort(ComparableTimSort.java:146) [INFO] [talledLocalContainer] at java.util.Arrays.sort(Arrays.java:472) [INFO] [talledLocalContainer] at java.util.Collections.sort(Collections.java:155) [INFO] [talledLocalContainer] at info.magnolia.ui.form.field.factory.SelectFieldFactory.buildOptions(SelectFieldFactory.java:138) [INFO] [talledLocalContainer] at info.magnolia.ui.form.field.factory.SelectFieldFactory.createFieldComponent(SelectFieldFactory.java:98)
- depends upon
-
PAGES-38 TemplateSelectorFieldFactory may return a blank label
- Closed