diff --git a/src/main/java/org/springframework/data/auditing/AnnotationAuditingMetadata.java b/src/main/java/org/springframework/data/auditing/AnnotationAuditingMetadata.java index 7076f974a..f645e5790 100644 --- a/src/main/java/org/springframework/data/auditing/AnnotationAuditingMetadata.java +++ b/src/main/java/org/springframework/data/auditing/AnnotationAuditingMetadata.java @@ -78,7 +78,7 @@ final class AnnotationAuditingMetadata { */ private AnnotationAuditingMetadata(Class type) { - Assert.notNull(type, "Given type must not be null!"); + Assert.notNull(type, "Given type must not be null"); this.createdByField = Optional.ofNullable(ReflectionUtils.findField(type, CREATED_BY_FILTER)); this.createdDateField = Optional.ofNullable(ReflectionUtils.findField(type, CREATED_DATE_FILTER)); diff --git a/src/main/java/org/springframework/data/auditing/AuditingHandler.java b/src/main/java/org/springframework/data/auditing/AuditingHandler.java index d05f22850..25cfb43b5 100644 --- a/src/main/java/org/springframework/data/auditing/AuditingHandler.java +++ b/src/main/java/org/springframework/data/auditing/AuditingHandler.java @@ -48,7 +48,7 @@ public class AuditingHandler extends AuditingHandlerSupport implements Initializ public AuditingHandler(PersistentEntities entities) { super(entities); - Assert.notNull(entities, "PersistentEntities must not be null!"); + Assert.notNull(entities, "PersistentEntities must not be null"); this.auditorAware = Optional.empty(); } @@ -60,7 +60,7 @@ public class AuditingHandler extends AuditingHandlerSupport implements Initializ */ public void setAuditorAware(AuditorAware auditorAware) { - Assert.notNull(auditorAware, "AuditorAware must not be null!"); + Assert.notNull(auditorAware, "AuditorAware must not be null"); this.auditorAware = Optional.of(auditorAware); } @@ -71,7 +71,7 @@ public class AuditingHandler extends AuditingHandlerSupport implements Initializ */ public T markCreated(T source) { - Assert.notNull(source, "Entity must not be null!"); + Assert.notNull(source, "Entity must not be null"); return markCreated(getAuditor(), source); } @@ -83,7 +83,7 @@ public class AuditingHandler extends AuditingHandlerSupport implements Initializ */ public T markModified(T source) { - Assert.notNull(source, "Entity must not be null!"); + Assert.notNull(source, "Entity must not be null"); return markModified(getAuditor(), source); } @@ -97,7 +97,7 @@ public class AuditingHandler extends AuditingHandlerSupport implements Initializ public void afterPropertiesSet() { if (!auditorAware.isPresent()) { - logger.debug("No AuditorAware set! Auditing will not be applied!"); + logger.debug("No AuditorAware set; Auditing will not be applied"); } } } diff --git a/src/main/java/org/springframework/data/auditing/AuditingHandlerSupport.java b/src/main/java/org/springframework/data/auditing/AuditingHandlerSupport.java index 53d9c7f25..b30e8896d 100644 --- a/src/main/java/org/springframework/data/auditing/AuditingHandlerSupport.java +++ b/src/main/java/org/springframework/data/auditing/AuditingHandlerSupport.java @@ -53,7 +53,7 @@ public abstract class AuditingHandlerSupport { */ public AuditingHandlerSupport(PersistentEntities entities) { - Assert.notNull(entities, "PersistentEntities must not be null!"); + Assert.notNull(entities, "PersistentEntities must not be null"); this.factory = new MappingAuditableBeanWrapperFactory(entities); } @@ -96,7 +96,7 @@ public abstract class AuditingHandlerSupport { */ protected final boolean isAuditable(Object source) { - Assert.notNull(source, "Source entity must not be null!"); + Assert.notNull(source, "Source entity must not be null"); return factory.getBeanWrapperFor(source).isPresent(); } @@ -109,7 +109,7 @@ public abstract class AuditingHandlerSupport { */ T markCreated(Auditor auditor, T source) { - Assert.notNull(source, "Source entity must not be null!"); + Assert.notNull(source, "Source entity must not be null"); return touch(auditor, source, true); } @@ -122,7 +122,7 @@ public abstract class AuditingHandlerSupport { */ T markModified(Auditor auditor, T source) { - Assert.notNull(source, "Source entity must not be null!"); + Assert.notNull(source, "Source entity must not be null"); return touch(auditor, source, false); } @@ -163,7 +163,7 @@ public abstract class AuditingHandlerSupport { return; } - Assert.notNull(wrapper, "AuditableBeanWrapper must not be null!"); + Assert.notNull(wrapper, "AuditableBeanWrapper must not be null"); if (isNew) { wrapper.setCreatedBy(auditor.getValue()); @@ -183,11 +183,11 @@ public abstract class AuditingHandlerSupport { */ private Optional touchDate(AuditableBeanWrapper wrapper, boolean isNew) { - Assert.notNull(wrapper, "AuditableBeanWrapper must not be null!"); + Assert.notNull(wrapper, "AuditableBeanWrapper must not be null"); Optional now = dateTimeProvider.getNow(); - Assert.notNull(now, () -> String.format("Now must not be null! Returned by: %s!", dateTimeProvider.getClass())); + Assert.notNull(now, () -> String.format("Now must not be null Returned by: %s", dateTimeProvider.getClass())); now.filter(__ -> isNew).ifPresent(wrapper::setCreatedDate); now.filter(__ -> !isNew || modifyOnCreation).ifPresent(wrapper::setLastModifiedDate); diff --git a/src/main/java/org/springframework/data/auditing/DefaultAuditableBeanWrapperFactory.java b/src/main/java/org/springframework/data/auditing/DefaultAuditableBeanWrapperFactory.java index a6e286790..5474b7012 100644 --- a/src/main/java/org/springframework/data/auditing/DefaultAuditableBeanWrapperFactory.java +++ b/src/main/java/org/springframework/data/auditing/DefaultAuditableBeanWrapperFactory.java @@ -68,7 +68,7 @@ class DefaultAuditableBeanWrapperFactory implements AuditableBeanWrapperFactory @SuppressWarnings("unchecked") public Optional> getBeanWrapperFor(T source) { - Assert.notNull(source, "Source must not be null!"); + Assert.notNull(source, "Source must not be null"); return Optional.of(source).map(it -> { @@ -188,7 +188,7 @@ class DefaultAuditableBeanWrapperFactory implements AuditableBeanWrapperFactory if (!conversionService.canConvert(value.getClass(), Date.class)) { throw new IllegalArgumentException( - String.format("Cannot convert date type for member %s! From %s to java.util.Date to %s", source, + String.format("Cannot convert date type for member %s; From %s to java.util.Date to %s", source, value.getClass(), targetType)); } @@ -228,7 +228,7 @@ class DefaultAuditableBeanWrapperFactory implements AuditableBeanWrapperFactory } private static IllegalArgumentException rejectUnsupportedType(Object source) { - return new IllegalArgumentException(String.format("Invalid date type %s for member %s! Supported types are %s", + return new IllegalArgumentException(String.format("Invalid date type %s for member %s; Supported types are %s", source.getClass(), source, AnnotationAuditingMetadata.SUPPORTED_DATE_TYPES)); } @@ -251,7 +251,7 @@ class DefaultAuditableBeanWrapperFactory implements AuditableBeanWrapperFactory public ReflectionAuditingBeanWrapper(ConversionService conversionService, T target) { super(conversionService); - Assert.notNull(target, "Target object must not be null!"); + Assert.notNull(target, "Target object must not be null"); this.metadata = AnnotationAuditingMetadata.getMetadata(target.getClass()); this.target = target; diff --git a/src/main/java/org/springframework/data/auditing/IsNewAwareAuditingHandler.java b/src/main/java/org/springframework/data/auditing/IsNewAwareAuditingHandler.java index 8ad820240..1c39ef022 100644 --- a/src/main/java/org/springframework/data/auditing/IsNewAwareAuditingHandler.java +++ b/src/main/java/org/springframework/data/auditing/IsNewAwareAuditingHandler.java @@ -56,7 +56,7 @@ public class IsNewAwareAuditingHandler extends AuditingHandler { */ public Object markAudited(Object object) { - Assert.notNull(object, "Source object must not be null!"); + Assert.notNull(object, "Source object must not be null"); if (!isAuditable(object)) { return object; diff --git a/src/main/java/org/springframework/data/auditing/MappingAuditableBeanWrapperFactory.java b/src/main/java/org/springframework/data/auditing/MappingAuditableBeanWrapperFactory.java index 1db285d83..d6d537c3d 100644 --- a/src/main/java/org/springframework/data/auditing/MappingAuditableBeanWrapperFactory.java +++ b/src/main/java/org/springframework/data/auditing/MappingAuditableBeanWrapperFactory.java @@ -64,7 +64,7 @@ public class MappingAuditableBeanWrapperFactory extends DefaultAuditableBeanWrap */ public MappingAuditableBeanWrapperFactory(PersistentEntities entities) { - Assert.notNull(entities, "PersistentEntities must not be null!"); + Assert.notNull(entities, "PersistentEntities must not be null"); this.entities = entities; this.metadataCache = new ConcurrentReferenceHashMap<>(); @@ -118,7 +118,7 @@ public class MappingAuditableBeanWrapperFactory extends DefaultAuditableBeanWrap */ public

MappingAuditingMetadata(MappingContext> context, Class type) { - Assert.notNull(type, "Type must not be null!"); + Assert.notNull(type, "Type must not be null"); this.createdByPaths = findPropertyPaths(type, CreatedBy.class, context); this.createdDatePaths = findPropertyPaths(type, CreatedDate.class, context); @@ -184,8 +184,8 @@ public class MappingAuditableBeanWrapperFactory extends DefaultAuditableBeanWrap MappingAuditingMetadata metadata) { super(conversionService); - Assert.notNull(accessor, "PersistentPropertyAccessor must not be null!"); - Assert.notNull(metadata, "Auditing metadata must not be null!"); + Assert.notNull(accessor, "PersistentPropertyAccessor must not be null"); + Assert.notNull(metadata, "Auditing metadata must not be null"); this.accessor = accessor; this.metadata = metadata; diff --git a/src/main/java/org/springframework/data/auditing/ReactiveAuditingHandler.java b/src/main/java/org/springframework/data/auditing/ReactiveAuditingHandler.java index a5753a9f2..1d39f0e21 100644 --- a/src/main/java/org/springframework/data/auditing/ReactiveAuditingHandler.java +++ b/src/main/java/org/springframework/data/auditing/ReactiveAuditingHandler.java @@ -49,7 +49,7 @@ public class ReactiveAuditingHandler extends AuditingHandlerSupport { */ public void setAuditorAware(ReactiveAuditorAware auditorAware) { - Assert.notNull(auditorAware, "AuditorAware must not be null!"); + Assert.notNull(auditorAware, "AuditorAware must not be null"); this.auditorAware = auditorAware; } @@ -60,7 +60,7 @@ public class ReactiveAuditingHandler extends AuditingHandlerSupport { */ public Mono markCreated(T source) { - Assert.notNull(source, "Entity must not be null!"); + Assert.notNull(source, "Entity must not be null"); return getAuditor() // .map(auditor -> markCreated(auditor, source)); @@ -73,7 +73,7 @@ public class ReactiveAuditingHandler extends AuditingHandlerSupport { */ public Mono markModified(T source) { - Assert.notNull(source, "Entity must not be null!"); + Assert.notNull(source, "Entity must not be null"); return getAuditor() // .map(auditor -> markModified(auditor, source)); diff --git a/src/main/java/org/springframework/data/auditing/ReactiveIsNewAwareAuditingHandler.java b/src/main/java/org/springframework/data/auditing/ReactiveIsNewAwareAuditingHandler.java index 8721caf81..07e39121c 100644 --- a/src/main/java/org/springframework/data/auditing/ReactiveIsNewAwareAuditingHandler.java +++ b/src/main/java/org/springframework/data/auditing/ReactiveIsNewAwareAuditingHandler.java @@ -56,7 +56,7 @@ public class ReactiveIsNewAwareAuditingHandler extends ReactiveAuditingHandler { */ public Mono markAudited(Object object) { - Assert.notNull(object, "Source object must not be null!"); + Assert.notNull(object, "Source object must not be null"); if (!isAuditable(object)) { return Mono.just(object); diff --git a/src/main/java/org/springframework/data/auditing/config/AnnotationAuditingConfiguration.java b/src/main/java/org/springframework/data/auditing/config/AnnotationAuditingConfiguration.java index f913751f4..787e2b37d 100644 --- a/src/main/java/org/springframework/data/auditing/config/AnnotationAuditingConfiguration.java +++ b/src/main/java/org/springframework/data/auditing/config/AnnotationAuditingConfiguration.java @@ -31,7 +31,7 @@ import org.springframework.util.Assert; */ public class AnnotationAuditingConfiguration implements AuditingConfiguration { - private static final String MISSING_ANNOTATION_ATTRIBUTES = "Couldn't find annotation attributes for %s in %s!"; + private static final String MISSING_ANNOTATION_ATTRIBUTES = "Couldn't find annotation attributes for %s in %s"; private final AnnotationAttributes attributes; @@ -44,8 +44,8 @@ public class AnnotationAuditingConfiguration implements AuditingConfiguration { */ public AnnotationAuditingConfiguration(AnnotationMetadata metadata, Class annotation) { - Assert.notNull(metadata, "AnnotationMetadata must not be null!"); - Assert.notNull(annotation, "Annotation must not be null!"); + Assert.notNull(metadata, "AnnotationMetadata must not be null"); + Assert.notNull(annotation, "Annotation must not be null"); Map attributesSource = metadata.getAnnotationAttributes(annotation.getName()); diff --git a/src/main/java/org/springframework/data/auditing/config/AuditingBeanDefinitionRegistrarSupport.java b/src/main/java/org/springframework/data/auditing/config/AuditingBeanDefinitionRegistrarSupport.java index 69bafd3ce..d45b25303 100644 --- a/src/main/java/org/springframework/data/auditing/config/AuditingBeanDefinitionRegistrarSupport.java +++ b/src/main/java/org/springframework/data/auditing/config/AuditingBeanDefinitionRegistrarSupport.java @@ -53,8 +53,8 @@ public abstract class AuditingBeanDefinitionRegistrarSupport implements ImportBe @Override public void registerBeanDefinitions(AnnotationMetadata annotationMetadata, BeanDefinitionRegistry registry) { - Assert.notNull(annotationMetadata, "AnnotationMetadata must not be null!"); - Assert.notNull(registry, "BeanDefinitionRegistry must not be null!"); + Assert.notNull(annotationMetadata, "AnnotationMetadata must not be null"); + Assert.notNull(registry, "BeanDefinitionRegistry must not be null"); AbstractBeanDefinition ahbd = registerAuditHandlerBeanDefinition(registry, getConfiguration(annotationMetadata)); registerAuditListenerBeanDefinition(ahbd, registry); @@ -70,8 +70,8 @@ public abstract class AuditingBeanDefinitionRegistrarSupport implements ImportBe private AbstractBeanDefinition registerAuditHandlerBeanDefinition(BeanDefinitionRegistry registry, AuditingConfiguration configuration) { - Assert.notNull(registry, "BeanDefinitionRegistry must not be null!"); - Assert.notNull(configuration, "AuditingConfiguration must not be null!"); + Assert.notNull(registry, "BeanDefinitionRegistry must not be null"); + Assert.notNull(configuration, "AuditingConfiguration must not be null"); AbstractBeanDefinition ahbd = getAuditHandlerBeanDefinitionBuilder(configuration).getBeanDefinition(); registry.registerBeanDefinition(getAuditingHandlerBeanName(), ahbd); @@ -87,7 +87,7 @@ public abstract class AuditingBeanDefinitionRegistrarSupport implements ImportBe */ protected BeanDefinitionBuilder getAuditHandlerBeanDefinitionBuilder(AuditingConfiguration configuration) { - Assert.notNull(configuration, "AuditingConfiguration must not be null!"); + Assert.notNull(configuration, "AuditingConfiguration must not be null"); return configureDefaultAuditHandlerAttributes(configuration, BeanDefinitionBuilder.rootBeanDefinition(AuditingHandler.class)); diff --git a/src/main/java/org/springframework/data/auditing/config/AuditingHandlerBeanDefinitionParser.java b/src/main/java/org/springframework/data/auditing/config/AuditingHandlerBeanDefinitionParser.java index c61210413..ccb6cb46e 100644 --- a/src/main/java/org/springframework/data/auditing/config/AuditingHandlerBeanDefinitionParser.java +++ b/src/main/java/org/springframework/data/auditing/config/AuditingHandlerBeanDefinitionParser.java @@ -56,7 +56,7 @@ public class AuditingHandlerBeanDefinitionParser extends AbstractSingleBeanDefin @SuppressWarnings("null") public AuditingHandlerBeanDefinitionParser(String mappingContextBeanName) { - Assert.hasText(mappingContextBeanName, "MappingContext bean name must not be null!"); + Assert.hasText(mappingContextBeanName, "MappingContext bean name must not be null"); this.mappingContextBeanName = mappingContextBeanName; } diff --git a/src/main/java/org/springframework/data/config/BeanComponentDefinitionBuilder.java b/src/main/java/org/springframework/data/config/BeanComponentDefinitionBuilder.java index f06a07b6c..620d7e2eb 100644 --- a/src/main/java/org/springframework/data/config/BeanComponentDefinitionBuilder.java +++ b/src/main/java/org/springframework/data/config/BeanComponentDefinitionBuilder.java @@ -44,8 +44,8 @@ public class BeanComponentDefinitionBuilder { */ public BeanComponentDefinitionBuilder(Element defaultSource, ParserContext context) { - Assert.notNull(defaultSource, "DefaultSource must not be null!"); - Assert.notNull(context, "Context must not be null!"); + Assert.notNull(defaultSource, "DefaultSource must not be null"); + Assert.notNull(context, "Context must not be null"); this.defaultSource = defaultSource; this.context = context; @@ -59,7 +59,7 @@ public class BeanComponentDefinitionBuilder { */ public BeanComponentDefinition getComponent(BeanDefinitionBuilder builder) { - Assert.notNull(builder, "Builder must not be null!"); + Assert.notNull(builder, "Builder must not be null"); AbstractBeanDefinition definition = builder.getRawBeanDefinition(); String name = BeanDefinitionReaderUtils.generateBeanName(definition, context.getRegistry(), context.isNested()); @@ -77,7 +77,7 @@ public class BeanComponentDefinitionBuilder { */ public BeanComponentDefinition getComponentIdButFallback(BeanDefinitionBuilder builder, String fallback) { - Assert.hasText(fallback, "Fallback component id must not be null or empty!"); + Assert.hasText(fallback, "Fallback component id must not be null or empty"); String id = defaultSource.getAttribute("id"); return getComponent(builder, StringUtils.hasText(id) ? id : fallback); @@ -105,8 +105,8 @@ public class BeanComponentDefinitionBuilder { */ public BeanComponentDefinition getComponent(BeanDefinitionBuilder builder, String name, Object rawSource) { - Assert.notNull(builder, "Builder must not be null!"); - Assert.hasText(name, "Name of bean must not be null or empty!"); + Assert.notNull(builder, "Builder must not be null"); + Assert.hasText(name, "Name of bean must not be null or empty"); AbstractBeanDefinition definition = builder.getRawBeanDefinition(); definition.setSource(context.extractSource(rawSource)); diff --git a/src/main/java/org/springframework/data/config/ConfigurationUtils.java b/src/main/java/org/springframework/data/config/ConfigurationUtils.java index 251c59440..8e460204d 100644 --- a/src/main/java/org/springframework/data/config/ConfigurationUtils.java +++ b/src/main/java/org/springframework/data/config/ConfigurationUtils.java @@ -40,7 +40,7 @@ public interface ConfigurationUtils { */ public static ResourceLoader getRequiredResourceLoader(XmlReaderContext context) { - Assert.notNull(context, "XmlReaderContext must not be null!"); + Assert.notNull(context, "XmlReaderContext must not be null"); ResourceLoader resourceLoader = context.getResourceLoader(); @@ -71,7 +71,7 @@ public interface ConfigurationUtils { */ public static ClassLoader getRequiredClassLoader(ResourceLoader resourceLoader) { - Assert.notNull(resourceLoader, "ResourceLoader must not be null!"); + Assert.notNull(resourceLoader, "ResourceLoader must not be null"); ClassLoader classLoader = resourceLoader.getClassLoader(); @@ -91,7 +91,7 @@ public interface ConfigurationUtils { */ public static String getRequiredBeanClassName(BeanDefinition beanDefinition) { - Assert.notNull(beanDefinition, "BeanDefinition must not be null!"); + Assert.notNull(beanDefinition, "BeanDefinition must not be null"); String result = beanDefinition.getBeanClassName(); diff --git a/src/main/java/org/springframework/data/config/ParsingUtils.java b/src/main/java/org/springframework/data/config/ParsingUtils.java index 07f3e0d2a..ebe5877a6 100644 --- a/src/main/java/org/springframework/data/config/ParsingUtils.java +++ b/src/main/java/org/springframework/data/config/ParsingUtils.java @@ -50,10 +50,10 @@ public abstract class ParsingUtils { public static void setPropertyValue(BeanDefinitionBuilder builder, Element element, String attrName, String propertyName) { - Assert.notNull(builder, "BeanDefinitionBuilder must not be null!"); - Assert.notNull(element, "Element must not be null!"); - Assert.hasText(attrName, "Attribute name must not be null!"); - Assert.hasText(propertyName, "Property name must not be null!"); + Assert.notNull(builder, "BeanDefinitionBuilder must not be null"); + Assert.notNull(element, "Element must not be null"); + Assert.hasText(attrName, "Attribute name must not be null"); + Assert.hasText(propertyName, "Property name must not be null"); String attr = element.getAttribute(attrName); @@ -85,10 +85,10 @@ public abstract class ParsingUtils { public static void setPropertyReference(BeanDefinitionBuilder builder, Element element, String attribute, String property) { - Assert.notNull(builder, "BeanDefinitionBuilder must not be null!"); - Assert.notNull(element, "Element must not be null!"); - Assert.hasText(attribute, "Attribute name must not be null!"); - Assert.hasText(property, "Property name must not be null!"); + Assert.notNull(builder, "BeanDefinitionBuilder must not be null"); + Assert.notNull(element, "Element must not be null"); + Assert.hasText(attribute, "Attribute name must not be null"); + Assert.hasText(property, "Property name must not be null"); String value = element.getAttribute(attribute); @@ -109,8 +109,8 @@ public abstract class ParsingUtils { public static AbstractBeanDefinition getSourceBeanDefinition(BeanDefinitionBuilder builder, ParserContext context, Element element) { - Assert.notNull(element, "Element must not be null!"); - Assert.notNull(context, "ParserContext must not be null!"); + Assert.notNull(element, "Element must not be null"); + Assert.notNull(context, "ParserContext must not be null"); return getSourceBeanDefinition(builder, context.extractSource(element)); } @@ -124,7 +124,7 @@ public abstract class ParsingUtils { */ public static AbstractBeanDefinition getSourceBeanDefinition(BeanDefinitionBuilder builder, @Nullable Object source) { - Assert.notNull(builder, "Builder must not be null!"); + Assert.notNull(builder, "Builder must not be null"); AbstractBeanDefinition definition = builder.getRawBeanDefinition(); definition.setSource(source); @@ -141,7 +141,7 @@ public abstract class ParsingUtils { */ public static AbstractBeanDefinition getObjectFactoryBeanDefinition(String targetBeanName, @Nullable Object source) { - Assert.hasText(targetBeanName, "Target bean name must not be null or empty!"); + Assert.hasText(targetBeanName, "Target bean name must not be null or empty"); BeanDefinitionBuilder builder = BeanDefinitionBuilder.rootBeanDefinition(ObjectFactoryCreatingFactoryBean.class); builder.addPropertyValue("targetBeanName", targetBeanName); diff --git a/src/main/java/org/springframework/data/config/TypeFilterParser.java b/src/main/java/org/springframework/data/config/TypeFilterParser.java index 9a6e21b4b..6aea3f675 100644 --- a/src/main/java/org/springframework/data/config/TypeFilterParser.java +++ b/src/main/java/org/springframework/data/config/TypeFilterParser.java @@ -69,8 +69,8 @@ public class TypeFilterParser { */ TypeFilterParser(ReaderContext readerContext, ClassLoader classLoader) { - Assert.notNull(readerContext, "ReaderContext must not be null!"); - Assert.notNull(classLoader, "ClassLoader must not be null!"); + Assert.notNull(readerContext, "ReaderContext must not be null"); + Assert.notNull(classLoader, "ClassLoader must not be null"); this.readerContext = readerContext; this.classLoader = classLoader; diff --git a/src/main/java/org/springframework/data/convert/ConfigurableTypeInformationMapper.java b/src/main/java/org/springframework/data/convert/ConfigurableTypeInformationMapper.java index f1a062246..5709fa5f8 100644 --- a/src/main/java/org/springframework/data/convert/ConfigurableTypeInformationMapper.java +++ b/src/main/java/org/springframework/data/convert/ConfigurableTypeInformationMapper.java @@ -47,7 +47,7 @@ public class ConfigurableTypeInformationMapper implements TypeInformationMapper */ public ConfigurableTypeInformationMapper(Map, String> sourceTypeMap) { - Assert.notNull(sourceTypeMap, "SourceTypeMap must not be null!"); + Assert.notNull(sourceTypeMap, "SourceTypeMap must not be null"); this.typeToAlias = new HashMap<>(sourceTypeMap.size()); this.aliasToType = new HashMap<>(sourceTypeMap.size()); @@ -59,7 +59,7 @@ public class ConfigurableTypeInformationMapper implements TypeInformationMapper if (typeToAlias.containsValue(alias)) { throw new IllegalArgumentException( - String.format("Detected mapping ambiguity! String %s cannot be mapped to more than one type", alias)); + String.format("Detected mapping ambiguity; String %s cannot be mapped to more than one type", alias)); } this.typeToAlias.put(type, alias); diff --git a/src/main/java/org/springframework/data/convert/ConverterBuilder.java b/src/main/java/org/springframework/data/convert/ConverterBuilder.java index 4a62d9fb4..664fbb8ea 100644 --- a/src/main/java/org/springframework/data/convert/ConverterBuilder.java +++ b/src/main/java/org/springframework/data/convert/ConverterBuilder.java @@ -48,9 +48,9 @@ public interface ConverterBuilder { static ReadingConverterBuilder reading(Class source, Class target, Function function) { - Assert.notNull(source, "Source type must not be null!"); - Assert.notNull(target, "Target type must not be null!"); - Assert.notNull(function, "Conversion function must not be null!"); + Assert.notNull(source, "Source type must not be null"); + Assert.notNull(target, "Target type must not be null"); + Assert.notNull(function, "Conversion function must not be null"); return new DefaultConverterBuilder<>(new ConvertiblePair(source, target), Optional.empty(), Optional.of(function)); } @@ -67,9 +67,9 @@ public interface ConverterBuilder { static WritingConverterBuilder writing(Class source, Class target, Function function) { - Assert.notNull(source, "Source type must not be null!"); - Assert.notNull(target, "Target type must not be null!"); - Assert.notNull(function, "Conversion function must not be null!"); + Assert.notNull(source, "Source type must not be null"); + Assert.notNull(target, "Target type must not be null"); + Assert.notNull(function, "Conversion function must not be null"); return new DefaultConverterBuilder<>(new ConvertiblePair(target, source), Optional.of(function), Optional.empty()); } diff --git a/src/main/java/org/springframework/data/convert/CustomConversions.java b/src/main/java/org/springframework/data/convert/CustomConversions.java index 4e4642cc2..df16a0306 100644 --- a/src/main/java/org/springframework/data/convert/CustomConversions.java +++ b/src/main/java/org/springframework/data/convert/CustomConversions.java @@ -60,10 +60,10 @@ import org.springframework.util.ObjectUtils; public class CustomConversions { private static final Log logger = LogFactory.getLog(CustomConversions.class); - private static final String READ_CONVERTER_NOT_SIMPLE = "Registering converter from %s to %s as reading converter although it doesn't convert from a store-supported type; You might want to check your annotation setup at the converter implementation."; - private static final String WRITE_CONVERTER_NOT_SIMPLE = "Registering converter from %s to %s as writing converter although it doesn't convert to a store-supported type; You might want to check your annotation setup at the converter implementation."; + private static final String READ_CONVERTER_NOT_SIMPLE = "Registering converter from %s to %s as reading converter although it doesn't convert from a store-supported type; You might want to check your annotation setup at the converter implementation"; + private static final String WRITE_CONVERTER_NOT_SIMPLE = "Registering converter from %s to %s as writing converter although it doesn't convert to a store-supported type; You might want to check your annotation setup at the converter implementation"; private static final String NOT_A_CONVERTER = "Converter %s is neither a Spring Converter, GenericConverter or ConverterFactory"; - private static final String CONVERTER_FILTER = "converter from %s to %s as %s converter."; + private static final String CONVERTER_FILTER = "converter from %s to %s as %s converter"; private static final String ADD_CONVERTER = "Adding %s" + CONVERTER_FILTER; private static final String SKIP_CONVERTER = "Skipping " + CONVERTER_FILTER + " %s is not a store supported simple type"; diff --git a/src/main/java/org/springframework/data/convert/DefaultTypeMapper.java b/src/main/java/org/springframework/data/convert/DefaultTypeMapper.java index 1ccbe9db3..ada432ec2 100644 --- a/src/main/java/org/springframework/data/convert/DefaultTypeMapper.java +++ b/src/main/java/org/springframework/data/convert/DefaultTypeMapper.java @@ -82,8 +82,8 @@ public class DefaultTypeMapper implements TypeMapper, BeanClassLoaderAware @Nullable MappingContext, ?> mappingContext, List additionalMappers) { - Assert.notNull(accessor, "Accessor must not be null!"); - Assert.notNull(additionalMappers, "AdditionalMappers must not be null!"); + Assert.notNull(accessor, "Accessor must not be null"); + Assert.notNull(additionalMappers, "AdditionalMappers must not be null"); List mappers = new ArrayList<>(additionalMappers.size() + 1); if (mappingContext != null) { @@ -111,7 +111,7 @@ public class DefaultTypeMapper implements TypeMapper, BeanClassLoaderAware @Override public TypeInformation readType(S source) { - Assert.notNull(source, "Source object must not be null!"); + Assert.notNull(source, "Source object must not be null"); return getFromCacheOrCreate(accessor.readAliasFrom(source)); } @@ -138,8 +138,8 @@ public class DefaultTypeMapper implements TypeMapper, BeanClassLoaderAware @Override public TypeInformation readType(S source, TypeInformation basicType) { - Assert.notNull(source, "Source must not be null!"); - Assert.notNull(basicType, "Basic type must not be null!"); + Assert.notNull(source, "Source must not be null"); + Assert.notNull(basicType, "Basic type must not be null"); Class documentsTargetType = getDefaultedTypeToBeUsed(source); @@ -196,7 +196,7 @@ public class DefaultTypeMapper implements TypeMapper, BeanClassLoaderAware @Override public void writeType(TypeInformation info, S sink) { - Assert.notNull(info, "TypeInformation must not be null!"); + Assert.notNull(info, "TypeInformation must not be null"); Alias alias = getAliasFor(info); if (alias.isPresent()) { @@ -222,7 +222,7 @@ public class DefaultTypeMapper implements TypeMapper, BeanClassLoaderAware */ protected final Alias getAliasFor(TypeInformation info) { - Assert.notNull(info, "TypeInformation must not be null!"); + Assert.notNull(info, "TypeInformation must not be null"); for (TypeInformationMapper mapper : mappers) { diff --git a/src/main/java/org/springframework/data/convert/DtoInstantiatingConverter.java b/src/main/java/org/springframework/data/convert/DtoInstantiatingConverter.java index d3e257631..dc73b4222 100644 --- a/src/main/java/org/springframework/data/convert/DtoInstantiatingConverter.java +++ b/src/main/java/org/springframework/data/convert/DtoInstantiatingConverter.java @@ -54,9 +54,9 @@ public class DtoInstantiatingConverter implements Converter { MappingContext, ? extends PersistentProperty> context, EntityInstantiators instantiators) { - Assert.notNull(dtoType, "DTO type must not be null!"); - Assert.notNull(context, "MappingContext must not be null!"); - Assert.notNull(instantiators, "EntityInstantiators must not be null!"); + Assert.notNull(dtoType, "DTO type must not be null"); + Assert.notNull(context, "MappingContext must not be null"); + Assert.notNull(instantiators, "EntityInstantiators must not be null"); this.targetType = dtoType; this.context = context; diff --git a/src/main/java/org/springframework/data/convert/MappingContextTypeInformationMapper.java b/src/main/java/org/springframework/data/convert/MappingContextTypeInformationMapper.java index 6f1290f88..abe944e45 100644 --- a/src/main/java/org/springframework/data/convert/MappingContextTypeInformationMapper.java +++ b/src/main/java/org/springframework/data/convert/MappingContextTypeInformationMapper.java @@ -49,7 +49,7 @@ public class MappingContextTypeInformationMapper implements TypeInformationMappe */ public MappingContextTypeInformationMapper(MappingContext, ?> mappingContext) { - Assert.notNull(mappingContext, "MappingContext must not be null!"); + Assert.notNull(mappingContext, "MappingContext must not be null"); this.typeMap = new ConcurrentHashMap<>(); this.mappingContext = mappingContext; diff --git a/src/main/java/org/springframework/data/convert/PropertyValueConverterFactories.java b/src/main/java/org/springframework/data/convert/PropertyValueConverterFactories.java index 9f94871c6..36acc7efb 100644 --- a/src/main/java/org/springframework/data/convert/PropertyValueConverterFactories.java +++ b/src/main/java/org/springframework/data/convert/PropertyValueConverterFactories.java @@ -89,7 +89,7 @@ final class PropertyValueConverterFactories { public > PropertyValueConverter getConverter( Class> converterType) { - Assert.notNull(converterType, "ConverterType must not be null!"); + Assert.notNull(converterType, "ConverterType must not be null"); if (converterType.isEnum()) { return (PropertyValueConverter) EnumSet.allOf((Class) converterType).iterator().next(); diff --git a/src/main/java/org/springframework/data/convert/PropertyValueConverterRegistrar.java b/src/main/java/org/springframework/data/convert/PropertyValueConverterRegistrar.java index 753d89beb..3ae9965bc 100644 --- a/src/main/java/org/springframework/data/convert/PropertyValueConverterRegistrar.java +++ b/src/main/java/org/springframework/data/convert/PropertyValueConverterRegistrar.java @@ -108,7 +108,7 @@ public class PropertyValueConverterRegistrar

> { */ public void registerConvertersIn(@NonNull ValueConverterRegistry

target) { - Assert.notNull(target, "Target registry must not be null!"); + Assert.notNull(target, "Target registry must not be null"); registry.getConverterRegistrationMap().forEach((key, value) -> target.registerConverter(key.type, key.path, value)); diff --git a/src/main/java/org/springframework/data/convert/SimplePropertyValueConversions.java b/src/main/java/org/springframework/data/convert/SimplePropertyValueConversions.java index 70f61ac6f..d9e7bf685 100644 --- a/src/main/java/org/springframework/data/convert/SimplePropertyValueConversions.java +++ b/src/main/java/org/springframework/data/convert/SimplePropertyValueConversions.java @@ -45,7 +45,7 @@ import org.springframework.util.Assert; public class SimplePropertyValueConversions implements PropertyValueConversions, InitializingBean { private static final String NO_CONVERTER_FACTORY_ERROR_MESSAGE = - "PropertyValueConverterFactory is not set. Make sure to either set the converter factory or call afterPropertiesSet() to initialize the object."; + "PropertyValueConverterFactory is not set; Make sure to either set the converter factory or call afterPropertiesSet() to initialize the object"; private boolean converterCacheEnabled = true; diff --git a/src/main/java/org/springframework/data/convert/ValueConversionContext.java b/src/main/java/org/springframework/data/convert/ValueConversionContext.java index ece29d117..8a3880024 100644 --- a/src/main/java/org/springframework/data/convert/ValueConversionContext.java +++ b/src/main/java/org/springframework/data/convert/ValueConversionContext.java @@ -89,7 +89,7 @@ public interface ValueConversionContext

> { } throw new IllegalStateException(String.format( - "%s does not provide write function that allows value conversion to target type (%s).", getClass(), target)); + "%s does not provide write function that allows value conversion to target type (%s)", getClass(), target)); } /** @@ -139,6 +139,6 @@ public interface ValueConversionContext

> { } throw new IllegalStateException(String.format( - "%s does not provide read function that allows value conversion to target type (%s).", getClass(), target)); + "%s does not provide read function that allows value conversion to target type (%s)", getClass(), target)); } } diff --git a/src/main/java/org/springframework/data/domain/AbstractAggregateRoot.java b/src/main/java/org/springframework/data/domain/AbstractAggregateRoot.java index 53591f55b..81f0211bc 100644 --- a/src/main/java/org/springframework/data/domain/AbstractAggregateRoot.java +++ b/src/main/java/org/springframework/data/domain/AbstractAggregateRoot.java @@ -46,7 +46,7 @@ public class AbstractAggregateRoot> { */ protected T registerEvent(T event) { - Assert.notNull(event, "Domain event must not be null!"); + Assert.notNull(event, "Domain event must not be null"); this.domainEvents.add(event); return event; @@ -78,7 +78,7 @@ public class AbstractAggregateRoot> { @SuppressWarnings("unchecked") protected final A andEventsFrom(A aggregate) { - Assert.notNull(aggregate, "Aggregate must not be null!"); + Assert.notNull(aggregate, "Aggregate must not be null"); this.domainEvents.addAll(aggregate.domainEvents()); diff --git a/src/main/java/org/springframework/data/domain/Chunk.java b/src/main/java/org/springframework/data/domain/Chunk.java index 4e111f8d6..74d37aa1c 100644 --- a/src/main/java/org/springframework/data/domain/Chunk.java +++ b/src/main/java/org/springframework/data/domain/Chunk.java @@ -47,8 +47,8 @@ abstract class Chunk implements Slice, Serializable { */ public Chunk(List content, Pageable pageable) { - Assert.notNull(content, "Content must not be null!"); - Assert.notNull(pageable, "Pageable must not be null!"); + Assert.notNull(content, "Content must not be null"); + Assert.notNull(pageable, "Pageable must not be null"); this.content.addAll(content); this.pageable = pageable; @@ -116,7 +116,7 @@ abstract class Chunk implements Slice, Serializable { */ protected List getConvertedContent(Function converter) { - Assert.notNull(converter, "Function must not be null!"); + Assert.notNull(converter, "Function must not be null"); return this.stream().map(converter::apply).collect(Collectors.toList()); } diff --git a/src/main/java/org/springframework/data/domain/ExampleMatcher.java b/src/main/java/org/springframework/data/domain/ExampleMatcher.java index fef882668..ce9568271 100644 --- a/src/main/java/org/springframework/data/domain/ExampleMatcher.java +++ b/src/main/java/org/springframework/data/domain/ExampleMatcher.java @@ -121,8 +121,8 @@ public interface ExampleMatcher { */ default ExampleMatcher withMatcher(String propertyPath, MatcherConfigurer matcherConfigurer) { - Assert.hasText(propertyPath, "PropertyPath must not be empty!"); - Assert.notNull(matcherConfigurer, "MatcherConfigurer must not be empty!"); + Assert.hasText(propertyPath, "PropertyPath must not be empty"); + Assert.notNull(matcherConfigurer, "MatcherConfigurer must not be empty"); GenericPropertyMatcher genericPropertyMatcher = new GenericPropertyMatcher(); matcherConfigurer.configureMatcher(genericPropertyMatcher); @@ -418,7 +418,7 @@ public interface ExampleMatcher { */ public GenericPropertyMatcher stringMatcher(StringMatcher stringMatcher) { - Assert.notNull(stringMatcher, "StringMatcher must not be null!"); + Assert.notNull(stringMatcher, "StringMatcher must not be null"); this.stringMatcher = stringMatcher; return this; } @@ -431,7 +431,7 @@ public interface ExampleMatcher { */ public GenericPropertyMatcher transform(PropertyValueTransformer propertyValueTransformer) { - Assert.notNull(propertyValueTransformer, "PropertyValueTransformer must not be null!"); + Assert.notNull(propertyValueTransformer, "PropertyValueTransformer must not be null"); this.valueTransformer = propertyValueTransformer; return this; } @@ -627,7 +627,7 @@ public interface ExampleMatcher { */ PropertySpecifier(String path) { - Assert.hasText(path, "Path must not be null/empty!"); + Assert.hasText(path, "Path must not be null/empty"); this.path = path; this.stringMatcher = null; @@ -652,7 +652,7 @@ public interface ExampleMatcher { */ public PropertySpecifier withStringMatcher(StringMatcher stringMatcher) { - Assert.notNull(stringMatcher, "StringMatcher must not be null!"); + Assert.notNull(stringMatcher, "StringMatcher must not be null"); return new PropertySpecifier(this.path, stringMatcher, this.ignoreCase, this.valueTransformer); } @@ -676,7 +676,7 @@ public interface ExampleMatcher { */ public PropertySpecifier withValueTransformer(PropertyValueTransformer valueTransformer) { - Assert.notNull(valueTransformer, "PropertyValueTransformer must not be null!"); + Assert.notNull(valueTransformer, "PropertyValueTransformer must not be null"); return new PropertySpecifier(this.path, this.stringMatcher, this.ignoreCase, valueTransformer); } @@ -785,7 +785,7 @@ public interface ExampleMatcher { public void add(PropertySpecifier specifier) { - Assert.notNull(specifier, "PropertySpecifier must not be null!"); + Assert.notNull(specifier, "PropertySpecifier must not be null"); propertySpecifiers.put(specifier.getPath(), specifier); } diff --git a/src/main/java/org/springframework/data/domain/PageRequest.java b/src/main/java/org/springframework/data/domain/PageRequest.java index f87bcedb9..34e30f781 100644 --- a/src/main/java/org/springframework/data/domain/PageRequest.java +++ b/src/main/java/org/springframework/data/domain/PageRequest.java @@ -44,7 +44,7 @@ public class PageRequest extends AbstractPageRequest { super(page, size); - Assert.notNull(sort, "Sort must not be null!"); + Assert.notNull(sort, "Sort must not be null"); this.sort = sort; } diff --git a/src/main/java/org/springframework/data/domain/Pageable.java b/src/main/java/org/springframework/data/domain/Pageable.java index 28ce95433..3979fbb68 100644 --- a/src/main/java/org/springframework/data/domain/Pageable.java +++ b/src/main/java/org/springframework/data/domain/Pageable.java @@ -101,7 +101,7 @@ public interface Pageable { */ default Sort getSortOr(Sort sort) { - Assert.notNull(sort, "Fallback Sort must not be null!"); + Assert.notNull(sort, "Fallback Sort must not be null"); return getSort().isSorted() ? getSort() : sort; } diff --git a/src/main/java/org/springframework/data/domain/Range.java b/src/main/java/org/springframework/data/domain/Range.java index e7b2258cc..3b1562af4 100644 --- a/src/main/java/org/springframework/data/domain/Range.java +++ b/src/main/java/org/springframework/data/domain/Range.java @@ -44,8 +44,8 @@ public final class Range { private Range(Bound lowerBound, Bound upperBound) { - Assert.notNull(lowerBound, "Lower bound must not be null!"); - Assert.notNull(upperBound, "Upper bound must not be null!"); + Assert.notNull(lowerBound, "Lower bound must not be null"); + Assert.notNull(upperBound, "Upper bound must not be null"); this.lowerBound = lowerBound; this.upperBound = upperBound; @@ -149,7 +149,7 @@ public final class Range { */ public static RangeBuilder from(Bound lower) { - Assert.notNull(lower, "Lower bound must not be null!"); + Assert.notNull(lower, "Lower bound must not be null"); return new RangeBuilder<>(lower); } @@ -204,7 +204,7 @@ public final class Range { */ public boolean contains(T value, Comparator comparator) { - Assert.notNull(value, "Reference value must not be null!"); + Assert.notNull(value, "Reference value must not be null"); boolean greaterThanLowerBound = lowerBound.getValue() // .map(it -> lowerBound.isInclusive() ? comparator.compare(it, value) <= 0 : comparator.compare(it, value) < 0) // @@ -301,7 +301,7 @@ public final class Range { */ public static Bound inclusive(T value) { - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(value, "Value must not be null"); return new Bound<>(Optional.of(value), true); } @@ -353,7 +353,7 @@ public final class Range { */ public static Bound exclusive(T value) { - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(value, "Value must not be null"); return new Bound<>(Optional.of(value), false); } @@ -474,7 +474,7 @@ public final class Range { */ public Range to(Bound upper) { - Assert.notNull(upper, "Upper bound must not be null!"); + Assert.notNull(upper, "Upper bound must not be null"); return new Range<>(lower, upper); } } diff --git a/src/main/java/org/springframework/data/domain/Sort.java b/src/main/java/org/springframework/data/domain/Sort.java index f42283859..e6a87e0df 100644 --- a/src/main/java/org/springframework/data/domain/Sort.java +++ b/src/main/java/org/springframework/data/domain/Sort.java @@ -81,7 +81,7 @@ public class Sort implements Streamable orders) { - Assert.notNull(orders, "Orders must not be null!"); + Assert.notNull(orders, "Orders must not be null"); return orders.isEmpty() ? Sort.unsorted() : new Sort(orders); } @@ -109,7 +109,7 @@ public class Sort implements Streamable 0, "At least one property must be given!"); + Assert.notNull(direction, "Direction must not be null"); + Assert.notNull(properties, "Properties must not be null"); + Assert.isTrue(properties.length > 0, "At least one property must be given"); return Sort.by(Arrays.stream(properties)// .map(it -> new Order(direction, it))// @@ -192,7 +192,7 @@ public class Sort implements Streamable these = new ArrayList(this.toList()); @@ -305,7 +305,7 @@ public class Sort implements Streamable newIgnoredPaths = new LinkedHashSet<>(this.ignoredPaths); newIgnoredPaths.addAll(Arrays.asList(ignoredPaths)); @@ -71,7 +71,7 @@ class TypedExampleMatcher implements ExampleMatcher { @Override public ExampleMatcher withStringMatcher(StringMatcher defaultStringMatcher) { - Assert.notNull(ignoredPaths, "DefaultStringMatcher must not be empty!"); + Assert.notNull(ignoredPaths, "DefaultStringMatcher must not be empty"); return new TypedExampleMatcher(nullHandler, defaultStringMatcher, propertySpecifiers, ignoredPaths, defaultIgnoreCase, mode); @@ -86,8 +86,8 @@ class TypedExampleMatcher implements ExampleMatcher { @Override public ExampleMatcher withMatcher(String propertyPath, GenericPropertyMatcher genericPropertyMatcher) { - Assert.hasText(propertyPath, "PropertyPath must not be empty!"); - Assert.notNull(genericPropertyMatcher, "GenericPropertyMatcher must not be empty!"); + Assert.hasText(propertyPath, "PropertyPath must not be empty"); + Assert.notNull(genericPropertyMatcher, "GenericPropertyMatcher must not be empty"); PropertySpecifiers propertySpecifiers = new PropertySpecifiers(this.propertySpecifiers); PropertySpecifier propertySpecifier = new PropertySpecifier(propertyPath); @@ -111,8 +111,8 @@ class TypedExampleMatcher implements ExampleMatcher { @Override public ExampleMatcher withTransformer(String propertyPath, PropertyValueTransformer propertyValueTransformer) { - Assert.hasText(propertyPath, "PropertyPath must not be empty!"); - Assert.notNull(propertyValueTransformer, "PropertyValueTransformer must not be empty!"); + Assert.hasText(propertyPath, "PropertyPath must not be empty"); + Assert.notNull(propertyValueTransformer, "PropertyValueTransformer must not be empty"); PropertySpecifiers propertySpecifiers = new PropertySpecifiers(this.propertySpecifiers); PropertySpecifier propertySpecifier = getOrCreatePropertySpecifier(propertyPath, propertySpecifiers); @@ -126,8 +126,8 @@ class TypedExampleMatcher implements ExampleMatcher { @Override public ExampleMatcher withIgnoreCase(String... propertyPaths) { - Assert.notEmpty(propertyPaths, "PropertyPaths must not be empty!"); - Assert.noNullElements(propertyPaths, "PropertyPaths must not contain null elements!"); + Assert.notEmpty(propertyPaths, "PropertyPaths must not be empty"); + Assert.noNullElements(propertyPaths, "PropertyPaths must not contain null elements"); PropertySpecifiers propertySpecifiers = new PropertySpecifiers(this.propertySpecifiers); @@ -143,7 +143,7 @@ class TypedExampleMatcher implements ExampleMatcher { @Override public ExampleMatcher withNullHandler(NullHandler nullHandler) { - Assert.notNull(nullHandler, "NullHandler must not be null!"); + Assert.notNull(nullHandler, "NullHandler must not be null"); return new TypedExampleMatcher(nullHandler, defaultStringMatcher, propertySpecifiers, ignoredPaths, defaultIgnoreCase, mode); } diff --git a/src/main/java/org/springframework/data/domain/jaxb/SpringDataJaxb.java b/src/main/java/org/springframework/data/domain/jaxb/SpringDataJaxb.java index 440ddb49c..5c2ff3024 100644 --- a/src/main/java/org/springframework/data/domain/jaxb/SpringDataJaxb.java +++ b/src/main/java/org/springframework/data/domain/jaxb/SpringDataJaxb.java @@ -111,7 +111,7 @@ public abstract class SpringDataJaxb { */ public static List unmarshal(Collection source, XmlAdapter adapter) { - Assert.notNull(adapter, "Adapter must not be null!"); + Assert.notNull(adapter, "Adapter must not be null"); if (source == null || source.isEmpty()) { return Collections.emptyList(); @@ -138,7 +138,7 @@ public abstract class SpringDataJaxb { */ public static List marshal(@Nullable Iterable source, XmlAdapter adapter) { - Assert.notNull(adapter, "Adapter must not be null!"); + Assert.notNull(adapter, "Adapter must not be null"); if (source == null) { return Collections.emptyList(); diff --git a/src/main/java/org/springframework/data/geo/Box.java b/src/main/java/org/springframework/data/geo/Box.java index 10f4cccae..3fee9818f 100644 --- a/src/main/java/org/springframework/data/geo/Box.java +++ b/src/main/java/org/springframework/data/geo/Box.java @@ -41,8 +41,8 @@ public class Box implements Shape { */ public Box(Point first, Point second) { - Assert.notNull(first, "First point must not be null!"); - Assert.notNull(second, "Second point must not be null!"); + Assert.notNull(first, "First point must not be null"); + Assert.notNull(second, "Second point must not be null"); this.first = first; this.second = second; @@ -56,8 +56,8 @@ public class Box implements Shape { */ public Box(double[] first, double[] second) { - Assert.isTrue(first.length == 2, "Point array has to have 2 elements!"); - Assert.isTrue(second.length == 2, "Point array has to have 2 elements!"); + Assert.isTrue(first.length == 2, "Point array has to have 2 elements"); + Assert.isTrue(second.length == 2, "Point array has to have 2 elements"); this.first = new Point(first[0], first[1]); this.second = new Point(second[0], second[1]); diff --git a/src/main/java/org/springframework/data/geo/Circle.java b/src/main/java/org/springframework/data/geo/Circle.java index d26b7d384..b0902ce28 100644 --- a/src/main/java/org/springframework/data/geo/Circle.java +++ b/src/main/java/org/springframework/data/geo/Circle.java @@ -43,9 +43,9 @@ public class Circle implements Shape { @PersistenceConstructor public Circle(Point center, Distance radius) { - Assert.notNull(center, "Center point must not be null!"); - Assert.notNull(radius, "Radius must not be null!"); - Assert.isTrue(radius.getValue() >= 0, "Radius must not be negative!"); + Assert.notNull(center, "Center point must not be null"); + Assert.notNull(radius, "Radius must not be null"); + Assert.isTrue(radius.getValue() >= 0, "Radius must not be negative"); this.center = center; this.radius = radius; diff --git a/src/main/java/org/springframework/data/geo/CustomMetric.java b/src/main/java/org/springframework/data/geo/CustomMetric.java index 0d3645471..439b1680d 100644 --- a/src/main/java/org/springframework/data/geo/CustomMetric.java +++ b/src/main/java/org/springframework/data/geo/CustomMetric.java @@ -49,7 +49,7 @@ public class CustomMetric implements Metric { */ public CustomMetric(double multiplier, String abbreviation) { - Assert.notNull(abbreviation, "Abbreviation must not be null!"); + Assert.notNull(abbreviation, "Abbreviation must not be null"); this.multiplier = multiplier; this.abbreviation = abbreviation; diff --git a/src/main/java/org/springframework/data/geo/Distance.java b/src/main/java/org/springframework/data/geo/Distance.java index e7c3b9be0..e2b36881c 100644 --- a/src/main/java/org/springframework/data/geo/Distance.java +++ b/src/main/java/org/springframework/data/geo/Distance.java @@ -61,7 +61,7 @@ public final class Distance implements Serializable, Comparable { */ public Distance(double value, Metric metric) { - Assert.notNull(metric, "Metric must not be null!"); + Assert.notNull(metric, "Metric must not be null"); this.value = value; this.metric = metric; @@ -119,7 +119,7 @@ public final class Distance implements Serializable, Comparable { */ public Distance add(Distance other) { - Assert.notNull(other, "Distance to add must not be null!"); + Assert.notNull(other, "Distance to add must not be null"); double newNormalizedValue = getNormalizedValue() + other.getNormalizedValue(); @@ -135,8 +135,8 @@ public final class Distance implements Serializable, Comparable { */ public Distance add(Distance other, Metric metric) { - Assert.notNull(other, "Distance to must not be null!"); - Assert.notNull(metric, "Result metric must not be null!"); + Assert.notNull(other, "Distance to must not be null"); + Assert.notNull(metric, "Result metric must not be null"); double newLeft = getNormalizedValue() * metric.getMultiplier(); double newRight = other.getNormalizedValue() * metric.getMultiplier(); @@ -153,7 +153,7 @@ public final class Distance implements Serializable, Comparable { */ public Distance in(Metric metric) { - Assert.notNull(metric, "Metric must not be null!"); + Assert.notNull(metric, "Metric must not be null"); return this.metric.equals(metric) ? this : new Distance(getNormalizedValue() * metric.getMultiplier(), metric); } diff --git a/src/main/java/org/springframework/data/geo/GeoResults.java b/src/main/java/org/springframework/data/geo/GeoResults.java index a95c69a05..1ec009e47 100644 --- a/src/main/java/org/springframework/data/geo/GeoResults.java +++ b/src/main/java/org/springframework/data/geo/GeoResults.java @@ -70,8 +70,8 @@ public class GeoResults implements Iterable>, Serializable { @PersistenceConstructor public GeoResults(List> results, Distance averageDistance) { - Assert.notNull(results, "Results must not be null!"); - Assert.notNull(averageDistance, "Average Distance must not be null!"); + Assert.notNull(results, "Results must not be null"); + Assert.notNull(averageDistance, "Average Distance must not be null"); this.results = results; this.averageDistance = averageDistance; @@ -133,8 +133,8 @@ public class GeoResults implements Iterable>, Serializable { private static Distance calculateAverageDistance(List> results, Metric metric) { - Assert.notNull(results, "Results must not be null!"); - Assert.notNull(metric, "Metric must not be null!"); + Assert.notNull(results, "Results must not be null"); + Assert.notNull(metric, "Metric must not be null"); if (results.isEmpty()) { return new Distance(0, metric); diff --git a/src/main/java/org/springframework/data/geo/Point.java b/src/main/java/org/springframework/data/geo/Point.java index 590fceeee..49c46dcbf 100644 --- a/src/main/java/org/springframework/data/geo/Point.java +++ b/src/main/java/org/springframework/data/geo/Point.java @@ -56,7 +56,7 @@ public class Point implements Serializable { */ public Point(Point point) { - Assert.notNull(point, "Source point must not be null!"); + Assert.notNull(point, "Source point must not be null"); this.x = point.x; this.y = point.y; diff --git a/src/main/java/org/springframework/data/geo/Polygon.java b/src/main/java/org/springframework/data/geo/Polygon.java index 1996419b8..2c9b10bad 100644 --- a/src/main/java/org/springframework/data/geo/Polygon.java +++ b/src/main/java/org/springframework/data/geo/Polygon.java @@ -50,10 +50,10 @@ public class Polygon implements Iterable, Shape { */ public Polygon(Point x, Point y, Point z, Point... others) { - Assert.notNull(x, "X 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(others, "Others must not be null!"); + Assert.notNull(x, "X 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(others, "Others must not be null"); List points = new ArrayList<>(3 + others.length); points.addAll(Arrays.asList(x, y, z)); @@ -70,13 +70,13 @@ public class Polygon implements Iterable, Shape { @PersistenceConstructor public Polygon(List points) { - Assert.notNull(points, "Points must not be null!"); + Assert.notNull(points, "Points must not be null"); List pointsToSet = new ArrayList<>(points.size()); for (Point point : points) { - Assert.notNull(point, "Single Point in Polygon must not be null!"); + Assert.notNull(point, "Single Point in Polygon must not be null"); pointsToSet.add(point); } diff --git a/src/main/java/org/springframework/data/geo/format/DistanceFormatter.java b/src/main/java/org/springframework/data/geo/format/DistanceFormatter.java index a207855c6..a92fefca3 100644 --- a/src/main/java/org/springframework/data/geo/format/DistanceFormatter.java +++ b/src/main/java/org/springframework/data/geo/format/DistanceFormatter.java @@ -43,7 +43,7 @@ public enum DistanceFormatter implements Converter, Formatter< INSTANCE; private static final Map SUPPORTED_METRICS; - private static final String INVALID_DISTANCE = "Expected double amount optionally followed by a metrics abbreviation (%s) but got '%s'!"; + private static final String INVALID_DISTANCE = "Expected double amount optionally followed by a metrics abbreviation (%s) but got '%s'"; static { diff --git a/src/main/java/org/springframework/data/geo/format/PointFormatter.java b/src/main/java/org/springframework/data/geo/format/PointFormatter.java index affa2edf5..fb03d4d0d 100644 --- a/src/main/java/org/springframework/data/geo/format/PointFormatter.java +++ b/src/main/java/org/springframework/data/geo/format/PointFormatter.java @@ -35,7 +35,7 @@ public enum PointFormatter implements Converter, Formatter public static final ConvertiblePair CONVERTIBLE = new ConvertiblePair(String.class, Point.class); - private static final String INVALID_FORMAT = "Expected two doubles separated by a comma but got '%s'!"; + private static final String INVALID_FORMAT = "Expected two doubles separated by a comma but got '%s'"; @NonNull @Override diff --git a/src/main/java/org/springframework/data/history/AnnotationRevisionMetadata.java b/src/main/java/org/springframework/data/history/AnnotationRevisionMetadata.java index 1f9d541e0..9e0fe3430 100755 --- a/src/main/java/org/springframework/data/history/AnnotationRevisionMetadata.java +++ b/src/main/java/org/springframework/data/history/AnnotationRevisionMetadata.java @@ -73,10 +73,10 @@ public class AnnotationRevisionMetadata> implem public AnnotationRevisionMetadata(Object entity, Class revisionNumberAnnotation, Class revisionTimeStampAnnotation, RevisionType revisionType) { - Assert.notNull(entity, "Entity must not be null!"); - Assert.notNull(revisionNumberAnnotation, "Revision number annotation must not be null!"); - Assert.notNull(revisionTimeStampAnnotation, "Revision time stamp annotation must not be null!"); - Assert.notNull(revisionType, "Revision Type must not be null!"); + Assert.notNull(entity, "Entity must not be null"); + Assert.notNull(revisionNumberAnnotation, "Revision number annotation must not be null"); + Assert.notNull(revisionTimeStampAnnotation, "Revision time stamp annotation must not be null"); + Assert.notNull(revisionType, "Revision Type must not be null"); this.entity = entity; this.revisionNumber = detectAnnotation(entity, revisionNumberAnnotation); diff --git a/src/main/java/org/springframework/data/history/RevisionSort.java b/src/main/java/org/springframework/data/history/RevisionSort.java index feb0c1241..ef4e08918 100644 --- a/src/main/java/org/springframework/data/history/RevisionSort.java +++ b/src/main/java/org/springframework/data/history/RevisionSort.java @@ -74,7 +74,7 @@ public class RevisionSort extends Sort { */ public static Direction getRevisionDirection(Sort sort) { - Assert.notNull(sort, "Sort must not be null!"); + Assert.notNull(sort, "Sort must not be null"); Order order = sort.getOrderFor(PROPERTY); return order == null ? Direction.ASC : order.getDirection(); diff --git a/src/main/java/org/springframework/data/history/Revisions.java b/src/main/java/org/springframework/data/history/Revisions.java index 85960d2f9..d2b17899e 100644 --- a/src/main/java/org/springframework/data/history/Revisions.java +++ b/src/main/java/org/springframework/data/history/Revisions.java @@ -56,7 +56,7 @@ public class Revisions, T> implements Streamabl */ private Revisions(List> revisions, boolean latestLast) { - Assert.notNull(revisions, "Revisions must not be null!"); + Assert.notNull(revisions, "Revisions must not be null"); this.revisions = revisions.stream()// .sorted(latestLast ? NATURAL_ORDER : NATURAL_ORDER.reversed())// diff --git a/src/main/java/org/springframework/data/mapping/AccessOptions.java b/src/main/java/org/springframework/data/mapping/AccessOptions.java index 44bb0bb92..2b25dd6e5 100644 --- a/src/main/java/org/springframework/data/mapping/AccessOptions.java +++ b/src/main/java/org/springframework/data/mapping/AccessOptions.java @@ -112,8 +112,8 @@ public class AccessOptions { */ public GetOptions registerHandler(PersistentProperty property, Function handler) { - Assert.notNull(property, "Property must not be null!"); - Assert.notNull(handler, "Handler must not be null!"); + Assert.notNull(property, "Property must not be null"); + Assert.notNull(handler, "Handler must not be null"); Map, Function> newHandlers = new HashMap<>(handlers); newHandlers.put(property, handler); @@ -184,7 +184,7 @@ public class AccessOptions { Function handler) { Assert.isTrue(type.isAssignableFrom(property.getType()), () -> String - .format("Cannot register a property handler for %s on a property of type %s!", type, property.getType())); + .format("Cannot register a property handler for %s on a property of type %s", type, property.getType())); Function caster = (Function) it -> type.cast(it); @@ -333,7 +333,7 @@ public class AccessOptions { */ public SetOptions withCollectionAndMapPropagation(Propagation propagation) { - Assert.notNull(propagation, "Propagation must not be null!"); + Assert.notNull(propagation, "Propagation must not be null"); return withCollectionPropagation(propagation) // .withMapPropagation(propagation); diff --git a/src/main/java/org/springframework/data/mapping/Alias.java b/src/main/java/org/springframework/data/mapping/Alias.java index f5a55fdb1..94e257994 100644 --- a/src/main/java/org/springframework/data/mapping/Alias.java +++ b/src/main/java/org/springframework/data/mapping/Alias.java @@ -54,7 +54,7 @@ public final class Alias { */ public static Alias of(Object alias) { - Assert.notNull(alias, "Alias must not be null!"); + Assert.notNull(alias, "Alias must not be null"); return new Alias(alias); } @@ -87,7 +87,7 @@ public final class Alias { */ public boolean isPresentButDifferent(Alias other) { - Assert.notNull(other, "Other alias must not be null!"); + Assert.notNull(other, "Other alias must not be null"); return isPresent() && !this.value.equals(other.value); } diff --git a/src/main/java/org/springframework/data/mapping/InstanceCreatorMetadataSupport.java b/src/main/java/org/springframework/data/mapping/InstanceCreatorMetadataSupport.java index 18f4f66aa..1de9f4696 100644 --- a/src/main/java/org/springframework/data/mapping/InstanceCreatorMetadataSupport.java +++ b/src/main/java/org/springframework/data/mapping/InstanceCreatorMetadataSupport.java @@ -46,8 +46,8 @@ class InstanceCreatorMetadataSupport> impleme @SafeVarargs public InstanceCreatorMetadataSupport(Executable executable, Parameter... parameters) { - Assert.notNull(executable, "Executable must not be null!"); - Assert.notNull(parameters, "Parameters must not be null!"); + Assert.notNull(executable, "Executable must not be null"); + Assert.notNull(parameters, "Parameters must not be null"); this.executable = executable; this.parameters = Arrays.asList(parameters); @@ -85,7 +85,7 @@ class InstanceCreatorMetadataSupport> impleme @Override public boolean isCreatorParameter(PersistentProperty property) { - Assert.notNull(property, "Property must not be null!"); + Assert.notNull(property, "Property must not be null"); Boolean cached = isPropertyParameterCache.get(property); diff --git a/src/main/java/org/springframework/data/mapping/Parameter.java b/src/main/java/org/springframework/data/mapping/Parameter.java index 7053ee3cb..fa682994b 100644 --- a/src/main/java/org/springframework/data/mapping/Parameter.java +++ b/src/main/java/org/springframework/data/mapping/Parameter.java @@ -56,8 +56,8 @@ public class Parameter> { public Parameter(@Nullable String name, TypeInformation type, Annotation[] annotations, @Nullable PersistentEntity entity) { - Assert.notNull(type, "Type must not be null!"); - Assert.notNull(annotations, "Annotations must not be null!"); + Assert.notNull(type, "Type must not be null"); + Assert.notNull(annotations, "Annotations must not be null"); this.name = name; this.type = type; diff --git a/src/main/java/org/springframework/data/mapping/PersistentEntity.java b/src/main/java/org/springframework/data/mapping/PersistentEntity.java index 8232e7644..5f819bccd 100644 --- a/src/main/java/org/springframework/data/mapping/PersistentEntity.java +++ b/src/main/java/org/springframework/data/mapping/PersistentEntity.java @@ -279,7 +279,7 @@ public interface PersistentEntity> extends It */ default void doWithAll(PropertyHandler

handler) { - Assert.notNull(handler, "PropertyHandler must not be null!"); + Assert.notNull(handler, "PropertyHandler must not be null"); doWithProperties(handler); doWithAssociations( diff --git a/src/main/java/org/springframework/data/mapping/PersistentProperty.java b/src/main/java/org/springframework/data/mapping/PersistentProperty.java index 11826a9b6..99bc254b5 100644 --- a/src/main/java/org/springframework/data/mapping/PersistentProperty.java +++ b/src/main/java/org/springframework/data/mapping/PersistentProperty.java @@ -341,7 +341,7 @@ public interface PersistentProperty

> { } throw new IllegalStateException( - String.format("Required annotation %s not found for %s!", annotationType, getName())); + String.format("Required annotation %s not found for %s", annotationType, getName())); } /** @@ -380,7 +380,7 @@ public interface PersistentProperty

> { */ default boolean hasActualTypeAnnotation(Class annotationType) { - Assert.notNull(annotationType, "Annotation type must not be null!"); + Assert.notNull(annotationType, "Annotation type must not be null"); return AnnotatedElementUtils.hasAnnotation(getActualType(), annotationType); } @@ -420,7 +420,7 @@ public interface PersistentProperty

> { */ default PersistentPropertyAccessor getAccessorForOwner(T owner) { - Assert.notNull(owner, "Owner must not be null!"); + Assert.notNull(owner, "Owner must not be null"); return getOwner().getPropertyAccessor(owner); } diff --git a/src/main/java/org/springframework/data/mapping/PersistentPropertyAccessor.java b/src/main/java/org/springframework/data/mapping/PersistentPropertyAccessor.java index 534ff3a9c..fdad23aae 100644 --- a/src/main/java/org/springframework/data/mapping/PersistentPropertyAccessor.java +++ b/src/main/java/org/springframework/data/mapping/PersistentPropertyAccessor.java @@ -59,8 +59,8 @@ public interface PersistentPropertyAccessor { @Deprecated default void setProperty(PersistentPropertyPath> path, @Nullable Object value) { - Assert.notNull(path, "PersistentPropertyPath must not be null!"); - Assert.isTrue(!path.isEmpty(), "PersistentPropertyPath must not be empty!"); + Assert.notNull(path, "PersistentPropertyPath must not be null"); + Assert.isTrue(!path.isEmpty(), "PersistentPropertyPath must not be empty"); PersistentPropertyPath> parentPath = path.getParentPath(); PersistentProperty> leafProperty = path.getRequiredLeafProperty(); @@ -76,7 +76,7 @@ public interface PersistentPropertyAccessor { if (parent == null) { - String nullIntermediateMessage = "Cannot lookup property %s on null intermediate! Original path was: %s on %s"; + String nullIntermediateMessage = "Cannot lookup property %s on null intermediate; Original path was: %s on %s"; throw new MappingException( String.format(nullIntermediateMessage, parentProperty, path.toDotPath(), getBean().getClass().getName())); @@ -152,7 +152,7 @@ public interface PersistentPropertyAccessor { if (current == null) { - String nullIntermediateMessage = "Cannot lookup property %s on null intermediate! Original path was: %s on %s"; + String nullIntermediateMessage = "Cannot lookup property %s on null intermediate; Original path was: %s on %s"; throw new MappingException( String.format(nullIntermediateMessage, property, path.toDotPath(), bean.getClass().getName())); diff --git a/src/main/java/org/springframework/data/mapping/PreferredConstructor.java b/src/main/java/org/springframework/data/mapping/PreferredConstructor.java index 99386ef9a..8b0cb8273 100644 --- a/src/main/java/org/springframework/data/mapping/PreferredConstructor.java +++ b/src/main/java/org/springframework/data/mapping/PreferredConstructor.java @@ -108,7 +108,7 @@ public final class PreferredConstructor> exte */ public boolean isEnclosingClassParameter(Parameter parameter) { - Assert.notNull(parameter, "Parameter must not be null!"); + Assert.notNull(parameter, "Parameter must not be null"); if (parameters.isEmpty() || !parameter.isEnclosingClassParameter()) { return false; @@ -116,5 +116,4 @@ public final class PreferredConstructor> exte return parameters.get(0).equals(parameter); } - } diff --git a/src/main/java/org/springframework/data/mapping/PropertyPath.java b/src/main/java/org/springframework/data/mapping/PropertyPath.java index 0e88d2a65..daae7ddc8 100644 --- a/src/main/java/org/springframework/data/mapping/PropertyPath.java +++ b/src/main/java/org/springframework/data/mapping/PropertyPath.java @@ -45,7 +45,7 @@ import org.springframework.util.StringUtils; */ public class PropertyPath implements Streamable { - private static final String PARSE_DEPTH_EXCEEDED = "Trying to parse a path with depth greater than 1000! This has been disabled for security reasons to prevent parsing overflows"; + private static final String PARSE_DEPTH_EXCEEDED = "Trying to parse a path with depth greater than 1000; This has been disabled for security reasons to prevent parsing overflows"; private static final String DELIMITERS = "_\\."; private static final Pattern SPLITTER = Pattern.compile("(?:[%s]?([%s]*?[^%s]+))".replaceAll("%s", DELIMITERS)); @@ -80,9 +80,9 @@ public class PropertyPath implements Streamable { */ PropertyPath(String name, TypeInformation owningType, List base) { - Assert.hasText(name, "Name must not be null or empty!"); - Assert.notNull(owningType, "Owning type must not be null!"); - Assert.notNull(base, "Previously found properties must not be null!"); + Assert.hasText(name, "Name must not be null or empty"); + Assert.notNull(owningType, "Owning type must not be null"); + Assert.notNull(base, "Previously found properties must not be null"); String propertyName = Introspector.decapitalize(name); TypeInformation propertyType = owningType.getProperty(propertyName); @@ -208,7 +208,7 @@ public class PropertyPath implements Streamable { */ public PropertyPath nested(String path) { - Assert.hasText(path, "Path must not be null or empty!"); + Assert.hasText(path, "Path must not be null or empty"); String lookup = toDotPath().concat(".").concat(path); @@ -301,7 +301,7 @@ public class PropertyPath implements Streamable { if (result == null) { throw new IllegalStateException( - "No next path available! Clients should call hasNext() before invoking this method"); + "No next path available; Clients should call hasNext() before invoking this method"); } return result; @@ -329,8 +329,8 @@ public class PropertyPath implements Streamable { */ public static PropertyPath from(String source, TypeInformation type) { - Assert.hasText(source, "Source must not be null or empty!"); - Assert.notNull(type, "TypeInformation must not be null or empty!"); + Assert.hasText(source, "Source must not be null or empty"); + Assert.notNull(type, "TypeInformation must not be null or empty"); return cache.computeIfAbsent(Key.of(type, source), it -> { diff --git a/src/main/java/org/springframework/data/mapping/PropertyReferenceException.java b/src/main/java/org/springframework/data/mapping/PropertyReferenceException.java index e14d30958..c84570af7 100644 --- a/src/main/java/org/springframework/data/mapping/PropertyReferenceException.java +++ b/src/main/java/org/springframework/data/mapping/PropertyReferenceException.java @@ -37,8 +37,8 @@ import org.springframework.util.StringUtils; public class PropertyReferenceException extends RuntimeException { private static final long serialVersionUID = -5254424051438976570L; - private static final String ERROR_TEMPLATE = "No property '%s' found for type '%s'!"; - private static final String HINTS_TEMPLATE = " Did you mean '%s'?"; + private static final String ERROR_TEMPLATE = "No property '%s' found for type '%s'"; + private static final String HINTS_TEMPLATE = " Did you mean '%s'"; private final String propertyName; private final TypeInformation type; @@ -55,9 +55,9 @@ public class PropertyReferenceException extends RuntimeException { public PropertyReferenceException(String propertyName, TypeInformation type, List alreadyResolvedPah) { - Assert.hasText(propertyName, "Property name must not be null!"); - Assert.notNull(type, "Type must not be null!"); - Assert.notNull(alreadyResolvedPah, "Already resolved paths must not be null!"); + Assert.hasText(propertyName, "Property name must not be null"); + Assert.notNull(type, "Type must not be null"); + Assert.notNull(alreadyResolvedPah, "Already resolved paths must not be null"); this.propertyName = propertyName; this.type = type; diff --git a/src/main/java/org/springframework/data/mapping/TraversalContext.java b/src/main/java/org/springframework/data/mapping/TraversalContext.java index 8187617bc..57d693a0e 100644 --- a/src/main/java/org/springframework/data/mapping/TraversalContext.java +++ b/src/main/java/org/springframework/data/mapping/TraversalContext.java @@ -49,8 +49,8 @@ public class TraversalContext { */ public TraversalContext registerHandler(PersistentProperty property, Function handler) { - Assert.notNull(property, "Property must not be null!"); - Assert.notNull(handler, "Handler must not be null!"); + Assert.notNull(property, "Property must not be null"); + Assert.notNull(handler, "Handler must not be null"); handlers.put(property, handler); @@ -122,7 +122,7 @@ public class TraversalContext { Function handler) { Assert.isTrue(type.isAssignableFrom(property.getType()), () -> String - .format("Cannot register a property handler for %s on a property of type %s!", type, property.getType())); + .format("Cannot register a property handler for %s on a property of type %s", type, property.getType())); Function caster = (Function) it -> type.cast(it); diff --git a/src/main/java/org/springframework/data/mapping/callback/DefaultEntityCallbacks.java b/src/main/java/org/springframework/data/mapping/callback/DefaultEntityCallbacks.java index 30f7ea1d2..3017df3e9 100644 --- a/src/main/java/org/springframework/data/mapping/callback/DefaultEntityCallbacks.java +++ b/src/main/java/org/springframework/data/mapping/callback/DefaultEntityCallbacks.java @@ -63,7 +63,7 @@ class DefaultEntityCallbacks implements EntityCallbacks { @Override public T callback(Class callbackType, T entity, Object... args) { - Assert.notNull(entity, "Entity must not be null!"); + Assert.notNull(entity, "Entity must not be null"); Class entityType = (Class) (entity != null ? ClassUtils.getUserClass(entity.getClass()) : callbackDiscoverer.resolveDeclaredEntityType(callbackType).getRawClass()); diff --git a/src/main/java/org/springframework/data/mapping/callback/DefaultReactiveEntityCallbacks.java b/src/main/java/org/springframework/data/mapping/callback/DefaultReactiveEntityCallbacks.java index d3f935be5..9220f17e4 100644 --- a/src/main/java/org/springframework/data/mapping/callback/DefaultReactiveEntityCallbacks.java +++ b/src/main/java/org/springframework/data/mapping/callback/DefaultReactiveEntityCallbacks.java @@ -64,7 +64,7 @@ class DefaultReactiveEntityCallbacks implements ReactiveEntityCallbacks { @Override public Mono callback(Class callbackType, T entity, Object... args) { - Assert.notNull(entity, "Entity must not be null!"); + Assert.notNull(entity, "Entity must not be null"); Class entityType = (Class) (entity != null ? ClassUtils.getUserClass(entity.getClass()) : callbackDiscoverer.resolveDeclaredEntityType(callbackType).getRawClass()); diff --git a/src/main/java/org/springframework/data/mapping/callback/EntityCallbackDiscoverer.java b/src/main/java/org/springframework/data/mapping/callback/EntityCallbackDiscoverer.java index e3bec0535..68cfe8dbe 100644 --- a/src/main/java/org/springframework/data/mapping/callback/EntityCallbackDiscoverer.java +++ b/src/main/java/org/springframework/data/mapping/callback/EntityCallbackDiscoverer.java @@ -74,7 +74,7 @@ class EntityCallbackDiscoverer { void addEntityCallback(EntityCallback callback) { - Assert.notNull(callback, "Callback must not be null!"); + Assert.notNull(callback, "Callback must not be null"); synchronized (this.retrievalMutex) { diff --git a/src/main/java/org/springframework/data/mapping/callback/EntityCallbacks.java b/src/main/java/org/springframework/data/mapping/callback/EntityCallbacks.java index 75161d531..851aaf9d7 100644 --- a/src/main/java/org/springframework/data/mapping/callback/EntityCallbacks.java +++ b/src/main/java/org/springframework/data/mapping/callback/EntityCallbacks.java @@ -81,7 +81,7 @@ public interface EntityCallbacks { */ static EntityCallbacks create(BeanFactory beanFactory) { - Assert.notNull(beanFactory, "Context must not be null!"); + Assert.notNull(beanFactory, "Context must not be null"); return new DefaultEntityCallbacks(beanFactory); } } diff --git a/src/main/java/org/springframework/data/mapping/callback/ReactiveEntityCallbacks.java b/src/main/java/org/springframework/data/mapping/callback/ReactiveEntityCallbacks.java index 781db6ae4..a7b024cf2 100644 --- a/src/main/java/org/springframework/data/mapping/callback/ReactiveEntityCallbacks.java +++ b/src/main/java/org/springframework/data/mapping/callback/ReactiveEntityCallbacks.java @@ -84,7 +84,7 @@ public interface ReactiveEntityCallbacks { */ static ReactiveEntityCallbacks create(BeanFactory beanFactory) { - Assert.notNull(beanFactory, "Context must not be null!"); + Assert.notNull(beanFactory, "Context must not be null"); return new DefaultReactiveEntityCallbacks(beanFactory); } } diff --git a/src/main/java/org/springframework/data/mapping/context/AbstractMappingContext.java b/src/main/java/org/springframework/data/mapping/context/AbstractMappingContext.java index 243287124..6b3d9bffe 100644 --- a/src/main/java/org/springframework/data/mapping/context/AbstractMappingContext.java +++ b/src/main/java/org/springframework/data/mapping/context/AbstractMappingContext.java @@ -166,7 +166,7 @@ public abstract class AbstractMappingContext type) { - Assert.notNull(type, "Type must not be null!"); + Assert.notNull(type, "Type must not be null"); TypeInformation typeInformation = ClassTypeInformation.from(type); @@ -231,7 +231,7 @@ public abstract class AbstractMappingContext type) { - Assert.notNull(type, "Type must not be null!"); + Assert.notNull(type, "Type must not be null"); try { @@ -270,7 +270,7 @@ public abstract class AbstractMappingContext PersistentPropertyPaths findPersistentPropertyPaths(Class type, Predicate predicate) { - Assert.notNull(type, "Type must not be null!"); - Assert.notNull(predicate, "Selection predicate must not be null!"); + Assert.notNull(type, "Type must not be null"); + Assert.notNull(predicate, "Selection predicate must not be null"); return doFindPersistentPropertyPaths(type, predicate, it -> !it.isAssociation()); } @@ -333,7 +333,7 @@ public abstract class AbstractMappingContext addPersistentEntity(TypeInformation typeInformation) { - Assert.notNull(typeInformation, "TypeInformation must not be null!"); + Assert.notNull(typeInformation, "TypeInformation must not be null"); try { @@ -698,7 +698,7 @@ public abstract class AbstractMappingContext type) { - Assert.notNull(name, "Name must not be null!"); - Assert.notNull(type, "Type must not be null!"); + Assert.notNull(name, "Name must not be null"); + Assert.notNull(type, "Type must not be null"); if (namePattern != null && !name.matches(namePattern)) { return false; diff --git a/src/main/java/org/springframework/data/mapping/context/DefaultPersistentPropertyPath.java b/src/main/java/org/springframework/data/mapping/context/DefaultPersistentPropertyPath.java index 68a327588..0894697c4 100644 --- a/src/main/java/org/springframework/data/mapping/context/DefaultPersistentPropertyPath.java +++ b/src/main/java/org/springframework/data/mapping/context/DefaultPersistentPropertyPath.java @@ -50,7 +50,7 @@ class DefaultPersistentPropertyPath

> implements */ public DefaultPersistentPropertyPath(List

properties) { - Assert.notNull(properties, "Properties must not be null!"); + Assert.notNull(properties, "Properties must not be null"); this.properties = properties; } @@ -73,7 +73,7 @@ class DefaultPersistentPropertyPath

> implements */ public DefaultPersistentPropertyPath

append(P property) { - Assert.notNull(property, "Property must not be null!"); + Assert.notNull(property, "Property must not be null"); if (isEmpty()) { return new DefaultPersistentPropertyPath<>(Collections.singletonList(property)); @@ -83,7 +83,7 @@ class DefaultPersistentPropertyPath

> implements Class leafPropertyType = getLeafProperty().getActualType(); Assert.isTrue(property.getOwner().getType().equals(leafPropertyType), - () -> String.format("Cannot append property %s to type %s!", property.getName(), leafPropertyType.getName())); + () -> String.format("Cannot append property %s to type %s", property.getName(), leafPropertyType.getName())); List

properties = new ArrayList<>(this.properties); properties.add(property); @@ -109,8 +109,8 @@ class DefaultPersistentPropertyPath

> implements @Nullable public String toPath(String delimiter, Converter converter) { - Assert.hasText(delimiter, "Delimiter must not be null or empty!"); - Assert.notNull(converter, "Converter must not be null!"); + Assert.hasText(delimiter, "Delimiter must not be null or empty"); + Assert.notNull(converter, "Converter must not be null"); String result = properties.stream() // .map(converter::convert) // @@ -132,7 +132,7 @@ class DefaultPersistentPropertyPath

> implements public boolean isBasePathOf(PersistentPropertyPath

path) { - Assert.notNull(path, "PersistentPropertyPath must not be null!"); + Assert.notNull(path, "PersistentPropertyPath must not be null"); Iterator

iterator = path.iterator(); diff --git a/src/main/java/org/springframework/data/mapping/context/InvalidPersistentPropertyPath.java b/src/main/java/org/springframework/data/mapping/context/InvalidPersistentPropertyPath.java index 75f6a6a69..a08cd68f0 100644 --- a/src/main/java/org/springframework/data/mapping/context/InvalidPersistentPropertyPath.java +++ b/src/main/java/org/springframework/data/mapping/context/InvalidPersistentPropertyPath.java @@ -37,7 +37,7 @@ import org.springframework.util.StringUtils; public class InvalidPersistentPropertyPath extends MappingException { private static final long serialVersionUID = 2805815643641094488L; - private static final String DEFAULT_MESSAGE = "No property '%s' found on %s! Did you mean: %s?"; + private static final String DEFAULT_MESSAGE = "No property '%s' found on %s; Did you mean: %s"; private final String source; private final String unresolvableSegment; @@ -57,9 +57,9 @@ public class InvalidPersistentPropertyPath extends MappingException { super(createMessage(resolvedPath.isEmpty() ? type : resolvedPath.getRequiredLeafProperty().getTypeInformation(), unresolvableSegment)); - Assert.notNull(source, "Source property path must not be null!"); - Assert.notNull(type, "Type must not be null!"); - Assert.notNull(unresolvableSegment, "Unresolvable segment must not be null!"); + Assert.notNull(source, "Source property path must not be null"); + Assert.notNull(type, "Type must not be null"); + Assert.notNull(unresolvableSegment, "Unresolvable segment must not be null"); this.source = source; this.type = type; diff --git a/src/main/java/org/springframework/data/mapping/context/MappingContextEvent.java b/src/main/java/org/springframework/data/mapping/context/MappingContextEvent.java index 23a050fce..7efa15373 100644 --- a/src/main/java/org/springframework/data/mapping/context/MappingContextEvent.java +++ b/src/main/java/org/springframework/data/mapping/context/MappingContextEvent.java @@ -46,8 +46,8 @@ public class MappingContextEvent, P extends Per super(source); - Assert.notNull(source, "Source MappingContext must not be null!"); - Assert.notNull(entity, "Entity must not be null!"); + Assert.notNull(source, "Source MappingContext must not be null"); + Assert.notNull(entity, "Entity must not be null"); this.source = source; this.entity = entity; diff --git a/src/main/java/org/springframework/data/mapping/context/PersistentEntities.java b/src/main/java/org/springframework/data/mapping/context/PersistentEntities.java index 577a89211..132e29ac4 100644 --- a/src/main/java/org/springframework/data/mapping/context/PersistentEntities.java +++ b/src/main/java/org/springframework/data/mapping/context/PersistentEntities.java @@ -56,7 +56,7 @@ public class PersistentEntities implements Streamable> contexts) { - Assert.notNull(contexts, "MappingContexts must not be null!"); + Assert.notNull(contexts, "MappingContexts must not be null"); this.contexts = contexts instanceof Collection ? (Collection>>) contexts @@ -71,7 +71,7 @@ public class PersistentEntities implements Streamable... contexts) { - Assert.notNull(contexts, "MappingContexts must not be null!"); + Assert.notNull(contexts, "MappingContexts must not be null"); return new PersistentEntities(Arrays.asList(contexts)); } @@ -110,7 +110,7 @@ public class PersistentEntities implements Streamable> getRequiredPersistentEntity(Class type) { - Assert.notNull(type, "Domain type must not be null!"); + Assert.notNull(type, "Domain type must not be null"); if (contexts.size() == 1) { return contexts.iterator().next().getRequiredPersistentEntity(type); @@ -118,7 +118,7 @@ public class PersistentEntities implements Streamable { return new MappingException(String.format( - "Cannot get or create PersistentEntity for type %s! PersistentEntities knows about %s MappingContext instances and therefore cannot identify a single responsible one. Please configure the initialEntitySet through an entity scan using the base package in your configuration to pre initialize contexts", + "Cannot get or create PersistentEntity for type %s; PersistentEntities knows about %s MappingContext instances and therefore cannot identify a single responsible one; Please configure the initialEntitySet through an entity scan using the base package in your configuration to pre initialize contexts", type.getName(), contexts.size())); }); } @@ -135,8 +135,8 @@ public class PersistentEntities implements Streamable Optional mapOnContext(Class type, BiFunction>, PersistentEntity, T> combiner) { - Assert.notNull(type, "Type must not be null!"); - Assert.notNull(combiner, "Combining BiFunction must not be null!"); + Assert.notNull(type, "Type must not be null"); + Assert.notNull(combiner, "Combining BiFunction must not be null"); if (contexts.size() == 1) { return contexts.stream() // @@ -215,7 +215,7 @@ public class PersistentEntities implements Streamable getTypeUltimatelyReferredToBy(PersistentProperty property) { - Assert.notNull(property, "PersistentProperty must not be null!"); + Assert.notNull(property, "PersistentProperty must not be null"); PersistentEntity> entity = getEntityUltimatelyReferredToBy(property); @@ -254,7 +254,7 @@ public class PersistentEntities implements Streamable it.getType().getName()).collect(Collectors.joining(", ")); - message += "! Introduce dedicated unique identifier types or explicitly define the target type in @Reference"; + message += "; Introduce dedicated unique identifier types or explicitly define the target type in @Reference"; throw new IllegalStateException(message); } diff --git a/src/main/java/org/springframework/data/mapping/context/PersistentPropertyPathFactory.java b/src/main/java/org/springframework/data/mapping/context/PersistentPropertyPathFactory.java index 82a32cb2f..c7acde884 100644 --- a/src/main/java/org/springframework/data/mapping/context/PersistentPropertyPathFactory.java +++ b/src/main/java/org/springframework/data/mapping/context/PersistentPropertyPathFactory.java @@ -65,8 +65,8 @@ class PersistentPropertyPathFactory, P extends */ public PersistentPropertyPath

from(Class type, String propertyPath) { - Assert.notNull(type, "Type must not be null!"); - Assert.notNull(propertyPath, "Property path must not be null!"); + Assert.notNull(type, "Type must not be null"); + Assert.notNull(propertyPath, "Property path must not be null"); return getPersistentPropertyPath(ClassTypeInformation.from(type), propertyPath); } @@ -80,8 +80,8 @@ class PersistentPropertyPathFactory, P extends */ public PersistentPropertyPath

from(TypeInformation type, String propertyPath) { - Assert.notNull(type, "Type must not be null!"); - Assert.notNull(propertyPath, "Property path must not be null!"); + Assert.notNull(type, "Type must not be null"); + Assert.notNull(propertyPath, "Property path must not be null"); return getPersistentPropertyPath(type, propertyPath); } @@ -94,7 +94,7 @@ class PersistentPropertyPathFactory, P extends */ public PersistentPropertyPath

from(PropertyPath path) { - Assert.notNull(path, "Property path must not be null!"); + Assert.notNull(path, "Property path must not be null"); return from(path.getOwningType(), path.toDotPath()); } @@ -109,8 +109,8 @@ class PersistentPropertyPathFactory, P extends */ public PersistentPropertyPaths from(Class type, Predicate propertyFilter) { - Assert.notNull(type, "Type must not be null!"); - Assert.notNull(propertyFilter, "Property filter must not be null!"); + Assert.notNull(type, "Type must not be null"); + Assert.notNull(propertyFilter, "Property filter must not be null"); return from(ClassTypeInformation.from(type), propertyFilter); } @@ -127,9 +127,9 @@ class PersistentPropertyPathFactory, P extends public PersistentPropertyPaths from(Class type, Predicate propertyFilter, Predicate

traversalGuard) { - Assert.notNull(type, "Type must not be null!"); - Assert.notNull(propertyFilter, "Property filter must not be null!"); - Assert.notNull(traversalGuard, "Traversal guard must not be null!"); + Assert.notNull(type, "Type must not be null"); + Assert.notNull(propertyFilter, "Property filter must not be null"); + Assert.notNull(traversalGuard, "Traversal guard must not be null"); return from(ClassTypeInformation.from(type), propertyFilter, traversalGuard); } @@ -158,9 +158,9 @@ class PersistentPropertyPathFactory, P extends public PersistentPropertyPaths from(TypeInformation type, Predicate propertyFilter, Predicate

traversalGuard) { - Assert.notNull(type, "Type must not be null!"); - Assert.notNull(propertyFilter, "Property filter must not be null!"); - Assert.notNull(traversalGuard, "Traversal guard must not be null!"); + Assert.notNull(type, "Type must not be null"); + Assert.notNull(propertyFilter, "Property filter must not be null"); + Assert.notNull(traversalGuard, "Traversal guard must not be null"); return DefaultPersistentPropertyPaths.of(type, from(type, propertyFilter, traversalGuard, DefaultPersistentPropertyPath.empty())); @@ -369,7 +369,7 @@ class PersistentPropertyPathFactory, P extends @Override public boolean contains(PropertyPath path) { - Assert.notNull(path, "PropertyPath must not be null!"); + Assert.notNull(path, "PropertyPath must not be null"); if (!path.getOwningType().equals(type)) { return false; @@ -388,7 +388,7 @@ class PersistentPropertyPathFactory, P extends @Override public PersistentPropertyPaths dropPathIfSegmentMatches(Predicate predicate) { - Assert.notNull(predicate, "Predicate must not be null!"); + Assert.notNull(predicate, "Predicate must not be null"); List> paths = this.stream() // .filter(it -> !it.stream().anyMatch(predicate)) // diff --git a/src/main/java/org/springframework/data/mapping/model/AbstractPersistentProperty.java b/src/main/java/org/springframework/data/mapping/model/AbstractPersistentProperty.java index 0d8b62ae0..9cb29d47b 100644 --- a/src/main/java/org/springframework/data/mapping/model/AbstractPersistentProperty.java +++ b/src/main/java/org/springframework/data/mapping/model/AbstractPersistentProperty.java @@ -75,8 +75,8 @@ public abstract class AbstractPersistentProperty

public AbstractPersistentProperty(Property property, PersistentEntity owner, SimpleTypeHolder simpleTypeHolder) { - Assert.notNull(simpleTypeHolder, "SimpleTypeHolder must not be null!"); - Assert.notNull(owner, "Owner entity must not be null!"); + Assert.notNull(simpleTypeHolder, "SimpleTypeHolder must not be null"); + Assert.notNull(owner, "Owner entity must not be null"); this.name = property.getName(); this.information = owner.getTypeInformation().getRequiredProperty(getName()); diff --git a/src/main/java/org/springframework/data/mapping/model/AnnotationBasedPersistentProperty.java b/src/main/java/org/springframework/data/mapping/model/AnnotationBasedPersistentProperty.java index 7cfbd5dcd..78bbd8565 100644 --- a/src/main/java/org/springframework/data/mapping/model/AnnotationBasedPersistentProperty.java +++ b/src/main/java/org/springframework/data/mapping/model/AnnotationBasedPersistentProperty.java @@ -128,8 +128,8 @@ public abstract class AnnotationBasedPersistentProperty

A findAnnotation(Class annotationType) { - Assert.notNull(annotationType, "Annotation type must not be null!"); + Assert.notNull(annotationType, "Annotation type must not be null"); return doFindAnnotation(annotationType).orElse(null); } diff --git a/src/main/java/org/springframework/data/mapping/model/BasicPersistentEntity.java b/src/main/java/org/springframework/data/mapping/model/BasicPersistentEntity.java index 8fbd9c5aa..f9debf9eb 100644 --- a/src/main/java/org/springframework/data/mapping/model/BasicPersistentEntity.java +++ b/src/main/java/org/springframework/data/mapping/model/BasicPersistentEntity.java @@ -62,7 +62,7 @@ import org.springframework.util.StringUtils; */ public class BasicPersistentEntity> implements MutablePersistentEntity { - private static final String TYPE_MISMATCH = "Target bean of type %s is not of type of the persistent entity (%s)!"; + private static final String TYPE_MISMATCH = "Target bean of type %s is not of type of the persistent entity (%s)"; private final @Nullable InstanceCreatorMetadata

creator; private final TypeInformation information; @@ -104,7 +104,7 @@ public class BasicPersistentEntity> implement */ public BasicPersistentEntity(TypeInformation information, @Nullable Comparator

comparator) { - Assert.notNull(information, "Information must not be null!"); + Assert.notNull(information, "Information must not be null"); this.information = information; this.properties = new ArrayList<>(); @@ -178,7 +178,7 @@ public class BasicPersistentEntity> implement public void addPersistentProperty(P property) { - Assert.notNull(property, "Property must not be null!"); + Assert.notNull(property, "Property must not be null"); if (properties.contains(property)) { return; @@ -207,7 +207,7 @@ public class BasicPersistentEntity> implement throw new MappingException( String.format( "Attempt to add version property %s but already have property %s registered " - + "as version. Check your mapping configuration", + + "as version; Check your mapping configuration", property.getField(), versionProperty.getField())); } @@ -237,7 +237,7 @@ public class BasicPersistentEntity> implement if (idProperty != null) { throw new MappingException(String.format("Attempt to add id property %s but already have property %s registered " - + "as id. Check your mapping configuration ", property.getField(), idProperty.getField())); + + "as id; Check your mapping configuration ", property.getField(), idProperty.getField())); } return property; @@ -245,7 +245,7 @@ public class BasicPersistentEntity> implement public void addAssociation(Association

association) { - Assert.notNull(association, "Association must not be null!"); + Assert.notNull(association, "Association must not be null"); associations.add(association); } @@ -259,7 +259,7 @@ public class BasicPersistentEntity> implement @Override public Iterable

getPersistentProperties(Class annotationType) { - Assert.notNull(annotationType, "Annotation type must not be null!"); + Assert.notNull(annotationType, "Annotation type must not be null"); return propertyAnnotationCache.computeIfAbsent(annotationType, this::doFindPersistentProperty); } @@ -292,7 +292,7 @@ public class BasicPersistentEntity> implement public void doWithProperties(PropertyHandler

handler) { - Assert.notNull(handler, "PropertyHandler must not be null!"); + Assert.notNull(handler, "PropertyHandler must not be null"); for (P property : persistentPropertiesCache) { handler.doWithPersistentProperty(property); @@ -302,7 +302,7 @@ public class BasicPersistentEntity> implement @Override public void doWithProperties(SimplePropertyHandler handler) { - Assert.notNull(handler, "Handler must not be null!"); + Assert.notNull(handler, "Handler must not be null"); for (PersistentProperty property : persistentPropertiesCache) { handler.doWithPersistentProperty(property); @@ -311,7 +311,7 @@ public class BasicPersistentEntity> implement public void doWithAssociations(AssociationHandler

handler) { - Assert.notNull(handler, "Handler must not be null!"); + Assert.notNull(handler, "Handler must not be null"); for (Association

association : associations) { handler.doWithAssociation(association); @@ -320,7 +320,7 @@ public class BasicPersistentEntity> implement public void doWithAssociations(SimpleAssociationHandler handler) { - Assert.notNull(handler, "Handler must not be null!"); + Assert.notNull(handler, "Handler must not be null"); for (Association> association : associations) { handler.doWithAssociation(association); @@ -462,7 +462,7 @@ public class BasicPersistentEntity> implement */ private void verifyBeanType(Object bean) { - Assert.notNull(bean, "Target bean must not be null!"); + Assert.notNull(bean, "Target bean must not be null"); Assert.isInstanceOf(getType(), bean, () -> String.format(TYPE_MISMATCH, bean.getClass().getName(), getType().getName())); } diff --git a/src/main/java/org/springframework/data/mapping/model/BeanWrapper.java b/src/main/java/org/springframework/data/mapping/model/BeanWrapper.java index df39b10c8..e3cfd5070 100644 --- a/src/main/java/org/springframework/data/mapping/model/BeanWrapper.java +++ b/src/main/java/org/springframework/data/mapping/model/BeanWrapper.java @@ -52,14 +52,14 @@ class BeanWrapper implements PersistentPropertyAccessor { */ protected BeanWrapper(T bean) { - Assert.notNull(bean, "Bean must not be null!"); + Assert.notNull(bean, "Bean must not be null"); this.bean = bean; } @SuppressWarnings("unchecked") public void setProperty(PersistentProperty property, @Nullable Object value) { - Assert.notNull(property, "PersistentProperty must not be null!"); + Assert.notNull(property, "PersistentProperty must not be null"); try { @@ -120,7 +120,7 @@ class BeanWrapper implements PersistentPropertyAccessor { @Nullable public Object getProperty(PersistentProperty property, Class type) { - Assert.notNull(property, "PersistentProperty must not be null!"); + Assert.notNull(property, "PersistentProperty must not be null"); try { diff --git a/src/main/java/org/springframework/data/mapping/model/CamelCaseSplittingFieldNamingStrategy.java b/src/main/java/org/springframework/data/mapping/model/CamelCaseSplittingFieldNamingStrategy.java index b2a60f424..fb6fb8588 100644 --- a/src/main/java/org/springframework/data/mapping/model/CamelCaseSplittingFieldNamingStrategy.java +++ b/src/main/java/org/springframework/data/mapping/model/CamelCaseSplittingFieldNamingStrategy.java @@ -41,7 +41,7 @@ public class CamelCaseSplittingFieldNamingStrategy implements FieldNamingStrateg */ public CamelCaseSplittingFieldNamingStrategy(String delimiter) { - Assert.notNull(delimiter, "Delimiter must not be null!"); + Assert.notNull(delimiter, "Delimiter must not be null"); this.delimiter = delimiter; } diff --git a/src/main/java/org/springframework/data/mapping/model/ClassGeneratingEntityInstantiator.java b/src/main/java/org/springframework/data/mapping/model/ClassGeneratingEntityInstantiator.java index 90c73dc46..797f61e3f 100644 --- a/src/main/java/org/springframework/data/mapping/model/ClassGeneratingEntityInstantiator.java +++ b/src/main/java/org/springframework/data/mapping/model/ClassGeneratingEntityInstantiator.java @@ -143,7 +143,7 @@ class ClassGeneratingEntityInstantiator implements EntityInstantiator { if (LOGGER.isDebugEnabled()) { LOGGER.debug( - String.format("Cannot create entity instantiator for %s. Falling back to ReflectionEntityInstantiator.", + String.format("Cannot create entity instantiator for %s; Falling back to ReflectionEntityInstantiator", entity.getName()), ex); } @@ -172,7 +172,7 @@ class ClassGeneratingEntityInstantiator implements EntityInstantiator { if (NativeDetector.inNativeImage()) { if (LOGGER.isDebugEnabled()) { - LOGGER.debug(String.format("graalvm.nativeimage - fall back to reflection for %s.", entity.getName())); + LOGGER.debug(String.format("graalvm.nativeimage - fall back to reflection for %s", entity.getName())); } return true; @@ -575,7 +575,7 @@ class ClassGeneratingEntityInstantiator implements EntityInstantiator { private static void insertAssertNotNull(MethodVisitor mv, String parameterName) { // Assert.notNull(property) - mv.visitLdcInsn(String.format("Parameter %s must not be null!", parameterName)); + mv.visitLdcInsn(String.format("Parameter %s must not be null", parameterName)); mv.visitMethodInsn(INVOKESTATIC, Type.getInternalName(Assert.class), "notNull", String.format("(%s%s)V", BytecodeUtil.referenceName(JAVA_LANG_OBJECT), BytecodeUtil.referenceName(String.class)), false); } diff --git a/src/main/java/org/springframework/data/mapping/model/ClassGeneratingPropertyAccessorFactory.java b/src/main/java/org/springframework/data/mapping/model/ClassGeneratingPropertyAccessorFactory.java index b6438d817..8936cd95e 100644 --- a/src/main/java/org/springframework/data/mapping/model/ClassGeneratingPropertyAccessorFactory.java +++ b/src/main/java/org/springframework/data/mapping/model/ClassGeneratingPropertyAccessorFactory.java @@ -115,7 +115,7 @@ public class ClassGeneratingPropertyAccessorFactory implements PersistentPropert @Override public boolean isSupported(PersistentEntity entity) { - Assert.notNull(entity, "PersistentEntity must not be null!"); + Assert.notNull(entity, "PersistentEntity must not be null"); return isClassLoaderDefineClassAvailable(entity) && isTypeInjectable(entity) && hasUniquePropertyHashCodes(entity); } @@ -260,7 +260,7 @@ public class ClassGeneratingPropertyAccessorFactory implements PersistentPropert * // … * } * throw new UnsupportedOperationException( - * String.format("No accessor to set property %s!", new Object[] { property })); + * String.format("No accessor to set property %s", new Object[] { property })); * } * * public Object getProperty(PersistentProperty property) { @@ -275,7 +275,7 @@ public class ClassGeneratingPropertyAccessorFactory implements PersistentPropert * return bean.field; * // … * throw new UnsupportedOperationException( - * String.format("No accessor to get property %s!", new Object[] { property })); + * String.format("No accessor to get property %s", new Object[] { property })); * } * } * } @@ -446,7 +446,7 @@ public class ClassGeneratingPropertyAccessorFactory implements PersistentPropert // Assert.notNull(bean) mv.visitVarInsn(ALOAD, 1); - mv.visitLdcInsn("Bean must not be null!"); + mv.visitLdcInsn("Bean must not be null"); mv.visitMethodInsn(INVOKESTATIC, "org/springframework/util/Assert", "notNull", String.format("(%s%s)V", referenceName(JAVA_LANG_OBJECT), referenceName(JAVA_LANG_STRING)), false); @@ -911,7 +911,7 @@ public class ClassGeneratingPropertyAccessorFactory implements PersistentPropert * // … * } * throw new UnsupportedOperationException( - * String.format("No accessor to set property %s!", new Object[] { property })); + * String.format("No accessor to set property %s", new Object[] { property })); * } * */ @@ -1240,7 +1240,7 @@ public class ClassGeneratingPropertyAccessorFactory implements PersistentPropert // Assert.notNull(property) mv.visitVarInsn(ALOAD, 1); - mv.visitLdcInsn("Property must not be null!"); + mv.visitLdcInsn("Property must not be null"); mv.visitMethodInsn(INVOKESTATIC, "org/springframework/util/Assert", "notNull", String.format("(%s%s)V", referenceName(JAVA_LANG_OBJECT), referenceName(JAVA_LANG_STRING)), false); } diff --git a/src/main/java/org/springframework/data/mapping/model/ConvertingPropertyAccessor.java b/src/main/java/org/springframework/data/mapping/model/ConvertingPropertyAccessor.java index be6ef3736..294372f81 100644 --- a/src/main/java/org/springframework/data/mapping/model/ConvertingPropertyAccessor.java +++ b/src/main/java/org/springframework/data/mapping/model/ConvertingPropertyAccessor.java @@ -48,8 +48,8 @@ public class ConvertingPropertyAccessor extends SimplePersistentPropertyPathA super(accessor); - Assert.notNull(accessor, "PersistentPropertyAccessor must not be null!"); - Assert.notNull(conversionService, "ConversionService must not be null!"); + Assert.notNull(accessor, "PersistentPropertyAccessor must not be null"); + Assert.notNull(conversionService, "ConversionService must not be null"); this.accessor = accessor; this.conversionService = conversionService; @@ -78,8 +78,8 @@ public class ConvertingPropertyAccessor extends SimplePersistentPropertyPathA @Nullable public S getProperty(PersistentProperty property, Class targetType) { - Assert.notNull(property, "PersistentProperty must not be null!"); - Assert.notNull(targetType, "Target type must not be null!"); + Assert.notNull(property, "PersistentProperty must not be null"); + Assert.notNull(targetType, "Target type must not be null"); return convertIfNecessary(getProperty(property), targetType); } diff --git a/src/main/java/org/springframework/data/mapping/model/DefaultSpELExpressionEvaluator.java b/src/main/java/org/springframework/data/mapping/model/DefaultSpELExpressionEvaluator.java index 86c6947f4..b0026d14c 100644 --- a/src/main/java/org/springframework/data/mapping/model/DefaultSpELExpressionEvaluator.java +++ b/src/main/java/org/springframework/data/mapping/model/DefaultSpELExpressionEvaluator.java @@ -36,8 +36,8 @@ public class DefaultSpELExpressionEvaluator implements SpELExpressionEvaluator { public DefaultSpELExpressionEvaluator(Object source, SpELContext factory) { - Assert.notNull(source, "Source must not be null!"); - Assert.notNull(factory, "SpELContext must not be null!"); + Assert.notNull(source, "Source must not be null"); + Assert.notNull(factory, "SpELContext must not be null"); this.source = source; this.factory = factory; diff --git a/src/main/java/org/springframework/data/mapping/model/EntityInstantiators.java b/src/main/java/org/springframework/data/mapping/model/EntityInstantiators.java index aab81dbdb..5100c2eff 100644 --- a/src/main/java/org/springframework/data/mapping/model/EntityInstantiators.java +++ b/src/main/java/org/springframework/data/mapping/model/EntityInstantiators.java @@ -71,8 +71,8 @@ public class EntityInstantiators { public EntityInstantiators(EntityInstantiator defaultInstantiator, Map, EntityInstantiator> customInstantiators) { - Assert.notNull(defaultInstantiator, "DefaultInstantiator must not be null!"); - Assert.notNull(customInstantiators, "CustomInstantiators must not be null!"); + Assert.notNull(defaultInstantiator, "DefaultInstantiator must not be null"); + Assert.notNull(customInstantiators, "CustomInstantiators must not be null"); this.fallback = defaultInstantiator; this.customInstantiators = customInstantiators; @@ -86,7 +86,7 @@ public class EntityInstantiators { */ public EntityInstantiator getInstantiatorFor(PersistentEntity entity) { - Assert.notNull(entity, "Entity must not be null!"); + Assert.notNull(entity, "Entity must not be null"); Class type = entity.getType(); if (!customInstantiators.containsKey(type)) { diff --git a/src/main/java/org/springframework/data/mapping/model/IdPropertyIdentifierAccessor.java b/src/main/java/org/springframework/data/mapping/model/IdPropertyIdentifierAccessor.java index 5ae1eaada..61f16f274 100644 --- a/src/main/java/org/springframework/data/mapping/model/IdPropertyIdentifierAccessor.java +++ b/src/main/java/org/springframework/data/mapping/model/IdPropertyIdentifierAccessor.java @@ -46,9 +46,9 @@ public class IdPropertyIdentifierAccessor extends TargetAwareIdentifierAccessor super(target); - Assert.notNull(entity, "PersistentEntity must not be null!"); - Assert.isTrue(entity.hasIdProperty(), "PersistentEntity must have an identifier property!"); - Assert.notNull(target, "Target bean must not be null!"); + Assert.notNull(entity, "PersistentEntity must not be null"); + Assert.isTrue(entity.hasIdProperty(), "PersistentEntity must have an identifier property"); + Assert.notNull(target, "Target bean must not be null"); this.idProperty = entity.getRequiredIdProperty(); this.accessor = entity.getPropertyAccessor(target); diff --git a/src/main/java/org/springframework/data/mapping/model/InstanceCreatorMetadataDiscoverer.java b/src/main/java/org/springframework/data/mapping/model/InstanceCreatorMetadataDiscoverer.java index 512352f51..6d9289dd9 100644 --- a/src/main/java/org/springframework/data/mapping/model/InstanceCreatorMetadataDiscoverer.java +++ b/src/main/java/org/springframework/data/mapping/model/InstanceCreatorMetadataDiscoverer.java @@ -65,7 +65,7 @@ class InstanceCreatorMetadataDiscoverer { if (hasAnnotatedConstructor && hasAnnotatedFactoryMethod) { throw new MappingException( - "Invalid usage of @Factory and @PersistenceConstructor on %s. Only one annotation type permitted to indicate how entity instances should be created." + "Invalid usage of @Factory and @PersistenceConstructor on %s; Only one annotation type permitted to indicate how entity instances should be created" .formatted(entity.getType().getName())); } @@ -130,7 +130,7 @@ class InstanceCreatorMetadataDiscoverer { if (!Modifier.isStatic(method.getModifiers())) { throw new MappingException( - "@PersistenceCreator can only be used on static methods. Offending method: %s".formatted(method)); + "@PersistenceCreator can only be used on static methods; Offending method: %s".formatted(method)); } } } diff --git a/src/main/java/org/springframework/data/mapping/model/InstantiationAwarePropertyAccessor.java b/src/main/java/org/springframework/data/mapping/model/InstantiationAwarePropertyAccessor.java index 7ae8c5887..21f1d1363 100644 --- a/src/main/java/org/springframework/data/mapping/model/InstantiationAwarePropertyAccessor.java +++ b/src/main/java/org/springframework/data/mapping/model/InstantiationAwarePropertyAccessor.java @@ -39,8 +39,8 @@ import org.springframework.util.Assert; */ public class InstantiationAwarePropertyAccessor implements PersistentPropertyAccessor { - private static final String NO_SETTER_OR_CONSTRUCTOR = "Cannot set property %s because no setter, wither or copy constructor exists for %s!"; - private static final String NO_CONSTRUCTOR_PARAMETER = "Cannot set property %s because no setter, no wither and it's not part of the persistence constructor %s!"; + private static final String NO_SETTER_OR_CONSTRUCTOR = "Cannot set property %s because no setter, wither or copy constructor exists for %s"; + private static final String NO_CONSTRUCTOR_PARAMETER = "Cannot set property %s because no setter, no wither and it's not part of the persistence constructor %s"; private final Function> delegateFunction; private final EntityInstantiators instantiators; @@ -60,9 +60,9 @@ public class InstantiationAwarePropertyAccessor implements PersistentProperty public InstantiationAwarePropertyAccessor(T bean, Function> accessorFunction, EntityInstantiators instantiators) { - Assert.notNull(bean, "Bean must not be null!"); - Assert.notNull(accessorFunction, "PersistentPropertyAccessor function must not be null!"); - Assert.notNull(instantiators, "EntityInstantiators must not be null!"); + Assert.notNull(bean, "Bean must not be null"); + Assert.notNull(accessorFunction, "PersistentPropertyAccessor function must not be null"); + Assert.notNull(instantiators, "EntityInstantiators must not be null"); this.delegateFunction = accessorFunction; this.instantiators = instantiators; diff --git a/src/main/java/org/springframework/data/mapping/model/KotlinCopyMethod.java b/src/main/java/org/springframework/data/mapping/model/KotlinCopyMethod.java index 7614a802f..24823127b 100644 --- a/src/main/java/org/springframework/data/mapping/model/KotlinCopyMethod.java +++ b/src/main/java/org/springframework/data/mapping/model/KotlinCopyMethod.java @@ -76,7 +76,7 @@ class KotlinCopyMethod { */ public static Optional findCopyMethod(Class type) { - Assert.notNull(type, "Type must not be null!"); + Assert.notNull(type, "Type must not be null"); Optional syntheticCopyMethod = findSyntheticCopyMethod(type); diff --git a/src/main/java/org/springframework/data/mapping/model/PersistentEntityIsNewStrategy.java b/src/main/java/org/springframework/data/mapping/model/PersistentEntityIsNewStrategy.java index 45402ba78..092a13b08 100644 --- a/src/main/java/org/springframework/data/mapping/model/PersistentEntityIsNewStrategy.java +++ b/src/main/java/org/springframework/data/mapping/model/PersistentEntityIsNewStrategy.java @@ -44,7 +44,7 @@ class PersistentEntityIsNewStrategy implements IsNewStrategy { */ private PersistentEntityIsNewStrategy(PersistentEntity entity, boolean idOnly) { - Assert.notNull(entity, "PersistentEntity must not be null!"); + Assert.notNull(entity, "PersistentEntity must not be null"); this.valueLookup = entity.hasVersionProperty() && !idOnly // ? source -> entity.getPropertyAccessor(source).getProperty(entity.getRequiredVersionProperty()) @@ -61,7 +61,7 @@ class PersistentEntityIsNewStrategy implements IsNewStrategy { if (!ClassUtils.isAssignable(Number.class, type)) { throw new IllegalArgumentException(String - .format("Only numeric primitives are supported as identifier / version field types! Got: %s", valueType)); + .format("Only numeric primitives are supported as identifier / version field types; Got: %s", valueType)); } } } @@ -105,6 +105,6 @@ class PersistentEntityIsNewStrategy implements IsNewStrategy { } throw new IllegalArgumentException( - String.format("Could not determine whether %s is new! Unsupported identifier or version property", entity)); + String.format("Could not determine whether %s is new; Unsupported identifier or version property", entity)); } } diff --git a/src/main/java/org/springframework/data/mapping/model/PreferredConstructorDiscoverer.java b/src/main/java/org/springframework/data/mapping/model/PreferredConstructorDiscoverer.java index ac8c0ef4b..02d1a9fce 100644 --- a/src/main/java/org/springframework/data/mapping/model/PreferredConstructorDiscoverer.java +++ b/src/main/java/org/springframework/data/mapping/model/PreferredConstructorDiscoverer.java @@ -60,7 +60,7 @@ public interface PreferredConstructorDiscoverer> PreferredConstructor discover(Class type) { - Assert.notNull(type, "Type must not be null!"); + Assert.notNull(type, "Type must not be null"); return Discoverers.findDiscoverer(type) // .discover(ClassTypeInformation.from(type), null); @@ -75,7 +75,7 @@ public interface PreferredConstructorDiscoverer> PreferredConstructor discover(PersistentEntity entity) { - Assert.notNull(entity, "PersistentEntity must not be null!"); + Assert.notNull(entity, "PersistentEntity must not be null"); return Discoverers.findDiscoverer(entity.getType()) // .discover(entity.getTypeInformation(), entity); diff --git a/src/main/java/org/springframework/data/mapping/model/Property.java b/src/main/java/org/springframework/data/mapping/model/Property.java index c403a70ba..a972ff27d 100644 --- a/src/main/java/org/springframework/data/mapping/model/Property.java +++ b/src/main/java/org/springframework/data/mapping/model/Property.java @@ -54,8 +54,8 @@ public class Property { private Property(TypeInformation type, Optional field, Optional descriptor) { - Assert.notNull(type, "Type must not be null!"); - Assert.isTrue(Optionals.isAnyPresent(field, descriptor), "Either field or descriptor has to be given!"); + Assert.notNull(type, "Type must not be null"); + Assert.isTrue(Optionals.isAnyPresent(field, descriptor), "Either field or descriptor has to be given"); this.field = field; this.descriptor = descriptor; @@ -89,7 +89,7 @@ public class Property { */ public static Property of(TypeInformation type, Field field) { - Assert.notNull(field, "Field must not be null!"); + Assert.notNull(field, "Field must not be null"); return new Property(type, Optional.of(field), Optional.empty()); } @@ -104,8 +104,8 @@ public class Property { */ public static Property of(TypeInformation type, Field field, PropertyDescriptor descriptor) { - Assert.notNull(field, "Field must not be null!"); - Assert.notNull(descriptor, "PropertyDescriptor must not be null!"); + Assert.notNull(field, "Field must not be null"); + Assert.notNull(descriptor, "PropertyDescriptor must not be null"); return new Property(type, Optional.of(field), Optional.of(descriptor)); } @@ -121,7 +121,7 @@ public class Property { */ public static Property of(TypeInformation type, PropertyDescriptor descriptor) { - Assert.notNull(descriptor, "PropertyDescriptor must not be null!"); + Assert.notNull(descriptor, "PropertyDescriptor must not be null"); return new Property(type, Optional.empty(), Optional.of(descriptor)); } @@ -135,7 +135,7 @@ public class Property { */ public static boolean supportsStandalone(PropertyDescriptor descriptor) { - Assert.notNull(descriptor, "PropertyDescriptor must not be null!"); + Assert.notNull(descriptor, "PropertyDescriptor must not be null"); return descriptor.getPropertyType() != null; } @@ -259,7 +259,7 @@ public class Property { return Optionals.firstNonEmpty(// () -> this.field.map(field), // () -> this.descriptor.map(descriptor))// - .orElseThrow(() -> new IllegalStateException("Should not occur! Either field or descriptor has to be given")); + .orElseThrow(() -> new IllegalStateException("Should not occur; Either field or descriptor has to be given")); } private static Optional findWither(TypeInformation owner, String propertyName, Class rawType) { diff --git a/src/main/java/org/springframework/data/mapping/model/ReflectionEntityInstantiator.java b/src/main/java/org/springframework/data/mapping/model/ReflectionEntityInstantiator.java index 6be9ec56c..5d9f6d33b 100644 --- a/src/main/java/org/springframework/data/mapping/model/ReflectionEntityInstantiator.java +++ b/src/main/java/org/springframework/data/mapping/model/ReflectionEntityInstantiator.java @@ -66,7 +66,7 @@ enum ReflectionEntityInstantiator implements EntityInstantiator { T t = (T) ReflectionUtils.invokeMethod(method.getFactoryMethod(), null, params); if (t == null) { - throw new IllegalStateException("Method %s returned null!".formatted(method.getFactoryMethod())); + throw new IllegalStateException("Method %s returned null".formatted(method.getFactoryMethod())); } return t; } catch (Exception e) { diff --git a/src/main/java/org/springframework/data/mapping/model/SimplePersistentPropertyPathAccessor.java b/src/main/java/org/springframework/data/mapping/model/SimplePersistentPropertyPathAccessor.java index b01a1a1e9..070a071b3 100644 --- a/src/main/java/org/springframework/data/mapping/model/SimplePersistentPropertyPathAccessor.java +++ b/src/main/java/org/springframework/data/mapping/model/SimplePersistentPropertyPathAccessor.java @@ -119,8 +119,8 @@ class SimplePersistentPropertyPathAccessor implements PersistentPropertyPathA public void setProperty(PersistentPropertyPath> path, @Nullable Object value, SetOptions options) { - Assert.notNull(path, "PersistentPropertyPath must not be null!"); - Assert.isTrue(!path.isEmpty(), "PersistentPropertyPath must not be empty!"); + Assert.notNull(path, "PersistentPropertyPath must not be null"); + Assert.isTrue(!path.isEmpty(), "PersistentPropertyPath must not be empty"); PersistentPropertyPath> parentPath = path.getParentPath(); PersistentProperty> leafProperty = path.getRequiredLeafProperty(); @@ -199,7 +199,7 @@ class SimplePersistentPropertyPathAccessor implements PersistentPropertyPathA return null; } - String nullIntermediateMessage = "Cannot lookup property %s on null intermediate! Original path was: %s on %s."; + String nullIntermediateMessage = "Cannot lookup property %s on null intermediate; Original path was: %s on %s"; if (SetNulls.SKIP_AND_LOG.equals(handling)) { logger.info(nullIntermediateMessage); @@ -240,8 +240,8 @@ class SimplePersistentPropertyPathAccessor implements PersistentPropertyPathA @Nullable protected S getTypedProperty(PersistentProperty property, Class type) { - Assert.notNull(property, "Property must not be null!"); - Assert.notNull(type, "Type must not be null!"); + Assert.notNull(property, "Property must not be null"); + Assert.notNull(type, "Type must not be null"); Object value = getProperty(property); @@ -250,7 +250,7 @@ class SimplePersistentPropertyPathAccessor implements PersistentPropertyPathA } if (!type.isInstance(value)) { - throw new MappingException(String.format("Invalid property value type! Need %s but got %s", // + throw new MappingException(String.format("Invalid property value type; Need %s but got %s", // type.getName(), value.getClass().getName())); } diff --git a/src/main/java/org/springframework/data/mapping/model/SimpleTypeHolder.java b/src/main/java/org/springframework/data/mapping/model/SimpleTypeHolder.java index 93e1f06a4..51605ae57 100644 --- a/src/main/java/org/springframework/data/mapping/model/SimpleTypeHolder.java +++ b/src/main/java/org/springframework/data/mapping/model/SimpleTypeHolder.java @@ -92,7 +92,7 @@ public class SimpleTypeHolder { */ public SimpleTypeHolder(Set> customSimpleTypes, boolean registerDefaults) { - Assert.notNull(customSimpleTypes, "CustomSimpleTypes must not be null!"); + Assert.notNull(customSimpleTypes, "CustomSimpleTypes must not be null"); this.simpleTypes = new WeakHashMap<>(customSimpleTypes.size() + DEFAULTS.size()); @@ -111,8 +111,8 @@ public class SimpleTypeHolder { */ public SimpleTypeHolder(Set> customSimpleTypes, SimpleTypeHolder source) { - Assert.notNull(customSimpleTypes, "CustomSimpleTypes must not be null!"); - Assert.notNull(source, "SourceTypeHolder must not be null!"); + Assert.notNull(customSimpleTypes, "CustomSimpleTypes must not be null"); + Assert.notNull(source, "SourceTypeHolder must not be null"); this.simpleTypes = new WeakHashMap<>(customSimpleTypes.size() + source.simpleTypes.size()); @@ -140,7 +140,7 @@ public class SimpleTypeHolder { */ public boolean isSimpleType(Class type) { - Assert.notNull(type, "Type must not be null!"); + Assert.notNull(type, "Type must not be null"); Map, Boolean> localSimpleTypes = this.simpleTypes; Boolean isSimpleType = localSimpleTypes.get(type); diff --git a/src/main/java/org/springframework/data/mapping/model/SpELContext.java b/src/main/java/org/springframework/data/mapping/model/SpELContext.java index 07a356a3a..b677e25b6 100644 --- a/src/main/java/org/springframework/data/mapping/model/SpELContext.java +++ b/src/main/java/org/springframework/data/mapping/model/SpELContext.java @@ -79,7 +79,7 @@ public class SpELContext { */ private SpELContext(PropertyAccessor accessor, @Nullable SpelExpressionParser parser, @Nullable BeanFactory factory) { - Assert.notNull(accessor, "PropertyAccessor must not be null!"); + Assert.notNull(accessor, "PropertyAccessor must not be null"); this.parser = parser == null ? new SpelExpressionParser() : parser; this.accessor = accessor; diff --git a/src/main/java/org/springframework/data/projection/Accessor.java b/src/main/java/org/springframework/data/projection/Accessor.java index 660fb1131..f5ab3af0b 100644 --- a/src/main/java/org/springframework/data/projection/Accessor.java +++ b/src/main/java/org/springframework/data/projection/Accessor.java @@ -43,7 +43,7 @@ public final class Accessor { */ public Accessor(Method method) { - Assert.notNull(method, "Method must not be null!"); + Assert.notNull(method, "Method must not be null"); PropertyDescriptor descriptor = BeanUtils.findPropertyForMethod(method); diff --git a/src/main/java/org/springframework/data/projection/DefaultProjectionInformation.java b/src/main/java/org/springframework/data/projection/DefaultProjectionInformation.java index 7d72ec44c..d27c01849 100644 --- a/src/main/java/org/springframework/data/projection/DefaultProjectionInformation.java +++ b/src/main/java/org/springframework/data/projection/DefaultProjectionInformation.java @@ -62,7 +62,7 @@ class DefaultProjectionInformation implements ProjectionInformation { */ DefaultProjectionInformation(Class type) { - Assert.notNull(type, "Projection type must not be null!"); + Assert.notNull(type, "Projection type must not be null"); this.projectionType = type; this.properties = new PropertyDescriptorSource(type).getDescriptors(); @@ -133,7 +133,7 @@ class DefaultProjectionInformation implements ProjectionInformation { */ PropertyDescriptorSource(Class type) { - Assert.notNull(type, "Type must not be null!"); + Assert.notNull(type, "Type must not be null"); this.type = type; this.metadata = getMetadata(type); @@ -228,7 +228,7 @@ class DefaultProjectionInformation implements ProjectionInformation { } catch (IOException e) { - logger.info(LogMessage.format("Couldn't read class metadata for %s. Input property calculation might fail!", type)); + logger.info(LogMessage.format("Couldn't read class metadata for %s. Input property calculation might fail", type)); return Optional.empty(); } } diff --git a/src/main/java/org/springframework/data/projection/ProjectingMethodInterceptor.java b/src/main/java/org/springframework/data/projection/ProjectingMethodInterceptor.java index b5ab7c7df..0d6e6c313 100644 --- a/src/main/java/org/springframework/data/projection/ProjectingMethodInterceptor.java +++ b/src/main/java/org/springframework/data/projection/ProjectingMethodInterceptor.java @@ -109,7 +109,7 @@ class ProjectingMethodInterceptor implements MethodInterceptor { return getProjection(result, targetType); } else { throw new UnsupportedOperationException( - String.format("Cannot project %s to %s. Target type is not an interface and no matching Converter found", + String.format("Cannot project %s to %s; Target type is not an interface and no matching Converter found", ClassUtils.getDescriptiveType(result), ClassUtils.getQualifiedName(targetType))); } } @@ -174,7 +174,7 @@ class ProjectingMethodInterceptor implements MethodInterceptor { */ private static Collection asCollection(Object source) { - Assert.notNull(source, "Source object must not be null!"); + Assert.notNull(source, "Source object must not be null"); if (source instanceof Collection) { return (Collection) source; diff --git a/src/main/java/org/springframework/data/projection/PropertyAccessingMethodInterceptor.java b/src/main/java/org/springframework/data/projection/PropertyAccessingMethodInterceptor.java index 4e3bf61a5..cbe84639e 100644 --- a/src/main/java/org/springframework/data/projection/PropertyAccessingMethodInterceptor.java +++ b/src/main/java/org/springframework/data/projection/PropertyAccessingMethodInterceptor.java @@ -46,7 +46,7 @@ class PropertyAccessingMethodInterceptor implements MethodInterceptor { */ public PropertyAccessingMethodInterceptor(Object target) { - Assert.notNull(target, "Proxy target must not be null!"); + Assert.notNull(target, "Proxy target must not be null"); this.target = new DirectFieldAccessFallbackBeanWrapper(target); } diff --git a/src/main/java/org/springframework/data/projection/ProxyProjectionFactory.java b/src/main/java/org/springframework/data/projection/ProxyProjectionFactory.java index 57b6be70c..94ff33e2e 100644 --- a/src/main/java/org/springframework/data/projection/ProxyProjectionFactory.java +++ b/src/main/java/org/springframework/data/projection/ProxyProjectionFactory.java @@ -86,7 +86,7 @@ class ProxyProjectionFactory implements ProjectionFactory, BeanClassLoaderAware */ public void registerMethodInvokerFactory(MethodInterceptorFactory factory) { - Assert.notNull(factory, "MethodInterceptorFactory must not be null!"); + Assert.notNull(factory, "MethodInterceptorFactory must not be null"); this.factories.add(0, factory); } @@ -95,9 +95,9 @@ class ProxyProjectionFactory implements ProjectionFactory, BeanClassLoaderAware @SuppressWarnings("unchecked") public T createProjection(Class projectionType, Object source) { - Assert.notNull(projectionType, "Projection type must not be null!"); - Assert.notNull(source, "Source must not be null!"); - Assert.isTrue(projectionType.isInterface(), "Projection type must be an interface!"); + Assert.notNull(projectionType, "Projection type must not be null"); + Assert.notNull(source, "Source must not be null"); + Assert.isTrue(projectionType.isInterface(), "Projection type must be an interface"); if (projectionType.isInstance(source)) { return (T) source; @@ -118,7 +118,7 @@ class ProxyProjectionFactory implements ProjectionFactory, BeanClassLoaderAware @Override public T createProjection(Class projectionType) { - Assert.notNull(projectionType, "Projection type must not be null!"); + Assert.notNull(projectionType, "Projection type must not be null"); return createProjection(projectionType, new HashMap()); } @@ -216,7 +216,7 @@ class ProxyProjectionFactory implements ProjectionFactory, BeanClassLoaderAware */ public TargetAwareMethodInterceptor(Class targetType) { - Assert.notNull(targetType, "Target type must not be null!"); + Assert.notNull(targetType, "Target type must not be null"); this.targetType = targetType; } diff --git a/src/main/java/org/springframework/data/projection/SpelAwareProxyProjectionFactory.java b/src/main/java/org/springframework/data/projection/SpelAwareProxyProjectionFactory.java index b88902030..e8029de48 100644 --- a/src/main/java/org/springframework/data/projection/SpelAwareProxyProjectionFactory.java +++ b/src/main/java/org/springframework/data/projection/SpelAwareProxyProjectionFactory.java @@ -86,7 +86,7 @@ public class SpelAwareProxyProjectionFactory extends ProxyProjectionFactory impl */ private static boolean hasMethodWithValueAnnotation(Class type) { - Assert.notNull(type, "Type must not be null!"); + Assert.notNull(type, "Type must not be null"); AnnotationDetectionMethodCallback callback = new AnnotationDetectionMethodCallback(Value.class); ReflectionUtils.doWithMethods(type, callback); diff --git a/src/main/java/org/springframework/data/projection/SpelEvaluatingMethodInterceptor.java b/src/main/java/org/springframework/data/projection/SpelEvaluatingMethodInterceptor.java index f45587e7c..43de6db78 100644 --- a/src/main/java/org/springframework/data/projection/SpelEvaluatingMethodInterceptor.java +++ b/src/main/java/org/springframework/data/projection/SpelEvaluatingMethodInterceptor.java @@ -73,10 +73,10 @@ class SpelEvaluatingMethodInterceptor implements MethodInterceptor { public SpelEvaluatingMethodInterceptor(MethodInterceptor delegate, Object target, @Nullable BeanFactory beanFactory, SpelExpressionParser parser, Class targetInterface) { - Assert.notNull(delegate, "Delegate MethodInterceptor must not be null!"); - Assert.notNull(target, "Target object must not be null!"); - Assert.notNull(parser, "SpelExpressionParser must not be null!"); - Assert.notNull(targetInterface, "Target interface must not be null!"); + Assert.notNull(delegate, "Delegate MethodInterceptor must not be null"); + Assert.notNull(target, "Target object must not be null"); + Assert.notNull(parser, "SpelExpressionParser must not be null"); + Assert.notNull(targetInterface, "Target interface must not be null"); StandardEvaluationContext evaluationContext = new StandardEvaluationContext(); diff --git a/src/main/java/org/springframework/data/querydsl/QPageRequest.java b/src/main/java/org/springframework/data/querydsl/QPageRequest.java index 3877231ca..34755fac2 100644 --- a/src/main/java/org/springframework/data/querydsl/QPageRequest.java +++ b/src/main/java/org/springframework/data/querydsl/QPageRequest.java @@ -75,7 +75,7 @@ public class QPageRequest extends AbstractPageRequest { super(page, size); - Assert.notNull(sort, "QSort must not be null!"); + Assert.notNull(sort, "QSort must not be null"); this.sort = sort; } diff --git a/src/main/java/org/springframework/data/querydsl/QSort.java b/src/main/java/org/springframework/data/querydsl/QSort.java index 19768fae8..3c4eb512a 100644 --- a/src/main/java/org/springframework/data/querydsl/QSort.java +++ b/src/main/java/org/springframework/data/querydsl/QSort.java @@ -80,7 +80,7 @@ public class QSort extends Sort implements Serializable { */ private static List toOrders(List> orderSpecifiers) { - Assert.notNull(orderSpecifiers, "Order specifiers must not be null!"); + Assert.notNull(orderSpecifiers, "Order specifiers must not be null"); return orderSpecifiers.stream().map(QSort::toOrder).collect(Collectors.toList()); } @@ -93,13 +93,13 @@ public class QSort extends Sort implements Serializable { */ private static Order toOrder(OrderSpecifier orderSpecifier) { - Assert.notNull(orderSpecifier, "Order specifier must not be null!"); + Assert.notNull(orderSpecifier, "Order specifier must not be null"); Expression target = orderSpecifier.getTarget(); Object targetElement = target instanceof Path ? preparePropertyPath((Path) target) : target; - Assert.notNull(targetElement, "Target element must not be null!"); + Assert.notNull(targetElement, "Target element must not be null"); return Order.by(targetElement.toString()).with(orderSpecifier.isAscending() ? Direction.ASC : Direction.DESC); } @@ -136,7 +136,7 @@ public class QSort extends Sort implements Serializable { */ public QSort and(List> orderSpecifiers) { - Assert.notEmpty(orderSpecifiers, "OrderSpecifiers must not be null or empty!"); + Assert.notEmpty(orderSpecifiers, "OrderSpecifiers must not be null or empty"); List> newOrderSpecifiers = new ArrayList<>(this.orderSpecifiers); newOrderSpecifiers.addAll(orderSpecifiers); @@ -153,7 +153,7 @@ public class QSort extends Sort implements Serializable { */ public QSort and(OrderSpecifier... orderSpecifiers) { - Assert.notEmpty(orderSpecifiers, "OrderSpecifiers must not be null or empty!"); + Assert.notEmpty(orderSpecifiers, "OrderSpecifiers must not be null or empty"); return and(Arrays.asList(orderSpecifiers)); } diff --git a/src/main/java/org/springframework/data/querydsl/QuerydslRepositoryInvokerAdapter.java b/src/main/java/org/springframework/data/querydsl/QuerydslRepositoryInvokerAdapter.java index dff2c0c30..bdbc4d781 100644 --- a/src/main/java/org/springframework/data/querydsl/QuerydslRepositoryInvokerAdapter.java +++ b/src/main/java/org/springframework/data/querydsl/QuerydslRepositoryInvokerAdapter.java @@ -49,8 +49,8 @@ public class QuerydslRepositoryInvokerAdapter implements RepositoryInvoker { public QuerydslRepositoryInvokerAdapter(RepositoryInvoker delegate, QuerydslPredicateExecutor executor, Predicate predicate) { - Assert.notNull(delegate, "Delegate RepositoryInvoker must not be null!"); - Assert.notNull(executor, "QuerydslPredicateExecutor must not be null!"); + Assert.notNull(delegate, "Delegate RepositoryInvoker must not be null"); + Assert.notNull(executor, "QuerydslPredicateExecutor must not be null"); this.delegate = delegate; this.executor = executor; diff --git a/src/main/java/org/springframework/data/querydsl/SimpleEntityPathResolver.java b/src/main/java/org/springframework/data/querydsl/SimpleEntityPathResolver.java index 44f822065..8530df7ec 100644 --- a/src/main/java/org/springframework/data/querydsl/SimpleEntityPathResolver.java +++ b/src/main/java/org/springframework/data/querydsl/SimpleEntityPathResolver.java @@ -34,8 +34,8 @@ import com.querydsl.core.types.EntityPath; */ public class SimpleEntityPathResolver implements EntityPathResolver { - private static final String NO_CLASS_FOUND_TEMPLATE = "Did not find a query class %s for domain class %s!"; - private static final String NO_FIELD_FOUND_TEMPLATE = "Did not find a static field of the same type in %s!"; + private static final String NO_CLASS_FOUND_TEMPLATE = "Did not find a query class %s for domain class %s"; + private static final String NO_FIELD_FOUND_TEMPLATE = "Did not find a static field of the same type in %s"; public static final SimpleEntityPathResolver INSTANCE = new SimpleEntityPathResolver(""); @@ -48,7 +48,7 @@ public class SimpleEntityPathResolver implements EntityPathResolver { */ public SimpleEntityPathResolver(String querySuffix) { - Assert.notNull(querySuffix, "Query suffix must not be null!"); + Assert.notNull(querySuffix, "Query suffix must not be null"); this.querySuffix = querySuffix; } diff --git a/src/main/java/org/springframework/data/querydsl/binding/QuerydslBindings.java b/src/main/java/org/springframework/data/querydsl/binding/QuerydslBindings.java index 8dcb91f0b..770426ef1 100644 --- a/src/main/java/org/springframework/data/querydsl/binding/QuerydslBindings.java +++ b/src/main/java/org/springframework/data/querydsl/binding/QuerydslBindings.java @@ -127,7 +127,7 @@ public class QuerydslBindings { */ public final void excluding(Path... paths) { - Assert.notEmpty(paths, "At least one path has to be provided!"); + Assert.notEmpty(paths, "At least one path has to be provided"); for (Path path : paths) { this.denyList.add(toDotPath(Optional.of(path))); @@ -141,7 +141,7 @@ public class QuerydslBindings { */ public final void including(Path... paths) { - Assert.notEmpty(paths, "At least one path has to be provided!"); + Assert.notEmpty(paths, "At least one path has to be provided"); for (Path path : paths) { this.allowList.add(toDotPath(Optional.of(path))); @@ -172,8 +172,8 @@ public class QuerydslBindings { */ boolean isPathAvailable(String path, Class type) { - Assert.notNull(path, "Path must not be null!"); - Assert.notNull(type, "Type must not be null!"); + Assert.notNull(path, "Path must not be null"); + Assert.notNull(type, "Type must not be null"); return isPathAvailable(path, ClassTypeInformation.from(type)); } @@ -187,8 +187,8 @@ public class QuerydslBindings { */ boolean isPathAvailable(String path, TypeInformation type) { - Assert.notNull(path, "Path must not be null!"); - Assert.notNull(type, "Type must not be null!"); + Assert.notNull(path, "Path must not be null"); + Assert.notNull(type, "Type must not be null"); return getPropertyPath(path, type) != null; } @@ -203,7 +203,7 @@ public class QuerydslBindings { @SuppressWarnings("unchecked") public , T> Optional> getBindingForPath(PathInformation path) { - Assert.notNull(path, "PropertyPath must not be null!"); + Assert.notNull(path, "PropertyPath must not be null"); PathAndBinding pathAndBinding = (PathAndBinding) pathSpecs.get(createKey(path)); @@ -229,7 +229,7 @@ public class QuerydslBindings { */ Optional> getExistingPath(PathInformation path) { - Assert.notNull(path, "PropertyPath must not be null!"); + Assert.notNull(path, "PropertyPath must not be null"); return Optional.ofNullable(pathSpecs.get(createKey(path))).flatMap(PathAndBinding::getPath); } @@ -244,8 +244,8 @@ public class QuerydslBindings { @Nullable PathInformation getPropertyPath(String path, TypeInformation type) { - Assert.notNull(path, "Path must not be null!"); - Assert.notNull(type, "Type information must not be null!"); + Assert.notNull(path, "Path must not be null"); + Assert.notNull(type, "Type information must not be null"); if (!isPathVisible(path)) { return null; @@ -381,7 +381,7 @@ public class QuerydslBindings { @SafeVarargs PathBinder(P... paths) { - Assert.notEmpty(paths, "At least one path has to be provided!"); + Assert.notEmpty(paths, "At least one path has to be provided"); this.paths = Arrays.asList(paths); } @@ -392,14 +392,14 @@ public class QuerydslBindings { */ public void firstOptional(OptionalValueBinding binding) { - Assert.notNull(binding, "Binding must not be null!"); + Assert.notNull(binding, "Binding must not be null"); all((path, value) -> binding.bind(path, Optionals.next(value.iterator()))); } public void first(SingleValueBinding binding) { - Assert.notNull(binding, "Binding must not be null!"); + Assert.notNull(binding, "Binding must not be null"); all((path, value) -> Optionals.next(value.iterator()).map(t -> binding.bind(path, t))); } @@ -410,7 +410,7 @@ public class QuerydslBindings { */ public void all(MultiValueBinding binding) { - Assert.notNull(binding, "Binding must not be null!"); + Assert.notNull(binding, "Binding must not be null"); paths.forEach(path -> registerBinding(PathAndBinding.withPath(path).with(binding))); } @@ -450,7 +450,7 @@ public class QuerydslBindings { super(path); - Assert.notNull(path, "Path must not be null!"); + Assert.notNull(path, "Path must not be null"); this.alias = alias; this.path = path; @@ -466,7 +466,7 @@ public class QuerydslBindings { */ public AliasingPathBinder as(String alias) { - Assert.hasText(alias, "Alias must not be null or empty!"); + Assert.hasText(alias, "Alias must not be null or empty"); return new AliasingPathBinder<>(alias, path); } @@ -512,13 +512,13 @@ public class QuerydslBindings { */ public

> void firstOptional(OptionalValueBinding binding) { - Assert.notNull(binding, "Binding must not be null!"); + Assert.notNull(binding, "Binding must not be null"); all((MultiValueBinding) (path, value) -> binding.bind(path, Optionals.next(value.iterator()))); } public

> void first(SingleValueBinding binding) { - Assert.notNull(binding, "Binding must not be null!"); + Assert.notNull(binding, "Binding must not be null"); all((MultiValueBinding) (path, value) -> Optionals.next(value.iterator()).map(t -> binding.bind(path, t))); } @@ -529,7 +529,7 @@ public class QuerydslBindings { */ public

> void all(MultiValueBinding binding) { - Assert.notNull(binding, "Binding must not be null!"); + Assert.notNull(binding, "Binding must not be null"); QuerydslBindings.this.typeSpecs.put(type, PathAndBinding. withoutPath().with(binding)); } diff --git a/src/main/java/org/springframework/data/querydsl/binding/QuerydslBindingsFactory.java b/src/main/java/org/springframework/data/querydsl/binding/QuerydslBindingsFactory.java index c4a12b240..07dbebaa8 100644 --- a/src/main/java/org/springframework/data/querydsl/binding/QuerydslBindingsFactory.java +++ b/src/main/java/org/springframework/data/querydsl/binding/QuerydslBindingsFactory.java @@ -44,7 +44,7 @@ import com.querydsl.core.types.EntityPath; */ public class QuerydslBindingsFactory implements ApplicationContextAware { - private static final String INVALID_DOMAIN_TYPE = "Unable to find Querydsl root type for detected domain type %s! User @%s's root attribute to define the domain type manually!"; + private static final String INVALID_DOMAIN_TYPE = "Unable to find Querydsl root type for detected domain type %s; User @%s's root attribute to define the domain type manually"; private final EntityPathResolver entityPathResolver; private final Map, EntityPath> entityPaths; @@ -60,7 +60,7 @@ public class QuerydslBindingsFactory implements ApplicationContextAware { */ public QuerydslBindingsFactory(EntityPathResolver entityPathResolver) { - Assert.notNull(entityPathResolver, "EntityPathResolver must not be null!"); + Assert.notNull(entityPathResolver, "EntityPathResolver must not be null"); this.entityPathResolver = entityPathResolver; this.entityPaths = new ConcurrentReferenceHashMap<>(); @@ -122,8 +122,8 @@ public class QuerydslBindingsFactory implements ApplicationContextAware { private QuerydslBindings createBindingsFor(TypeInformation domainType, Optional>> customizer) { - Assert.notNull(customizer, "Customizer must not be null!"); - Assert.notNull(domainType, "Domain type must not be null!"); + Assert.notNull(customizer, "Customizer must not be null"); + Assert.notNull(domainType, "Domain type must not be null"); EntityPath path = verifyEntityPathPresent(domainType); diff --git a/src/main/java/org/springframework/data/querydsl/binding/QuerydslDefaultBinding.java b/src/main/java/org/springframework/data/querydsl/binding/QuerydslDefaultBinding.java index 5a33e70d6..42adf97ed 100644 --- a/src/main/java/org/springframework/data/querydsl/binding/QuerydslDefaultBinding.java +++ b/src/main/java/org/springframework/data/querydsl/binding/QuerydslDefaultBinding.java @@ -47,8 +47,8 @@ class QuerydslDefaultBinding implements MultiValueBinding @SuppressWarnings({ "unchecked", "rawtypes" }) public Optional bind(Path path, Collection value) { - Assert.notNull(path, "Path must not be null!"); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(path, "Path must not be null"); + Assert.notNull(value, "Value must not be null"); if (value.isEmpty()) { return Optional.empty(); diff --git a/src/main/java/org/springframework/data/querydsl/binding/QuerydslPredicateBuilder.java b/src/main/java/org/springframework/data/querydsl/binding/QuerydslPredicateBuilder.java index f2ffad1ef..a9811b631 100644 --- a/src/main/java/org/springframework/data/querydsl/binding/QuerydslPredicateBuilder.java +++ b/src/main/java/org/springframework/data/querydsl/binding/QuerydslPredicateBuilder.java @@ -66,7 +66,7 @@ public class QuerydslPredicateBuilder { */ public QuerydslPredicateBuilder(ConversionService conversionService, EntityPathResolver resolver) { - Assert.notNull(conversionService, "ConversionService must not be null!"); + Assert.notNull(conversionService, "ConversionService must not be null"); this.defaultBinding = new QuerydslDefaultBinding(); this.conversionService = conversionService; @@ -85,7 +85,7 @@ public class QuerydslPredicateBuilder { */ public Predicate getPredicate(TypeInformation type, MultiValueMap values, QuerydslBindings bindings) { - Assert.notNull(bindings, "Context must not be null!"); + Assert.notNull(bindings, "Context must not be null"); BooleanBuilder builder = new BooleanBuilder(); diff --git a/src/main/java/org/springframework/data/repository/cdi/CdiRepositoryBean.java b/src/main/java/org/springframework/data/repository/cdi/CdiRepositoryBean.java index 29eb8f107..174d491e2 100644 --- a/src/main/java/org/springframework/data/repository/cdi/CdiRepositoryBean.java +++ b/src/main/java/org/springframework/data/repository/cdi/CdiRepositoryBean.java @@ -100,10 +100,10 @@ public abstract class CdiRepositoryBean implements Bean, PassivationCapabl public CdiRepositoryBean(Set qualifiers, Class repositoryType, BeanManager beanManager, Optional detector) { - Assert.notNull(qualifiers, "Qualifiers must not be null!"); - Assert.notNull(beanManager, "BeanManager must not be null!"); - Assert.notNull(repositoryType, "Repoitory type must not be null!"); - Assert.isTrue(repositoryType.isInterface(), "RepositoryType must be an interface!"); + Assert.notNull(qualifiers, "Qualifiers must not be null"); + Assert.notNull(beanManager, "BeanManager must not be null"); + Assert.notNull(repositoryType, "Repoitory type must not be null"); + Assert.isTrue(repositoryType.isInterface(), "RepositoryType must be an interface"); this.qualifiers = qualifiers; this.repositoryType = repositoryType; @@ -125,10 +125,10 @@ public abstract class CdiRepositoryBean implements Bean, PassivationCapabl public CdiRepositoryBean(Set qualifiers, Class repositoryType, BeanManager beanManager, CdiRepositoryContext context) { - Assert.notNull(qualifiers, "Qualifiers must not be null!"); - Assert.notNull(beanManager, "BeanManager must not be null!"); - Assert.notNull(repositoryType, "Repoitory type must not be null!"); - Assert.isTrue(repositoryType.isInterface(), "RepositoryType must be an interface!"); + Assert.notNull(qualifiers, "Qualifiers must not be null"); + Assert.notNull(beanManager, "BeanManager must not be null"); + Assert.notNull(repositoryType, "Repoitory type must not be null"); + Assert.isTrue(repositoryType.isInterface(), "RepositoryType must be an interface"); this.qualifiers = qualifiers; this.repositoryType = repositoryType; @@ -308,7 +308,7 @@ public abstract class CdiRepositoryBean implements Bean, PassivationCapabl */ protected RepositoryFragments getRepositoryFragments(Class repositoryType) { - Assert.notNull(repositoryType, "Repository type must not be null!"); + Assert.notNull(repositoryType, "Repository type must not be null"); CdiRepositoryConfiguration cdiRepositoryConfiguration = lookupConfiguration(beanManager, qualifiers); diff --git a/src/main/java/org/springframework/data/repository/cdi/CdiRepositoryContext.java b/src/main/java/org/springframework/data/repository/cdi/CdiRepositoryContext.java index f5e8bbb2b..ff5fbebe6 100644 --- a/src/main/java/org/springframework/data/repository/cdi/CdiRepositoryContext.java +++ b/src/main/java/org/springframework/data/repository/cdi/CdiRepositoryContext.java @@ -73,8 +73,8 @@ public class CdiRepositoryContext { */ public CdiRepositoryContext(ClassLoader classLoader, CustomRepositoryImplementationDetector detector) { - Assert.notNull(classLoader, "ClassLoader must not be null!"); - Assert.notNull(detector, "CustomRepositoryImplementationDetector must not be null!"); + Assert.notNull(classLoader, "ClassLoader must not be null"); + Assert.notNull(detector, "CustomRepositoryImplementationDetector must not be null"); ResourceLoader resourceLoader = new PathMatchingResourcePatternResolver(classLoader); diff --git a/src/main/java/org/springframework/data/repository/config/AnnotationRepositoryConfigurationSource.java b/src/main/java/org/springframework/data/repository/config/AnnotationRepositoryConfigurationSource.java index d65b85471..f78aad133 100644 --- a/src/main/java/org/springframework/data/repository/config/AnnotationRepositoryConfigurationSource.java +++ b/src/main/java/org/springframework/data/repository/config/AnnotationRepositoryConfigurationSource.java @@ -112,9 +112,9 @@ public class AnnotationRepositoryConfigurationSource extends RepositoryConfigura super(environment, ConfigurationUtils.getRequiredClassLoader(resourceLoader), registry, defaultBeanNameGenerator(generator)); - Assert.notNull(metadata, "Metadata must not be null!"); - Assert.notNull(annotation, "Annotation must not be null!"); - Assert.notNull(resourceLoader, "ResourceLoader must not be null!"); + Assert.notNull(metadata, "Metadata must not be null"); + Assert.notNull(annotation, "Annotation must not be null"); + Assert.notNull(resourceLoader, "ResourceLoader must not be null"); Map annotationAttributes = metadata.getAnnotationAttributes(annotation.getName()); diff --git a/src/main/java/org/springframework/data/repository/config/CustomRepositoryImplementationDetector.java b/src/main/java/org/springframework/data/repository/config/CustomRepositoryImplementationDetector.java index 492169d36..7be019791 100644 --- a/src/main/java/org/springframework/data/repository/config/CustomRepositoryImplementationDetector.java +++ b/src/main/java/org/springframework/data/repository/config/CustomRepositoryImplementationDetector.java @@ -46,7 +46,7 @@ import org.springframework.util.Assert; public class CustomRepositoryImplementationDetector { private static final String CUSTOM_IMPLEMENTATION_RESOURCE_PATTERN = "**/*%s.class"; - private static final String AMBIGUOUS_CUSTOM_IMPLEMENTATIONS = "Ambiguous custom implementations detected! Found %s but expected a single implementation!"; + private static final String AMBIGUOUS_CUSTOM_IMPLEMENTATIONS = "Ambiguous custom implementations detected; Found %s but expected a single implementation"; private final Environment environment; private final ResourceLoader resourceLoader; @@ -65,9 +65,9 @@ public class CustomRepositoryImplementationDetector { public CustomRepositoryImplementationDetector(Environment environment, ResourceLoader resourceLoader, ImplementationDetectionConfiguration configuration) { - Assert.notNull(environment, "Environment must not be null!"); - Assert.notNull(resourceLoader, "ResourceLoader must not be null!"); - Assert.notNull(configuration, "ImplementationDetectionConfiguration must not be null!"); + Assert.notNull(environment, "Environment must not be null"); + Assert.notNull(resourceLoader, "ResourceLoader must not be null"); + Assert.notNull(configuration, "ImplementationDetectionConfiguration must not be null"); this.environment = environment; this.resourceLoader = resourceLoader; @@ -84,8 +84,8 @@ public class CustomRepositoryImplementationDetector { */ public CustomRepositoryImplementationDetector(Environment environment, ResourceLoader resourceLoader) { - Assert.notNull(environment, "Environment must not be null!"); - Assert.notNull(resourceLoader, "ResourceLoader must not be null!"); + Assert.notNull(environment, "Environment must not be null"); + Assert.notNull(resourceLoader, "ResourceLoader must not be null"); this.environment = environment; this.resourceLoader = resourceLoader; @@ -100,7 +100,7 @@ public class CustomRepositoryImplementationDetector { */ public Optional detectCustomImplementation(ImplementationLookupConfiguration lookup) { - Assert.notNull(lookup, "ImplementationLookupConfiguration must not be null!"); + Assert.notNull(lookup, "ImplementationLookupConfiguration must not be null"); Set definitions = implementationCandidates.getOptional() .orElseGet(() -> findCandidateBeanDefinitions(lookup)).stream() // diff --git a/src/main/java/org/springframework/data/repository/config/DefaultImplementationLookupConfiguration.java b/src/main/java/org/springframework/data/repository/config/DefaultImplementationLookupConfiguration.java index 8d914ddb8..9c7eff7c4 100644 --- a/src/main/java/org/springframework/data/repository/config/DefaultImplementationLookupConfiguration.java +++ b/src/main/java/org/springframework/data/repository/config/DefaultImplementationLookupConfiguration.java @@ -51,8 +51,8 @@ class DefaultImplementationLookupConfiguration implements ImplementationLookupCo */ DefaultImplementationLookupConfiguration(ImplementationDetectionConfiguration config, String interfaceName) { - Assert.notNull(config, "ImplementationDetectionConfiguration must not be null!"); - Assert.hasText(interfaceName, "Interface name must not be null or empty!"); + Assert.notNull(config, "ImplementationDetectionConfiguration must not be null"); + Assert.hasText(interfaceName, "Interface name must not be null or empty"); this.config = config; this.interfaceName = interfaceName; @@ -93,7 +93,7 @@ class DefaultImplementationLookupConfiguration implements ImplementationLookupCo @Override public boolean hasMatchingBeanName(BeanDefinition definition) { - Assert.notNull(definition, "BeanDefinition must not be null!"); + Assert.notNull(definition, "BeanDefinition must not be null"); return beanName != null && beanName.equals(config.generateBeanName(definition)); } @@ -101,7 +101,7 @@ class DefaultImplementationLookupConfiguration implements ImplementationLookupCo @Override public boolean matches(BeanDefinition definition) { - Assert.notNull(definition, "BeanDefinition must not be null!"); + Assert.notNull(definition, "BeanDefinition must not be null"); String beanClassName = definition.getBeanClassName(); diff --git a/src/main/java/org/springframework/data/repository/config/DefaultRepositoryConfiguration.java b/src/main/java/org/springframework/data/repository/config/DefaultRepositoryConfiguration.java index 3d39c236b..623c94f2f 100644 --- a/src/main/java/org/springframework/data/repository/config/DefaultRepositoryConfiguration.java +++ b/src/main/java/org/springframework/data/repository/config/DefaultRepositoryConfiguration.java @@ -135,7 +135,7 @@ public class DefaultRepositoryConfiguration getFragmentInterfaces(String interfaceName) { - Assert.hasText(interfaceName, "Interface name must not be null or empty!"); + Assert.hasText(interfaceName, "Interface name must not be null or empty"); return Arrays.stream(getClassMetadata(interfaceName).getInterfaceNames()) // .filter(this::isCandidate); @@ -65,7 +65,7 @@ public class FragmentMetadata { */ private boolean isCandidate(String interfaceName) { - Assert.hasText(interfaceName, "Interface name must not be null or empty!"); + Assert.hasText(interfaceName, "Interface name must not be null or empty"); AnnotationMetadata metadata = getAnnotationMetadata(interfaceName); return !metadata.hasAnnotation(NoRepositoryBean.class.getName()); diff --git a/src/main/java/org/springframework/data/repository/config/ImplementationDetectionConfiguration.java b/src/main/java/org/springframework/data/repository/config/ImplementationDetectionConfiguration.java index c477efd9b..f95323b94 100644 --- a/src/main/java/org/springframework/data/repository/config/ImplementationDetectionConfiguration.java +++ b/src/main/java/org/springframework/data/repository/config/ImplementationDetectionConfiguration.java @@ -69,7 +69,7 @@ public interface ImplementationDetectionConfiguration { */ default String generateBeanName(BeanDefinition definition) { - Assert.notNull(definition, "BeanDefinition must not be null!"); + Assert.notNull(definition, "BeanDefinition must not be null"); String beanName = definition.getBeanClassName(); @@ -88,7 +88,7 @@ public interface ImplementationDetectionConfiguration { */ default ImplementationLookupConfiguration forFragment(String fragmentInterfaceName) { - Assert.hasText(fragmentInterfaceName, "Fragment interface name must not be null or empty!"); + Assert.hasText(fragmentInterfaceName, "Fragment interface name must not be null or empty"); return new DefaultImplementationLookupConfiguration(this, fragmentInterfaceName); } @@ -101,7 +101,7 @@ public interface ImplementationDetectionConfiguration { */ default ImplementationLookupConfiguration forRepositoryConfiguration(RepositoryConfiguration config) { - Assert.notNull(config, "RepositoryConfiguration must not be null!"); + Assert.notNull(config, "RepositoryConfiguration must not be null"); return new DefaultImplementationLookupConfiguration(this, config.getRepositoryInterface()) { diff --git a/src/main/java/org/springframework/data/repository/config/NamedQueriesBeanDefinitionBuilder.java b/src/main/java/org/springframework/data/repository/config/NamedQueriesBeanDefinitionBuilder.java index ee1daddd0..cafeeb419 100644 --- a/src/main/java/org/springframework/data/repository/config/NamedQueriesBeanDefinitionBuilder.java +++ b/src/main/java/org/springframework/data/repository/config/NamedQueriesBeanDefinitionBuilder.java @@ -43,7 +43,7 @@ public class NamedQueriesBeanDefinitionBuilder { @SuppressWarnings("null") public NamedQueriesBeanDefinitionBuilder(String defaultLocation) { - Assert.hasText(defaultLocation, "DefaultLocation must not be null nor empty!"); + Assert.hasText(defaultLocation, "DefaultLocation must not be null nor empty"); this.defaultLocation = defaultLocation; } @@ -54,7 +54,7 @@ public class NamedQueriesBeanDefinitionBuilder { */ public void setLocations(String locations) { - Assert.hasText(locations, "Locations must not be null nor empty!"); + Assert.hasText(locations, "Locations must not be null nor empty"); this.locations = locations; } diff --git a/src/main/java/org/springframework/data/repository/config/NamedQueriesBeanDefinitionParser.java b/src/main/java/org/springframework/data/repository/config/NamedQueriesBeanDefinitionParser.java index 826fa0888..72b8023e2 100644 --- a/src/main/java/org/springframework/data/repository/config/NamedQueriesBeanDefinitionParser.java +++ b/src/main/java/org/springframework/data/repository/config/NamedQueriesBeanDefinitionParser.java @@ -48,7 +48,7 @@ public class NamedQueriesBeanDefinitionParser implements BeanDefinitionParser { * @param defaultLocation must be non-empty */ public NamedQueriesBeanDefinitionParser(String defaultLocation) { - Assert.hasText(defaultLocation, "DefaultLocation must not be null nor empty!"); + Assert.hasText(defaultLocation, "DefaultLocation must not be null nor empty"); this.defaultLocation = defaultLocation; } diff --git a/src/main/java/org/springframework/data/repository/config/RepositoryBeanDefinitionBuilder.java b/src/main/java/org/springframework/data/repository/config/RepositoryBeanDefinitionBuilder.java index c02699d2e..38813f430 100644 --- a/src/main/java/org/springframework/data/repository/config/RepositoryBeanDefinitionBuilder.java +++ b/src/main/java/org/springframework/data/repository/config/RepositoryBeanDefinitionBuilder.java @@ -68,9 +68,9 @@ class RepositoryBeanDefinitionBuilder { public RepositoryBeanDefinitionBuilder(BeanDefinitionRegistry registry, RepositoryConfigurationExtension extension, RepositoryConfigurationSource configurationSource, ResourceLoader resourceLoader, Environment environment) { - Assert.notNull(extension, "RepositoryConfigurationExtension must not be null!"); - Assert.notNull(resourceLoader, "ResourceLoader must not be null!"); - Assert.notNull(environment, "Environment must not be null!"); + Assert.notNull(extension, "RepositoryConfigurationExtension must not be null"); + Assert.notNull(resourceLoader, "ResourceLoader must not be null"); + Assert.notNull(environment, "Environment must not be null"); this.registry = registry; this.extension = extension; @@ -92,8 +92,8 @@ class RepositoryBeanDefinitionBuilder { */ public BeanDefinitionBuilder build(RepositoryConfiguration configuration) { - Assert.notNull(registry, "BeanDefinitionRegistry must not be null!"); - Assert.notNull(resourceLoader, "ResourceLoader must not be null!"); + Assert.notNull(registry, "BeanDefinitionRegistry must not be null"); + Assert.notNull(resourceLoader, "ResourceLoader must not be null"); BeanDefinitionBuilder builder = BeanDefinitionBuilder .rootBeanDefinition(configuration.getRepositoryFactoryBeanClassName()); diff --git a/src/main/java/org/springframework/data/repository/config/RepositoryBeanDefinitionParser.java b/src/main/java/org/springframework/data/repository/config/RepositoryBeanDefinitionParser.java index 0b84a3bc5..22e075f9f 100644 --- a/src/main/java/org/springframework/data/repository/config/RepositoryBeanDefinitionParser.java +++ b/src/main/java/org/springframework/data/repository/config/RepositoryBeanDefinitionParser.java @@ -50,7 +50,7 @@ public class RepositoryBeanDefinitionParser implements BeanDefinitionParser { */ public RepositoryBeanDefinitionParser(RepositoryConfigurationExtension extension) { - Assert.notNull(extension, "Extension must not be null!"); + Assert.notNull(extension, "Extension must not be null"); this.extension = extension; } diff --git a/src/main/java/org/springframework/data/repository/config/RepositoryBeanDefinitionRegistrarSupport.java b/src/main/java/org/springframework/data/repository/config/RepositoryBeanDefinitionRegistrarSupport.java index bc72b9a87..77ed511f7 100644 --- a/src/main/java/org/springframework/data/repository/config/RepositoryBeanDefinitionRegistrarSupport.java +++ b/src/main/java/org/springframework/data/repository/config/RepositoryBeanDefinitionRegistrarSupport.java @@ -73,9 +73,9 @@ public abstract class RepositoryBeanDefinitionRegistrarSupport public void registerBeanDefinitions(AnnotationMetadata metadata, BeanDefinitionRegistry registry, BeanNameGenerator generator) { - Assert.notNull(metadata, "AnnotationMetadata must not be null!"); - Assert.notNull(registry, "BeanDefinitionRegistry must not be null!"); - Assert.notNull(resourceLoader, "ResourceLoader must not be null!"); + Assert.notNull(metadata, "AnnotationMetadata must not be null"); + Assert.notNull(registry, "BeanDefinitionRegistry must not be null"); + Assert.notNull(resourceLoader, "ResourceLoader must not be null"); // Guard against calls for sub-classes if (metadata.getAnnotationAttributes(getAnnotation().getName()) == null) { diff --git a/src/main/java/org/springframework/data/repository/config/RepositoryBeanNameGenerator.java b/src/main/java/org/springframework/data/repository/config/RepositoryBeanNameGenerator.java index ba866f1b6..ea845911b 100644 --- a/src/main/java/org/springframework/data/repository/config/RepositoryBeanNameGenerator.java +++ b/src/main/java/org/springframework/data/repository/config/RepositoryBeanNameGenerator.java @@ -52,9 +52,9 @@ class RepositoryBeanNameGenerator { public RepositoryBeanNameGenerator(ClassLoader beanClassLoader, BeanNameGenerator generator, BeanDefinitionRegistry registry) { - Assert.notNull(beanClassLoader, "Bean ClassLoader must not be null!"); - Assert.notNull(generator, "BeanNameGenerator must not be null!"); - Assert.notNull(registry, "BeanDefinitionRegistry must not be null!"); + Assert.notNull(beanClassLoader, "Bean ClassLoader must not be null"); + Assert.notNull(generator, "BeanNameGenerator must not be null"); + Assert.notNull(registry, "BeanDefinitionRegistry must not be null"); this.beanClassLoader = beanClassLoader; this.generator = generator; diff --git a/src/main/java/org/springframework/data/repository/config/RepositoryComponentProvider.java b/src/main/java/org/springframework/data/repository/config/RepositoryComponentProvider.java index 193aacde8..04f5161b8 100644 --- a/src/main/java/org/springframework/data/repository/config/RepositoryComponentProvider.java +++ b/src/main/java/org/springframework/data/repository/config/RepositoryComponentProvider.java @@ -60,8 +60,8 @@ class RepositoryComponentProvider extends ClassPathScanningCandidateComponentPro super(false); - Assert.notNull(includeFilters, "Include filters must not be null!"); - Assert.notNull(registry, "BeanDefinitionRegistry must not be null!"); + Assert.notNull(includeFilters, "Include filters must not be null"); + Assert.notNull(registry, "BeanDefinitionRegistry must not be null"); this.registry = registry; @@ -191,7 +191,7 @@ class RepositoryComponentProvider extends ClassPathScanningCandidateComponentPro */ public AllTypeFilter(List delegates) { - Assert.notNull(delegates, "TypeFilter deleages must not be null!"); + Assert.notNull(delegates, "TypeFilter deleages must not be null"); this.delegates = delegates; } diff --git a/src/main/java/org/springframework/data/repository/config/RepositoryConfigurationDelegate.java b/src/main/java/org/springframework/data/repository/config/RepositoryConfigurationDelegate.java index 02e570e2f..561862cd4 100644 --- a/src/main/java/org/springframework/data/repository/config/RepositoryConfigurationDelegate.java +++ b/src/main/java/org/springframework/data/repository/config/RepositoryConfigurationDelegate.java @@ -63,8 +63,8 @@ import org.springframework.util.StopWatch; public class RepositoryConfigurationDelegate { private static final String REPOSITORY_REGISTRATION = "Spring Data %s - Registering repository: %s - Interface: %s - Factory: %s"; - private static final String MULTIPLE_MODULES = "Multiple Spring Data modules found, entering strict repository configuration mode!"; - private static final String NON_DEFAULT_AUTOWIRE_CANDIDATE_RESOLVER = "Non-default AutowireCandidateResolver (%s) detected. Skipping the registration of LazyRepositoryInjectionPointResolver. Lazy repository injection will not be working!"; + private static final String MULTIPLE_MODULES = "Multiple Spring Data modules found, entering strict repository configuration mode"; + private static final String NON_DEFAULT_AUTOWIRE_CANDIDATE_RESOLVER = "Non-default AutowireCandidateResolver (%s) detected. Skipping the registration of LazyRepositoryInjectionPointResolver. Lazy repository injection will not be working"; static final String FACTORY_BEAN_OBJECT_TYPE = "factoryBeanObjectType"; @@ -91,8 +91,8 @@ public class RepositoryConfigurationDelegate { boolean isAnnotation = configurationSource instanceof AnnotationRepositoryConfigurationSource; Assert.isTrue(isXml || isAnnotation, - "Configuration source must either be an Xml- or an AnnotationBasedConfigurationSource!"); - Assert.notNull(resourceLoader, "ResourceLoader must not be null!"); + "Configuration source must either be an Xml- or an AnnotationBasedConfigurationSource"); + Assert.notNull(resourceLoader, "ResourceLoader must not be null"); this.configurationSource = configurationSource; this.resourceLoader = resourceLoader; diff --git a/src/main/java/org/springframework/data/repository/config/RepositoryConfigurationExtensionSupport.java b/src/main/java/org/springframework/data/repository/config/RepositoryConfigurationExtensionSupport.java index 18328dcc8..567bbc8db 100644 --- a/src/main/java/org/springframework/data/repository/config/RepositoryConfigurationExtensionSupport.java +++ b/src/main/java/org/springframework/data/repository/config/RepositoryConfigurationExtensionSupport.java @@ -55,8 +55,8 @@ import org.springframework.util.StringUtils; public abstract class RepositoryConfigurationExtensionSupport implements RepositoryConfigurationExtension { private static final Log logger = LogFactory.getLog(RepositoryConfigurationExtensionSupport.class); - private static final String CLASS_LOADING_ERROR = "%s - Could not load type %s using class loader %s."; - private static final String MULTI_STORE_DROPPED = "Spring Data %s - Could not safely identify store assignment for repository candidate %s. If you want this repository to be a %s repository,"; + private static final String CLASS_LOADING_ERROR = "%s - Could not load type %s using class loader %s"; + private static final String MULTI_STORE_DROPPED = "Spring Data %s - Could not safely identify store assignment for repository candidate %s; If you want this repository to be a %s repository,"; private boolean noMultiStoreSupport = false; @@ -73,8 +73,8 @@ public abstract class RepositoryConfigurationExtensionSupport implements Reposit public Collection> getRepositoryConfigurations( T configSource, ResourceLoader loader, boolean strictMatchesOnly) { - Assert.notNull(configSource, "ConfigSource must not be null!"); - Assert.notNull(loader, "Loader must not be null!"); + Assert.notNull(configSource, "ConfigSource must not be null"); + Assert.notNull(loader, "Loader must not be null"); Set> result = new HashSet<>(); @@ -277,7 +277,7 @@ public abstract class RepositoryConfigurationExtensionSupport implements Reposit if (types.isEmpty() && annotations.isEmpty()) { if (!noMultiStoreSupport) { - logger.warn(LogMessage.format("Spring Data %s does not support multi-store setups!", moduleName)); + logger.warn(LogMessage.format("Spring Data %s does not support multi-store setups", moduleName)); noMultiStoreSupport = true; return false; } @@ -311,8 +311,7 @@ public abstract class RepositoryConfigurationExtensionSupport implements Reposit message = message.concat(annotations.isEmpty() ? " consider" : ", or consider") // .concat(" extending one of the following types with your repository: ") // - .concat(toString(types)) // - .concat("."); + .concat(toString(types)); } logger.info(message); @@ -334,7 +333,7 @@ public abstract class RepositoryConfigurationExtensionSupport implements Reposit if (metadata.isReactiveRepository()) { throw new InvalidDataAccessApiUsageException( - String.format("Reactive Repositories are not supported by %s. Offending repository is %s", getModuleName(), + String.format("Reactive Repositories are not supported by %s; Offending repository is %s", getModuleName(), metadata.getRepositoryInterface().getName())); } diff --git a/src/main/java/org/springframework/data/repository/config/RepositoryConfigurationSource.java b/src/main/java/org/springframework/data/repository/config/RepositoryConfigurationSource.java index f2f44700b..a1124ae80 100644 --- a/src/main/java/org/springframework/data/repository/config/RepositoryConfigurationSource.java +++ b/src/main/java/org/springframework/data/repository/config/RepositoryConfigurationSource.java @@ -124,7 +124,7 @@ public interface RepositoryConfigurationSource { */ default T getRequiredAttribute(String name, Class type) { - Assert.hasText(name, "Attribute name must not be null or empty!"); + Assert.hasText(name, "Attribute name must not be null or empty"); return getAttribute(name, type) .orElseThrow(() -> new IllegalArgumentException(String.format("No attribute named %s found", name))); diff --git a/src/main/java/org/springframework/data/repository/config/RepositoryConfigurationSourceSupport.java b/src/main/java/org/springframework/data/repository/config/RepositoryConfigurationSourceSupport.java index b10bf1ddd..1f785923e 100644 --- a/src/main/java/org/springframework/data/repository/config/RepositoryConfigurationSourceSupport.java +++ b/src/main/java/org/springframework/data/repository/config/RepositoryConfigurationSourceSupport.java @@ -53,9 +53,9 @@ public abstract class RepositoryConfigurationSourceSupport implements Repository public RepositoryConfigurationSourceSupport(Environment environment, ClassLoader classLoader, BeanDefinitionRegistry registry, BeanNameGenerator generator) { - Assert.notNull(environment, "Environment must not be null!"); - Assert.notNull(classLoader, "ClassLoader must not be null!"); - Assert.notNull(registry, "BeanDefinitionRegistry must not be null!"); + Assert.notNull(environment, "Environment must not be null"); + Assert.notNull(classLoader, "ClassLoader must not be null"); + Assert.notNull(registry, "BeanDefinitionRegistry must not be null"); this.environment = environment; this.beanNameGenerator = new RepositoryBeanNameGenerator(classLoader, generator, registry); diff --git a/src/main/java/org/springframework/data/repository/config/RepositoryConfigurationUtils.java b/src/main/java/org/springframework/data/repository/config/RepositoryConfigurationUtils.java index 36b14fc89..23a816f3d 100644 --- a/src/main/java/org/springframework/data/repository/config/RepositoryConfigurationUtils.java +++ b/src/main/java/org/springframework/data/repository/config/RepositoryConfigurationUtils.java @@ -43,9 +43,9 @@ public interface RepositoryConfigurationUtils { public static void exposeRegistration(RepositoryConfigurationExtension extension, BeanDefinitionRegistry registry, RepositoryConfigurationSource configurationSource) { - Assert.notNull(extension, "RepositoryConfigurationExtension must not be null!"); - Assert.notNull(registry, "BeanDefinitionRegistry must not be null!"); - Assert.notNull(configurationSource, "RepositoryConfigurationSource must not be null!"); + Assert.notNull(extension, "RepositoryConfigurationExtension must not be null"); + Assert.notNull(registry, "BeanDefinitionRegistry must not be null"); + Assert.notNull(configurationSource, "RepositoryConfigurationSource must not be null"); Class extensionType = extension.getClass(); String beanName = extensionType.getName().concat(GENERATED_BEAN_NAME_SEPARATOR).concat("0"); diff --git a/src/main/java/org/springframework/data/repository/config/RepositoryFragmentConfiguration.java b/src/main/java/org/springframework/data/repository/config/RepositoryFragmentConfiguration.java index ddd575474..681670855 100644 --- a/src/main/java/org/springframework/data/repository/config/RepositoryFragmentConfiguration.java +++ b/src/main/java/org/springframework/data/repository/config/RepositoryFragmentConfiguration.java @@ -46,8 +46,8 @@ public final class RepositoryFragmentConfiguration { */ public RepositoryFragmentConfiguration(String interfaceName, String className) { - Assert.hasText(interfaceName, "Interface name must not be null or empty!"); - Assert.hasText(className, "Class name must not be null or empty!"); + Assert.hasText(interfaceName, "Interface name must not be null or empty"); + Assert.hasText(className, "Class name must not be null or empty"); this.interfaceName = interfaceName; this.className = className; @@ -63,8 +63,8 @@ public final class RepositoryFragmentConfiguration { */ public RepositoryFragmentConfiguration(String interfaceName, AbstractBeanDefinition beanDefinition) { - Assert.hasText(interfaceName, "Interface name must not be null or empty!"); - Assert.notNull(beanDefinition, "Bean definition must not be null!"); + Assert.hasText(interfaceName, "Interface name must not be null or empty"); + Assert.notNull(beanDefinition, "Bean definition must not be null"); this.interfaceName = interfaceName; this.className = ConfigurationUtils.getRequiredBeanClassName(beanDefinition); diff --git a/src/main/java/org/springframework/data/repository/config/SelectionSet.java b/src/main/java/org/springframework/data/repository/config/SelectionSet.java index 865a0bf7f..af8918739 100644 --- a/src/main/java/org/springframework/data/repository/config/SelectionSet.java +++ b/src/main/java/org/springframework/data/repository/config/SelectionSet.java @@ -83,7 +83,7 @@ class SelectionSet { if (c.isEmpty()) { return Optional.empty(); } else { - throw new IllegalStateException("More then one element in collection"); + throw new IllegalStateException("More than one element in collection"); } }; } diff --git a/src/main/java/org/springframework/data/repository/config/XmlRepositoryConfigurationSource.java b/src/main/java/org/springframework/data/repository/config/XmlRepositoryConfigurationSource.java index 59df933c9..4f9b46fff 100644 --- a/src/main/java/org/springframework/data/repository/config/XmlRepositoryConfigurationSource.java +++ b/src/main/java/org/springframework/data/repository/config/XmlRepositoryConfigurationSource.java @@ -75,7 +75,7 @@ public class XmlRepositoryConfigurationSource extends RepositoryConfigurationSou super(environment, ConfigurationUtils.getRequiredClassLoader(context.getReaderContext()), context.getRegistry(), defaultBeanNameGenerator(context.getReaderContext().getReader().getBeanNameGenerator())); - Assert.notNull(element, "Element must not be null!"); + Assert.notNull(element, "Element must not be null"); this.element = element; this.context = context; @@ -166,7 +166,7 @@ public class XmlRepositoryConfigurationSource extends RepositoryConfigurationSou @Override public Optional getAttribute(String name, Class type) { - Assert.isAssignable(String.class, type, "Only String attribute lookups are allowed for XML namespaces!"); + Assert.isAssignable(String.class, type, "Only String attribute lookups are allowed for XML namespaces"); return (Optional) getAttribute(name); } diff --git a/src/main/java/org/springframework/data/repository/core/EntityInformation.java b/src/main/java/org/springframework/data/repository/core/EntityInformation.java index 3789de688..b04e12c17 100644 --- a/src/main/java/org/springframework/data/repository/core/EntityInformation.java +++ b/src/main/java/org/springframework/data/repository/core/EntityInformation.java @@ -55,7 +55,7 @@ public interface EntityInformation extends EntityMetadata { */ default ID getRequiredId(T entity) throws IllegalArgumentException { - Assert.notNull(entity, "Entity must not be null!"); + Assert.notNull(entity, "Entity must not be null"); ID id = getId(entity); diff --git a/src/main/java/org/springframework/data/repository/core/support/AbstractRepositoryMetadata.java b/src/main/java/org/springframework/data/repository/core/support/AbstractRepositoryMetadata.java index efe02f745..735e7e95e 100644 --- a/src/main/java/org/springframework/data/repository/core/support/AbstractRepositoryMetadata.java +++ b/src/main/java/org/springframework/data/repository/core/support/AbstractRepositoryMetadata.java @@ -56,8 +56,8 @@ public abstract class AbstractRepositoryMetadata implements RepositoryMetadata { */ public AbstractRepositoryMetadata(Class repositoryInterface) { - Assert.notNull(repositoryInterface, "Given type must not be null!"); - Assert.isTrue(repositoryInterface.isInterface(), "Given type must be an interface!"); + Assert.notNull(repositoryInterface, "Given type must not be null"); + Assert.isTrue(repositoryInterface.isInterface(), "Given type must be an interface"); this.repositoryInterface = repositoryInterface; this.typeInformation = ClassTypeInformation.from(repositoryInterface); @@ -73,7 +73,7 @@ public abstract class AbstractRepositoryMetadata implements RepositoryMetadata { */ public static RepositoryMetadata getMetadata(Class repositoryInterface) { - Assert.notNull(repositoryInterface, "Repository interface must not be null!"); + Assert.notNull(repositoryInterface, "Repository interface must not be null"); return Repository.class.isAssignableFrom(repositoryInterface) ? new DefaultRepositoryMetadata(repositoryInterface) : new AnnotationRepositoryMetadata(repositoryInterface); diff --git a/src/main/java/org/springframework/data/repository/core/support/AnnotationRepositoryMetadata.java b/src/main/java/org/springframework/data/repository/core/support/AnnotationRepositoryMetadata.java index f54d36ff4..ceb243f2b 100644 --- a/src/main/java/org/springframework/data/repository/core/support/AnnotationRepositoryMetadata.java +++ b/src/main/java/org/springframework/data/repository/core/support/AnnotationRepositoryMetadata.java @@ -36,7 +36,7 @@ import org.springframework.util.Assert; */ public class AnnotationRepositoryMetadata extends AbstractRepositoryMetadata { - private static final String NO_ANNOTATION_FOUND = String.format("Interface %%s must be annotated with @%s!", + private static final String NO_ANNOTATION_FOUND = String.format("Interface %%s must be annotated with @%s", RepositoryDefinition.class.getName()); private final TypeInformation idType; diff --git a/src/main/java/org/springframework/data/repository/core/support/DefaultCrudMethods.java b/src/main/java/org/springframework/data/repository/core/support/DefaultCrudMethods.java index 4ffecb55c..0838c30b4 100644 --- a/src/main/java/org/springframework/data/repository/core/support/DefaultCrudMethods.java +++ b/src/main/java/org/springframework/data/repository/core/support/DefaultCrudMethods.java @@ -65,7 +65,7 @@ public class DefaultCrudMethods implements CrudMethods { */ public DefaultCrudMethods(RepositoryMetadata metadata) { - Assert.notNull(metadata, "RepositoryInformation must not be null!"); + Assert.notNull(metadata, "RepositoryInformation must not be null"); this.findOneMethod = selectMostSuitableFindOneMethod(metadata); this.findAllMethod = selectMostSuitableFindAllMethod(metadata); diff --git a/src/main/java/org/springframework/data/repository/core/support/DefaultRepositoryInformation.java b/src/main/java/org/springframework/data/repository/core/support/DefaultRepositoryInformation.java index 35a9cdec1..e427877e0 100644 --- a/src/main/java/org/springframework/data/repository/core/support/DefaultRepositoryInformation.java +++ b/src/main/java/org/springframework/data/repository/core/support/DefaultRepositoryInformation.java @@ -64,9 +64,9 @@ class DefaultRepositoryInformation implements RepositoryInformation { public DefaultRepositoryInformation(RepositoryMetadata metadata, Class repositoryBaseClass, RepositoryComposition composition) { - Assert.notNull(metadata, "Repository metadata must not be null!"); - Assert.notNull(repositoryBaseClass, "Repository base class must not be null!"); - Assert.notNull(composition, "Repository composition must not be null!"); + Assert.notNull(metadata, "Repository metadata must not be null"); + Assert.notNull(repositoryBaseClass, "Repository base class must not be null"); + Assert.notNull(composition, "Repository composition must not be null"); this.metadata = metadata; this.repositoryBaseClass = repositoryBaseClass; @@ -169,7 +169,7 @@ class DefaultRepositoryInformation implements RepositoryInformation { @Override public boolean isBaseClassMethod(Method method) { - Assert.notNull(method, "Method must not be null!"); + Assert.notNull(method, "Method must not be null"); return baseComposition.getMethod(method) != null; } diff --git a/src/main/java/org/springframework/data/repository/core/support/DefaultRepositoryMetadata.java b/src/main/java/org/springframework/data/repository/core/support/DefaultRepositoryMetadata.java index 92f7c4d64..733540af3 100644 --- a/src/main/java/org/springframework/data/repository/core/support/DefaultRepositoryMetadata.java +++ b/src/main/java/org/springframework/data/repository/core/support/DefaultRepositoryMetadata.java @@ -34,7 +34,7 @@ import org.springframework.util.Assert; */ public class DefaultRepositoryMetadata extends AbstractRepositoryMetadata { - private static final String MUST_BE_A_REPOSITORY = String.format("Given type must be assignable to %s!", + private static final String MUST_BE_A_REPOSITORY = String.format("Given type must be assignable to %s", Repository.class); private final TypeInformation idType; @@ -55,10 +55,10 @@ public class DefaultRepositoryMetadata extends AbstractRepositoryMetadata { .getTypeArguments(); this.domainType = resolveTypeParameter(arguments, 0, - () -> String.format("Could not resolve domain type of %s!", repositoryInterface)); + () -> String.format("Could not resolve domain type of %s", repositoryInterface)); this.idType = resolveTypeParameter(arguments, 1, - () -> String.format("Could not resolve id type of %s!", repositoryInterface)); + () -> String.format("Could not resolve id type of %s", repositoryInterface)); } @Override diff --git a/src/main/java/org/springframework/data/repository/core/support/EventPublishingRepositoryProxyPostProcessor.java b/src/main/java/org/springframework/data/repository/core/support/EventPublishingRepositoryProxyPostProcessor.java index 762eed1d8..352854877 100644 --- a/src/main/java/org/springframework/data/repository/core/support/EventPublishingRepositoryProxyPostProcessor.java +++ b/src/main/java/org/springframework/data/repository/core/support/EventPublishingRepositoryProxyPostProcessor.java @@ -158,7 +158,7 @@ public class EventPublishingRepositoryProxyPostProcessor implements RepositoryPr @Nullable public static EventPublishingMethod of(Class type) { - Assert.notNull(type, "Type must not be null!"); + Assert.notNull(type, "Type must not be null"); EventPublishingMethod eventPublishingMethod = cache.get(type); diff --git a/src/main/java/org/springframework/data/repository/core/support/MethodLookup.java b/src/main/java/org/springframework/data/repository/core/support/MethodLookup.java index be0bb5abc..a7a8aefd9 100644 --- a/src/main/java/org/springframework/data/repository/core/support/MethodLookup.java +++ b/src/main/java/org/springframework/data/repository/core/support/MethodLookup.java @@ -56,7 +56,7 @@ public interface MethodLookup { */ default MethodLookup and(MethodLookup other) { - Assert.notNull(other, "Other method lookup must not be null!"); + Assert.notNull(other, "Other method lookup must not be null"); return () -> Stream.concat(getLookups().stream(), other.getLookups().stream()).collect(Collectors.toList()); } diff --git a/src/main/java/org/springframework/data/repository/core/support/MethodLookups.java b/src/main/java/org/springframework/data/repository/core/support/MethodLookups.java index dc9ed7c82..dee439136 100644 --- a/src/main/java/org/springframework/data/repository/core/support/MethodLookups.java +++ b/src/main/java/org/springframework/data/repository/core/support/MethodLookups.java @@ -119,7 +119,7 @@ interface MethodLookups { */ public RepositoryAwareMethodLookup(RepositoryMetadata repositoryMetadata) { - Assert.notNull(repositoryMetadata, "Repository metadata must not be null!"); + Assert.notNull(repositoryMetadata, "Repository metadata must not be null"); this.entityType = repositoryMetadata.getDomainTypeInformation().toTypeDescriptor().getResolvableType(); this.idType = repositoryMetadata.getIdTypeInformation().toTypeDescriptor().getResolvableType(); @@ -292,7 +292,7 @@ interface MethodLookups { */ private static boolean isNonUnwrappingWrapper(Class parameterType) { - Assert.notNull(parameterType, "Parameter type must not be null!"); + Assert.notNull(parameterType, "Parameter type must not be null"); return ReactiveWrappers.supports(parameterType); } @@ -305,7 +305,7 @@ interface MethodLookups { */ private static boolean usesParametersWithReactiveWrappers(Method method) { - Assert.notNull(method, "Method must not be null!"); + Assert.notNull(method, "Method must not be null"); return Arrays.stream(method.getParameterTypes())// .anyMatch(ReactiveTypeInteropMethodLookup::isNonUnwrappingWrapper); diff --git a/src/main/java/org/springframework/data/repository/core/support/PropertiesBasedNamedQueries.java b/src/main/java/org/springframework/data/repository/core/support/PropertiesBasedNamedQueries.java index 1c48bb7ba..641943a02 100644 --- a/src/main/java/org/springframework/data/repository/core/support/PropertiesBasedNamedQueries.java +++ b/src/main/java/org/springframework/data/repository/core/support/PropertiesBasedNamedQueries.java @@ -27,7 +27,7 @@ import org.springframework.util.Assert; */ public class PropertiesBasedNamedQueries implements NamedQueries { - private static final String NO_QUERY_FOUND = "No query with name %s found! Make sure you call hasQuery(…) before calling this method!"; + private static final String NO_QUERY_FOUND = "No query with name %s found; Make sure you call hasQuery(…) before calling this method"; public static final NamedQueries EMPTY = new PropertiesBasedNamedQueries(new Properties()); @@ -39,14 +39,14 @@ public class PropertiesBasedNamedQueries implements NamedQueries { public boolean hasQuery(String queryName) { - Assert.hasText(queryName, "Query name must not be null or empty!"); + Assert.hasText(queryName, "Query name must not be null or empty"); return properties.containsKey(queryName); } public String getQuery(String queryName) { - Assert.hasText(queryName, "Query name must not be null or empty!"); + Assert.hasText(queryName, "Query name must not be null or empty"); String query = properties.getProperty(queryName); diff --git a/src/main/java/org/springframework/data/repository/core/support/RepositoryComposition.java b/src/main/java/org/springframework/data/repository/core/support/RepositoryComposition.java index e2ca4b57e..890df3c86 100644 --- a/src/main/java/org/springframework/data/repository/core/support/RepositoryComposition.java +++ b/src/main/java/org/springframework/data/repository/core/support/RepositoryComposition.java @@ -391,8 +391,8 @@ public class RepositoryComposition { */ public static RepositoryFragments just(Object... implementations) { - Assert.notNull(implementations, "Implementations must not be null!"); - Assert.noNullElements(implementations, "Implementations must not contain null elements!"); + Assert.notNull(implementations, "Implementations must not be null"); + Assert.noNullElements(implementations, "Implementations must not contain null elements"); return new RepositoryFragments( Arrays.stream(implementations).map(RepositoryFragment::implemented).collect(Collectors.toList())); @@ -406,8 +406,8 @@ public class RepositoryComposition { */ public static RepositoryFragments of(RepositoryFragment... fragments) { - Assert.notNull(fragments, "RepositoryFragments must not be null!"); - Assert.noNullElements(fragments, "RepositoryFragments must not contain null elements!"); + Assert.notNull(fragments, "RepositoryFragments must not be null"); + Assert.noNullElements(fragments, "RepositoryFragments must not contain null elements"); return new RepositoryFragments(Arrays.asList(fragments)); } @@ -420,7 +420,7 @@ public class RepositoryComposition { */ public static RepositoryFragments from(List> fragments) { - Assert.notNull(fragments, "RepositoryFragments must not be null!"); + Assert.notNull(fragments, "RepositoryFragments must not be null"); return new RepositoryFragments(new ArrayList<>(fragments)); } @@ -434,7 +434,7 @@ public class RepositoryComposition { */ public RepositoryFragments append(RepositoryFragment fragment) { - Assert.notNull(fragment, "RepositoryFragment must not be null!"); + Assert.notNull(fragment, "RepositoryFragment must not be null"); return concat(stream(), Stream.of(fragment)); } @@ -448,7 +448,7 @@ public class RepositoryComposition { */ public RepositoryFragments append(RepositoryFragments fragments) { - Assert.notNull(fragments, "RepositoryFragments must not be null!"); + Assert.notNull(fragments, "RepositoryFragments must not be null"); return concat(stream(), fragments.stream()); } diff --git a/src/main/java/org/springframework/data/repository/core/support/RepositoryFactoryBeanSupport.java b/src/main/java/org/springframework/data/repository/core/support/RepositoryFactoryBeanSupport.java index 8cd8cc379..c2a7bedca 100644 --- a/src/main/java/org/springframework/data/repository/core/support/RepositoryFactoryBeanSupport.java +++ b/src/main/java/org/springframework/data/repository/core/support/RepositoryFactoryBeanSupport.java @@ -86,7 +86,7 @@ public abstract class RepositoryFactoryBeanSupport, */ protected RepositoryFactoryBeanSupport(Class repositoryInterface) { - Assert.notNull(repositoryInterface, "Repository interface must not be null!"); + Assert.notNull(repositoryInterface, "Repository interface must not be null"); this.repositoryInterface = repositoryInterface; } diff --git a/src/main/java/org/springframework/data/repository/core/support/RepositoryFactorySupport.java b/src/main/java/org/springframework/data/repository/core/support/RepositoryFactorySupport.java index a853e5e32..d56df81be 100644 --- a/src/main/java/org/springframework/data/repository/core/support/RepositoryFactorySupport.java +++ b/src/main/java/org/springframework/data/repository/core/support/RepositoryFactorySupport.java @@ -184,7 +184,7 @@ public abstract class RepositoryFactorySupport implements BeanClassLoaderAware, */ public void addQueryCreationListener(QueryCreationListener listener) { - Assert.notNull(listener, "Listener must not be null!"); + Assert.notNull(listener, "Listener must not be null"); this.queryPostProcessors.add(listener); } @@ -197,7 +197,7 @@ public abstract class RepositoryFactorySupport implements BeanClassLoaderAware, */ public void addInvocationListener(RepositoryMethodInvocationListener listener) { - Assert.notNull(listener, "Listener must not be null!"); + Assert.notNull(listener, "Listener must not be null"); this.methodInvocationListeners.add(listener); } @@ -210,7 +210,7 @@ public abstract class RepositoryFactorySupport implements BeanClassLoaderAware, */ public void addRepositoryProxyPostProcessor(RepositoryProxyPostProcessor processor) { - Assert.notNull(processor, "RepositoryProxyPostProcessor must not be null!"); + Assert.notNull(processor, "RepositoryProxyPostProcessor must not be null"); this.postProcessors.add(processor); } @@ -272,8 +272,8 @@ public abstract class RepositoryFactorySupport implements BeanClassLoaderAware, logger.debug(LogMessage.format("Initializing repository instance for %s…", repositoryInterface.getName())); } - Assert.notNull(repositoryInterface, "Repository interface must not be null!"); - Assert.notNull(fragments, "RepositoryFragments must not be null!"); + Assert.notNull(repositoryInterface, "Repository interface must not be null"); + Assert.notNull(fragments, "RepositoryFragments must not be null"); ApplicationStartup applicationStartup = getStartup(); @@ -421,8 +421,8 @@ public abstract class RepositoryFactorySupport implements BeanClassLoaderAware, */ private RepositoryComposition getRepositoryComposition(RepositoryMetadata metadata, RepositoryFragments fragments) { - Assert.notNull(metadata, "RepositoryMetadata must not be null!"); - Assert.notNull(fragments, "RepositoryFragments must not be null!"); + Assert.notNull(metadata, "RepositoryMetadata must not be null"); + Assert.notNull(fragments, "RepositoryFragments must not be null"); RepositoryComposition composition = getRepositoryComposition(metadata); RepositoryFragments repositoryAspects = getRepositoryFragments(metadata); diff --git a/src/main/java/org/springframework/data/repository/core/support/RepositoryFragment.java b/src/main/java/org/springframework/data/repository/core/support/RepositoryFragment.java index f6de0d6e2..54ed4ceca 100644 --- a/src/main/java/org/springframework/data/repository/core/support/RepositoryFragment.java +++ b/src/main/java/org/springframework/data/repository/core/support/RepositoryFragment.java @@ -86,7 +86,7 @@ public interface RepositoryFragment { */ default boolean hasMethod(Method method) { - Assert.notNull(method, "Method must not be null!"); + Assert.notNull(method, "Method must not be null"); return ReflectionUtils.findMethod(getSignatureContributor(), method.getName(), method.getParameterTypes()) != null; } @@ -176,13 +176,13 @@ public interface RepositoryFragment { */ public ImplementedRepositoryFragment(Optional> interfaceClass, T implementation) { - Assert.notNull(interfaceClass, "Interface class must not be null!"); - Assert.notNull(implementation, "Implementation object must not be null!"); + Assert.notNull(interfaceClass, "Interface class must not be null"); + Assert.notNull(implementation, "Implementation object must not be null"); interfaceClass.ifPresent(it -> { Assert.isTrue(ClassUtils.isAssignableValue(it, implementation), - () -> String.format("Fragment implementation %s does not implement %s!", + () -> String.format("Fragment implementation %s does not implement %s", ClassUtils.getQualifiedName(implementation.getClass()), ClassUtils.getQualifiedName(it))); }); diff --git a/src/main/java/org/springframework/data/repository/core/support/RepositoryFragmentsFactoryBean.java b/src/main/java/org/springframework/data/repository/core/support/RepositoryFragmentsFactoryBean.java index f10642bb1..a733f1480 100644 --- a/src/main/java/org/springframework/data/repository/core/support/RepositoryFragmentsFactoryBean.java +++ b/src/main/java/org/springframework/data/repository/core/support/RepositoryFragmentsFactoryBean.java @@ -51,7 +51,7 @@ public class RepositoryFragmentsFactoryBean @SuppressWarnings("null") public RepositoryFragmentsFactoryBean(List fragmentBeanNames) { - Assert.notNull(fragmentBeanNames, "Fragment bean names must not be null!"); + Assert.notNull(fragmentBeanNames, "Fragment bean names must not be null"); this.fragmentBeanNames = fragmentBeanNames; } diff --git a/src/main/java/org/springframework/data/repository/core/support/TransactionalRepositoryProxyPostProcessor.java b/src/main/java/org/springframework/data/repository/core/support/TransactionalRepositoryProxyPostProcessor.java index d4e1c0da5..d085c0557 100644 --- a/src/main/java/org/springframework/data/repository/core/support/TransactionalRepositoryProxyPostProcessor.java +++ b/src/main/java/org/springframework/data/repository/core/support/TransactionalRepositoryProxyPostProcessor.java @@ -58,8 +58,8 @@ class TransactionalRepositoryProxyPostProcessor implements RepositoryProxyPostPr public TransactionalRepositoryProxyPostProcessor(ListableBeanFactory beanFactory, String transactionManagerName, boolean enableDefaultTransaction) { - Assert.notNull(beanFactory, "BeanFactory must not be null!"); - Assert.notNull(transactionManagerName, "TransactionManagerName must not be null!"); + Assert.notNull(beanFactory, "BeanFactory must not be null"); + Assert.notNull(transactionManagerName, "TransactionManagerName must not be null"); this.beanFactory = beanFactory; this.transactionManagerName = transactionManagerName; @@ -106,7 +106,7 @@ class TransactionalRepositoryProxyPostProcessor implements RepositoryProxyPostPr super(true); - Assert.notNull(repositoryInformation, "RepositoryInformation must not be null!"); + Assert.notNull(repositoryInformation, "RepositoryInformation must not be null"); this.enableDefaultTransactions = enableDefaultTransactions; this.repositoryInformation = repositoryInformation; diff --git a/src/main/java/org/springframework/data/repository/init/AbstractRepositoryPopulatorFactoryBean.java b/src/main/java/org/springframework/data/repository/init/AbstractRepositoryPopulatorFactoryBean.java index 212d8410b..518cb6603 100644 --- a/src/main/java/org/springframework/data/repository/init/AbstractRepositoryPopulatorFactoryBean.java +++ b/src/main/java/org/springframework/data/repository/init/AbstractRepositoryPopulatorFactoryBean.java @@ -50,7 +50,7 @@ public abstract class AbstractRepositoryPopulatorFactoryBean */ public void setResources(Resource[] resources) { - Assert.notNull(resources, "Resources must not be null!"); + Assert.notNull(resources, "Resources must not be null"); this.resources = resources.clone(); } @@ -99,7 +99,7 @@ public abstract class AbstractRepositoryPopulatorFactoryBean @Override public void afterPropertiesSet() throws Exception { - Assert.state(resources != null, "Resources must not be null!"); + Assert.state(resources != null, "Resources must not be null"); super.afterPropertiesSet(); } } diff --git a/src/main/java/org/springframework/data/repository/init/Jackson2ResourceReader.java b/src/main/java/org/springframework/data/repository/init/Jackson2ResourceReader.java index c43eb1919..f51efe27b 100644 --- a/src/main/java/org/springframework/data/repository/init/Jackson2ResourceReader.java +++ b/src/main/java/org/springframework/data/repository/init/Jackson2ResourceReader.java @@ -80,7 +80,7 @@ public class Jackson2ResourceReader implements ResourceReader { public Object readFrom(Resource resource, @Nullable ClassLoader classLoader) throws Exception { - Assert.notNull(resource, "Resource must not be null!"); + Assert.notNull(resource, "Resource must not be null"); InputStream stream = resource.getInputStream(); JsonNode node = mapper.readerFor(JsonNode.class).readTree(stream); diff --git a/src/main/java/org/springframework/data/repository/init/RepositoriesPopulatedEvent.java b/src/main/java/org/springframework/data/repository/init/RepositoriesPopulatedEvent.java index a69df675c..167812a07 100644 --- a/src/main/java/org/springframework/data/repository/init/RepositoriesPopulatedEvent.java +++ b/src/main/java/org/springframework/data/repository/init/RepositoriesPopulatedEvent.java @@ -44,8 +44,8 @@ public class RepositoriesPopulatedEvent extends ApplicationEvent { super(populator); - Assert.notNull(populator, "Populator must not be null!"); - Assert.notNull(repositories, "Repositories must not be null!"); + Assert.notNull(populator, "Populator must not be null"); + Assert.notNull(repositories, "Repositories must not be null"); this.repositories = repositories; } diff --git a/src/main/java/org/springframework/data/repository/init/ResourceReaderRepositoryPopulator.java b/src/main/java/org/springframework/data/repository/init/ResourceReaderRepositoryPopulator.java index 0947d4ffb..a2a1f3b33 100644 --- a/src/main/java/org/springframework/data/repository/init/ResourceReaderRepositoryPopulator.java +++ b/src/main/java/org/springframework/data/repository/init/ResourceReaderRepositoryPopulator.java @@ -71,7 +71,7 @@ public class ResourceReaderRepositoryPopulator implements RepositoryPopulator, A */ public ResourceReaderRepositoryPopulator(ResourceReader reader, @Nullable ClassLoader classLoader) { - Assert.notNull(reader, "Reader must not be null!"); + Assert.notNull(reader, "Reader must not be null"); this.reader = reader; this.classLoader = classLoader; @@ -86,7 +86,7 @@ public class ResourceReaderRepositoryPopulator implements RepositoryPopulator, A * @throws IOException */ public void setResourceLocation(String location) throws IOException { - Assert.hasText(location, "Location must not be null!"); + Assert.hasText(location, "Location must not be null"); setResources(resolver.getResources(location)); } @@ -105,7 +105,7 @@ public class ResourceReaderRepositoryPopulator implements RepositoryPopulator, A public void populate(Repositories repositories) { - Assert.notNull(repositories, "Repositories must not be null!"); + Assert.notNull(repositories, "Repositories must not be null"); RepositoryInvokerFactory invokerFactory = new DefaultRepositoryInvokerFactory(repositories); @@ -120,7 +120,7 @@ public class ResourceReaderRepositoryPopulator implements RepositoryPopulator, A if (element != null) { persist(element, invokerFactory); } else { - logger.info("Skipping null element found in unmarshal result!"); + logger.info("Skipping null element found in unmarshal result"); } } } else { diff --git a/src/main/java/org/springframework/data/repository/init/UnmarshallerRepositoryPopulatorFactoryBean.java b/src/main/java/org/springframework/data/repository/init/UnmarshallerRepositoryPopulatorFactoryBean.java index 41df0b4f1..df451c3a9 100644 --- a/src/main/java/org/springframework/data/repository/init/UnmarshallerRepositoryPopulatorFactoryBean.java +++ b/src/main/java/org/springframework/data/repository/init/UnmarshallerRepositoryPopulatorFactoryBean.java @@ -55,7 +55,7 @@ public class UnmarshallerRepositoryPopulatorFactoryBean extends AbstractReposito @Override public void afterPropertiesSet() throws Exception { - Assert.state(unmarshaller != null, "No Unmarshaller configured!"); + Assert.state(unmarshaller != null, "No Unmarshaller configured"); super.afterPropertiesSet(); } } diff --git a/src/main/java/org/springframework/data/repository/init/UnmarshallingResourceReader.java b/src/main/java/org/springframework/data/repository/init/UnmarshallingResourceReader.java index 6e8639af7..2d34b8af3 100644 --- a/src/main/java/org/springframework/data/repository/init/UnmarshallingResourceReader.java +++ b/src/main/java/org/springframework/data/repository/init/UnmarshallingResourceReader.java @@ -41,7 +41,7 @@ public class UnmarshallingResourceReader implements ResourceReader { public Object readFrom(Resource resource, @Nullable ClassLoader classLoader) throws IOException { - Assert.notNull(resource, "Resource must not be null!"); + Assert.notNull(resource, "Resource must not be null"); StreamSource source = new StreamSource(resource.getInputStream()); return unmarshaller.unmarshal(source); diff --git a/src/main/java/org/springframework/data/repository/query/ExtensionAwareQueryMethodEvaluationContextProvider.java b/src/main/java/org/springframework/data/repository/query/ExtensionAwareQueryMethodEvaluationContextProvider.java index 44de294ff..8a12232ac 100644 --- a/src/main/java/org/springframework/data/repository/query/ExtensionAwareQueryMethodEvaluationContextProvider.java +++ b/src/main/java/org/springframework/data/repository/query/ExtensionAwareQueryMethodEvaluationContextProvider.java @@ -51,7 +51,7 @@ public class ExtensionAwareQueryMethodEvaluationContextProvider implements Query */ public ExtensionAwareQueryMethodEvaluationContextProvider(ListableBeanFactory beanFactory) { - Assert.notNull(beanFactory, "ListableBeanFactory must not be null!"); + Assert.notNull(beanFactory, "ListableBeanFactory must not be null"); this.delegate = new ExtensionAwareEvaluationContextProvider(beanFactory); } @@ -64,7 +64,7 @@ public class ExtensionAwareQueryMethodEvaluationContextProvider implements Query */ public ExtensionAwareQueryMethodEvaluationContextProvider(List extensions) { - Assert.notNull(extensions, "EvaluationContextExtensions must not be null!"); + Assert.notNull(extensions, "EvaluationContextExtensions must not be null"); this.delegate = new org.springframework.data.spel.ExtensionAwareEvaluationContextProvider(extensions); } diff --git a/src/main/java/org/springframework/data/repository/query/Parameter.java b/src/main/java/org/springframework/data/repository/query/Parameter.java index c80356045..c5c6f9d76 100644 --- a/src/main/java/org/springframework/data/repository/query/Parameter.java +++ b/src/main/java/org/springframework/data/repository/query/Parameter.java @@ -76,7 +76,7 @@ public class Parameter { */ protected Parameter(MethodParameter parameter) { - Assert.notNull(parameter, "MethodParameter must not be null!"); + Assert.notNull(parameter, "MethodParameter must not be null"); this.parameter = parameter; this.parameterType = potentiallyUnwrapParameterType(parameter); diff --git a/src/main/java/org/springframework/data/repository/query/Parameters.java b/src/main/java/org/springframework/data/repository/query/Parameters.java index d66bb1d01..69f217f89 100644 --- a/src/main/java/org/springframework/data/repository/query/Parameters.java +++ b/src/main/java/org/springframework/data/repository/query/Parameters.java @@ -46,7 +46,7 @@ public abstract class Parameters, T extends Parameter private static final String PARAM_ON_SPECIAL = format("You must not use @%s on a parameter typed %s or %s", Param.class.getSimpleName(), Pageable.class.getSimpleName(), Sort.class.getSimpleName()); private static final String ALL_OR_NOTHING = String.format( - "Either use @%s on all parameters except %s and %s typed once, or none at all!", Param.class.getSimpleName(), + "Either use @%s on all parameters except %s and %s typed once, or none at all", Param.class.getSimpleName(), Pageable.class.getSimpleName(), Sort.class.getSimpleName()); private static final ParameterNameDiscoverer PARAMETER_NAME_DISCOVERER = new DefaultParameterNameDiscoverer(); @@ -65,7 +65,7 @@ public abstract class Parameters, T extends Parameter */ public Parameters(Method method) { - Assert.notNull(method, "Method must not be null!"); + Assert.notNull(method, "Method must not be null"); int parameterCount = method.getParameterCount(); @@ -237,7 +237,7 @@ public abstract class Parameters, T extends Parameter return parameters.get(index); } catch (IndexOutOfBoundsException e) { throw new ParameterOutOfBoundsException( - "Invalid parameter index! You seem to have declared too little query method parameters", e); + "Invalid parameter index; You seem to have declared too little query method parameters", e); } } diff --git a/src/main/java/org/springframework/data/repository/query/ParametersParameterAccessor.java b/src/main/java/org/springframework/data/repository/query/ParametersParameterAccessor.java index 08366b677..49fa0dafa 100644 --- a/src/main/java/org/springframework/data/repository/query/ParametersParameterAccessor.java +++ b/src/main/java/org/springframework/data/repository/query/ParametersParameterAccessor.java @@ -43,10 +43,10 @@ public class ParametersParameterAccessor implements ParameterAccessor { */ public ParametersParameterAccessor(Parameters parameters, Object[] values) { - Assert.notNull(parameters, "Parameters must not be null!"); - Assert.notNull(values, "Values must not be null!"); + Assert.notNull(parameters, "Parameters must not be null"); + 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"); this.parameters = parameters; @@ -185,7 +185,7 @@ public class ParametersParameterAccessor implements ParameterAccessor { */ public BindableParameterIterator(ParametersParameterAccessor accessor) { - Assert.notNull(accessor, "ParametersParameterAccessor must not be null!"); + Assert.notNull(accessor, "ParametersParameterAccessor must not be null"); this.accessor = accessor; this.bindableParameterCount = accessor.getParameters().getBindableParameters().getNumberOfParameters(); diff --git a/src/main/java/org/springframework/data/repository/query/QueryCreationException.java b/src/main/java/org/springframework/data/repository/query/QueryCreationException.java index f5b22d7b0..924ac3b4e 100644 --- a/src/main/java/org/springframework/data/repository/query/QueryCreationException.java +++ b/src/main/java/org/springframework/data/repository/query/QueryCreationException.java @@ -28,7 +28,7 @@ import org.springframework.data.repository.core.RepositoryCreationException; public final class QueryCreationException extends RepositoryCreationException { private static final long serialVersionUID = -1238456123580L; - private static final String MESSAGE_TEMPLATE = "Could not create query for method %s! Could not find property %s on domain class %s."; + private static final String MESSAGE_TEMPLATE = "Could not create query for method %s; Could not find property %s on domain class %s"; private final Method method; @@ -72,7 +72,7 @@ public final class QueryCreationException extends RepositoryCreationException { */ public static QueryCreationException create(QueryMethod method, String message) { - return new QueryCreationException(String.format("Could not create query for %s! Reason: %s", method, message), + return new QueryCreationException(String.format("Could not create query for %s; Reason: %s", method, message), method); } @@ -98,7 +98,7 @@ public final class QueryCreationException extends RepositoryCreationException { */ public static QueryCreationException create(String message, Throwable cause, Class repositoryInterface, Method method) { - return new QueryCreationException(String.format("Could not create query for %s! Reason: %s", method, message), + return new QueryCreationException(String.format("Could not create query for %s; Reason: %s", method, message), cause, repositoryInterface, method); } diff --git a/src/main/java/org/springframework/data/repository/query/QueryMethod.java b/src/main/java/org/springframework/data/repository/query/QueryMethod.java index 2252a73e1..80eb8c060 100644 --- a/src/main/java/org/springframework/data/repository/query/QueryMethod.java +++ b/src/main/java/org/springframework/data/repository/query/QueryMethod.java @@ -66,15 +66,15 @@ public class QueryMethod { */ public QueryMethod(Method method, RepositoryMetadata metadata, ProjectionFactory factory) { - Assert.notNull(method, "Method must not be null!"); - Assert.notNull(metadata, "Repository metadata must not be null!"); - Assert.notNull(factory, "ProjectionFactory must not be null!"); + Assert.notNull(method, "Method must not be null"); + Assert.notNull(metadata, "Repository metadata must not be null"); + Assert.notNull(factory, "ProjectionFactory must not be null"); Parameters.TYPES.stream() .filter(type -> getNumberOfOccurrences(method, type) > 1) .findFirst().ifPresent(type -> { throw new IllegalStateException( - String.format("Method must have only one argument of type %s! Offending method: %s", + String.format("Method must have only one argument of type %s; Offending method: %s", type.getSimpleName(), method)); }); @@ -91,16 +91,16 @@ public class QueryMethod { if (hasParameterOfType(method, Sort.class)) { throw new IllegalStateException(String.format("Method must not have Pageable *and* Sort parameters. " - + "Use sorting capabilities on Pageable instead! Offending method: %s", method)); + + "Use sorting capabilities on Pageable instead; Offending method: %s", method)); } } Assert.notNull(this.parameters, - () -> String.format("Parameters extracted from method '%s' must not be null!", method.getName())); + () -> String.format("Parameters extracted from method '%s' must not be null", method.getName())); if (isPageQuery()) { Assert.isTrue(this.parameters.hasPageableParameter(), - String.format("Paging query needs to have a Pageable parameter! Offending method: %s", method)); + String.format("Paging query needs to have a Pageable parameter; Offending method: %s", method)); } this.domainClass = Lazy.of(() -> { @@ -297,8 +297,8 @@ public class QueryMethod { private static void assertReturnTypeAssignable(Method method, Set> types) { - Assert.notNull(method, "Method must not be null!"); - Assert.notEmpty(types, "Types must not be null or empty!"); + Assert.notNull(method, "Method must not be null"); + Assert.notEmpty(types, "Types must not be null or empty"); TypeInformation returnType = ClassTypeInformation.fromReturnTypeOf(method); diff --git a/src/main/java/org/springframework/data/repository/query/ReactiveExtensionAwareQueryMethodEvaluationContextProvider.java b/src/main/java/org/springframework/data/repository/query/ReactiveExtensionAwareQueryMethodEvaluationContextProvider.java index 022745873..c2ffe21c9 100644 --- a/src/main/java/org/springframework/data/repository/query/ReactiveExtensionAwareQueryMethodEvaluationContextProvider.java +++ b/src/main/java/org/springframework/data/repository/query/ReactiveExtensionAwareQueryMethodEvaluationContextProvider.java @@ -49,7 +49,7 @@ public class ReactiveExtensionAwareQueryMethodEvaluationContextProvider */ public ReactiveExtensionAwareQueryMethodEvaluationContextProvider(ListableBeanFactory beanFactory) { - Assert.notNull(beanFactory, "ListableBeanFactory must not be null!"); + Assert.notNull(beanFactory, "ListableBeanFactory must not be null"); this.delegate = new ReactiveExtensionAwareEvaluationContextProvider(beanFactory); } @@ -63,7 +63,7 @@ public class ReactiveExtensionAwareQueryMethodEvaluationContextProvider */ public ReactiveExtensionAwareQueryMethodEvaluationContextProvider(List extensions) { - Assert.notNull(extensions, "EvaluationContextExtensions must not be null!"); + Assert.notNull(extensions, "EvaluationContextExtensions must not be null"); this.delegate = new ReactiveExtensionAwareEvaluationContextProvider(extensions); } diff --git a/src/main/java/org/springframework/data/repository/query/ResultProcessor.java b/src/main/java/org/springframework/data/repository/query/ResultProcessor.java index 48ae3947b..344f0161e 100644 --- a/src/main/java/org/springframework/data/repository/query/ResultProcessor.java +++ b/src/main/java/org/springframework/data/repository/query/ResultProcessor.java @@ -68,9 +68,9 @@ public class ResultProcessor { */ private ResultProcessor(QueryMethod method, ProjectionFactory factory, Class type) { - Assert.notNull(method, "QueryMethod must not be null!"); - Assert.notNull(factory, "ProjectionFactory must not be null!"); - Assert.notNull(type, "Type must not be null!"); + Assert.notNull(method, "QueryMethod must not be null"); + Assert.notNull(factory, "ProjectionFactory must not be null"); + Assert.notNull(type, "Type must not be null"); this.method = method; this.type = ReturnedType.of(type, method.getDomainClass(), factory); @@ -94,7 +94,7 @@ public class ResultProcessor { */ public ResultProcessor withDynamicProjection(ParameterAccessor accessor) { - Assert.notNull(accessor, "Parameter accessor must not be null!"); + Assert.notNull(accessor, "Parameter accessor must not be null"); Class projection = accessor.findDynamicProjection(); @@ -139,7 +139,7 @@ public class ResultProcessor { return (T) source; } - Assert.notNull(preparingConverter, "Preparing converter must not be null!"); + Assert.notNull(preparingConverter, "Preparing converter must not be null"); ChainingConverter converter = ChainingConverter.of(type.getReturnedType(), preparingConverter).and(this.converter); @@ -214,7 +214,7 @@ public class ResultProcessor { */ public ChainingConverter and(final Converter converter) { - Assert.notNull(converter, "Converter must not be null!"); + Assert.notNull(converter, "Converter must not be null"); return new ChainingConverter(targetType, source -> { @@ -282,7 +282,7 @@ public class ResultProcessor { */ ProjectingConverter withType(ReturnedType type) { - Assert.notNull(type, "ReturnedType must not be null!"); + Assert.notNull(type, "ReturnedType must not be null"); return new ProjectingConverter(type, factory, conversionService); } diff --git a/src/main/java/org/springframework/data/repository/query/ReturnedType.java b/src/main/java/org/springframework/data/repository/query/ReturnedType.java index c68248bf7..1c63dc725 100644 --- a/src/main/java/org/springframework/data/repository/query/ReturnedType.java +++ b/src/main/java/org/springframework/data/repository/query/ReturnedType.java @@ -64,9 +64,9 @@ public abstract class ReturnedType { */ static ReturnedType of(Class returnedType, Class domainType, ProjectionFactory factory) { - Assert.notNull(returnedType, "Returned type must not be null!"); - Assert.notNull(domainType, "Domain type must not be null!"); - Assert.notNull(factory, "ProjectionFactory must not be null!"); + Assert.notNull(returnedType, "Returned type must not be null"); + Assert.notNull(domainType, "Domain type must not be null"); + Assert.notNull(factory, "ProjectionFactory must not be null"); return cache.computeIfAbsent(CacheKey.of(returnedType, domainType, factory.hashCode()), key -> { @@ -153,7 +153,7 @@ public abstract class ReturnedType { super(domainType); - Assert.notNull(information, "Projection information must not be null!"); + Assert.notNull(information, "Projection information must not be null"); this.information = information; this.domainType = domainType; @@ -217,9 +217,9 @@ public abstract class ReturnedType { super(domainType); - Assert.notNull(returnedType, "Returned type must not be null!"); - Assert.notNull(domainType, "Domain type must not be null!"); - Assert.isTrue(!returnedType.isInterface(), "Returned type must not be an interface!"); + Assert.notNull(returnedType, "Returned type must not be null"); + Assert.notNull(domainType, "Domain type must not be null"); + Assert.isTrue(!returnedType.isInterface(), "Returned type must not be an interface"); this.type = returnedType; this.inputProperties = detectConstructorParameterNames(returnedType); diff --git a/src/main/java/org/springframework/data/repository/query/SpelQueryContext.java b/src/main/java/org/springframework/data/repository/query/SpelQueryContext.java index 82f63e6ec..e1f666fd0 100644 --- a/src/main/java/org/springframework/data/repository/query/SpelQueryContext.java +++ b/src/main/java/org/springframework/data/repository/query/SpelQueryContext.java @@ -104,7 +104,7 @@ public class SpelQueryContext { */ public EvaluatingSpelQueryContext withEvaluationContextProvider(QueryMethodEvaluationContextProvider provider) { - Assert.notNull(provider, "QueryMethodEvaluationContextProvider must not be null!"); + Assert.notNull(provider, "QueryMethodEvaluationContextProvider must not be null"); return new EvaluatingSpelQueryContext(provider, parameterNameSource, replacementSource); } diff --git a/src/main/java/org/springframework/data/repository/query/parser/AbstractQueryCreator.java b/src/main/java/org/springframework/data/repository/query/parser/AbstractQueryCreator.java index b5fd5d545..f36f43bb0 100644 --- a/src/main/java/org/springframework/data/repository/query/parser/AbstractQueryCreator.java +++ b/src/main/java/org/springframework/data/repository/query/parser/AbstractQueryCreator.java @@ -91,7 +91,7 @@ public abstract class AbstractQueryCreator { */ public T createQuery(Sort dynamicSort) { - Assert.notNull(dynamicSort, "DynamicSort must not be null!"); + Assert.notNull(dynamicSort, "DynamicSort must not be null"); return complete(createCriteria(tree), tree.getSort().and(dynamicSort)); } diff --git a/src/main/java/org/springframework/data/repository/query/parser/OrderBySource.java b/src/main/java/org/springframework/data/repository/query/parser/OrderBySource.java index 1e742d2a7..d8e1a0940 100644 --- a/src/main/java/org/springframework/data/repository/query/parser/OrderBySource.java +++ b/src/main/java/org/springframework/data/repository/query/parser/OrderBySource.java @@ -45,7 +45,7 @@ class OrderBySource { private static final String BLOCK_SPLIT = "(?<=Asc|Desc)(?=\\p{Lu})"; private static final Pattern DIRECTION_SPLIT = Pattern.compile("(.+?)(Asc|Desc)?$"); - private static final String INVALID_ORDER_SYNTAX = "Invalid order syntax for part %s!"; + private static final String INVALID_ORDER_SYNTAX = "Invalid order syntax for part %s"; private static final Set DIRECTION_KEYWORDS = new HashSet<>(Arrays.asList("Asc", "Desc")); private final List orders; diff --git a/src/main/java/org/springframework/data/repository/query/parser/Part.java b/src/main/java/org/springframework/data/repository/query/parser/Part.java index 1dd32f23e..0610f6c46 100644 --- a/src/main/java/org/springframework/data/repository/query/parser/Part.java +++ b/src/main/java/org/springframework/data/repository/query/parser/Part.java @@ -68,8 +68,8 @@ public class Part { */ public Part(String source, Class clazz, boolean alwaysIgnoreCase) { - Assert.hasText(source, "Part source must not be null or empty!"); - Assert.notNull(clazz, "Type must not be null!"); + Assert.hasText(source, "Part source must not be null or empty"); + Assert.notNull(clazz, "Type must not be null"); String partToUse = detectAndSetIgnoreCase(source); diff --git a/src/main/java/org/springframework/data/repository/support/AnnotationAttribute.java b/src/main/java/org/springframework/data/repository/support/AnnotationAttribute.java index cb5517849..6031587b2 100644 --- a/src/main/java/org/springframework/data/repository/support/AnnotationAttribute.java +++ b/src/main/java/org/springframework/data/repository/support/AnnotationAttribute.java @@ -70,7 +70,7 @@ class AnnotationAttribute { */ public Optional getValueFrom(MethodParameter parameter) { - Assert.notNull(parameter, "MethodParameter must not be null!"); + Assert.notNull(parameter, "MethodParameter must not be null"); Annotation annotation = parameter.getParameterAnnotation(annotationType); return Optional.ofNullable(annotation).map(this::getValueFrom); @@ -84,7 +84,7 @@ class AnnotationAttribute { */ public Optional getValueFrom(AnnotatedElement annotatedElement) { - Assert.notNull(annotatedElement, "Annotated element must not be null!"); + Assert.notNull(annotatedElement, "Annotated element must not be null"); Annotation annotation = annotatedElement.getAnnotation(annotationType); return Optional.ofNullable(annotation).map(it -> getValueFrom(annotation)); @@ -98,7 +98,7 @@ class AnnotationAttribute { */ public Object getValueFrom(Annotation annotation) { - Assert.notNull(annotation, "Annotation must not be null!"); + Assert.notNull(annotation, "Annotation must not be null"); return attributeName.map(it -> AnnotationUtils.getValue(annotation, it)) .orElseGet(() -> AnnotationUtils.getValue(annotation)); } diff --git a/src/main/java/org/springframework/data/repository/support/DefaultRepositoryInvokerFactory.java b/src/main/java/org/springframework/data/repository/support/DefaultRepositoryInvokerFactory.java index e0fc003db..5ae0f30d7 100644 --- a/src/main/java/org/springframework/data/repository/support/DefaultRepositoryInvokerFactory.java +++ b/src/main/java/org/springframework/data/repository/support/DefaultRepositoryInvokerFactory.java @@ -63,8 +63,8 @@ public class DefaultRepositoryInvokerFactory implements RepositoryInvokerFactory */ public DefaultRepositoryInvokerFactory(Repositories repositories, ConversionService conversionService) { - Assert.notNull(repositories, "Repositories must not be null!"); - Assert.notNull(conversionService, "ConversionService must not be null!"); + Assert.notNull(repositories, "Repositories must not be null"); + Assert.notNull(conversionService, "ConversionService must not be null"); this.repositories = repositories; this.conversionService = conversionService; diff --git a/src/main/java/org/springframework/data/repository/support/DomainClassConverter.java b/src/main/java/org/springframework/data/repository/support/DomainClassConverter.java index 7bf183d60..15bbdd7df 100644 --- a/src/main/java/org/springframework/data/repository/support/DomainClassConverter.java +++ b/src/main/java/org/springframework/data/repository/support/DomainClassConverter.java @@ -60,7 +60,7 @@ public class DomainClassConverter namingAnnotation) { - Assert.notNull(method, "Method must not be null!"); + Assert.notNull(method, "Method must not be null"); this.parameters = new ArrayList<>(); for (int i = 0; i < method.getParameterCount(); i++) { @@ -87,7 +87,7 @@ class MethodParameters { */ public Optional getParameter(String name) { - Assert.hasText(name, "Parameter name must not be null!"); + Assert.hasText(name, "Parameter name must not be null"); return getParameters().stream()// .filter(it -> name.equals(it.getParameterName())).findFirst(); @@ -102,7 +102,7 @@ class MethodParameters { */ public List getParametersOfType(Class type) { - Assert.notNull(type, "Type must not be null!"); + Assert.notNull(type, "Type must not be null"); return getParameters().stream()// .filter(it -> it.getParameterType().equals(type))// @@ -117,7 +117,7 @@ class MethodParameters { */ public List getParametersWith(Class annotation) { - Assert.notNull(annotation, "Annotation must not be null!"); + Assert.notNull(annotation, "Annotation must not be null"); return getParameters().stream()// .filter(it -> it.hasParameterAnnotation(annotation))// diff --git a/src/main/java/org/springframework/data/repository/support/ReflectionRepositoryInvoker.java b/src/main/java/org/springframework/data/repository/support/ReflectionRepositoryInvoker.java index f09bc931a..bda6f99e8 100644 --- a/src/main/java/org/springframework/data/repository/support/ReflectionRepositoryInvoker.java +++ b/src/main/java/org/springframework/data/repository/support/ReflectionRepositoryInvoker.java @@ -49,7 +49,7 @@ import org.springframework.util.StringUtils; class ReflectionRepositoryInvoker implements RepositoryInvoker { private static final AnnotationAttribute PARAM_ANNOTATION = new AnnotationAttribute(Param.class); - private static final String NAME_NOT_FOUND = "Unable to detect parameter names for query method %s! Use @Param or compile with -parameters on JDK 8."; + private static final String NAME_NOT_FOUND = "Unable to detect parameter names for query method %s; Use @Param or compile with -parameters on JDK 8"; private final Object repository; private final CrudMethods methods; @@ -67,9 +67,9 @@ class ReflectionRepositoryInvoker implements RepositoryInvoker { public ReflectionRepositoryInvoker(Object repository, RepositoryMetadata metadata, ConversionService conversionService) { - Assert.notNull(repository, "Repository must not be null!"); - Assert.notNull(metadata, "RepositoryMetadata must not be null!"); - Assert.notNull(conversionService, "ConversionService must not be null!"); + Assert.notNull(repository, "Repository must not be null"); + Assert.notNull(metadata, "RepositoryMetadata must not be null"); + Assert.notNull(conversionService, "ConversionService must not be null"); this.repository = repository; this.methods = metadata.getCrudMethods(); @@ -129,7 +129,7 @@ class ReflectionRepositoryInvoker implements RepositoryInvoker { @Override public void invokeDeleteById(Object id) { - Assert.notNull(id, "Identifier must not be null!"); + Assert.notNull(id, "Identifier must not be null"); Method method = methods.getDeleteMethod() .orElseThrow(() -> new IllegalStateException("Repository doesn't have a delete-method declared")); @@ -145,10 +145,10 @@ class ReflectionRepositoryInvoker implements RepositoryInvoker { public Optional invokeQueryMethod(Method method, MultiValueMap parameters, Pageable pageable, Sort sort) { - Assert.notNull(method, "Method must not be null!"); - Assert.notNull(parameters, "Parameters must not be null!"); - Assert.notNull(pageable, "Pageable must not be null!"); - Assert.notNull(sort, "Sort must not be null!"); + Assert.notNull(method, "Method must not be null"); + Assert.notNull(parameters, "Parameters must not be null"); + Assert.notNull(pageable, "Pageable must not be null"); + Assert.notNull(sort, "Sort must not be null"); ReflectionUtils.makeAccessible(method); @@ -248,7 +248,7 @@ class ReflectionRepositoryInvoker implements RepositoryInvoker { */ protected Object convertId(Object id) { - Assert.notNull(id, "Id must not be null!"); + Assert.notNull(id, "Id must not be null"); TypeDescriptor idDescriptor = TypeDescriptor.forObject(id); if (idDescriptor.isAssignableTo(idTypeDescriptor)) { diff --git a/src/main/java/org/springframework/data/repository/support/Repositories.java b/src/main/java/org/springframework/data/repository/support/Repositories.java index ddb8504b8..46157b207 100644 --- a/src/main/java/org/springframework/data/repository/support/Repositories.java +++ b/src/main/java/org/springframework/data/repository/support/Repositories.java @@ -56,7 +56,7 @@ public class Repositories implements Iterable> { static final Repositories NONE = new Repositories(); private static final RepositoryFactoryInformation EMPTY_REPOSITORY_FACTORY_INFO = EmptyRepositoryFactoryInformation.INSTANCE; - private static final String DOMAIN_TYPE_MUST_NOT_BE_NULL = "Domain type must not be null!"; + private static final String DOMAIN_TYPE_MUST_NOT_BE_NULL = "Domain type must not be null"; private final Optional beanFactory; private final Map, String> repositoryBeanNames; @@ -82,7 +82,7 @@ public class Repositories implements Iterable> { */ public Repositories(ListableBeanFactory factory) { - Assert.notNull(factory, "ListableBeanFactory must not be null!"); + Assert.notNull(factory, "ListableBeanFactory must not be null"); this.beanFactory = Optional.of(factory); this.repositoryFactoryInfos = new HashMap<>(); @@ -326,7 +326,7 @@ public class Repositories implements Iterable> { */ private Class getRepositoryDomainTypeFor(Class domainType) { - Assert.notNull(domainType, "Domain type must not be null!"); + Assert.notNull(domainType, "Domain type must not be null"); Set> declaredTypes = repositoryBeanNames.keySet(); diff --git a/src/main/java/org/springframework/data/repository/util/ClassUtils.java b/src/main/java/org/springframework/data/repository/util/ClassUtils.java index f35a906a7..1b80f0f12 100644 --- a/src/main/java/org/springframework/data/repository/util/ClassUtils.java +++ b/src/main/java/org/springframework/data/repository/util/ClassUtils.java @@ -139,15 +139,15 @@ public abstract class ClassUtils { */ public static void assertReturnTypeAssignable(Method method, Class... types) { - Assert.notNull(method, "Method must not be null!"); - Assert.notEmpty(types, "Types must not be null or empty!"); + Assert.notNull(method, "Method must not be null"); + Assert.notEmpty(types, "Types must not be null or empty"); TypeInformation returnType = getEffectivelyReturnedTypeFrom(method); Arrays.stream(types)// .filter(it -> it.isAssignableFrom(returnType.getType()))// .findAny().orElseThrow(() -> new IllegalStateException( - "Method has to have one of the following return types " + Arrays.toString(types))); + "Method has to have one of the following return types: " + Arrays.toString(types))); } /** diff --git a/src/main/java/org/springframework/data/repository/util/QueryExecutionConverters.java b/src/main/java/org/springframework/data/repository/util/QueryExecutionConverters.java index 3c1810846..e8a3216b0 100644 --- a/src/main/java/org/springframework/data/repository/util/QueryExecutionConverters.java +++ b/src/main/java/org/springframework/data/repository/util/QueryExecutionConverters.java @@ -126,7 +126,7 @@ public abstract class QueryExecutionConverters { */ public static boolean supports(Class type) { - Assert.notNull(type, "Type must not be null!"); + Assert.notNull(type, "Type must not be null"); return supportsCache.computeIfAbsent(type, key -> { @@ -148,7 +148,7 @@ public abstract class QueryExecutionConverters { */ public static boolean supportsUnwrapping(Class type) { - Assert.notNull(type, "Type must not be null!"); + Assert.notNull(type, "Type must not be null"); if (NullableWrapperConverters.supportsUnwrapping(type)) { return NullableWrapperConverters.supportsUnwrapping(type); @@ -195,7 +195,7 @@ public abstract class QueryExecutionConverters { */ public static void registerConvertersIn(ConfigurableConversionService conversionService) { - Assert.notNull(conversionService, "ConversionService must not be null!"); + Assert.notNull(conversionService, "ConversionService must not be null"); conversionService.removeConvertible(Collection.class, Object.class); @@ -265,7 +265,7 @@ public abstract class QueryExecutionConverters { @Nullable public static ExecutionAdapter getExecutionAdapter(Class returnType) { - Assert.notNull(returnType, "Return type must not be null!"); + Assert.notNull(returnType, "Return type must not be null"); return EXECUTION_ADAPTER.get(returnType); } @@ -296,7 +296,7 @@ public abstract class QueryExecutionConverters { */ AbstractWrapperTypeConverter(Object nullValue) { - Assert.notNull(nullValue, "Null value must not be null!"); + Assert.notNull(nullValue, "Null value must not be null"); this.nullValue = nullValue; this.wrapperTypes = Collections.singleton(nullValue.getClass()); diff --git a/src/main/java/org/springframework/data/repository/util/ReactiveWrapperConverters.java b/src/main/java/org/springframework/data/repository/util/ReactiveWrapperConverters.java index b28039821..7d65cb139 100644 --- a/src/main/java/org/springframework/data/repository/util/ReactiveWrapperConverters.java +++ b/src/main/java/org/springframework/data/repository/util/ReactiveWrapperConverters.java @@ -102,7 +102,7 @@ public abstract class ReactiveWrapperConverters { */ private static ConversionService registerConvertersIn(ConfigurableConversionService conversionService) { - Assert.notNull(conversionService, "ConversionService must not be null!"); + Assert.notNull(conversionService, "ConversionService must not be null"); if (ReactiveWrappers.isAvailable(ReactiveLibrary.PROJECT_REACTOR)) { @@ -163,8 +163,8 @@ public abstract class ReactiveWrapperConverters { @SuppressWarnings("unchecked") public static T toWrapper(Object reactiveObject, Class targetWrapperType) { - Assert.notNull(reactiveObject, "Reactive source object must not be null!"); - Assert.notNull(targetWrapperType, "Reactive target type must not be null!"); + Assert.notNull(reactiveObject, "Reactive source object must not be null"); + Assert.notNull(targetWrapperType, "Reactive target type must not be null"); if (targetWrapperType.isAssignableFrom(reactiveObject.getClass())) { return (T) reactiveObject; @@ -183,8 +183,8 @@ public abstract class ReactiveWrapperConverters { @SuppressWarnings("unchecked") public static T map(Object reactiveObject, Function converter) { - Assert.notNull(reactiveObject, "Reactive source object must not be null!"); - Assert.notNull(converter, "Converter must not be null!"); + Assert.notNull(reactiveObject, "Reactive source object must not be null"); + Assert.notNull(converter, "Converter must not be null"); return getFirst(reactiveObject)// .map(it -> (T) it.map(reactiveObject, converter))// @@ -206,8 +206,8 @@ public abstract class ReactiveWrapperConverters { */ public static boolean canConvert(Class sourceType, Class targetType) { - Assert.notNull(sourceType, "Source type must not be null!"); - Assert.notNull(targetType, "Target type must not be null!"); + Assert.notNull(sourceType, "Source type must not be null"); + Assert.notNull(targetType, "Target type must not be null"); return GENERIC_CONVERSION_SERVICE.canConvert(sourceType, targetType); } diff --git a/src/main/java/org/springframework/data/repository/util/ReactiveWrappers.java b/src/main/java/org/springframework/data/repository/util/ReactiveWrappers.java index 477aa2db8..eaa52d194 100644 --- a/src/main/java/org/springframework/data/repository/util/ReactiveWrappers.java +++ b/src/main/java/org/springframework/data/repository/util/ReactiveWrappers.java @@ -104,7 +104,7 @@ public abstract class ReactiveWrappers { */ public static boolean isAvailable(ReactiveLibrary reactiveLibrary) { - Assert.notNull(reactiveLibrary, "Reactive library must not be null!"); + Assert.notNull(reactiveLibrary, "Reactive library must not be null"); switch (reactiveLibrary) { case PROJECT_REACTOR: @@ -138,7 +138,7 @@ public abstract class ReactiveWrappers { */ public static boolean usesReactiveType(Class type) { - Assert.notNull(type, "Type must not be null!"); + Assert.notNull(type, "Type must not be null"); return Arrays.stream(type.getMethods())// .flatMap(ReflectionUtils::returnTypeAndParameters)// @@ -153,7 +153,7 @@ public abstract class ReactiveWrappers { */ public static boolean isNoValueType(Class type) { - Assert.notNull(type, "Candidate type must not be null!"); + Assert.notNull(type, "Candidate type must not be null"); return findDescriptor(type).map(ReactiveTypeDescriptor::isNoValue).orElse(false); } @@ -166,7 +166,7 @@ public abstract class ReactiveWrappers { */ public static boolean isSingleValueType(Class type) { - Assert.notNull(type, "Candidate type must not be null!"); + Assert.notNull(type, "Candidate type must not be null"); return findDescriptor(type).map(it -> !it.isMultiValue() && !it.isNoValue()).orElse(false); } @@ -181,7 +181,7 @@ public abstract class ReactiveWrappers { */ public static boolean isMultiValueType(Class type) { - Assert.notNull(type, "Candidate type must not be null!"); + Assert.notNull(type, "Candidate type must not be null"); // Prevent single-types with a multi-hierarchy supertype to be reported as multi type // See Mono implements Publisher @@ -197,7 +197,7 @@ public abstract class ReactiveWrappers { */ private static boolean isWrapper(Class type) { - Assert.notNull(type, "Candidate type must not be null!"); + Assert.notNull(type, "Candidate type must not be null"); return isNoValueType(type) || isSingleValueType(type) || isMultiValueType(type); } @@ -210,7 +210,7 @@ public abstract class ReactiveWrappers { */ private static Optional findDescriptor(Class type) { - Assert.notNull(type, "Wrapper type must not be null!"); + Assert.notNull(type, "Wrapper type must not be null"); ReactiveAdapterRegistry adapterRegistry = ReactiveWrapperConverters.RegistryHolder.REACTIVE_ADAPTER_REGISTRY; diff --git a/src/main/java/org/springframework/data/spel/EvaluationContextExtensionInformation.java b/src/main/java/org/springframework/data/spel/EvaluationContextExtensionInformation.java index 224f357a6..c226b1d1b 100644 --- a/src/main/java/org/springframework/data/spel/EvaluationContextExtensionInformation.java +++ b/src/main/java/org/springframework/data/spel/EvaluationContextExtensionInformation.java @@ -72,7 +72,7 @@ class EvaluationContextExtensionInformation { */ public EvaluationContextExtensionInformation(Class type) { - Assert.notNull(type, "Extension type must not be null!"); + Assert.notNull(type, "Extension type must not be null"); Class rootObjectType = org.springframework.data.util.ReflectionUtils.findRequiredMethod(type, "getRootObject") .getReturnType(); @@ -154,7 +154,7 @@ class EvaluationContextExtensionInformation { */ public ExtensionTypeInformation(Class type) { - Assert.notNull(type, "Extension type must not be null!"); + Assert.notNull(type, "Extension type must not be null"); this.functions = discoverDeclaredFunctions(type); this.properties = discoverDeclaredProperties(type); @@ -256,7 +256,7 @@ class EvaluationContextExtensionInformation { */ RootObjectInformation(Class type) { - Assert.notNull(type, "Type must not be null!"); + Assert.notNull(type, "Type must not be null"); this.accessors = new HashMap<>(); this.methods = new Methods(); diff --git a/src/main/java/org/springframework/data/spel/ExtensionAwareEvaluationContextProvider.java b/src/main/java/org/springframework/data/spel/ExtensionAwareEvaluationContextProvider.java index 83b7519e3..10d6c81df 100644 --- a/src/main/java/org/springframework/data/spel/ExtensionAwareEvaluationContextProvider.java +++ b/src/main/java/org/springframework/data/spel/ExtensionAwareEvaluationContextProvider.java @@ -209,7 +209,7 @@ public class ExtensionAwareEvaluationContextProvider implements EvaluationContex */ public ExtensionAwarePropertyAccessor(Collection extensions) { - Assert.notNull(extensions, "Extensions must not be null!"); + Assert.notNull(extensions, "Extensions must not be null"); this.adapters = toAdapters(extensions); this.adapterMap = adapters.stream()// @@ -368,8 +368,8 @@ public class ExtensionAwareEvaluationContextProvider implements EvaluationContex public EvaluationContextExtensionAdapter(EvaluationContextExtension extension, EvaluationContextExtensionInformation information) { - Assert.notNull(extension, "Extension must not be null!"); - Assert.notNull(information, "Extension information must not be null!"); + Assert.notNull(extension, "Extension must not be null"); + Assert.notNull(information, "Extension information must not be null"); Optional target = Optional.ofNullable(extension.getRootObject()); EvaluationContextExtensionInformation.ExtensionTypeInformation extensionTypeInformation = information diff --git a/src/main/java/org/springframework/data/spel/Functions.java b/src/main/java/org/springframework/data/spel/Functions.java index ac41a71a3..2c3b06f6d 100644 --- a/src/main/java/org/springframework/data/spel/Functions.java +++ b/src/main/java/org/springframework/data/spel/Functions.java @@ -39,7 +39,7 @@ import org.springframework.util.MultiValueMap; class Functions { private static final String MESSAGE_TEMPLATE = "There are multiple matching methods of name '%s' for parameter types (%s), but no " - + "exact match. Make sure to provide only one matching overload or one with exactly those types."; + + "exact match; Make sure to provide only one matching overload or one with exactly those types"; private final MultiValueMap functions = new LinkedMultiValueMap<>(); diff --git a/src/main/java/org/springframework/data/spel/spi/Function.java b/src/main/java/org/springframework/data/spel/spi/Function.java index 7cb7bca2e..6843c24ef 100644 --- a/src/main/java/org/springframework/data/spel/spi/Function.java +++ b/src/main/java/org/springframework/data/spel/spi/Function.java @@ -51,7 +51,7 @@ public class Function { this(method, null); - Assert.isTrue(Modifier.isStatic(method.getModifiers()), "Method must be static!"); + Assert.isTrue(Modifier.isStatic(method.getModifiers()), "Method must be static"); } /** @@ -62,9 +62,9 @@ public class Function { */ public Function(Method method, @Nullable Object target) { - Assert.notNull(method, "Method must not be null!"); + Assert.notNull(method, "Method must not be null"); Assert.isTrue(target != null || Modifier.isStatic(method.getModifiers()), - "Method must either be static or a non-static one with a target object!"); + "Method must either be static or a non-static one with a target object"); this.method = method; this.target = target; diff --git a/src/main/java/org/springframework/data/support/PageableExecutionUtils.java b/src/main/java/org/springframework/data/support/PageableExecutionUtils.java index 756c77461..c47935dd0 100644 --- a/src/main/java/org/springframework/data/support/PageableExecutionUtils.java +++ b/src/main/java/org/springframework/data/support/PageableExecutionUtils.java @@ -50,9 +50,9 @@ public abstract class PageableExecutionUtils { */ public static Page getPage(List content, Pageable pageable, LongSupplier totalSupplier) { - Assert.notNull(content, "Content must not be null!"); - Assert.notNull(pageable, "Pageable must not be null!"); - Assert.notNull(totalSupplier, "TotalSupplier must not be null!"); + Assert.notNull(content, "Content must not be null"); + Assert.notNull(pageable, "Pageable must not be null"); + Assert.notNull(totalSupplier, "TotalSupplier must not be null"); if (pageable.isUnpaged() || pageable.getOffset() == 0) { diff --git a/src/main/java/org/springframework/data/support/PersistableIsNewStrategy.java b/src/main/java/org/springframework/data/support/PersistableIsNewStrategy.java index 47cc3794c..d582d9fe8 100644 --- a/src/main/java/org/springframework/data/support/PersistableIsNewStrategy.java +++ b/src/main/java/org/springframework/data/support/PersistableIsNewStrategy.java @@ -31,7 +31,7 @@ public enum PersistableIsNewStrategy implements IsNewStrategy { @Override public boolean isNew(Object entity) { - Assert.notNull(entity, "Entity must not be null!"); + Assert.notNull(entity, "Entity must not be null"); if (!(entity instanceof Persistable)) { throw new IllegalArgumentException( diff --git a/src/main/java/org/springframework/data/transaction/ChainedTransactionManager.java b/src/main/java/org/springframework/data/transaction/ChainedTransactionManager.java index da9e33ef6..b06479f54 100644 --- a/src/main/java/org/springframework/data/transaction/ChainedTransactionManager.java +++ b/src/main/java/org/springframework/data/transaction/ChainedTransactionManager.java @@ -94,9 +94,9 @@ public class ChainedTransactionManager implements PlatformTransactionManager { ChainedTransactionManager(SynchronizationManager synchronizationManager, PlatformTransactionManager... transactionManagers) { - Assert.notNull(synchronizationManager, "SynchronizationManager must not be null!"); - Assert.notNull(transactionManagers, "Transaction managers must not be null!"); - Assert.isTrue(transactionManagers.length > 0, "At least one PlatformTransactionManager must be given!"); + Assert.notNull(synchronizationManager, "SynchronizationManager must not be null"); + Assert.notNull(transactionManagers, "Transaction managers must not be null"); + Assert.isTrue(transactionManagers.length > 0, "At least one PlatformTransactionManager must be given"); this.synchronizationManager = synchronizationManager; this.transactionManagers = asList(transactionManagers); diff --git a/src/main/java/org/springframework/data/transaction/MultiTransactionStatus.java b/src/main/java/org/springframework/data/transaction/MultiTransactionStatus.java index 8c84ba092..0ce4f1227 100644 --- a/src/main/java/org/springframework/data/transaction/MultiTransactionStatus.java +++ b/src/main/java/org/springframework/data/transaction/MultiTransactionStatus.java @@ -49,7 +49,7 @@ class MultiTransactionStatus implements TransactionStatus { */ public MultiTransactionStatus(PlatformTransactionManager mainTransactionManager) { - Assert.notNull(mainTransactionManager, "TransactionManager must not be null!"); + Assert.notNull(mainTransactionManager, "TransactionManager must not be null"); this.mainTransactionManager = mainTransactionManager; } @@ -144,7 +144,7 @@ class MultiTransactionStatus implements TransactionStatus { private void addSavePoint(TransactionStatus status, Object savepoint) { - Assert.notNull(status, "TransactionStatus must not be null!"); + Assert.notNull(status, "TransactionStatus must not be null"); this.savepoints.put(status, savepoint); } diff --git a/src/main/java/org/springframework/data/util/AnnotationDetectionFieldCallback.java b/src/main/java/org/springframework/data/util/AnnotationDetectionFieldCallback.java index 6dfe1b766..1a888f540 100755 --- a/src/main/java/org/springframework/data/util/AnnotationDetectionFieldCallback.java +++ b/src/main/java/org/springframework/data/util/AnnotationDetectionFieldCallback.java @@ -45,7 +45,7 @@ public class AnnotationDetectionFieldCallback implements FieldCallback { */ public AnnotationDetectionFieldCallback(Class annotationType) { - Assert.notNull(annotationType, "AnnotationType must not be null!"); + Assert.notNull(annotationType, "AnnotationType must not be null"); this.annotationType = annotationType; } @@ -121,7 +121,7 @@ public class AnnotationDetectionFieldCallback implements FieldCallback { @SuppressWarnings("unchecked") public T getValue(Object source) { - Assert.notNull(source, "Source object must not be null!"); + Assert.notNull(source, "Source object must not be null"); Field field = this.field; diff --git a/src/main/java/org/springframework/data/util/AnnotationDetectionMethodCallback.java b/src/main/java/org/springframework/data/util/AnnotationDetectionMethodCallback.java index e9dbeda12..20a5989a8 100644 --- a/src/main/java/org/springframework/data/util/AnnotationDetectionMethodCallback.java +++ b/src/main/java/org/springframework/data/util/AnnotationDetectionMethodCallback.java @@ -34,7 +34,7 @@ import org.springframework.util.ReflectionUtils.MethodCallback; */ public class AnnotationDetectionMethodCallback implements MethodCallback { - private static final String MULTIPLE_FOUND = "Found annotation %s both on %s and %s! Make sure only one of them is annotated with it!"; + private static final String MULTIPLE_FOUND = "Found annotation %s both on %s and %s; Make sure only one of them is annotated with it"; private final boolean enforceUniqueness; private final Class annotationType; @@ -59,7 +59,7 @@ public class AnnotationDetectionMethodCallback implements */ public AnnotationDetectionMethodCallback(Class annotationType, boolean enforceUniqueness) { - Assert.notNull(annotationType, "Annotation type must not be null!"); + Assert.notNull(annotationType, "Annotation type must not be null"); this.annotationType = annotationType; this.enforceUniqueness = enforceUniqueness; diff --git a/src/main/java/org/springframework/data/util/BeanLookup.java b/src/main/java/org/springframework/data/util/BeanLookup.java index 4f22225c0..ea368e995 100644 --- a/src/main/java/org/springframework/data/util/BeanLookup.java +++ b/src/main/java/org/springframework/data/util/BeanLookup.java @@ -47,7 +47,7 @@ public abstract class BeanLookup { */ public static Lazy lazyIfAvailable(Class type, BeanFactory beanFactory) { - Assert.notNull(type, "Type must not be null!"); + Assert.notNull(type, "Type must not be null"); Assert.isInstanceOf(ListableBeanFactory.class, beanFactory); return Lazy.of(() -> lookupBean(type, (ListableBeanFactory) beanFactory)); diff --git a/src/main/java/org/springframework/data/util/ClassTypeInformation.java b/src/main/java/org/springframework/data/util/ClassTypeInformation.java index 84a460358..a3c992d0a 100644 --- a/src/main/java/org/springframework/data/util/ClassTypeInformation.java +++ b/src/main/java/org/springframework/data/util/ClassTypeInformation.java @@ -67,7 +67,7 @@ public class ClassTypeInformation extends TypeDiscoverer { */ public static ClassTypeInformation from(Class type) { - Assert.notNull(type, "Type must not be null!"); + Assert.notNull(type, "Type must not be null"); return (ClassTypeInformation) cache.computeIfAbsent(type, ClassTypeInformation::new); } @@ -80,7 +80,7 @@ public class ClassTypeInformation extends TypeDiscoverer { */ public static TypeInformation fromReturnTypeOf(Method method) { - Assert.notNull(method, "Method must not be null!"); + Assert.notNull(method, "Method must not be null"); return (TypeInformation) ClassTypeInformation.from(method.getDeclaringClass()) .createInfo(method.getGenericReturnType()); } diff --git a/src/main/java/org/springframework/data/util/CustomCollections.java b/src/main/java/org/springframework/data/util/CustomCollections.java index 7fd273e3a..d4c799673 100644 --- a/src/main/java/org/springframework/data/util/CustomCollections.java +++ b/src/main/java/org/springframework/data/util/CustomCollections.java @@ -123,7 +123,7 @@ public class CustomCollections { */ public static boolean isMapBaseType(Class type) { - Assert.notNull(type, "Type must not be null!"); + Assert.notNull(type, "Type must not be null"); return MAP_TYPES.has(type); } @@ -180,7 +180,7 @@ public class CustomCollections { */ public static void registerConvertersIn(ConverterRegistry registry) { - Assert.notNull(registry, "ConverterRegistry must not be null!"); + Assert.notNull(registry, "ConverterRegistry must not be null"); REGISTRARS.forEach(it -> it.registerConvertersIn(registry)); } @@ -215,7 +215,7 @@ public class CustomCollections { public boolean hasSuperTypeFor(Class type) { - Assert.notNull(type, "Type must not be null!"); + Assert.notNull(type, "Type must not be null"); return isOneOf(type, IS_ASSIGNABLE, IS_NOT_NULL); } @@ -228,7 +228,7 @@ public class CustomCollections { */ public boolean has(Class type) { - Assert.notNull(type, "Type must not be null!"); + Assert.notNull(type, "Type must not be null"); return isOneOf(type, EQUALS, IS_NOT_NULL); } @@ -242,9 +242,9 @@ public class CustomCollections { */ public Class getSuperType(Class type) { - Assert.notNull(type, "Type must not be null!"); + Assert.notNull(type, "Type must not be null"); - Supplier message = () -> String.format("Type %s not contained in candidates %s!", type, types); + Supplier message = () -> String.format("Type %s not contained in candidates %s", type, types); return isOneOf(type, (l, r) -> l.isAssignableFrom(r), rejectNull(message)); } @@ -278,7 +278,7 @@ public class CustomCollections { */ private static Function, Class> rejectNull(Supplier message) { - Assert.notNull(message, "Message must not be null!"); + Assert.notNull(message, "Message must not be null"); return candidate -> { diff --git a/src/main/java/org/springframework/data/util/Lazy.java b/src/main/java/org/springframework/data/util/Lazy.java index 33a70e416..b0f1fd3ab 100644 --- a/src/main/java/org/springframework/data/util/Lazy.java +++ b/src/main/java/org/springframework/data/util/Lazy.java @@ -86,7 +86,7 @@ public class Lazy implements Supplier { */ public static Lazy of(T value) { - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(value, "Value must not be null"); return new Lazy<>(() -> value); } @@ -137,7 +137,7 @@ public class Lazy implements Supplier { */ public Lazy or(Supplier supplier) { - Assert.notNull(supplier, "Supplier must not be null!"); + Assert.notNull(supplier, "Supplier must not be null"); return Lazy.of(() -> orElseGet(supplier)); } @@ -150,7 +150,7 @@ public class Lazy implements Supplier { */ public Lazy or(T value) { - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(value, "Value must not be null"); return Lazy.of(() -> orElse(value)); } @@ -180,7 +180,7 @@ public class Lazy implements Supplier { @Nullable private T orElseGet(Supplier supplier) { - Assert.notNull(supplier, "Default value supplier must not be null!"); + Assert.notNull(supplier, "Default value supplier must not be null"); T value = getNullable(); @@ -195,7 +195,7 @@ public class Lazy implements Supplier { */ public Lazy map(Function function) { - Assert.notNull(function, "Function must not be null!"); + Assert.notNull(function, "Function must not be null"); return Lazy.of(() -> function.apply(get())); } @@ -208,7 +208,7 @@ public class Lazy implements Supplier { */ public Lazy flatMap(Function> function) { - Assert.notNull(function, "Function must not be null!"); + Assert.notNull(function, "Function must not be null"); return Lazy.of(() -> function.apply(get()).get()); } diff --git a/src/main/java/org/springframework/data/util/MethodInvocationRecorder.java b/src/main/java/org/springframework/data/util/MethodInvocationRecorder.java index 9e6543f23..17ae62634 100644 --- a/src/main/java/org/springframework/data/util/MethodInvocationRecorder.java +++ b/src/main/java/org/springframework/data/util/MethodInvocationRecorder.java @@ -70,8 +70,8 @@ public class MethodInvocationRecorder { */ public static Recorded forProxyOf(Class type) { - Assert.notNull(type, "Type must not be null!"); - Assert.isTrue(!Modifier.isFinal(type.getModifiers()), "Type to record invocations on must not be final!"); + Assert.notNull(type, "Type must not be null"); + Assert.isTrue(!Modifier.isFinal(type.getModifiers()), "Type to record invocations on must not be final"); return new MethodInvocationRecorder().create(type); } @@ -172,7 +172,7 @@ public class MethodInvocationRecorder { public InvocationInformation(Recorded recorded, @Nullable Method invokedMethod) { - Assert.notNull(recorded, "Recorded must not be null!"); + Assert.notNull(recorded, "Recorded must not be null"); this.recorded = recorded; this.invokedMethod = invokedMethod; @@ -317,7 +317,7 @@ public class MethodInvocationRecorder { */ public Recorded record(Function converter) { - Assert.notNull(converter, "Function must not be null!"); + Assert.notNull(converter, "Function must not be null"); return new Recorded(converter.apply(currentInstance), recorder); } @@ -330,7 +330,7 @@ public class MethodInvocationRecorder { */ public Recorded record(ToCollectionConverter converter) { - Assert.notNull(converter, "Converter must not be null!"); + Assert.notNull(converter, "Converter must not be null"); return new Recorded(converter.apply(currentInstance).iterator().next(), recorder); } @@ -343,7 +343,7 @@ public class MethodInvocationRecorder { */ public Recorded record(ToMapConverter converter) { - Assert.notNull(converter, "Converter must not be null!"); + Assert.notNull(converter, "Converter must not be null"); return new Recorded(converter.apply(currentInstance).values().iterator().next(), recorder); } diff --git a/src/main/java/org/springframework/data/util/NullableWrapperConverters.java b/src/main/java/org/springframework/data/util/NullableWrapperConverters.java index c8ae553e4..2478c0e39 100644 --- a/src/main/java/org/springframework/data/util/NullableWrapperConverters.java +++ b/src/main/java/org/springframework/data/util/NullableWrapperConverters.java @@ -103,7 +103,7 @@ public abstract class NullableWrapperConverters { */ public static boolean supports(Class type) { - Assert.notNull(type, "Type must not be null!"); + Assert.notNull(type, "Type must not be null"); return supportsCache.computeIfAbsent(type, key -> { @@ -125,7 +125,7 @@ public abstract class NullableWrapperConverters { */ public static boolean supportsUnwrapping(Class type) { - Assert.notNull(type, "Type must not be null!"); + Assert.notNull(type, "Type must not be null"); for (WrapperType candidate : UNWRAPPER_TYPES) { if (candidate.getType().isAssignableFrom(type)) { @@ -154,7 +154,7 @@ public abstract class NullableWrapperConverters { */ public static void registerConvertersIn(ConverterRegistry registry) { - Assert.notNull(registry, "ConversionService must not be null!"); + Assert.notNull(registry, "ConversionService must not be null"); registry.addConverter(NullableWrapperToJdk8OptionalConverter.INSTANCE); @@ -232,7 +232,7 @@ public abstract class NullableWrapperConverters { */ protected AbstractWrapperTypeConverter(Object nullValue) { - Assert.notNull(nullValue, "Null value must not be null!"); + Assert.notNull(nullValue, "Null value must not be null"); this.nullValue = nullValue; this.wrapperTypes = Collections.singleton(nullValue.getClass()); diff --git a/src/main/java/org/springframework/data/util/Optionals.java b/src/main/java/org/springframework/data/util/Optionals.java index c04763c59..7e31b2942 100644 --- a/src/main/java/org/springframework/data/util/Optionals.java +++ b/src/main/java/org/springframework/data/util/Optionals.java @@ -43,7 +43,7 @@ public interface Optionals { */ public static boolean isAnyPresent(Optional... optionals) { - Assert.notNull(optionals, "Optionals must not be null!"); + Assert.notNull(optionals, "Optionals must not be null"); return Arrays.stream(optionals).anyMatch(Optional::isPresent); } @@ -57,7 +57,7 @@ public interface Optionals { @SafeVarargs public static Stream toStream(Optional... optionals) { - Assert.notNull(optionals, "Optional must not be null!"); + Assert.notNull(optionals, "Optional must not be null"); return Arrays.asList(optionals).stream().flatMap(it -> it.map(Stream::of).orElseGet(Stream::empty)); } @@ -71,8 +71,8 @@ public interface Optionals { */ public static Optional firstNonEmpty(Iterable source, Function> function) { - Assert.notNull(source, "Source must not be null!"); - Assert.notNull(function, "Function must not be null!"); + Assert.notNull(source, "Source must not be null"); + Assert.notNull(function, "Function must not be null"); return Streamable.of(source).stream()// .map(function::apply)// @@ -89,8 +89,8 @@ public interface Optionals { */ public static T firstNonEmpty(Iterable source, Function function, T defaultValue) { - Assert.notNull(source, "Source must not be null!"); - Assert.notNull(function, "Function must not be null!"); + Assert.notNull(source, "Source must not be null"); + Assert.notNull(function, "Function must not be null"); return Streamable.of(source).stream()// .map(function::apply)// @@ -107,7 +107,7 @@ public interface Optionals { @SafeVarargs public static Optional firstNonEmpty(Supplier>... suppliers) { - Assert.notNull(suppliers, "Suppliers must not be null!"); + Assert.notNull(suppliers, "Suppliers must not be null"); return firstNonEmpty(Streamable.of(suppliers)); } @@ -120,7 +120,7 @@ public interface Optionals { */ public static Optional firstNonEmpty(Iterable>> suppliers) { - Assert.notNull(suppliers, "Suppliers must not be null!"); + Assert.notNull(suppliers, "Suppliers must not be null"); return Streamable.of(suppliers).stream()// .map(Supplier::get)// @@ -137,7 +137,7 @@ public interface Optionals { */ public static Optional next(Iterator iterator) { - Assert.notNull(iterator, "Iterator must not be null!"); + Assert.notNull(iterator, "Iterator must not be null"); return iterator.hasNext() ? Optional.of(iterator.next()) : Optional.empty(); } @@ -163,9 +163,9 @@ public interface Optionals { */ public static void ifAllPresent(Optional left, Optional right, BiConsumer consumer) { - Assert.notNull(left, "Optional must not be null!"); - Assert.notNull(right, "Optional must not be null!"); - Assert.notNull(consumer, "Consumer must not be null!"); + Assert.notNull(left, "Optional must not be null"); + Assert.notNull(right, "Optional must not be null"); + Assert.notNull(consumer, "Consumer must not be null"); mapIfAllPresent(left, right, (l, r) -> { consumer.accept(l, r); @@ -184,9 +184,9 @@ public interface Optionals { public static Optional mapIfAllPresent(Optional left, Optional right, BiFunction function) { - Assert.notNull(left, "Optional must not be null!"); - Assert.notNull(right, "Optional must not be null!"); - Assert.notNull(function, "BiFunctionmust not be null!"); + Assert.notNull(left, "Optional must not be null"); + Assert.notNull(right, "Optional must not be null"); + Assert.notNull(function, "BiFunction must not be null"); return left.flatMap(l -> right.map(r -> function.apply(l, r))); } @@ -200,9 +200,9 @@ public interface Optionals { */ public static void ifPresentOrElse(Optional optional, Consumer consumer, Runnable runnable) { - Assert.notNull(optional, "Optional must not be null!"); - Assert.notNull(consumer, "Consumer must not be null!"); - Assert.notNull(runnable, "Runnable must not be null!"); + Assert.notNull(optional, "Optional must not be null"); + Assert.notNull(consumer, "Consumer must not be null"); + Assert.notNull(runnable, "Runnable must not be null"); if (optional.isPresent()) { optional.ifPresent(consumer); diff --git a/src/main/java/org/springframework/data/util/Pair.java b/src/main/java/org/springframework/data/util/Pair.java index 547817546..5e9021be0 100644 --- a/src/main/java/org/springframework/data/util/Pair.java +++ b/src/main/java/org/springframework/data/util/Pair.java @@ -41,8 +41,8 @@ public final class Pair { private Pair(S first, T second) { - Assert.notNull(first, "First must not be null!"); - Assert.notNull(second, "Second must not be null!"); + Assert.notNull(first, "First must not be null"); + Assert.notNull(second, "Second must not be null"); this.first = first; this.second = second; diff --git a/src/main/java/org/springframework/data/util/ParameterTypes.java b/src/main/java/org/springframework/data/util/ParameterTypes.java index 923a3a03b..1391ee80e 100644 --- a/src/main/java/org/springframework/data/util/ParameterTypes.java +++ b/src/main/java/org/springframework/data/util/ParameterTypes.java @@ -74,7 +74,7 @@ public class ParameterTypes { */ public static ParameterTypes of(List types) { - Assert.notNull(types, "Types must not be null!"); + Assert.notNull(types, "Types must not be null"); return cache.computeIfAbsent(types, ParameterTypes::new); } @@ -87,8 +87,8 @@ public class ParameterTypes { */ static ParameterTypes of(Class... types) { - Assert.notNull(types, "Types must not be null!"); - Assert.noNullElements(types, "Types must not have null elements!"); + Assert.notNull(types, "Types must not be null"); + Assert.noNullElements(types, "Types must not have null elements"); return of(Arrays.stream(types) // .map(TypeDescriptor::valueOf) // @@ -104,7 +104,7 @@ public class ParameterTypes { */ public boolean areValidFor(Method method) { - Assert.notNull(method, "Method must not be null!"); + Assert.notNull(method, "Method must not be null"); // Direct matches if (areValidTypes(method)) { @@ -150,7 +150,7 @@ public class ParameterTypes { */ boolean hasTypes(Class... types) { - Assert.notNull(types, "Types must not be null!"); + Assert.notNull(types, "Types must not be null"); return Arrays.stream(types) // .map(TypeDescriptor::valueOf) // @@ -253,7 +253,7 @@ public class ParameterTypes { */ private boolean areValidTypes(Method method) { - Assert.notNull(method, "Method must not be null!"); + Assert.notNull(method, "Method must not be null"); if (method.getParameterCount() != types.size()) { return false; diff --git a/src/main/java/org/springframework/data/util/ParsingUtils.java b/src/main/java/org/springframework/data/util/ParsingUtils.java index 27c06b185..bc2f6a9ec 100644 --- a/src/main/java/org/springframework/data/util/ParsingUtils.java +++ b/src/main/java/org/springframework/data/util/ParsingUtils.java @@ -70,15 +70,15 @@ public abstract class ParsingUtils { */ public static String reconcatenateCamelCase(String source, String delimiter) { - Assert.notNull(source, "Source string must not be null!"); - Assert.notNull(delimiter, "Delimiter must not be null!"); + Assert.notNull(source, "Source string must not be null"); + Assert.notNull(delimiter, "Delimiter must not be null"); return StringUtils.collectionToDelimitedString(splitCamelCaseToLower(source), delimiter); } private static List split(String source, boolean toLower) { - Assert.notNull(source, "Source string must not be null!"); + Assert.notNull(source, "Source string must not be null"); String[] parts = CAMEL_CASE.split(source); List result = new ArrayList<>(parts.length); diff --git a/src/main/java/org/springframework/data/util/Predicates.java b/src/main/java/org/springframework/data/util/Predicates.java index b34fe69a4..fecb85925 100644 --- a/src/main/java/org/springframework/data/util/Predicates.java +++ b/src/main/java/org/springframework/data/util/Predicates.java @@ -52,7 +52,7 @@ public interface Predicates { */ static Predicate negate(Predicate predicate) { - Assert.notNull(predicate, "Predicate must not be null!"); + Assert.notNull(predicate, "Predicate must not be null"); return predicate.negate(); } } diff --git a/src/main/java/org/springframework/data/util/ProxyUtils.java b/src/main/java/org/springframework/data/util/ProxyUtils.java index 4a82215e0..bf4bd625d 100644 --- a/src/main/java/org/springframework/data/util/ProxyUtils.java +++ b/src/main/java/org/springframework/data/util/ProxyUtils.java @@ -51,7 +51,7 @@ public abstract class ProxyUtils { */ public static Class getUserClass(Class type) { - Assert.notNull(type, "Type must not be null!"); + Assert.notNull(type, "Type must not be null"); return USER_TYPES.computeIfAbsent(type, it -> { @@ -73,7 +73,7 @@ public abstract class ProxyUtils { */ public static Class getUserClass(Object source) { - Assert.notNull(source, "Source object must not be null!"); + Assert.notNull(source, "Source object must not be null"); return getUserClass(AopUtils.getTargetClass(source)); } diff --git a/src/main/java/org/springframework/data/util/ReflectionUtils.java b/src/main/java/org/springframework/data/util/ReflectionUtils.java index 2d1f6fb10..80ce5a7a7 100644 --- a/src/main/java/org/springframework/data/util/ReflectionUtils.java +++ b/src/main/java/org/springframework/data/util/ReflectionUtils.java @@ -180,8 +180,8 @@ public final class ReflectionUtils { @Nullable public static Field findField(Class type, DescribedFieldFilter filter, boolean enforceUniqueness) { - Assert.notNull(type, "Type must not be null!"); - Assert.notNull(filter, "Filter must not be null!"); + Assert.notNull(type, "Type must not be null"); + Assert.notNull(filter, "Filter must not be null"); Class targetClass = type; Field foundField = null; @@ -252,8 +252,8 @@ public final class ReflectionUtils { */ public static Optional> findConstructor(Class type, Object... constructorArguments) { - Assert.notNull(type, "Target type must not be null!"); - Assert.notNull(constructorArguments, "Constructor arguments must not be null!"); + Assert.notNull(type, "Target type must not be null"); + Assert.notNull(constructorArguments, "Constructor arguments must not be null"); return Arrays.stream(type.getDeclaredConstructors())// .filter(constructor -> argumentsMatch(constructor.getParameterTypes(), constructorArguments))// @@ -297,7 +297,7 @@ public final class ReflectionUtils { .collect(Collectors.joining(", ")); throw new IllegalArgumentException( - String.format("Unable to find method %s(%s)on %s!", name, parameterTypeNames, type)); + String.format("Unable to find method %s(%s) on %s", name, parameterTypeNames, type)); } return result; @@ -316,7 +316,7 @@ public final class ReflectionUtils { */ public static Stream> returnTypeAndParameters(Method method) { - Assert.notNull(method, "Method must not be null!"); + Assert.notNull(method, "Method must not be null"); Stream> returnType = Stream.of(method.getReturnType()); Stream> parameterTypes = Arrays.stream(method.getParameterTypes()); @@ -335,9 +335,9 @@ public final class ReflectionUtils { */ public static Optional getMethod(Class type, String name, ResolvableType... parameterTypes) { - Assert.notNull(type, "Type must not be null!"); - Assert.hasText(name, "Name must not be null or empty!"); - Assert.notNull(parameterTypes, "Parameter types must not be null!"); + Assert.notNull(type, "Type must not be null"); + Assert.hasText(name, "Name must not be null or empty"); + Assert.notNull(parameterTypes, "Parameter types must not be null"); List> collect = Arrays.stream(parameterTypes)// .map(ResolvableType::getRawClass)// diff --git a/src/main/java/org/springframework/data/util/StreamUtils.java b/src/main/java/org/springframework/data/util/StreamUtils.java index 26bd7d90d..cc8d18e01 100644 --- a/src/main/java/org/springframework/data/util/StreamUtils.java +++ b/src/main/java/org/springframework/data/util/StreamUtils.java @@ -66,7 +66,7 @@ public interface StreamUtils { */ static Stream createStreamFromIterator(CloseableIterator iterator) { - Assert.notNull(iterator, "Iterator must not be null!"); + Assert.notNull(iterator, "Iterator must not be null"); return createStreamFromIterator((Iterator) iterator).onClose(() -> iterator.close()); } @@ -124,9 +124,9 @@ public interface StreamUtils { */ static Stream zip(Stream left, Stream right, BiFunction combiner) { - Assert.notNull(left, "Left stream must not be null!"); - Assert.notNull(right, "Right must not be null!"); - Assert.notNull(combiner, "Combiner must not be null!"); + Assert.notNull(left, "Left stream must not be null"); + Assert.notNull(right, "Right must not be null"); + Assert.notNull(combiner, "Combiner must not be null"); Spliterator lefts = left.spliterator(); Spliterator rights = right.spliterator(); diff --git a/src/main/java/org/springframework/data/util/Streamable.java b/src/main/java/org/springframework/data/util/Streamable.java index 7b9c9423a..a3552edba 100644 --- a/src/main/java/org/springframework/data/util/Streamable.java +++ b/src/main/java/org/springframework/data/util/Streamable.java @@ -69,7 +69,7 @@ public interface Streamable extends Iterable, Supplier> { */ static Streamable of(Iterable iterable) { - Assert.notNull(iterable, "Iterable must not be null!"); + Assert.notNull(iterable, "Iterable must not be null"); return iterable::iterator; } @@ -96,7 +96,7 @@ public interface Streamable extends Iterable, Supplier> { */ default Streamable map(Function mapper) { - Assert.notNull(mapper, "Mapping function must not be null!"); + Assert.notNull(mapper, "Mapping function must not be null"); return Streamable.of(() -> stream().map(mapper)); } @@ -110,7 +110,7 @@ public interface Streamable extends Iterable, Supplier> { */ default Streamable flatMap(Function> mapper) { - Assert.notNull(mapper, "Mapping function must not be null!"); + Assert.notNull(mapper, "Mapping function must not be null"); return Streamable.of(() -> stream().flatMap(mapper)); } @@ -124,7 +124,7 @@ public interface Streamable extends Iterable, Supplier> { */ default Streamable filter(Predicate predicate) { - Assert.notNull(predicate, "Filter predicate must not be null!"); + Assert.notNull(predicate, "Filter predicate must not be null"); return Streamable.of(() -> stream().filter(predicate)); } @@ -147,7 +147,7 @@ public interface Streamable extends Iterable, Supplier> { */ default Streamable and(Supplier> stream) { - Assert.notNull(stream, "Stream must not be null!"); + Assert.notNull(stream, "Stream must not be null"); return Streamable.of(() -> Stream.concat(this.stream(), stream.get())); } @@ -162,7 +162,7 @@ public interface Streamable extends Iterable, Supplier> { @SuppressWarnings("unchecked") default Streamable and(T... others) { - Assert.notNull(others, "Other values must not be null!"); + Assert.notNull(others, "Other values must not be null"); return Streamable.of(() -> Stream.concat(this.stream(), Arrays.stream(others))); } @@ -176,7 +176,7 @@ public interface Streamable extends Iterable, Supplier> { */ default Streamable and(Iterable iterable) { - Assert.notNull(iterable, "Iterable must not be null!"); + Assert.notNull(iterable, "Iterable must not be null"); return Streamable.of(() -> Stream.concat(this.stream(), StreamSupport.stream(iterable.spliterator(), false))); } diff --git a/src/main/java/org/springframework/data/util/TypeDiscoverer.java b/src/main/java/org/springframework/data/util/TypeDiscoverer.java index 951e50997..09b327ecf 100644 --- a/src/main/java/org/springframework/data/util/TypeDiscoverer.java +++ b/src/main/java/org/springframework/data/util/TypeDiscoverer.java @@ -72,8 +72,8 @@ class TypeDiscoverer implements TypeInformation { */ protected TypeDiscoverer(Type type, Map, Type> typeVariableMap) { - Assert.notNull(type, "Type must not be null!"); - Assert.notNull(typeVariableMap, "TypeVariableMap must not be null!"); + Assert.notNull(type, "Type must not be null"); + Assert.notNull(typeVariableMap, "TypeVariableMap must not be null"); this.type = type; this.resolvedType = Lazy.of(() -> resolveType(type)); @@ -101,7 +101,7 @@ class TypeDiscoverer implements TypeInformation { @SuppressWarnings({ "rawtypes", "unchecked" }) protected TypeInformation createInfo(Type fieldType) { - Assert.notNull(fieldType, "Field type must not be null!"); + Assert.notNull(fieldType, "Field type must not be null"); if (fieldType.equals(this.type)) { return this; @@ -160,7 +160,7 @@ class TypeDiscoverer implements TypeInformation { public List> getParameterTypes(Constructor constructor) { - Assert.notNull(constructor, "Constructor must not be null!"); + Assert.notNull(constructor, "Constructor must not be null"); List> parameterTypes = new ArrayList<>(constructor.getParameterCount()); for (Parameter parameter : constructor.getParameters()) { @@ -354,13 +354,13 @@ class TypeDiscoverer implements TypeInformation { public TypeInformation getReturnType(Method method) { - Assert.notNull(method, "Method must not be null!"); + Assert.notNull(method, "Method must not be null"); return createInfo(method.getGenericReturnType()); } public List> getParameterTypes(Method method) { - Assert.notNull(method, "Method most not be null!"); + Assert.notNull(method, "Method most not be null"); return Streamable.of(method.getGenericParameterTypes()).stream()// .map(this::createInfo)// @@ -423,7 +423,7 @@ class TypeDiscoverer implements TypeInformation { @SuppressWarnings("unchecked") public TypeInformation specialize(ClassTypeInformation type) { - Assert.notNull(type, "Type must not be null!"); + Assert.notNull(type, "Type must not be null"); Assert.isTrue(getType().isAssignableFrom(type.getType()), () -> String.format("%s must be assignable from %s", getType(), type.getType())); diff --git a/src/main/java/org/springframework/data/util/TypeInformation.java b/src/main/java/org/springframework/data/util/TypeInformation.java index 2847764ee..fffb75625 100644 --- a/src/main/java/org/springframework/data/util/TypeInformation.java +++ b/src/main/java/org/springframework/data/util/TypeInformation.java @@ -198,7 +198,7 @@ public interface TypeInformation { if (result == null) { throw new IllegalStateException( - "Expected to be able to resolve a type but got null! This usually stems from types implementing raw Map or Collection interfaces"); + "Expected to be able to resolve a type but got null; This usually stems from types implementing raw Map or Collection interfaces"); } return result; @@ -245,7 +245,7 @@ public interface TypeInformation { if (result == null) { throw new IllegalArgumentException(String.format( - "Can't retrieve super type information for %s! Does current type really implement the given one", + "Can't retrieve super type information for %s; Does current type really implement the given one", superType)); } diff --git a/src/main/java/org/springframework/data/util/TypeVariableTypeInformation.java b/src/main/java/org/springframework/data/util/TypeVariableTypeInformation.java index 3423ff414..ff41205c5 100644 --- a/src/main/java/org/springframework/data/util/TypeVariableTypeInformation.java +++ b/src/main/java/org/springframework/data/util/TypeVariableTypeInformation.java @@ -48,7 +48,7 @@ class TypeVariableTypeInformation extends ParentTypeAwareTypeInformation { super(variable, parent); - Assert.notNull(variable, "TypeVariable must not be null!"); + Assert.notNull(variable, "TypeVariable must not be null"); this.variable = variable; this.parameters = Lazy.of(() -> { diff --git a/src/main/java/org/springframework/data/util/Version.java b/src/main/java/org/springframework/data/util/Version.java index dce030963..266c2c4d7 100644 --- a/src/main/java/org/springframework/data/util/Version.java +++ b/src/main/java/org/springframework/data/util/Version.java @@ -29,7 +29,7 @@ import org.springframework.util.StringUtils; */ public class Version implements Comparable { - private static final String VERSION_PARSE_ERROR = "Invalid version string! Could not parse segment %s within %s."; + private static final String VERSION_PARSE_ERROR = "Invalid version string; Could not parse segment %s within %s"; private final int major; private final int minor; @@ -43,19 +43,19 @@ public class Version implements Comparable { */ public Version(int... parts) { - Assert.notNull(parts, "Parts must not be null!"); + 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)); + String.format("Invalid parts length: 0 < %s < 5", parts.length)); this.major = parts[0]; this.minor = parts.length > 1 ? parts[1] : 0; this.bugfix = parts.length > 2 ? parts[2] : 0; this.build = parts.length > 3 ? parts[3] : 0; - Assert.isTrue(major >= 0, "Major version must be greater or equal zero!"); - Assert.isTrue(minor >= 0, "Minor version must be greater or equal zero!"); - Assert.isTrue(bugfix >= 0, "Bugfix version must be greater or equal zero!"); - Assert.isTrue(build >= 0, "Build version must be greater or equal zero!"); + Assert.isTrue(major >= 0, "Major version must be greater or equal zero"); + Assert.isTrue(minor >= 0, "Minor version must be greater or equal zero"); + Assert.isTrue(bugfix >= 0, "Bugfix version must be greater or equal zero"); + Assert.isTrue(build >= 0, "Build version must be greater or equal zero"); } /** @@ -66,7 +66,7 @@ public class Version implements Comparable { */ public static Version parse(String version) { - Assert.hasText(version, "Version must not be null o empty!"); + Assert.hasText(version, "Version must not be null o empty"); String[] parts = version.trim().split("\\."); int[] intParts = new int[parts.length]; diff --git a/src/main/java/org/springframework/data/web/HateoasPageableHandlerMethodArgumentResolver.java b/src/main/java/org/springframework/data/web/HateoasPageableHandlerMethodArgumentResolver.java index 002657fa9..e219a7fde 100644 --- a/src/main/java/org/springframework/data/web/HateoasPageableHandlerMethodArgumentResolver.java +++ b/src/main/java/org/springframework/data/web/HateoasPageableHandlerMethodArgumentResolver.java @@ -100,7 +100,7 @@ public class HateoasPageableHandlerMethodArgumentResolver extends PageableHandle @Override public void enhance(UriComponentsBuilder builder, @Nullable MethodParameter parameter, Object value) { - Assert.notNull(builder, "UriComponentsBuilder must not be null!"); + Assert.notNull(builder, "UriComponentsBuilder must not be null"); if (!(value instanceof Pageable pageable)) { return; diff --git a/src/main/java/org/springframework/data/web/JsonProjectingMethodInterceptorFactory.java b/src/main/java/org/springframework/data/web/JsonProjectingMethodInterceptorFactory.java index 0917ef38b..a3583e3e2 100644 --- a/src/main/java/org/springframework/data/web/JsonProjectingMethodInterceptorFactory.java +++ b/src/main/java/org/springframework/data/web/JsonProjectingMethodInterceptorFactory.java @@ -84,8 +84,8 @@ public class JsonProjectingMethodInterceptorFactory implements MethodInterceptor */ public JsonProjectingMethodInterceptorFactory(JsonProvider jsonProvider, MappingProvider mappingProvider) { - Assert.notNull(jsonProvider, "JsonProvider must not be null!"); - Assert.notNull(mappingProvider, "MappingProvider must not be null!"); + Assert.notNull(jsonProvider, "JsonProvider must not be null"); + Assert.notNull(mappingProvider, "MappingProvider must not be null"); Configuration configuration = Configuration.builder()// .options(Option.ALWAYS_RETURN_LIST) // diff --git a/src/main/java/org/springframework/data/web/MapDataBinder.java b/src/main/java/org/springframework/data/web/MapDataBinder.java index 8dda90e34..b4f44d304 100644 --- a/src/main/java/org/springframework/data/web/MapDataBinder.java +++ b/src/main/java/org/springframework/data/web/MapDataBinder.java @@ -171,7 +171,7 @@ class MapDataBinder extends WebDataBinder { if (typeDescriptor == null) { throw new IllegalStateException( - String.format("Couldn't obtain type descriptor for method parameter %s!", methodParameter)); + String.format("Couldn't obtain type descriptor for method parameter %s", methodParameter)); } value = conversionService.convert(value, TypeDescriptor.forObject(value), typeDescriptor); @@ -227,8 +227,8 @@ class MapDataBinder extends WebDataBinder { */ public PropertyTraversingMapAccessor(Class type, ConversionService conversionService) { - Assert.notNull(type, "Type must not be null!"); - Assert.notNull(conversionService, "ConversionService must not be null!"); + Assert.notNull(type, "Type must not be null"); + Assert.notNull(conversionService, "ConversionService must not be null"); this.type = type; this.conversionService = conversionService; diff --git a/src/main/java/org/springframework/data/web/MethodParameterAwarePagedResourcesAssembler.java b/src/main/java/org/springframework/data/web/MethodParameterAwarePagedResourcesAssembler.java index a98cc27da..850e3333f 100644 --- a/src/main/java/org/springframework/data/web/MethodParameterAwarePagedResourcesAssembler.java +++ b/src/main/java/org/springframework/data/web/MethodParameterAwarePagedResourcesAssembler.java @@ -44,7 +44,7 @@ class MethodParameterAwarePagedResourcesAssembler extends PagedResourcesAssem super(resolver, baseUri); - Assert.notNull(parameter, "Method parameter must not be null!"); + Assert.notNull(parameter, "Method parameter must not be null"); this.parameter = parameter; } diff --git a/src/main/java/org/springframework/data/web/PageableHandlerMethodArgumentResolverSupport.java b/src/main/java/org/springframework/data/web/PageableHandlerMethodArgumentResolverSupport.java index e26695755..19ca6612f 100644 --- a/src/main/java/org/springframework/data/web/PageableHandlerMethodArgumentResolverSupport.java +++ b/src/main/java/org/springframework/data/web/PageableHandlerMethodArgumentResolverSupport.java @@ -43,7 +43,7 @@ import org.springframework.util.StringUtils; */ public abstract class PageableHandlerMethodArgumentResolverSupport { - private static final String INVALID_DEFAULT_PAGE_SIZE = "Invalid default page size configured for method %s! Must not be less than one!"; + private static final String INVALID_DEFAULT_PAGE_SIZE = "Invalid default page size configured for method %s; Must not be less than one"; private static final String DEFAULT_PAGE_PARAMETER = "page"; private static final String DEFAULT_SIZE_PARAMETER = "size"; @@ -71,7 +71,7 @@ public abstract class PageableHandlerMethodArgumentResolverSupport { */ public void setFallbackPageable(Pageable fallbackPageable) { - Assert.notNull(fallbackPageable, "Fallback Pageable must not be null!"); + Assert.notNull(fallbackPageable, "Fallback Pageable must not be null"); this.fallbackPageable = fallbackPageable; } @@ -113,7 +113,7 @@ public abstract class PageableHandlerMethodArgumentResolverSupport { */ public void setPageParameterName(String pageParameterName) { - Assert.hasText(pageParameterName, "Page parameter name must not be null or empty!"); + Assert.hasText(pageParameterName, "Page parameter name must not be null or empty"); this.pageParameterName = pageParameterName; } @@ -133,7 +133,7 @@ public abstract class PageableHandlerMethodArgumentResolverSupport { */ public void setSizeParameterName(String sizeParameterName) { - Assert.hasText(sizeParameterName, "Size parameter name must not be null or empty!"); + Assert.hasText(sizeParameterName, "Size parameter name must not be null or empty"); this.sizeParameterName = sizeParameterName; } diff --git a/src/main/java/org/springframework/data/web/PagedResourcesAssembler.java b/src/main/java/org/springframework/data/web/PagedResourcesAssembler.java index 262f79d85..bd8265d0c 100644 --- a/src/main/java/org/springframework/data/web/PagedResourcesAssembler.java +++ b/src/main/java/org/springframework/data/web/PagedResourcesAssembler.java @@ -131,7 +131,7 @@ public class PagedResourcesAssembler implements RepresentationModelAssembler< public > PagedModel toModel(Page page, RepresentationModelAssembler assembler, Link link) { - Assert.notNull(link, "Link must not be null!"); + Assert.notNull(link, "Link must not be null"); return createModel(page, assembler, Optional.of(link)); } @@ -163,10 +163,10 @@ public class PagedResourcesAssembler implements RepresentationModelAssembler< private PagedModel toEmptyModel(Page page, Class type, Optional link) { - Assert.notNull(page, "Page must not be null!"); - Assert.isTrue(!page.hasContent(), "Page must not have any content!"); - Assert.notNull(type, "Type must not be null!"); - Assert.notNull(link, "Link must not be null!"); + Assert.notNull(page, "Page must not be null"); + Assert.isTrue(!page.hasContent(), "Page must not have any content"); + Assert.notNull(type, "Type must not be null"); + Assert.notNull(link, "Link must not be null"); PageMetadata metadata = asPageMetadata(page); @@ -187,9 +187,9 @@ public class PagedResourcesAssembler implements RepresentationModelAssembler< protected , S> PagedModel createPagedModel(List resources, PageMetadata metadata, Page page) { - Assert.notNull(resources, "Content resources must not be null!"); - Assert.notNull(metadata, "PageMetadata must not be null!"); - Assert.notNull(page, "Page must not be null!"); + Assert.notNull(resources, "Content resources must not be null"); + Assert.notNull(metadata, "PageMetadata must not be null"); + Assert.notNull(page, "Page must not be null"); return PagedModel.of(resources, metadata); } @@ -197,8 +197,8 @@ public class PagedResourcesAssembler implements RepresentationModelAssembler< private > PagedModel createModel(Page page, RepresentationModelAssembler assembler, Optional link) { - Assert.notNull(page, "Page must not be null!"); - Assert.notNull(assembler, "ResourceAssembler must not be null!"); + Assert.notNull(page, "Page must not be null"); + Assert.notNull(assembler, "ResourceAssembler must not be null"); List resources = new ArrayList<>(page.getNumberOfElements()); @@ -292,7 +292,7 @@ public class PagedResourcesAssembler implements RepresentationModelAssembler< */ private PageMetadata asPageMetadata(Page page) { - Assert.notNull(page, "Page must not be null!"); + Assert.notNull(page, "Page must not be null"); int number = pageableResolver.isOneIndexedParameters() ? page.getNumber() + 1 : page.getNumber(); diff --git a/src/main/java/org/springframework/data/web/PagedResourcesAssemblerArgumentResolver.java b/src/main/java/org/springframework/data/web/PagedResourcesAssemblerArgumentResolver.java index 27e60d14a..3aa82a6c0 100644 --- a/src/main/java/org/springframework/data/web/PagedResourcesAssemblerArgumentResolver.java +++ b/src/main/java/org/springframework/data/web/PagedResourcesAssemblerArgumentResolver.java @@ -47,8 +47,8 @@ public class PagedResourcesAssemblerArgumentResolver implements HandlerMethodArg private static final Log logger = LogFactory.getLog(PagedResourcesAssemblerArgumentResolver.class); - private static final String SUPERFLOUS_QUALIFIER = "Found qualified %s parameter, but a unique unqualified %s parameter. Using that one, but you might want to check your controller method configuration!"; - private static final String PARAMETER_AMBIGUITY = "Discovered multiple parameters of type Pageable but no qualifier annotations to disambiguate!"; + private static final String SUPERFLOUS_QUALIFIER = "Found qualified %s parameter, but a unique unqualified %s parameter; Using that one, but you might want to check your controller method configuration"; + private static final String PARAMETER_AMBIGUITY = "Discovered multiple parameters of type Pageable but no qualifier annotations to disambiguate"; private final HateoasPageableHandlerMethodArgumentResolver resolver; diff --git a/src/main/java/org/springframework/data/web/ProjectingJackson2HttpMessageConverter.java b/src/main/java/org/springframework/data/web/ProjectingJackson2HttpMessageConverter.java index 0eab5a468..4e58c21d9 100644 --- a/src/main/java/org/springframework/data/web/ProjectingJackson2HttpMessageConverter.java +++ b/src/main/java/org/springframework/data/web/ProjectingJackson2HttpMessageConverter.java @@ -82,7 +82,7 @@ public class ProjectingJackson2HttpMessageConverter extends MappingJackson2HttpM */ private static SpelAwareProxyProjectionFactory initProjectionFactory(ObjectMapper mapper) { - Assert.notNull(mapper, "ObjectMapper must not be null!"); + Assert.notNull(mapper, "ObjectMapper must not be null"); SpelAwareProxyProjectionFactory projectionFactory = new SpelAwareProxyProjectionFactory(); projectionFactory.registerMethodInvokerFactory(new JsonProjectingMethodInterceptorFactory( diff --git a/src/main/java/org/springframework/data/web/ReactivePageableHandlerMethodArgumentResolver.java b/src/main/java/org/springframework/data/web/ReactivePageableHandlerMethodArgumentResolver.java index 15e378f72..bc313db04 100644 --- a/src/main/java/org/springframework/data/web/ReactivePageableHandlerMethodArgumentResolver.java +++ b/src/main/java/org/springframework/data/web/ReactivePageableHandlerMethodArgumentResolver.java @@ -55,7 +55,7 @@ public class ReactivePageableHandlerMethodArgumentResolver extends PageableHandl */ public ReactivePageableHandlerMethodArgumentResolver(ReactiveSortHandlerMethodArgumentResolver sortResolver) { - Assert.notNull(sortResolver, "ReactiveSortHandlerMethodArgumentResolver must not be null!"); + Assert.notNull(sortResolver, "ReactiveSortHandlerMethodArgumentResolver must not be null"); this.sortResolver = sortResolver; } diff --git a/src/main/java/org/springframework/data/web/SortHandlerMethodArgumentResolverSupport.java b/src/main/java/org/springframework/data/web/SortHandlerMethodArgumentResolverSupport.java index bd1f4ecc1..49061120c 100644 --- a/src/main/java/org/springframework/data/web/SortHandlerMethodArgumentResolverSupport.java +++ b/src/main/java/org/springframework/data/web/SortHandlerMethodArgumentResolverSupport.java @@ -64,7 +64,7 @@ public abstract class SortHandlerMethodArgumentResolverSupport { */ public void setSortParameter(String sortParameter) { - Assert.hasText(sortParameter, "SortParameter must not be null nor empty!"); + Assert.hasText(sortParameter, "SortParameter must not be null nor empty"); this.sortParameter = sortParameter; } @@ -76,7 +76,7 @@ public abstract class SortHandlerMethodArgumentResolverSupport { */ public void setPropertyDelimiter(String propertyDelimiter) { - Assert.hasText(propertyDelimiter, "Property delimiter must not be null or empty!"); + Assert.hasText(propertyDelimiter, "Property delimiter must not be null or empty"); this.propertyDelimiter = propertyDelimiter; } @@ -126,7 +126,7 @@ public abstract class SortHandlerMethodArgumentResolverSupport { if (annotatedDefault != null && annotatedDefaults != null) { throw new IllegalArgumentException( - String.format("Cannot use both @%s and @%s on parameter %s! Move %s into %s to define sorting order", + String.format("Cannot use both @%s and @%s on parameter %s; Move %s into %s to define sorting order", SORT_DEFAULTS_NAME, SORT_DEFAULT_NAME, parameter.toString(), SORT_DEFAULT_NAME, SORT_DEFAULTS_NAME)); } @@ -310,7 +310,7 @@ public abstract class SortHandlerMethodArgumentResolverSupport { */ ExpressionBuilder(Direction direction) { - Assert.notNull(direction, "Direction must not be null!"); + Assert.notNull(direction, "Direction must not be null"); this.direction = direction; } diff --git a/src/main/java/org/springframework/data/web/SpringDataAnnotationUtils.java b/src/main/java/org/springframework/data/web/SpringDataAnnotationUtils.java index 7f250bfaa..e2784abdb 100644 --- a/src/main/java/org/springframework/data/web/SpringDataAnnotationUtils.java +++ b/src/main/java/org/springframework/data/web/SpringDataAnnotationUtils.java @@ -148,7 +148,7 @@ abstract class SpringDataAnnotationUtils { if (null == qualifier) { throw new IllegalStateException( - "Ambiguous Pageable arguments in handler method. If you use multiple parameters of type Pageable you need to qualify them with @Qualifier"); + "Ambiguous Pageable arguments in handler method; If you use multiple parameters of type Pageable you need to qualify them with @Qualifier"); } if (values.contains(qualifier.value())) { diff --git a/src/main/java/org/springframework/data/web/XmlBeamHttpMessageConverter.java b/src/main/java/org/springframework/data/web/XmlBeamHttpMessageConverter.java index b25f287ae..219f87fbb 100644 --- a/src/main/java/org/springframework/data/web/XmlBeamHttpMessageConverter.java +++ b/src/main/java/org/springframework/data/web/XmlBeamHttpMessageConverter.java @@ -82,7 +82,7 @@ public class XmlBeamHttpMessageConverter extends AbstractHttpMessageConverter conversionService) { - Assert.notNull(context, "ApplicationContext must not be null!"); - Assert.notNull(conversionService, "ConversionService must not be null!"); + Assert.notNull(context, "ApplicationContext must not be null"); + Assert.notNull(conversionService, "ConversionService must not be null"); this.context = context; diff --git a/src/test/java/org/springframework/data/classloadersupport/HidingClassLoader.java b/src/test/java/org/springframework/data/classloadersupport/HidingClassLoader.java index 7ac1261df..d79072c79 100644 --- a/src/test/java/org/springframework/data/classloadersupport/HidingClassLoader.java +++ b/src/test/java/org/springframework/data/classloadersupport/HidingClassLoader.java @@ -54,7 +54,7 @@ public class HidingClassLoader extends ShadowingClassLoader { */ public static HidingClassLoader hide(Class... packages) { - Assert.notNull(packages, "Packages must not be null!"); + Assert.notNull(packages, "Packages must not be null"); return new HidingClassLoader(Arrays.stream(packages)// .map(it -> it.getPackage().getName())// diff --git a/src/test/java/org/springframework/data/mapping/PropertyPathUnitTests.java b/src/test/java/org/springframework/data/mapping/PropertyPathUnitTests.java index b95eb87a0..4276ee05d 100755 --- a/src/test/java/org/springframework/data/mapping/PropertyPathUnitTests.java +++ b/src/test/java/org/springframework/data/mapping/PropertyPathUnitTests.java @@ -117,7 +117,7 @@ class PropertyPathUnitTests { try { PropertyPath.from("usersMame", Bar.class); - fail("Expected PropertyReferenceException!"); + fail("Expected PropertyReferenceException"); } catch (PropertyReferenceException e) { assertThat(e.getPropertyName()).isEqualTo("mame"); assertThat(e.getBaseProperty()).isEqualTo(PropertyPath.from("users", Bar.class)); diff --git a/src/test/java/org/springframework/data/mapping/context/AbstractMappingContextUnitTests.java b/src/test/java/org/springframework/data/mapping/context/AbstractMappingContextUnitTests.java index c87de3e08..f584649d7 100755 --- a/src/test/java/org/springframework/data/mapping/context/AbstractMappingContextUnitTests.java +++ b/src/test/java/org/springframework/data/mapping/context/AbstractMappingContextUnitTests.java @@ -377,7 +377,7 @@ class AbstractMappingContextUnitTests { } if (found != expected) { - fail(String.format("%s to find persistent entity for %s!", expected ? "Expected" : "Did not expect", type)); + fail(String.format("%s to find persistent entity for %s", expected ? "Expected" : "Did not expect", type)); } } diff --git a/src/test/java/org/springframework/data/mapping/model/AbstractPersistentPropertyUnitTests.java b/src/test/java/org/springframework/data/mapping/model/AbstractPersistentPropertyUnitTests.java index e108da8da..7e7c037da 100755 --- a/src/test/java/org/springframework/data/mapping/model/AbstractPersistentPropertyUnitTests.java +++ b/src/test/java/org/springframework/data/mapping/model/AbstractPersistentPropertyUnitTests.java @@ -260,7 +260,7 @@ public class AbstractPersistentPropertyUnitTests { () -> Optionals.mapIfAllPresent(field, descriptor, (left, right) -> Property.of(typeInformation, left, right)), // () -> field.map(it -> Property.of(typeInformation, it)), // () -> descriptor.map(it -> Property.of(typeInformation, it))) // - .orElseThrow(() -> new IllegalArgumentException(String.format("Couldn't find property %s on %s!", name, type))); + .orElseThrow(() -> new IllegalArgumentException(String.format("Couldn't find property %s on %s", name, type))); return new SamplePersistentProperty(property, getEntity(type), typeHolder); } diff --git a/src/test/java/org/springframework/data/mapping/model/AnnotationBasedPersistentPropertyUnitTests.java b/src/test/java/org/springframework/data/mapping/model/AnnotationBasedPersistentPropertyUnitTests.java index 2fe234eed..34f40487a 100755 --- a/src/test/java/org/springframework/data/mapping/model/AnnotationBasedPersistentPropertyUnitTests.java +++ b/src/test/java/org/springframework/data/mapping/model/AnnotationBasedPersistentPropertyUnitTests.java @@ -115,7 +115,7 @@ public class AnnotationBasedPersistentPropertyUnitTests

try { this.instance.createInstance(entity, provider); - fail("Expected MappingInstantiationException!"); + fail("Expected MappingInstantiationException"); } catch (MappingInstantiationException o_O) { diff --git a/src/test/java/org/springframework/data/mapping/model/ReflectionEntityInstantiatorUnitTests.java b/src/test/java/org/springframework/data/mapping/model/ReflectionEntityInstantiatorUnitTests.java index aea1dd32d..fb0d3a547 100755 --- a/src/test/java/org/springframework/data/mapping/model/ReflectionEntityInstantiatorUnitTests.java +++ b/src/test/java/org/springframework/data/mapping/model/ReflectionEntityInstantiatorUnitTests.java @@ -126,7 +126,7 @@ class ReflectionEntityInstantiatorUnitTests

> { try { INSTANCE.createInstance(entity, provider); - fail("Expected MappingInstantiationException!"); + fail("Expected MappingInstantiationException"); } catch (MappingInstantiationException o_O) { diff --git a/src/test/java/org/springframework/data/repository/core/support/RepositoryFragmentUnitTests.java b/src/test/java/org/springframework/data/repository/core/support/RepositoryFragmentUnitTests.java index decf8b55a..8e367ba36 100644 --- a/src/test/java/org/springframework/data/repository/core/support/RepositoryFragmentUnitTests.java +++ b/src/test/java/org/springframework/data/repository/core/support/RepositoryFragmentUnitTests.java @@ -31,7 +31,7 @@ class RepositoryFragmentUnitTests { void fragmentCreationFromUnrelatedTypesShouldFail() { assertThatThrownBy(() -> RepositoryFragment.implemented((Class) CustomFragment.class, new UnrelatedImpl())) - .hasMessageMatching("Fragment implementation .*UnrelatedImpl does not implement .*!") + .hasMessageMatching("Fragment implementation .*UnrelatedImpl does not implement .*") .isInstanceOf(IllegalArgumentException.class); } diff --git a/src/test/java/org/springframework/data/repository/query/parser/PartTreeUnitTests.java b/src/test/java/org/springframework/data/repository/query/parser/PartTreeUnitTests.java index b47693579..22ff87f99 100755 --- a/src/test/java/org/springframework/data/repository/query/parser/PartTreeUnitTests.java +++ b/src/test/java/org/springframework/data/repository/query/parser/PartTreeUnitTests.java @@ -725,10 +725,10 @@ class PartTreeUnitTests { for (var k = 0; k < part.length; k++) { assertThat(partIterator.hasNext()).as("Expected %d parts but have %d", part.length, k).isTrue(); var next = partIterator.next(); - assertThat(part[k]).as("Expected %s but got %s!", part[k], next).isEqualTo(next); + assertThat(part[k]).as("Expected %s but got %s", part[k], next).isEqualTo(next); } - assertThat(partIterator.hasNext()).as("Too many parts!").isFalse(); + assertThat(partIterator.hasNext()).as("Too many parts").isFalse(); } private static Collection toCollection(Iterable iterable) { diff --git a/src/test/java/org/springframework/data/repository/support/RepositoryInvocationTestUtils.java b/src/test/java/org/springframework/data/repository/support/RepositoryInvocationTestUtils.java index 3f2334d81..964d4fbdc 100644 --- a/src/test/java/org/springframework/data/repository/support/RepositoryInvocationTestUtils.java +++ b/src/test/java/org/springframework/data/repository/support/RepositoryInvocationTestUtils.java @@ -77,7 +77,7 @@ class RepositoryInvocationTestUtils { var type = invocation.getMethod().getDeclaringClass(); - assertThat(type).as("Expected methods invocation on %s but was invoked on %s!", expectedInvocationTarget, type) + assertThat(type).as("Expected methods invocation on %s but was invoked on %s", expectedInvocationTarget, type) .isEqualTo(expectedInvocationTarget); } diff --git a/src/test/java/org/springframework/data/web/config/SpringDataWebConfigurationIntegrationTests.java b/src/test/java/org/springframework/data/web/config/SpringDataWebConfigurationIntegrationTests.java index 9e5030b1d..4020dcf8e 100644 --- a/src/test/java/org/springframework/data/web/config/SpringDataWebConfigurationIntegrationTests.java +++ b/src/test/java/org/springframework/data/web/config/SpringDataWebConfigurationIntegrationTests.java @@ -149,7 +149,7 @@ class SpringDataWebConfigurationIntegrationTests { private static Condition instanceWithClassName(Class expectedClass) { return new Condition<>(it -> it.getClass().getName().equals(expectedClass.getName()), // - "with class name %s!", expectedClass.getName()); + "with class name %s", expectedClass.getName()); } @Configuration