Browse Source

DATACMNS-985 - Remove references to single-argument assertion methods.

pull/194/head
Christoph Strobl 9 years ago committed by Oliver Gierke
parent
commit
3e048a6dca
  1. 2
      src/main/java/org/springframework/data/auditing/AuditingHandler.java
  2. 12
      src/main/java/org/springframework/data/config/BeanComponentDefinitionBuilder.java
  3. 4
      src/main/java/org/springframework/data/convert/ConfigurableTypeInformationMapper.java
  4. 12
      src/main/java/org/springframework/data/convert/DefaultTypeMapper.java
  5. 8
      src/main/java/org/springframework/data/convert/EntityInstantiators.java
  6. 2
      src/main/java/org/springframework/data/convert/MappingContextTypeInformationMapper.java
  7. 4
      src/main/java/org/springframework/data/domain/jaxb/SpringDataJaxb.java
  8. 4
      src/main/java/org/springframework/data/geo/Box.java
  9. 4
      src/main/java/org/springframework/data/geo/Circle.java
  10. 4
      src/main/java/org/springframework/data/geo/GeoResult.java
  11. 2
      src/main/java/org/springframework/data/geo/GeoResults.java
  12. 2
      src/main/java/org/springframework/data/geo/Point.java
  13. 6
      src/main/java/org/springframework/data/geo/Polygon.java
  14. 2
      src/main/java/org/springframework/data/history/AnnotationRevisionMetadata.java
  15. 4
      src/main/java/org/springframework/data/history/Revision.java
  16. 2
      src/main/java/org/springframework/data/history/Revisions.java
  17. 12
      src/main/java/org/springframework/data/mapping/PreferredConstructor.java
  18. 2
      src/main/java/org/springframework/data/mapping/context/AbstractMappingContext.java
  19. 2
      src/main/java/org/springframework/data/mapping/context/DefaultPersistentPropertyPath.java
  20. 4
      src/main/java/org/springframework/data/mapping/context/MappingContextEvent.java
  21. 4
      src/main/java/org/springframework/data/mapping/model/AbstractPersistentProperty.java
  22. 12
      src/main/java/org/springframework/data/mapping/model/BasicPersistentEntity.java
  23. 4
      src/main/java/org/springframework/data/mapping/model/PersistentEntityParameterValueProvider.java
  24. 8
      src/main/java/org/springframework/data/mapping/model/SimpleTypeHolder.java
  25. 8
      src/main/java/org/springframework/data/repository/cdi/CdiRepositoryBean.java
  26. 8
      src/main/java/org/springframework/data/repository/config/AnnotationRepositoryConfigurationSource.java
  27. 4
      src/main/java/org/springframework/data/repository/config/DefaultRepositoryConfiguration.java
  28. 4
      src/main/java/org/springframework/data/repository/config/NamedQueriesBeanDefinitionBuilder.java
  29. 2
      src/main/java/org/springframework/data/repository/config/NamedQueriesBeanDefinitionParser.java
  30. 2
      src/main/java/org/springframework/data/repository/config/RepositoryBeanDefinitionParser.java
  31. 4
      src/main/java/org/springframework/data/repository/config/RepositoryComponentProvider.java
  32. 2
      src/main/java/org/springframework/data/repository/config/RepositoryConfigurationDelegate.java
  33. 4
      src/main/java/org/springframework/data/repository/config/RepositoryConfigurationExtensionSupport.java
  34. 4
      src/main/java/org/springframework/data/repository/config/XmlRepositoryConfigurationSource.java
  35. 2
      src/main/java/org/springframework/data/repository/core/support/AbstractEntityInformation.java
  36. 6
      src/main/java/org/springframework/data/repository/core/support/DefaultRepositoryInformation.java
  37. 2
      src/main/java/org/springframework/data/repository/core/support/DelegatingEntityInformation.java
  38. 2
      src/main/java/org/springframework/data/repository/core/support/PropertiesBasedNamedQueries.java
  39. 2
      src/main/java/org/springframework/data/repository/core/support/ReflectionEntityInformation.java
  40. 2
      src/main/java/org/springframework/data/repository/core/support/RepositoryFactorySupport.java
  41. 4
      src/main/java/org/springframework/data/repository/core/support/TransactionalRepositoryProxyPostProcessor.java
  42. 4
      src/main/java/org/springframework/data/repository/init/RepositoriesPopulatedEvent.java
  43. 4
      src/main/java/org/springframework/data/repository/init/ResourceReaderRepositoryPopulator.java
  44. 2
      src/main/java/org/springframework/data/repository/query/Parameter.java
  45. 2
      src/main/java/org/springframework/data/repository/query/Parameters.java
  46. 4
      src/main/java/org/springframework/data/repository/query/ParametersParameterAccessor.java
  47. 2
      src/main/java/org/springframework/data/repository/query/QueryMethod.java
  48. 2
      src/main/java/org/springframework/data/repository/support/AnnotationAttribute.java
  49. 4
      src/main/java/org/springframework/data/repository/support/MethodParameters.java
  50. 2
      src/main/java/org/springframework/data/repository/support/Repositories.java
  51. 4
      src/main/java/org/springframework/data/util/AnnotationDetectionFieldCallback.java
  52. 8
      src/main/java/org/springframework/data/util/TypeDiscoverer.java
  53. 2
      src/main/java/org/springframework/data/util/TypeVariableTypeInformation.java
  54. 6
      src/main/java/org/springframework/data/util/Version.java
  55. 2
      src/main/java/org/springframework/data/web/SortHandlerMethodArgumentResolver.java

2
src/main/java/org/springframework/data/auditing/AuditingHandler.java

@ -82,7 +82,7 @@ public class AuditingHandler implements InitializingBean {
*/ */
public void setAuditorAware(final AuditorAware<?> auditorAware) { public void setAuditorAware(final AuditorAware<?> auditorAware) {
Assert.notNull(auditorAware); Assert.notNull(auditorAware, "AuditorAware must not be null!");
this.auditorAware = auditorAware; this.auditorAware = auditorAware;
} }

12
src/main/java/org/springframework/data/config/BeanComponentDefinitionBuilder.java

@ -43,8 +43,8 @@ public class BeanComponentDefinitionBuilder {
*/ */
public BeanComponentDefinitionBuilder(Element defaultSource, ParserContext context) { public BeanComponentDefinitionBuilder(Element defaultSource, ParserContext context) {
Assert.notNull(defaultSource); Assert.notNull(defaultSource, "DefaultSource must not be null!");
Assert.notNull(context); Assert.notNull(context, "Context must not be null!");
this.defaultSource = defaultSource; this.defaultSource = defaultSource;
this.context = context; this.context = context;
@ -58,7 +58,7 @@ public class BeanComponentDefinitionBuilder {
*/ */
public BeanComponentDefinition getComponent(BeanDefinitionBuilder builder) { public BeanComponentDefinition getComponent(BeanDefinitionBuilder builder) {
Assert.notNull(builder); Assert.notNull(builder, "Builder must not be null!");
AbstractBeanDefinition definition = builder.getRawBeanDefinition(); AbstractBeanDefinition definition = builder.getRawBeanDefinition();
String name = BeanDefinitionReaderUtils.generateBeanName(definition, context.getRegistry(), context.isNested()); String name = BeanDefinitionReaderUtils.generateBeanName(definition, context.getRegistry(), context.isNested());
@ -76,7 +76,7 @@ public class BeanComponentDefinitionBuilder {
*/ */
public BeanComponentDefinition getComponentIdButFallback(BeanDefinitionBuilder builder, String fallback) { public BeanComponentDefinition getComponentIdButFallback(BeanDefinitionBuilder builder, String fallback) {
Assert.hasText(fallback); Assert.hasText(fallback, "Fallback component id must not be null or empty!");
String id = defaultSource.getAttribute("id"); String id = defaultSource.getAttribute("id");
return getComponent(builder, StringUtils.hasText(id) ? id : fallback); return getComponent(builder, StringUtils.hasText(id) ? id : fallback);
@ -104,8 +104,8 @@ public class BeanComponentDefinitionBuilder {
*/ */
public BeanComponentDefinition getComponent(BeanDefinitionBuilder builder, String name, Object rawSource) { public BeanComponentDefinition getComponent(BeanDefinitionBuilder builder, String name, Object rawSource) {
Assert.notNull(builder); Assert.notNull(builder, "Builder must not be null!");
Assert.hasText(name); Assert.hasText(name, "Name of bean must not be null or empty!");
AbstractBeanDefinition definition = builder.getRawBeanDefinition(); AbstractBeanDefinition definition = builder.getRawBeanDefinition();
definition.setSource(context.extractSource(rawSource)); definition.setSource(context.extractSource(rawSource));

4
src/main/java/org/springframework/data/convert/ConfigurableTypeInformationMapper.java

@ -37,13 +37,13 @@ public class ConfigurableTypeInformationMapper implements TypeInformationMapper
private final Map<ClassTypeInformation<?>, Object> typeMap; private final Map<ClassTypeInformation<?>, Object> typeMap;
/** /**
* Creates a new {@link ConfigurableTypeMapper} for the given type map. * Creates a new {@link ConfigurableTypeInformationMapper} for the given type map.
* *
* @param sourceTypeMap must not be {@literal null}. * @param sourceTypeMap must not be {@literal null}.
*/ */
public ConfigurableTypeInformationMapper(Map<? extends Class<?>, String> sourceTypeMap) { public ConfigurableTypeInformationMapper(Map<? extends Class<?>, String> sourceTypeMap) {
Assert.notNull(sourceTypeMap); Assert.notNull(sourceTypeMap, "SourceTypeMap must not be null!");
this.typeMap = new HashMap<ClassTypeInformation<?>, Object>(sourceTypeMap.size()); this.typeMap = new HashMap<ClassTypeInformation<?>, Object>(sourceTypeMap.size());
for (Entry<? extends Class<?>, String> entry : sourceTypeMap.entrySet()) { for (Entry<? extends Class<?>, String> entry : sourceTypeMap.entrySet()) {

12
src/main/java/org/springframework/data/convert/DefaultTypeMapper.java

@ -77,8 +77,8 @@ public class DefaultTypeMapper<S> implements TypeMapper<S> {
MappingContext<? extends PersistentEntity<?, ?>, ?> mappingContext, MappingContext<? extends PersistentEntity<?, ?>, ?> mappingContext,
List<? extends TypeInformationMapper> additionalMappers) { List<? extends TypeInformationMapper> additionalMappers) {
Assert.notNull(accessor); Assert.notNull(accessor, "Accessor must not be null!");
Assert.notNull(additionalMappers); Assert.notNull(additionalMappers, "AdditionalMappers must not be null!");
List<TypeInformationMapper> mappers = new ArrayList<TypeInformationMapper>(additionalMappers.size() + 1); List<TypeInformationMapper> mappers = new ArrayList<TypeInformationMapper>(additionalMappers.size() + 1);
if (mappingContext != null) { if (mappingContext != null) {
@ -97,7 +97,7 @@ public class DefaultTypeMapper<S> implements TypeMapper<S> {
*/ */
public TypeInformation<?> readType(S source) { public TypeInformation<?> readType(S source) {
Assert.notNull(source); Assert.notNull(source, "Source object must not be null!");
Object alias = accessor.readAliasFrom(source); Object alias = accessor.readAliasFrom(source);
return alias == null ? null : getFromCacheOrCreate(alias); return alias == null ? null : getFromCacheOrCreate(alias);
@ -138,7 +138,7 @@ public class DefaultTypeMapper<S> implements TypeMapper<S> {
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public <T> TypeInformation<? extends T> readType(S source, TypeInformation<T> basicType) { public <T> TypeInformation<? extends T> readType(S source, TypeInformation<T> basicType) {
Assert.notNull(source); Assert.notNull(source, "Source object must not be null!");
Class<?> documentsTargetType = getDefaultedTypeToBeUsed(source); Class<?> documentsTargetType = getDefaultedTypeToBeUsed(source);
if (documentsTargetType == null) { if (documentsTargetType == null) {
@ -198,7 +198,7 @@ public class DefaultTypeMapper<S> implements TypeMapper<S> {
*/ */
public void writeType(TypeInformation<?> info, S sink) { public void writeType(TypeInformation<?> info, S sink) {
Assert.notNull(info); Assert.notNull(info, "TypeInformation must not be null!");
Object alias = getAliasFor(info); Object alias = getAliasFor(info);
if (alias != null) { if (alias != null) {
@ -215,7 +215,7 @@ public class DefaultTypeMapper<S> implements TypeMapper<S> {
*/ */
protected final Object getAliasFor(TypeInformation<?> info) { protected final Object getAliasFor(TypeInformation<?> info) {
Assert.notNull(info); Assert.notNull(info, "TypeInformation must not be null!");
for (TypeInformationMapper mapper : mappers) { for (TypeInformationMapper mapper : mappers) {
Object alias = mapper.createAliasFor(info); Object alias = mapper.createAliasFor(info);

8
src/main/java/org/springframework/data/convert/EntityInstantiators.java

@ -62,14 +62,14 @@ public class EntityInstantiators {
* Creates a new {@link EntityInstantiator} using the given fallback {@link EntityInstantiator} and the given custom * Creates a new {@link EntityInstantiator} using the given fallback {@link EntityInstantiator} and the given custom
* ones. * ones.
* *
* @param fallback must not be {@literal null}. * @param defaultInstantiator must not be {@literal null}.
* @param customInstantiators must not be {@literal null}. * @param customInstantiators must not be {@literal null}.
*/ */
public EntityInstantiators(EntityInstantiator defaultInstantiator, public EntityInstantiators(EntityInstantiator defaultInstantiator,
Map<Class<?>, EntityInstantiator> customInstantiators) { Map<Class<?>, EntityInstantiator> customInstantiators) {
Assert.notNull(defaultInstantiator); Assert.notNull(defaultInstantiator, "DefaultInstantiator must not be null!");
Assert.notNull(customInstantiators); Assert.notNull(customInstantiators, "CustomInstantiators must not be null!");
this.fallback = defaultInstantiator; this.fallback = defaultInstantiator;
this.customInstantiators = customInstantiators; this.customInstantiators = customInstantiators;
@ -83,7 +83,7 @@ public class EntityInstantiators {
*/ */
public EntityInstantiator getInstantiatorFor(PersistentEntity<?, ?> entity) { public EntityInstantiator getInstantiatorFor(PersistentEntity<?, ?> entity) {
Assert.notNull(entity); Assert.notNull(entity, "Entity must not be null!");
Class<?> type = entity.getType(); Class<?> type = entity.getType();
if (!customInstantiators.containsKey(type)) { if (!customInstantiators.containsKey(type)) {

2
src/main/java/org/springframework/data/convert/MappingContextTypeInformationMapper.java

@ -46,7 +46,7 @@ public class MappingContextTypeInformationMapper implements TypeInformationMappe
*/ */
public MappingContextTypeInformationMapper(MappingContext<? extends PersistentEntity<?, ?>, ?> mappingContext) { public MappingContextTypeInformationMapper(MappingContext<? extends PersistentEntity<?, ?>, ?> mappingContext) {
Assert.notNull(mappingContext); Assert.notNull(mappingContext, "MappingContext must not be null!");
this.typeMap = new ConcurrentHashMap<ClassTypeInformation<?>, CacheValue<Object>>(); this.typeMap = new ConcurrentHashMap<ClassTypeInformation<?>, CacheValue<Object>>();
this.mappingContext = mappingContext; this.mappingContext = mappingContext;

4
src/main/java/org/springframework/data/domain/jaxb/SpringDataJaxb.java

@ -110,7 +110,7 @@ public abstract class SpringDataJaxb {
*/ */
public static <T, S> List<T> unmarshal(Collection<S> source, XmlAdapter<S, T> adapter) { public static <T, S> List<T> unmarshal(Collection<S> source, XmlAdapter<S, T> adapter) {
Assert.notNull(adapter); Assert.notNull(adapter, "Adapter must not be null!");
if (source == null || source.isEmpty()) { if (source == null || source.isEmpty()) {
return Collections.emptyList(); return Collections.emptyList();
@ -138,7 +138,7 @@ public abstract class SpringDataJaxb {
*/ */
public static <T, S> List<S> marshal(Iterable<T> source, XmlAdapter<S, T> adapter) { public static <T, S> List<S> marshal(Iterable<T> source, XmlAdapter<S, T> adapter) {
Assert.notNull(adapter); Assert.notNull(adapter, "Adapter must not be null!");
if (source == null) { if (source == null) {
return Collections.emptyList(); return Collections.emptyList();

4
src/main/java/org/springframework/data/geo/Box.java

@ -40,8 +40,8 @@ public class Box implements Shape {
*/ */
public Box(Point first, Point second) { public Box(Point first, Point second) {
Assert.notNull(first); Assert.notNull(first, "First point must not be null!");
Assert.notNull(second); Assert.notNull(second, "Second point must not be null!");
this.first = first; this.first = first;
this.second = second; this.second = second;

4
src/main/java/org/springframework/data/geo/Circle.java

@ -42,8 +42,8 @@ public class Circle implements Shape {
@PersistenceConstructor @PersistenceConstructor
public Circle(Point center, Distance radius) { public Circle(Point center, Distance radius) {
Assert.notNull(center); Assert.notNull(center, "Center point must not be null!");
Assert.notNull(radius); Assert.notNull(radius, "Radius must not be null!");
Assert.isTrue(radius.getValue() >= 0, "Radius must not be negative!"); Assert.isTrue(radius.getValue() >= 0, "Radius must not be negative!");
this.center = center; this.center = center;

4
src/main/java/org/springframework/data/geo/GeoResult.java

@ -41,8 +41,8 @@ public class GeoResult<T> implements Serializable {
*/ */
public GeoResult(T content, Distance distance) { public GeoResult(T content, Distance distance) {
Assert.notNull(content); Assert.notNull(content, "Content must not be null!");
Assert.notNull(distance); Assert.notNull(distance, "Distance must not be null!");
this.content = content; this.content = content;
this.distance = distance; this.distance = distance;

2
src/main/java/org/springframework/data/geo/GeoResults.java

@ -68,7 +68,7 @@ public class GeoResults<T> implements Iterable<GeoResult<T>>, Serializable {
@PersistenceConstructor @PersistenceConstructor
public GeoResults(List<? extends GeoResult<T>> results, Distance averageDistance) { public GeoResults(List<? extends GeoResult<T>> results, Distance averageDistance) {
Assert.notNull(results); Assert.notNull(results, "Results must not be null!");
this.results = results; this.results = results;
this.averageDistance = averageDistance; this.averageDistance = averageDistance;

2
src/main/java/org/springframework/data/geo/Point.java

@ -55,7 +55,7 @@ public class Point implements Serializable {
*/ */
public Point(Point point) { public Point(Point point) {
Assert.notNull(point); Assert.notNull(point, "Source point must not be null!");
this.x = point.x; this.x = point.x;
this.y = point.y; this.y = point.y;

6
src/main/java/org/springframework/data/geo/Polygon.java

@ -51,7 +51,7 @@ public class Polygon implements Iterable<Point>, Shape {
Assert.notNull(x, "X coordinate must not be null!"); Assert.notNull(x, "X coordinate must not be null!");
Assert.notNull(y, "Y coordinate must not be null!"); Assert.notNull(y, "Y coordinate must not be null!");
Assert.notNull(z, "Z coordinate must not be null!"); Assert.notNull(z, "Z coordinate must not be null!");
Assert.notNull(others); Assert.notNull(others, "Others must not be null!");
List<Point> points = new ArrayList<Point>(3 + others.length); List<Point> points = new ArrayList<Point>(3 + others.length);
points.addAll(Arrays.asList(x, y, z)); points.addAll(Arrays.asList(x, y, z));
@ -68,13 +68,13 @@ public class Polygon implements Iterable<Point>, Shape {
@PersistenceConstructor @PersistenceConstructor
public Polygon(List<? extends Point> points) { public Polygon(List<? extends Point> points) {
Assert.notNull(points); Assert.notNull(points, "Points must not be null!");
List<Point> pointsToSet = new ArrayList<Point>(points.size()); List<Point> pointsToSet = new ArrayList<Point>(points.size());
for (Point point : points) { for (Point point : points) {
Assert.notNull(point); Assert.notNull(point, "Single Point in Polygon must not be null!");
pointsToSet.add(point); pointsToSet.add(point);
} }

2
src/main/java/org/springframework/data/history/AnnotationRevisionMetadata.java

@ -45,7 +45,7 @@ public class AnnotationRevisionMetadata<N extends Number & Comparable<N>> implem
public AnnotationRevisionMetadata(final Object entity, Class<? extends Annotation> revisionNumberAnnotation, public AnnotationRevisionMetadata(final Object entity, Class<? extends Annotation> revisionNumberAnnotation,
Class<? extends Annotation> revisionTimeStampAnnotation) { Class<? extends Annotation> revisionTimeStampAnnotation) {
Assert.notNull(entity); Assert.notNull(entity, "Entity must not be null!");
this.entity = entity; this.entity = entity;
if (revisionNumberAnnotation != null) { if (revisionNumberAnnotation != null) {

4
src/main/java/org/springframework/data/history/Revision.java

@ -37,8 +37,8 @@ public final class Revision<N extends Number & Comparable<N>, T> implements Comp
*/ */
public Revision(RevisionMetadata<N> metadata, T entity) { public Revision(RevisionMetadata<N> metadata, T entity) {
Assert.notNull(metadata); Assert.notNull(metadata, "Metadata must not be null!");
Assert.notNull(entity); Assert.notNull(entity, "Entity must not be null!");
this.metadata = metadata; this.metadata = metadata;
this.entity = entity; this.entity = entity;

2
src/main/java/org/springframework/data/history/Revisions.java

@ -51,7 +51,7 @@ public class Revisions<N extends Number & Comparable<N>, T> implements Iterable<
*/ */
private Revisions(List<? extends Revision<N, T>> revisions, boolean latestLast) { private Revisions(List<? extends Revision<N, T>> revisions, boolean latestLast) {
Assert.notNull(revisions); Assert.notNull(revisions, "Revisions must not be null!");
this.revisions = new ArrayList<Revision<N, T>>(revisions); this.revisions = new ArrayList<Revision<N, T>>(revisions);
this.latestLast = latestLast; this.latestLast = latestLast;

12
src/main/java/org/springframework/data/mapping/PreferredConstructor.java

@ -58,8 +58,8 @@ public class PreferredConstructor<T, P extends PersistentProperty<P>> {
*/ */
public PreferredConstructor(Constructor<T> constructor, Parameter<Object, P>... parameters) { public PreferredConstructor(Constructor<T> constructor, Parameter<Object, P>... parameters) {
Assert.notNull(constructor); Assert.notNull(constructor, "Constructor must not be null!");
Assert.notNull(parameters); Assert.notNull(parameters, "Parameters must not be null!");
ReflectionUtils.makeAccessible(constructor); ReflectionUtils.makeAccessible(constructor);
this.constructor = constructor; this.constructor = constructor;
@ -122,7 +122,7 @@ public class PreferredConstructor<T, P extends PersistentProperty<P>> {
*/ */
public boolean isConstructorParameter(PersistentProperty<?> property) { public boolean isConstructorParameter(PersistentProperty<?> property) {
Assert.notNull(property); Assert.notNull(property, "Property must not be null!");
try { try {
@ -166,7 +166,7 @@ public class PreferredConstructor<T, P extends PersistentProperty<P>> {
*/ */
public boolean isEnclosingClassParameter(Parameter<?, P> parameter) { public boolean isEnclosingClassParameter(Parameter<?, P> parameter) {
Assert.notNull(parameter); Assert.notNull(parameter, "Parameter must not be null!");
if (parameters.isEmpty() || !parameter.isEnclosingClassParameter()) { if (parameters.isEmpty() || !parameter.isEnclosingClassParameter()) {
return false; return false;
@ -203,8 +203,8 @@ public class PreferredConstructor<T, P extends PersistentProperty<P>> {
*/ */
public Parameter(String name, TypeInformation<T> type, Annotation[] annotations, PersistentEntity<T, P> entity) { public Parameter(String name, TypeInformation<T> type, Annotation[] annotations, PersistentEntity<T, P> entity) {
Assert.notNull(type); Assert.notNull(type, "Type must not be null!");
Assert.notNull(annotations); Assert.notNull(annotations, "Annotations must not be null!");
this.name = name; this.name = name;
this.type = type; this.type = type;

2
src/main/java/org/springframework/data/mapping/context/AbstractMappingContext.java

@ -160,7 +160,7 @@ public abstract class AbstractMappingContext<E extends MutablePersistentEntity<?
*/ */
public E getPersistentEntity(TypeInformation<?> type) { public E getPersistentEntity(TypeInformation<?> type) {
Assert.notNull(type); Assert.notNull(type, "Type must not be null!");
try { try {
read.lock(); read.lock();

2
src/main/java/org/springframework/data/mapping/context/DefaultPersistentPropertyPath.java

@ -51,7 +51,7 @@ class DefaultPersistentPropertyPath<T extends PersistentProperty<T>> implements
*/ */
public DefaultPersistentPropertyPath(List<T> properties) { public DefaultPersistentPropertyPath(List<T> properties) {
Assert.notNull(properties); Assert.notNull(properties, "Properties must not be null!");
this.properties = properties; this.properties = properties;
} }

4
src/main/java/org/springframework/data/mapping/context/MappingContextEvent.java

@ -46,8 +46,8 @@ public class MappingContextEvent<E extends PersistentEntity<?, P>, P extends Per
super(source); super(source);
Assert.notNull(source); Assert.notNull(source, "Source MappingContext must not be null!");
Assert.notNull(entity); Assert.notNull(entity, "Entity must not be null!");
this.source = source; this.source = source;
this.entity = entity; this.entity = entity;

4
src/main/java/org/springframework/data/mapping/model/AbstractPersistentProperty.java

@ -58,8 +58,8 @@ public abstract class AbstractPersistentProperty<P extends PersistentProperty<P>
public AbstractPersistentProperty(Field field, PropertyDescriptor propertyDescriptor, PersistentEntity<?, P> owner, public AbstractPersistentProperty(Field field, PropertyDescriptor propertyDescriptor, PersistentEntity<?, P> owner,
SimpleTypeHolder simpleTypeHolder) { SimpleTypeHolder simpleTypeHolder) {
Assert.notNull(simpleTypeHolder); Assert.notNull(simpleTypeHolder, "SimpleTypeHolder must not be null!");
Assert.notNull(owner); Assert.notNull(owner, "Owner entity must not be null!");
this.name = field == null ? propertyDescriptor.getName() : field.getName(); this.name = field == null ? propertyDescriptor.getName() : field.getName();
this.rawType = field == null ? propertyDescriptor.getPropertyType() : field.getType(); this.rawType = field == null ? propertyDescriptor.getPropertyType() : field.getType();

12
src/main/java/org/springframework/data/mapping/model/BasicPersistentEntity.java

@ -96,7 +96,7 @@ public class BasicPersistentEntity<T, P extends PersistentProperty<P>> implement
*/ */
public BasicPersistentEntity(TypeInformation<T> information, Comparator<P> comparator) { public BasicPersistentEntity(TypeInformation<T> information, Comparator<P> comparator) {
Assert.notNull(information); Assert.notNull(information, "Information must not be null!");
this.information = information; this.information = information;
this.properties = new ArrayList<P>(); this.properties = new ArrayList<P>();
@ -188,7 +188,7 @@ public class BasicPersistentEntity<T, P extends PersistentProperty<P>> implement
*/ */
public void addPersistentProperty(P property) { public void addPersistentProperty(P property) {
Assert.notNull(property); Assert.notNull(property, "Property must not be null!");
if (properties.contains(property)) { if (properties.contains(property)) {
return; return;
@ -323,7 +323,7 @@ public class BasicPersistentEntity<T, P extends PersistentProperty<P>> implement
*/ */
public void doWithProperties(PropertyHandler<P> handler) { public void doWithProperties(PropertyHandler<P> handler) {
Assert.notNull(handler); Assert.notNull(handler, "Handler must not be null!");
for (P property : properties) { for (P property : properties) {
if (!property.isTransient() && !property.isAssociation()) { if (!property.isTransient() && !property.isAssociation()) {
@ -339,7 +339,7 @@ public class BasicPersistentEntity<T, P extends PersistentProperty<P>> implement
@Override @Override
public void doWithProperties(SimplePropertyHandler handler) { public void doWithProperties(SimplePropertyHandler handler) {
Assert.notNull(handler); Assert.notNull(handler, "Handler must not be null!");
for (PersistentProperty<?> property : properties) { for (PersistentProperty<?> property : properties) {
if (!property.isTransient() && !property.isAssociation()) { if (!property.isTransient() && !property.isAssociation()) {
@ -354,7 +354,7 @@ public class BasicPersistentEntity<T, P extends PersistentProperty<P>> implement
*/ */
public void doWithAssociations(AssociationHandler<P> handler) { public void doWithAssociations(AssociationHandler<P> handler) {
Assert.notNull(handler); Assert.notNull(handler, "Handler must not be null!");
for (Association<P> association : associations) { for (Association<P> association : associations) {
handler.doWithAssociation(association); handler.doWithAssociation(association);
@ -367,7 +367,7 @@ public class BasicPersistentEntity<T, P extends PersistentProperty<P>> implement
*/ */
public void doWithAssociations(SimpleAssociationHandler handler) { public void doWithAssociations(SimpleAssociationHandler handler) {
Assert.notNull(handler); Assert.notNull(handler, "Handler must not be null!");
for (Association<? extends PersistentProperty<?>> association : associations) { for (Association<? extends PersistentProperty<?>> association : associations) {
handler.doWithAssociation(association); handler.doWithAssociation(association);

4
src/main/java/org/springframework/data/mapping/model/PersistentEntityParameterValueProvider.java

@ -47,8 +47,8 @@ public class PersistentEntityParameterValueProvider<P extends PersistentProperty
public PersistentEntityParameterValueProvider(PersistentEntity<?, P> entity, PropertyValueProvider<P> provider, public PersistentEntityParameterValueProvider(PersistentEntity<?, P> entity, PropertyValueProvider<P> provider,
Object parent) { Object parent) {
Assert.notNull(entity); Assert.notNull(entity, "Entity must not be null!");
Assert.notNull(provider); Assert.notNull(provider, "Provider must not be null!");
this.entity = entity; this.entity = entity;
this.provider = provider; this.provider = provider;

8
src/main/java/org/springframework/data/mapping/model/SimpleTypeHolder.java

@ -86,7 +86,7 @@ public class SimpleTypeHolder {
*/ */
public SimpleTypeHolder(Set<? extends Class<?>> customSimpleTypes, boolean registerDefaults) { public SimpleTypeHolder(Set<? extends Class<?>> customSimpleTypes, boolean registerDefaults) {
Assert.notNull(customSimpleTypes); Assert.notNull(customSimpleTypes, "CustomSimpleTypes must not be null!");
this.simpleTypes = new CopyOnWriteArraySet<Class<?>>(customSimpleTypes); this.simpleTypes = new CopyOnWriteArraySet<Class<?>>(customSimpleTypes);
if (registerDefaults) { if (registerDefaults) {
@ -102,8 +102,8 @@ public class SimpleTypeHolder {
*/ */
public SimpleTypeHolder(Set<? extends Class<?>> customSimpleTypes, SimpleTypeHolder source) { public SimpleTypeHolder(Set<? extends Class<?>> customSimpleTypes, SimpleTypeHolder source) {
Assert.notNull(customSimpleTypes); Assert.notNull(customSimpleTypes, "CustomSimpleTypes must not be null!");
Assert.notNull(source); Assert.notNull(source, "SourceTypeHolder must not be null!");
this.simpleTypes = new CopyOnWriteArraySet<Class<?>>(customSimpleTypes); this.simpleTypes = new CopyOnWriteArraySet<Class<?>>(customSimpleTypes);
this.simpleTypes.addAll(source.simpleTypes); this.simpleTypes.addAll(source.simpleTypes);
@ -117,7 +117,7 @@ public class SimpleTypeHolder {
*/ */
public boolean isSimpleType(Class<?> type) { public boolean isSimpleType(Class<?> type) {
Assert.notNull(type); Assert.notNull(type, "Type must not be null!");
if (Object.class.equals(type) || simpleTypes.contains(type)) { if (Object.class.equals(type) || simpleTypes.contains(type)) {
return true; return true;

8
src/main/java/org/springframework/data/repository/cdi/CdiRepositoryBean.java

@ -86,10 +86,10 @@ public abstract class CdiRepositoryBean<T> implements Bean<T>, PassivationCapabl
public CdiRepositoryBean(Set<Annotation> qualifiers, Class<T> repositoryType, BeanManager beanManager, public CdiRepositoryBean(Set<Annotation> qualifiers, Class<T> repositoryType, BeanManager beanManager,
CustomRepositoryImplementationDetector detector) { CustomRepositoryImplementationDetector detector) {
Assert.notNull(qualifiers); Assert.notNull(qualifiers, "Qualifiers must not be null!");
Assert.notNull(beanManager); Assert.notNull(beanManager, "BeanManager must not be null!");
Assert.notNull(repositoryType); Assert.notNull(repositoryType, "Repoitory type must not be null!");
Assert.isTrue(repositoryType.isInterface()); Assert.isTrue(repositoryType.isInterface(), "RepositoryType must be an interface!");
this.qualifiers = qualifiers; this.qualifiers = qualifiers;
this.repositoryType = repositoryType; this.repositoryType = repositoryType;

8
src/main/java/org/springframework/data/repository/config/AnnotationRepositoryConfigurationSource.java

@ -67,7 +67,7 @@ public class AnnotationRepositoryConfigurationSource extends RepositoryConfigura
* Creates a new {@link AnnotationRepositoryConfigurationSource} from the given {@link AnnotationMetadata} and * Creates a new {@link AnnotationRepositoryConfigurationSource} from the given {@link AnnotationMetadata} and
* annotation. * annotation.
* *
* @param configMetadata must not be {@literal null}. * @param metadata must not be {@literal null}.
* @param annotation must not be {@literal null}. * @param annotation must not be {@literal null}.
* @param resourceLoader must not be {@literal null}. * @param resourceLoader must not be {@literal null}.
* @param environment * @param environment
@ -77,9 +77,9 @@ public class AnnotationRepositoryConfigurationSource extends RepositoryConfigura
super(environment); super(environment);
Assert.notNull(metadata); Assert.notNull(metadata, "Metadata must not be null!");
Assert.notNull(annotation); Assert.notNull(annotation, "Annotation must not be null!");
Assert.notNull(resourceLoader); Assert.notNull(resourceLoader, "ResourceLoader must not be null!");
this.attributes = new AnnotationAttributes(metadata.getAnnotationAttributes(annotation.getName())); this.attributes = new AnnotationAttributes(metadata.getAnnotationAttributes(annotation.getName()));
this.enableAnnotationMetadata = new StandardAnnotationMetadata(annotation); this.enableAnnotationMetadata = new StandardAnnotationMetadata(annotation);

4
src/main/java/org/springframework/data/repository/config/DefaultRepositoryConfiguration.java

@ -44,8 +44,8 @@ public class DefaultRepositoryConfiguration<T extends RepositoryConfigurationSou
*/ */
public DefaultRepositoryConfiguration(T configurationSource, BeanDefinition definition) { public DefaultRepositoryConfiguration(T configurationSource, BeanDefinition definition) {
Assert.notNull(configurationSource); Assert.notNull(configurationSource, "ConfigurationSource must not be null!");
Assert.notNull(definition); Assert.notNull(definition, "BeanDefinition must not be null!");
this.configurationSource = configurationSource; this.configurationSource = configurationSource;
this.definition = definition; this.definition = definition;

4
src/main/java/org/springframework/data/repository/config/NamedQueriesBeanDefinitionBuilder.java

@ -41,7 +41,7 @@ public class NamedQueriesBeanDefinitionBuilder {
*/ */
public NamedQueriesBeanDefinitionBuilder(String defaultLocation) { public NamedQueriesBeanDefinitionBuilder(String defaultLocation) {
Assert.hasText(defaultLocation); Assert.hasText(defaultLocation, "DefaultLocation must not be null nor empty!");
this.defaultLocation = defaultLocation; this.defaultLocation = defaultLocation;
} }
@ -52,7 +52,7 @@ public class NamedQueriesBeanDefinitionBuilder {
*/ */
public void setLocations(String locations) { public void setLocations(String locations) {
Assert.hasText(locations); Assert.hasText(locations, "Locations must not be null nor empty!");
this.locations = locations; this.locations = locations;
} }

2
src/main/java/org/springframework/data/repository/config/NamedQueriesBeanDefinitionParser.java

@ -46,7 +46,7 @@ public class NamedQueriesBeanDefinitionParser implements BeanDefinitionParser {
* @param defaultLocation must be non-empty * @param defaultLocation must be non-empty
*/ */
public NamedQueriesBeanDefinitionParser(String defaultLocation) { public NamedQueriesBeanDefinitionParser(String defaultLocation) {
Assert.hasText(defaultLocation); Assert.hasText(defaultLocation, "DefaultLocation must not be null nor empty!");
this.defaultLocation = defaultLocation; this.defaultLocation = defaultLocation;
} }

2
src/main/java/org/springframework/data/repository/config/RepositoryBeanDefinitionParser.java

@ -47,7 +47,7 @@ public class RepositoryBeanDefinitionParser implements BeanDefinitionParser {
*/ */
public RepositoryBeanDefinitionParser(RepositoryConfigurationExtension extension) { public RepositoryBeanDefinitionParser(RepositoryConfigurationExtension extension) {
Assert.notNull(extension); Assert.notNull(extension, "Extension must not be null!");
this.extension = extension; this.extension = extension;
} }

4
src/main/java/org/springframework/data/repository/config/RepositoryComponentProvider.java

@ -61,7 +61,7 @@ class RepositoryComponentProvider extends ClassPathScanningCandidateComponentPro
assertRequiredSpringVersionPresent(); assertRequiredSpringVersionPresent();
Assert.notNull(includeFilters); Assert.notNull(includeFilters, "Include filters must not be null!");
if (includeFilters.iterator().hasNext()) { if (includeFilters.iterator().hasNext()) {
for (TypeFilter filter : includeFilters) { for (TypeFilter filter : includeFilters) {
@ -204,7 +204,7 @@ class RepositoryComponentProvider extends ClassPathScanningCandidateComponentPro
*/ */
public AllTypeFilter(List<TypeFilter> delegates) { public AllTypeFilter(List<TypeFilter> delegates) {
Assert.notNull(delegates); Assert.notNull(delegates, "TypeFilter deleages must not be null!");
this.delegates = delegates; this.delegates = delegates;
} }

2
src/main/java/org/springframework/data/repository/config/RepositoryConfigurationDelegate.java

@ -73,7 +73,7 @@ public class RepositoryConfigurationDelegate {
Assert.isTrue(isXml || isAnnotation, Assert.isTrue(isXml || isAnnotation,
"Configuration source must either be an Xml- or an AnnotationBasedConfigurationSource!"); "Configuration source must either be an Xml- or an AnnotationBasedConfigurationSource!");
Assert.notNull(resourceLoader); Assert.notNull(resourceLoader, "ResourceLoader must not be null!");
RepositoryBeanNameGenerator generator = new RepositoryBeanNameGenerator(); RepositoryBeanNameGenerator generator = new RepositoryBeanNameGenerator();
generator.setBeanClassLoader(resourceLoader.getClassLoader()); generator.setBeanClassLoader(resourceLoader.getClassLoader());

4
src/main/java/org/springframework/data/repository/config/RepositoryConfigurationExtensionSupport.java

@ -76,8 +76,8 @@ public abstract class RepositoryConfigurationExtensionSupport implements Reposit
public <T extends RepositoryConfigurationSource> Collection<RepositoryConfiguration<T>> getRepositoryConfigurations( public <T extends RepositoryConfigurationSource> Collection<RepositoryConfiguration<T>> getRepositoryConfigurations(
T configSource, ResourceLoader loader, boolean strictMatchesOnly) { T configSource, ResourceLoader loader, boolean strictMatchesOnly) {
Assert.notNull(configSource); Assert.notNull(configSource, "ConfigSource must not be null!");
Assert.notNull(loader); Assert.notNull(loader, "Loader must not be null!");
Set<RepositoryConfiguration<T>> result = new HashSet<RepositoryConfiguration<T>>(); Set<RepositoryConfiguration<T>> result = new HashSet<RepositoryConfiguration<T>>();

4
src/main/java/org/springframework/data/repository/config/XmlRepositoryConfigurationSource.java

@ -62,8 +62,8 @@ public class XmlRepositoryConfigurationSource extends RepositoryConfigurationSou
super(environment); super(environment);
Assert.notNull(element); Assert.notNull(element, "Element must not be null!");
Assert.notNull(context); Assert.notNull(context, "Context must not be null!");
this.element = element; this.element = element;
this.context = context; this.context = context;

2
src/main/java/org/springframework/data/repository/core/support/AbstractEntityInformation.java

@ -38,7 +38,7 @@ public abstract class AbstractEntityInformation<T, ID extends Serializable> impl
*/ */
public AbstractEntityInformation(Class<T> domainClass) { public AbstractEntityInformation(Class<T> domainClass) {
Assert.notNull(domainClass); Assert.notNull(domainClass, "DomainClass must not be null!");
this.domainClass = domainClass; this.domainClass = domainClass;
} }

6
src/main/java/org/springframework/data/repository/core/support/DefaultRepositoryInformation.java

@ -73,8 +73,8 @@ class DefaultRepositoryInformation implements RepositoryInformation {
public DefaultRepositoryInformation(RepositoryMetadata metadata, Class<?> repositoryBaseClass, public DefaultRepositoryInformation(RepositoryMetadata metadata, Class<?> repositoryBaseClass,
Class<?> customImplementationClass) { Class<?> customImplementationClass) {
Assert.notNull(metadata); Assert.notNull(metadata, "Metadata must not be null!");
Assert.notNull(repositoryBaseClass); Assert.notNull(repositoryBaseClass, "RepositoryBaseClass must not be null!");
this.metadata = metadata; this.metadata = metadata;
this.repositoryBaseClass = repositoryBaseClass; this.repositoryBaseClass = repositoryBaseClass;
@ -146,7 +146,7 @@ class DefaultRepositoryInformation implements RepositoryInformation {
*/ */
private boolean isTargetClassMethod(Method method, Class<?> targetType) { private boolean isTargetClassMethod(Method method, Class<?> targetType) {
Assert.notNull(method); Assert.notNull(method, "Method must not be null!");
if (targetType == null) { if (targetType == null) {
return false; return false;

2
src/main/java/org/springframework/data/repository/core/support/DelegatingEntityInformation.java

@ -38,7 +38,7 @@ public class DelegatingEntityInformation<T, ID extends Serializable> implements
*/ */
public DelegatingEntityInformation(EntityInformation<T, ID> delegate) { public DelegatingEntityInformation(EntityInformation<T, ID> delegate) {
Assert.notNull(delegate); Assert.notNull(delegate, "Delegate EnittyInformation must not be null!");
this.delegate = delegate; this.delegate = delegate;
} }

2
src/main/java/org/springframework/data/repository/core/support/PropertiesBasedNamedQueries.java

@ -37,7 +37,7 @@ public class PropertiesBasedNamedQueries implements NamedQueries {
* @param properties * @param properties
*/ */
public PropertiesBasedNamedQueries(Properties properties) { public PropertiesBasedNamedQueries(Properties properties) {
Assert.notNull(properties); Assert.notNull(properties, "Properties must not be null!");
this.properties = properties; this.properties = properties;
} }

2
src/main/java/org/springframework/data/repository/core/support/ReflectionEntityInformation.java

@ -58,7 +58,7 @@ public class ReflectionEntityInformation<T, ID extends Serializable> extends Abs
public ReflectionEntityInformation(Class<T> domainClass, final Class<? extends Annotation> annotation) { public ReflectionEntityInformation(Class<T> domainClass, final Class<? extends Annotation> annotation) {
super(domainClass); super(domainClass);
Assert.notNull(annotation); Assert.notNull(annotation, "Annotation must not be null!");
ReflectionUtils.doWithFields(domainClass, new FieldCallback() { ReflectionUtils.doWithFields(domainClass, new FieldCallback() {
public void doWith(Field field) { public void doWith(Field field) {

2
src/main/java/org/springframework/data/repository/core/support/RepositoryFactorySupport.java

@ -153,7 +153,7 @@ public abstract class RepositoryFactorySupport implements BeanClassLoaderAware,
*/ */
public void addQueryCreationListener(QueryCreationListener<?> listener) { public void addQueryCreationListener(QueryCreationListener<?> listener) {
Assert.notNull(listener); Assert.notNull(listener, "Listener must not be null!");
this.queryPostProcessors.add(listener); this.queryPostProcessors.add(listener);
} }

4
src/main/java/org/springframework/data/repository/core/support/TransactionalRepositoryProxyPostProcessor.java

@ -70,8 +70,8 @@ class TransactionalRepositoryProxyPostProcessor implements RepositoryProxyPostPr
public TransactionalRepositoryProxyPostProcessor(ListableBeanFactory beanFactory, String transactionManagerName, public TransactionalRepositoryProxyPostProcessor(ListableBeanFactory beanFactory, String transactionManagerName,
boolean enableDefaultTransaction) { boolean enableDefaultTransaction) {
Assert.notNull(beanFactory); Assert.notNull(beanFactory, "BeanFactory must not be null!");
Assert.notNull(transactionManagerName); Assert.notNull(transactionManagerName, "TransactionManagerName must not be null!");
this.beanFactory = beanFactory; this.beanFactory = beanFactory;
this.transactionManagerName = transactionManagerName; this.transactionManagerName = transactionManagerName;

4
src/main/java/org/springframework/data/repository/init/RepositoriesPopulatedEvent.java

@ -43,8 +43,8 @@ public class RepositoriesPopulatedEvent extends ApplicationEvent {
super(populator); super(populator);
Assert.notNull(populator); Assert.notNull(populator, "Populator must not be null!");
Assert.notNull(repositories); Assert.notNull(repositories, "Repositories must not be null!");
this.repositories = repositories; this.repositories = repositories;
} }

4
src/main/java/org/springframework/data/repository/init/ResourceReaderRepositoryPopulator.java

@ -67,7 +67,7 @@ public class ResourceReaderRepositoryPopulator implements RepositoryPopulator, A
*/ */
public ResourceReaderRepositoryPopulator(ResourceReader reader, ClassLoader classLoader) { public ResourceReaderRepositoryPopulator(ResourceReader reader, ClassLoader classLoader) {
Assert.notNull(reader); Assert.notNull(reader, "Reader must not be null!");
this.reader = reader; this.reader = reader;
this.classLoader = classLoader; this.classLoader = classLoader;
@ -82,7 +82,7 @@ public class ResourceReaderRepositoryPopulator implements RepositoryPopulator, A
* @throws IOException * @throws IOException
*/ */
public void setResourceLocation(String location) throws IOException { public void setResourceLocation(String location) throws IOException {
Assert.hasText(location); Assert.hasText(location, "Location must not be null!");
setResources(resolver.getResources(location)); setResources(resolver.getResources(location));
} }

2
src/main/java/org/springframework/data/repository/query/Parameter.java

@ -54,7 +54,7 @@ public class Parameter {
*/ */
protected Parameter(MethodParameter parameter) { protected Parameter(MethodParameter parameter) {
Assert.notNull(parameter); Assert.notNull(parameter, "MethodParameter must not be null!");
this.parameter = parameter; this.parameter = parameter;
this.parameterType = potentiallyUnwrapParameterType(parameter); this.parameterType = potentiallyUnwrapParameterType(parameter);

2
src/main/java/org/springframework/data/repository/query/Parameters.java

@ -60,7 +60,7 @@ public abstract class Parameters<S extends Parameters<S, T>, T extends Parameter
*/ */
public Parameters(Method method) { public Parameters(Method method) {
Assert.notNull(method); Assert.notNull(method, "Method must not be null!");
List<Class<?>> types = Arrays.asList(method.getParameterTypes()); List<Class<?>> types = Arrays.asList(method.getParameterTypes());

4
src/main/java/org/springframework/data/repository/query/ParametersParameterAccessor.java

@ -42,8 +42,8 @@ public class ParametersParameterAccessor implements ParameterAccessor {
*/ */
public ParametersParameterAccessor(Parameters<?, ?> parameters, Object[] values) { public ParametersParameterAccessor(Parameters<?, ?> parameters, Object[] values) {
Assert.notNull(parameters); Assert.notNull(parameters, "Parameters must not be null!");
Assert.notNull(values); Assert.notNull(values, "Values must not be null!");
Assert.isTrue(parameters.getNumberOfParameters() == values.length, "Invalid number of parameters given!"); Assert.isTrue(parameters.getNumberOfParameters() == values.length, "Invalid number of parameters given!");

2
src/main/java/org/springframework/data/repository/query/QueryMethod.java

@ -87,7 +87,7 @@ public class QueryMethod {
} }
} }
Assert.notNull(this.parameters); Assert.notNull(this.parameters, String.format("Parameters extracted from method '%s' must not be null!", method.getName()));
if (isPageQuery()) { if (isPageQuery()) {
Assert.isTrue(this.parameters.hasPageableParameter(), Assert.isTrue(this.parameters.hasPageableParameter(),

2
src/main/java/org/springframework/data/repository/support/AnnotationAttribute.java

@ -50,7 +50,7 @@ class AnnotationAttribute {
*/ */
public AnnotationAttribute(Class<? extends Annotation> annotationType, String attributeName) { public AnnotationAttribute(Class<? extends Annotation> annotationType, String attributeName) {
Assert.notNull(annotationType); Assert.notNull(annotationType, "AnnotationType must not be null!");
this.annotationType = annotationType; this.annotationType = annotationType;
this.attributeName = attributeName; this.attributeName = attributeName;

4
src/main/java/org/springframework/data/repository/support/MethodParameters.java

@ -54,7 +54,7 @@ class MethodParameters {
*/ */
public MethodParameters(Method method, AnnotationAttribute namingAnnotation) { public MethodParameters(Method method, AnnotationAttribute namingAnnotation) {
Assert.notNull(method); Assert.notNull(method, "Method must not be null!");
this.parameters = new ArrayList<MethodParameter>(); this.parameters = new ArrayList<MethodParameter>();
for (int i = 0; i < method.getParameterTypes().length; i++) { for (int i = 0; i < method.getParameterTypes().length; i++) {
@ -122,7 +122,7 @@ class MethodParameters {
*/ */
public List<MethodParameter> getParametersWith(Class<? extends Annotation> annotation) { public List<MethodParameter> getParametersWith(Class<? extends Annotation> annotation) {
Assert.notNull(annotation); Assert.notNull(annotation, "Annotation must not be null!");
List<MethodParameter> result = new ArrayList<MethodParameter>(); List<MethodParameter> result = new ArrayList<MethodParameter>();
for (MethodParameter parameter : getParameters()) { for (MethodParameter parameter : getParameters()) {

2
src/main/java/org/springframework/data/repository/support/Repositories.java

@ -72,7 +72,7 @@ public class Repositories implements Iterable<Class<?>> {
*/ */
public Repositories(ListableBeanFactory factory) { public Repositories(ListableBeanFactory factory) {
Assert.notNull(factory); Assert.notNull(factory, "Factory must not be null!");
this.beanFactory = factory; this.beanFactory = factory;
this.repositoryFactoryInfos = new HashMap<Class<?>, RepositoryFactoryInformation<Object, Serializable>>(); this.repositoryFactoryInfos = new HashMap<Class<?>, RepositoryFactoryInformation<Object, Serializable>>();

4
src/main/java/org/springframework/data/util/AnnotationDetectionFieldCallback.java

@ -42,7 +42,7 @@ public class AnnotationDetectionFieldCallback implements FieldCallback {
*/ */
public AnnotationDetectionFieldCallback(Class<? extends Annotation> annotationType) { public AnnotationDetectionFieldCallback(Class<? extends Annotation> annotationType) {
Assert.notNull(annotationType); Assert.notNull(annotationType, "AnnotationType must not be null!");
this.annotationType = annotationType; this.annotationType = annotationType;
} }
@ -83,7 +83,7 @@ public class AnnotationDetectionFieldCallback implements FieldCallback {
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public <T> T getValue(Object source) { 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); return field == null ? null : (T) ReflectionUtils.getField(field, source);
} }
} }

8
src/main/java/org/springframework/data/util/TypeDiscoverer.java

@ -91,8 +91,8 @@ class TypeDiscoverer<S> implements TypeInformation<S> {
*/ */
protected TypeDiscoverer(Type type, Map<TypeVariable<?>, Type> typeVariableMap) { protected TypeDiscoverer(Type type, Map<TypeVariable<?>, Type> typeVariableMap) {
Assert.notNull(type); Assert.notNull(type, "Type must not be null!");
Assert.notNull(typeVariableMap); Assert.notNull(typeVariableMap, "TypeVariableMap must not be null!");
this.type = type; this.type = type;
this.typeVariableMap = typeVariableMap; this.typeVariableMap = typeVariableMap;
@ -447,7 +447,7 @@ class TypeDiscoverer<S> implements TypeInformation<S> {
*/ */
public TypeInformation<?> getReturnType(Method method) { public TypeInformation<?> getReturnType(Method method) {
Assert.notNull(method); Assert.notNull(method, "Method must not be null!");
return createInfo(method.getGenericReturnType()); return createInfo(method.getGenericReturnType());
} }
@ -532,7 +532,7 @@ class TypeDiscoverer<S> implements TypeInformation<S> {
@Override @Override
public TypeInformation<?> specialize(ClassTypeInformation<?> type) { 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(); List<TypeInformation<?>> arguments = getTypeArguments();

2
src/main/java/org/springframework/data/util/TypeVariableTypeInformation.java

@ -47,7 +47,7 @@ class TypeVariableTypeInformation<T> extends ParentTypeAwareTypeInformation<T> {
Map<TypeVariable<?>, Type> typeVariableMap) { Map<TypeVariable<?>, Type> typeVariableMap) {
super(variable, parent, typeVariableMap); super(variable, parent, typeVariableMap);
Assert.notNull(variable); Assert.notNull(variable, "TypeVariable must not be null!");
this.variable = variable; this.variable = variable;
this.owningType = owningType; this.owningType = owningType;
} }

6
src/main/java/org/springframework/data/util/Version.java

@ -42,8 +42,8 @@ public class Version implements Comparable<Version> {
*/ */
public Version(int... parts) { public Version(int... parts) {
Assert.notNull(parts); Assert.notNull(parts, "Parts must not be null!");
Assert.isTrue(parts.length > 0 && parts.length < 5); Assert.isTrue(parts.length > 0 && parts.length < 5, String.format("Invalid parts length. 0 < %s < 5", parts.length));
this.major = parts[0]; this.major = parts[0];
this.minor = parts.length > 1 ? parts[1] : 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) { public static Version parse(String version) {
Assert.hasText(version); Assert.hasText(version, "Version must not be null o empty!");
String[] parts = version.trim().split("\\."); String[] parts = version.trim().split("\\.");
int[] intParts = new int[parts.length]; int[] intParts = new int[parts.length];

2
src/main/java/org/springframework/data/web/SortHandlerMethodArgumentResolver.java

@ -64,7 +64,7 @@ public class SortHandlerMethodArgumentResolver implements SortArgumentResolver {
*/ */
public void setSortParameter(String sortParameter) { public void setSortParameter(String sortParameter) {
Assert.hasText(sortParameter); Assert.hasText(sortParameter, "SortParameter must not be null nor empty!");
this.sortParameter = sortParameter; this.sortParameter = sortParameter;
} }

Loading…
Cancel
Save