@@ -174,9 +174,8 @@ private static Stream<MethodParameter> fromSimpleClass(Class<?> paramClass, Fiel
174
174
try {
175
175
Parameter parameter = field .getAnnotation (Parameter .class );
176
176
boolean isNotRequired = parameter == null || !parameter .required ();
177
- Annotation [] finalFieldAnnotations = fieldAnnotations ;
178
177
179
- if ("java.lang.Record" .equals (paramClass .getSuperclass ().getName ())) {
178
+ if (paramClass . getSuperclass () != null && "java.lang.Record" .equals (paramClass .getSuperclass ().getName ())) {
180
179
Method classGetRecordComponents = Class .class .getMethod ("getRecordComponents" );
181
180
Object [] components = (Object []) classGetRecordComponents .invoke (paramClass );
182
181
@@ -191,7 +190,7 @@ private static Stream<MethodParameter> fromSimpleClass(Class<?> paramClass, Fiel
191
190
.filter (method -> method .getName ().equals (field .getName ()))
192
191
.map (method -> new MethodParameter (method , -1 ))
193
192
.map (methodParameter -> DelegatingMethodParameter .changeContainingClass (methodParameter , paramClass ))
194
- .map (param -> new DelegatingMethodParameter (param , fieldNamePrefix + field .getName (), finalFieldAnnotations , true , isNotRequired ));
193
+ .map (param -> new DelegatingMethodParameter (param , fieldNamePrefix + field .getName (), fieldAnnotations , true , isNotRequired ));
195
194
196
195
}
197
196
else
@@ -201,7 +200,7 @@ private static Stream<MethodParameter> fromSimpleClass(Class<?> paramClass, Fiel
201
200
.filter (Objects ::nonNull )
202
201
.map (method -> new MethodParameter (method , -1 ))
203
202
.map (methodParameter -> DelegatingMethodParameter .changeContainingClass (methodParameter , paramClass ))
204
- .map (param -> new DelegatingMethodParameter (param , fieldNamePrefix + field .getName (), finalFieldAnnotations , true , isNotRequired ));
203
+ .map (param -> new DelegatingMethodParameter (param , fieldNamePrefix + field .getName (), fieldAnnotations , true , isNotRequired ));
205
204
}
206
205
catch (IntrospectionException | NoSuchMethodException |
207
206
InvocationTargetException | IllegalAccessException |
0 commit comments