Skip to content

Commit 0141725

Browse files
committed
Polishing
Closes gh-34592
1 parent 0c2ba4e commit 0141725

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

spring-web/src/main/java/org/springframework/web/method/support/InvocableHandlerMethod.java

+4-2
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,8 @@ public static Object invokeFunction(Method method, Object target, Object[] args)
321321
Object arg = args[index];
322322
if (!(parameter.isOptional() && arg == null)) {
323323
KType type = parameter.getType();
324-
if (!(type.isMarkedNullable() && arg == null) && type.getClassifier() instanceof KClass<?> kClass
324+
if (!(type.isMarkedNullable() && arg == null)
325+
&& type.getClassifier() instanceof KClass<?> kClass
325326
&& KotlinDetector.isInlineClass(JvmClassMappingKt.getJavaClass(kClass))) {
326327
arg = box(kClass, arg);
327328
}
@@ -341,7 +342,8 @@ public static Object invokeFunction(Method method, Object target, Object[] args)
341342
private static Object box(KClass<?> kClass, @Nullable Object arg) {
342343
KFunction<?> constructor = Objects.requireNonNull(KClasses.getPrimaryConstructor(kClass));
343344
KType type = constructor.getParameters().get(0).getType();
344-
if (!(type.isMarkedNullable() && arg == null) && type.getClassifier() instanceof KClass<?> parameterClass
345+
if (!(type.isMarkedNullable() && arg == null)
346+
&& type.getClassifier() instanceof KClass<?> parameterClass
345347
&& KotlinDetector.isInlineClass(JvmClassMappingKt.getJavaClass(parameterClass))) {
346348
arg = box(parameterClass, arg);
347349
}

spring-webflux/src/main/java/org/springframework/web/reactive/result/method/InvocableHandlerMethod.java

+5-3
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,8 @@ public static Object invokeFunction(Method method, Object target, Object[] args,
360360
Object arg = args[index];
361361
if (!(parameter.isOptional() && arg == null)) {
362362
KType type = parameter.getType();
363-
if (!(type.isMarkedNullable() && arg == null) && type.getClassifier() instanceof KClass<?> kClass
363+
if (!(type.isMarkedNullable() && arg == null)
364+
&& type.getClassifier() instanceof KClass<?> kClass
364365
&& KotlinDetector.isInlineClass(JvmClassMappingKt.getJavaClass(kClass))) {
365366
arg = box(kClass, arg);
366367
}
@@ -378,10 +379,11 @@ public static Object invokeFunction(Method method, Object target, Object[] args,
378379
}
379380
}
380381

381-
private static Object box(KClass<?> kClass, Object arg) {
382+
private static Object box(KClass<?> kClass, @Nullable Object arg) {
382383
KFunction<?> constructor = Objects.requireNonNull(KClasses.getPrimaryConstructor(kClass));
383384
KType type = constructor.getParameters().get(0).getType();
384-
if (!(type.isMarkedNullable() && arg == null) && type.getClassifier() instanceof KClass<?> parameterClass
385+
if (!(type.isMarkedNullable() && arg == null)
386+
&& type.getClassifier() instanceof KClass<?> parameterClass
385387
&& KotlinDetector.isInlineClass(JvmClassMappingKt.getJavaClass(parameterClass))) {
386388
arg = box(parameterClass, arg);
387389
}

0 commit comments

Comments
 (0)