Details
-
Bug
-
Resolution: Unresolved
-
Minor
-
None
-
6.2.22
-
None
-
None
Description
Steps to reproduce
- Define a class public class MyTextField<E extends Enum<E>> extends TextFieldDefinition
- Use this class in a dialog
- Open the dialog
Expected results
The dialog is opened.
Actual results
Caused by: java.lang.IllegalArgumentException: Cannot resolve E from class...
Workaround
Remove the extends:
- public class MyTextField<E extends Enum<E>> extends TextFieldDefinition
+ public class MyTextField<E> extends TextFieldDefinition
Development notes
I believe these extends can be discarded like this:
@@ -149,10 +149,14 @@ public class ByteBuddyI18nizer implements I18nizer { - Type[] stubParameterTypes = Arrays.stream(typeParameters).map(param -> { - Type[] bounds = param.getBounds(); - return bounds.length == 0 ? Object.class : bounds[0]; - }).toArray(Type[]::new); + Type[] stubParameterTypes = Arrays.stream(typeParameters).map(param -> + Arrays.stream(param.getBounds()) + .filter(bound -> !(bound instanceof ParameterizedType) || + Arrays.stream(((ParameterizedType) bound).getActualTypeArguments()) + .noneMatch(TypeVariable.class::isInstance)) + .findFirst() + .orElse(Object.class)) + .toArray(Type[]::new);
Checklists
Acceptance criteria
Attachments
Issue Links
- is depended upon by
-
MGNLUI-7451 SwitchableField that allows EnumDatasources
-
- Open
-