fix(muscript): use String.formatted instead of concatenation
This commit is contained in:
parent
8bddb34c22
commit
3361ee9df1
|
@ -1,13 +1,12 @@
|
|||
package io.gitlab.jfronny.muscript.data.dynamic;
|
||||
|
||||
public class DynamicTypeConversionException extends RuntimeException {
|
||||
private static final String MESSAGE1 = "Could not convert dynamic of type ";
|
||||
private static final String MESSAGE2 = " to ";
|
||||
private static final String MESSAGE = "Could not convert dynamic of type %s to %s";
|
||||
private final String target;
|
||||
private final String actual;
|
||||
|
||||
public DynamicTypeConversionException(String target, Dynamic dynamic) {
|
||||
super(MESSAGE1 + (dynamic == null ? "null" : dynamic.getClass().getSimpleName()) + MESSAGE2 + target);
|
||||
super(MESSAGE.formatted(dynamic == null ? "null" : dynamic.getClass().getSimpleName(), target));
|
||||
this.target = target;
|
||||
this.actual = dynamic == null ? "null" : dynamic.getClass().getSimpleName();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue