Skip to content

Commit 2b180cd

Browse files
committed
Replace getOrThrow with getNonNullOrThrow
1 parent 42cc962 commit 2b180cd

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

junit-platform-commons/src/main/java/org/junit/platform/commons/support/conversion/ConversionException.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import java.io.Serial;
1616

1717
import org.apiguardian.api.API;
18+
import org.jspecify.annotations.Nullable;
1819
import org.junit.platform.commons.JUnitException;
1920

2021
/**
@@ -33,7 +34,7 @@ public ConversionException(String message) {
3334
super(message);
3435
}
3536

36-
public ConversionException(String message, Throwable cause) {
37+
public ConversionException(String message, @Nullable Throwable cause) {
3738
super(message, cause);
3839
}
3940

junit-platform-commons/src/main/java/org/junit/platform/commons/support/conversion/StringToClassConverter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ public boolean canConvert(ConversionContext context) {
2222
}
2323

2424
@Override
25-
public @Nullable Class<?> convert(@Nullable String className, ConversionContext context) {
25+
public Class<?> convert(@Nullable String className, ConversionContext context) {
2626
Preconditions.notNull(className, "className cannot be null");
2727
// @formatter:off
2828
return ReflectionSupport.tryToLoadClass(className, context.classLoader())
29-
.getOrThrow(cause -> new ConversionException(
29+
.getNonNullOrThrow(cause -> new ConversionException(
3030
"Failed to convert String \"" + className + "\" to type java.lang.Class", cause));
3131
// @formatter:on
3232
}

0 commit comments

Comments
 (0)