Skip to content

Commit e2ed5f5

Browse files
committed
Apply Spotless code formatting
Signed-off-by: Ogu1208 <[email protected]>
1 parent f56ddcb commit e2ed5f5

File tree

4 files changed

+48
-26
lines changed

4 files changed

+48
-26
lines changed

junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/support/MethodReflectionUtils.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@ public static Type getGenericReturnType(Method method) {
4646
if (isKotlinSuspendingFunction(method)) {
4747
return invokeKotlinSuspendingFunction(method, target, arguments);
4848
}
49-
if (isKotlinType(method.getDeclaringClass())
50-
&& KotlinReflectionUtils.isKotlinReflectPresent()
49+
if (isKotlinType(method.getDeclaringClass()) && KotlinReflectionUtils.isKotlinReflectPresent()
5150
&& hasInlineTypeArgument(arguments)) {
5251
return invokeKotlinFunction(method, target, arguments);
5352
}
@@ -59,8 +58,7 @@ private static boolean hasInlineTypeArgument(@Nullable Object[] arguments) {
5958
return false;
6059
}
6160

62-
return arguments.length > 0
63-
&& Arrays.stream(arguments).anyMatch(KotlinReflectionUtils::isInstanceOfInlineType);
61+
return arguments.length > 0 && Arrays.stream(arguments).anyMatch(KotlinReflectionUtils::isInstanceOfInlineType);
6462
}
6563

6664
private MethodReflectionUtils() {

junit-platform-commons/src/main/java/org/junit/platform/commons/util/KotlinReflectionUtils.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,7 @@ public static Class<?>[] getKotlinSuspendingFunctionParameterTypes(Method method
165165

166166
@API(status = INTERNAL, since = "6.1")
167167
public static boolean isInstanceOfInlineType(@Nullable Object value) {
168-
return jvmInline != null
169-
&& value != null
170-
&& value.getClass().getDeclaredAnnotation(jvmInline) != null;
168+
return jvmInline != null && value != null && value.getClass().getDeclaredAnnotation(jvmInline) != null;
171169
}
172170

173171
@API(status = INTERNAL, since = "6.1")

jupiter-tests/src/test/kotlin/org/junit/jupiter/api/kotlin/GenericInlineValueClassTests.kt

Lines changed: 30 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
/*
2+
* Copyright 2015-2025 the original author or authors.
3+
*
4+
* All rights reserved. This program and the accompanying materials are
5+
* made available under the terms of the Eclipse Public License v2.0 which
6+
* accompanies this distribution and is available at
7+
*
8+
* https://www.eclipse.org/legal/epl-v20.html
9+
*/
110
package org.junit.jupiter.api.kotlin
211

312
import org.junit.jupiter.api.Assertions.assertEquals
@@ -10,7 +19,6 @@ import org.junit.jupiter.params.provider.MethodSource
1019
* These work because they compile to Object in JVM, bypassing strict type validation.
1120
*/
1221
class GenericInlineValueClassTests {
13-
1422
@MethodSource("resultProvider")
1523
@ParameterizedTest
1624
fun testResult(result: Result<String>) {
@@ -41,29 +49,35 @@ class GenericInlineValueClassTests {
4149

4250
companion object {
4351
@JvmStatic
44-
fun resultProvider() = listOf(
45-
Arguments.of(Result.success("success"))
46-
)
52+
fun resultProvider() =
53+
listOf(
54+
Arguments.of(Result.success("success"))
55+
)
4756

4857
@JvmStatic
49-
fun multipleResultsProvider() = listOf(
50-
Arguments.of(
51-
Result.success("data"),
52-
Result.success(42)
58+
fun multipleResultsProvider() =
59+
listOf(
60+
Arguments.of(
61+
Result.success("data"),
62+
Result.success(42)
63+
)
5364
)
54-
)
5565

5666
@JvmStatic
57-
fun nullableResultProvider() = listOf(
58-
Arguments.of(Result.success("test"))
59-
)
67+
fun nullableResultProvider() =
68+
listOf(
69+
Arguments.of(Result.success("test"))
70+
)
6071

6172
@JvmStatic
62-
fun customGenericProvider() = listOf(
63-
Arguments.of(Container("content"))
64-
)
73+
fun customGenericProvider() =
74+
listOf(
75+
Arguments.of(Container("content"))
76+
)
6577
}
6678
}
6779

6880
@JvmInline
69-
value class Container<T>(val value: T)
81+
value class Container<T>(
82+
val value: T
83+
)

jupiter-tests/src/test/kotlin/org/junit/jupiter/api/kotlin/PrimitiveWrapperInlineValueClassTests.kt

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
/*
2+
* Copyright 2015-2025 the original author or authors.
3+
*
4+
* All rights reserved. This program and the accompanying materials are
5+
* made available under the terms of the Eclipse Public License v2.0 which
6+
* accompanies this distribution and is available at
7+
*
8+
* https://www.eclipse.org/legal/epl-v20.html
9+
*/
110
package org.junit.jupiter.api.kotlin
211

312
import org.junit.jupiter.api.Assertions.assertEquals
@@ -19,7 +28,6 @@ import org.junit.jupiter.params.provider.MethodSource
1928
*/
2029
@Disabled("Primitive-wrapper inline value classes are not yet supported")
2130
class PrimitiveWrapperInlineValueClassTests {
22-
2331
@MethodSource("uintProvider")
2432
@ParameterizedTest
2533
fun testUInt(value: UInt) {
@@ -51,7 +59,11 @@ class PrimitiveWrapperInlineValueClassTests {
5159
}
5260

5361
@JvmInline
54-
value class UserId(val value: Long)
62+
value class UserId(
63+
val value: Long
64+
)
5565

5666
@JvmInline
57-
value class Email(val value: String)
67+
value class Email(
68+
val value: String
69+
)

0 commit comments

Comments
 (0)