parent
b449928691
commit
659f13be1c
|
|
@ -46,7 +46,7 @@ class CacheResolverAdapter implements CacheResolver {
|
|||
}
|
||||
CacheInvocationContext<?> cacheInvocationContext = (CacheInvocationContext<?>) context;
|
||||
javax.cache.Cache<Object, Object> cache = target.resolveCache(cacheInvocationContext);
|
||||
Assert.notNull(cache, "Cannot resolve cache for '" + context + "' using '" + target + "'");
|
||||
Assert.notNull(cache, () -> "Cannot resolve cache for '" + context + "' using '" + target + "'");
|
||||
return Collections.singleton(new JCacheCache(cache));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -139,7 +139,7 @@ public abstract class AbstractMessageConverter implements SmartMessageConverter
|
|||
*/
|
||||
public void setSerializedPayloadClass(Class<?> payloadClass) {
|
||||
Assert.isTrue(byte[].class == payloadClass || String.class == payloadClass,
|
||||
"Payload class must be byte[] or String: " + payloadClass);
|
||||
() -> "Payload class must be byte[] or String: " + payloadClass);
|
||||
this.serializedPayloadClass = payloadClass;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ public class HeadersMethodArgumentResolver implements HandlerMethodArgumentResol
|
|||
}
|
||||
else {
|
||||
Method method = ReflectionUtils.findMethod(paramType, "wrap", Message.class);
|
||||
Assert.notNull(method, "Cannot create accessor of type " + paramType + " for message " + message);
|
||||
Assert.notNull(method, () -> "Cannot create accessor of type " + paramType + " for message " + message);
|
||||
return ReflectionUtils.invokeMethod(method, null, message);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@ public class HandlerMethodArgumentResolverComposite implements HandlerMethodArgu
|
|||
public Object resolveArgument(MethodParameter parameter, Message<?> message) throws Exception {
|
||||
|
||||
HandlerMethodArgumentResolver resolver = getArgumentResolver(parameter);
|
||||
Assert.notNull(resolver, "Unknown parameter type [" + parameter.getParameterType().getName() + "]");
|
||||
Assert.notNull(resolver, () -> "Unknown parameter type [" + parameter.getParameterType().getName() + "]");
|
||||
return resolver.resolveArgument(parameter, message);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -580,7 +580,7 @@ public class Jaxb2Marshaller implements MimeMarshaller, MimeUnmarshaller, Generi
|
|||
xmlReader.setFeature("http://xml.org/sax/features/namespace-prefixes", true);
|
||||
for (int i = 0; i < resources.length; i++) {
|
||||
Assert.notNull(resources[i], "Resource is null");
|
||||
Assert.isTrue(resources[i].exists(), "Resource " + resources[i] + " does not exist");
|
||||
Assert.isTrue(resources[i].exists(), () -> "Resource " + resources[i] + " does not exist");
|
||||
InputSource inputSource = SaxResourceUtils.createInputSource(resources[i]);
|
||||
schemaSources[i] = new SAXSource(xmlReader, inputSource);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ class HtmlCharacterEntityReferences {
|
|||
String key = (String) keys.nextElement();
|
||||
int referredChar = Integer.parseInt(key);
|
||||
Assert.isTrue((referredChar < 1000 || (referredChar >= 8000 && referredChar < 10000)),
|
||||
"Invalid reference to special HTML entity: " + referredChar);
|
||||
() -> "Invalid reference to special HTML entity: " + referredChar);
|
||||
int index = (referredChar < 1000 ? referredChar : referredChar - 7000);
|
||||
String reference = entityReferences.getProperty(key);
|
||||
this.characterToEntityReferenceMap[index] = REFERENCE_START + reference + REFERENCE_END;
|
||||
|
|
|
|||
Loading…
Reference in New Issue