The ParameterResolutionException class is part of a @NullMarked package. The constructors currently look like this:
public ParameterResolutionException(String message) {
super(message);
}
public ParameterResolutionException(String message, Throwable cause) {
super(message, cause);
}
To align with the JUnitException it extends from, this should be changed to:
public ParameterResolutionException(@Nullable String message) {
super(message);
}
public ParameterResolutionException(@Nullable String message, @Nullable Throwable cause) {
super(message, cause);
}
In my project NullAway gives an error for this construct:
} catch (Exception e) {
throw new ParameterResolutionException(e.getMessage(), e);
}
Because e.getMessage() can return null, but ParameterResolutionException now claims it does not accept null.
The
ParameterResolutionExceptionclass is part of a@NullMarkedpackage. The constructors currently look like this:To align with the
JUnitExceptionit extends from, this should be changed to:In my project NullAway gives an error for this construct:
Because
e.getMessage()can returnnull, butParameterResolutionExceptionnow claims it does not acceptnull.