Avoid creating message arguments to Assert.isABC calls

See 67f184293b
This commit is contained in:
Vladimir Sitnikov
2018-02-13 14:04:49 +03:00
committed by Juergen Hoeller
parent b449928691
commit 659f13be1c
8 changed files with 10 additions and 9 deletions

View File

@@ -49,8 +49,9 @@ public abstract class ParameterizedTypeReference<T> {
Type type = parameterizedTypeReferenceSubclass.getGenericSuperclass();
Assert.isInstanceOf(ParameterizedType.class, type, "Type must be a parameterized type");
ParameterizedType parameterizedType = (ParameterizedType) type;
Assert.isTrue(parameterizedType.getActualTypeArguments().length == 1, "Number of type arguments must be 1");
this.type = parameterizedType.getActualTypeArguments()[0];
Type[] actualTypeArguments = parameterizedType.getActualTypeArguments();
Assert.isTrue(actualTypeArguments.length == 1, "Number of type arguments must be 1");
this.type = actualTypeArguments[0];
}
private ParameterizedTypeReference(Type type) {

View File

@@ -62,7 +62,7 @@ public abstract class TransformerUtils {
*/
public static void enableIndenting(Transformer transformer, int indentAmount) {
Assert.notNull(transformer, "Transformer must not be null");
Assert.isTrue(indentAmount > -1, "The indent amount cannot be less than zero : got " + indentAmount);
Assert.isTrue(indentAmount > -1, () -> "The indent amount cannot be less than zero : got " + indentAmount);
transformer.setOutputProperty(OutputKeys.INDENT, "yes");
try {
// Xalan-specific, but this is the most common XSLT engine in any case