DATACMNS-985 - Remove references to single-argument assertion methods.
This commit is contained in:
committed by
Oliver Gierke
parent
49817278b7
commit
3e048a6dca
@@ -42,7 +42,7 @@ public class AnnotationDetectionFieldCallback implements FieldCallback {
|
||||
*/
|
||||
public AnnotationDetectionFieldCallback(Class<? extends Annotation> annotationType) {
|
||||
|
||||
Assert.notNull(annotationType);
|
||||
Assert.notNull(annotationType, "AnnotationType must not be null!");
|
||||
this.annotationType = annotationType;
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ public class AnnotationDetectionFieldCallback implements FieldCallback {
|
||||
@SuppressWarnings("unchecked")
|
||||
public <T> T getValue(Object source) {
|
||||
|
||||
Assert.notNull(source);
|
||||
Assert.notNull(source, "Source object must not be null!");
|
||||
return field == null ? null : (T) ReflectionUtils.getField(field, source);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -91,8 +91,8 @@ class TypeDiscoverer<S> implements TypeInformation<S> {
|
||||
*/
|
||||
protected TypeDiscoverer(Type type, Map<TypeVariable<?>, Type> typeVariableMap) {
|
||||
|
||||
Assert.notNull(type);
|
||||
Assert.notNull(typeVariableMap);
|
||||
Assert.notNull(type, "Type must not be null!");
|
||||
Assert.notNull(typeVariableMap, "TypeVariableMap must not be null!");
|
||||
|
||||
this.type = type;
|
||||
this.typeVariableMap = typeVariableMap;
|
||||
@@ -447,7 +447,7 @@ class TypeDiscoverer<S> implements TypeInformation<S> {
|
||||
*/
|
||||
public TypeInformation<?> getReturnType(Method method) {
|
||||
|
||||
Assert.notNull(method);
|
||||
Assert.notNull(method, "Method must not be null!");
|
||||
return createInfo(method.getGenericReturnType());
|
||||
}
|
||||
|
||||
@@ -532,7 +532,7 @@ class TypeDiscoverer<S> implements TypeInformation<S> {
|
||||
@Override
|
||||
public TypeInformation<?> specialize(ClassTypeInformation<?> type) {
|
||||
|
||||
Assert.isTrue(getType().isAssignableFrom(type.getType()));
|
||||
Assert.isTrue(getType().isAssignableFrom(type.getType()), String.format("%s must be assignable from %s", getType(), type.getType()));
|
||||
|
||||
List<TypeInformation<?>> arguments = getTypeArguments();
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ class TypeVariableTypeInformation<T> extends ParentTypeAwareTypeInformation<T> {
|
||||
Map<TypeVariable<?>, Type> typeVariableMap) {
|
||||
|
||||
super(variable, parent, typeVariableMap);
|
||||
Assert.notNull(variable);
|
||||
Assert.notNull(variable, "TypeVariable must not be null!");
|
||||
this.variable = variable;
|
||||
this.owningType = owningType;
|
||||
}
|
||||
|
||||
@@ -42,8 +42,8 @@ public class Version implements Comparable<Version> {
|
||||
*/
|
||||
public Version(int... parts) {
|
||||
|
||||
Assert.notNull(parts);
|
||||
Assert.isTrue(parts.length > 0 && parts.length < 5);
|
||||
Assert.notNull(parts, "Parts must not be null!");
|
||||
Assert.isTrue(parts.length > 0 && parts.length < 5, String.format("Invalid parts length. 0 < %s < 5", parts.length));
|
||||
|
||||
this.major = parts[0];
|
||||
this.minor = parts.length > 1 ? parts[1] : 0;
|
||||
@@ -64,7 +64,7 @@ public class Version implements Comparable<Version> {
|
||||
*/
|
||||
public static Version parse(String version) {
|
||||
|
||||
Assert.hasText(version);
|
||||
Assert.hasText(version, "Version must not be null o empty!");
|
||||
|
||||
String[] parts = version.trim().split("\\.");
|
||||
int[] intParts = new int[parts.length];
|
||||
|
||||
Reference in New Issue
Block a user