Polish for Exception message punctuation cleanup.

Closes #2603.
This commit is contained in:
John Blum
2022-06-07 11:39:44 -07:00
parent 6a23723f07
commit 8721ab4170
226 changed files with 762 additions and 764 deletions

View File

@@ -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));

View File

@@ -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> 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> 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");
}
}
}

View File

@@ -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> 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> 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<TemporalAccessor> touchDate(AuditableBeanWrapper<?> wrapper, boolean isNew) {
Assert.notNull(wrapper, "AuditableBeanWrapper must not be null!");
Assert.notNull(wrapper, "AuditableBeanWrapper must not be null");
Optional<TemporalAccessor> 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);

View File

@@ -68,7 +68,7 @@ class DefaultAuditableBeanWrapperFactory implements AuditableBeanWrapperFactory
@SuppressWarnings("unchecked")
public <T> Optional<AuditableBeanWrapper<T>> 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;

View File

@@ -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;

View File

@@ -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 <P> MappingAuditingMetadata(MappingContext<?, ? extends PersistentProperty<?>> 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;

View File

@@ -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 <T> Mono<T> 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 <T> Mono<T> 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));

View File

@@ -56,7 +56,7 @@ public class ReactiveIsNewAwareAuditingHandler extends ReactiveAuditingHandler {
*/
public Mono<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 Mono.just(object);

View File

@@ -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<? extends Annotation> 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<String, Object> attributesSource = metadata.getAnnotationAttributes(annotation.getName());

View File

@@ -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));

View File

@@ -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;
}

View File

@@ -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));

View File

@@ -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();

View File

@@ -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);

View File

@@ -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;

View File

@@ -47,7 +47,7 @@ public class ConfigurableTypeInformationMapper implements TypeInformationMapper
*/
public ConfigurableTypeInformationMapper(Map<? extends Class<?>, 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);

View File

@@ -48,9 +48,9 @@ public interface ConverterBuilder {
static <S, T> ReadingConverterBuilder<S, T> reading(Class<S> source, Class<T> target,
Function<? super S, ? extends T> 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 <S, T> WritingConverterBuilder<S, T> writing(Class<S> source, Class<T> target,
Function<? super S, ? extends T> 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());
}

View File

@@ -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";

View File

@@ -82,8 +82,8 @@ public class DefaultTypeMapper<S> implements TypeMapper<S>, BeanClassLoaderAware
@Nullable MappingContext<? extends PersistentEntity<?, ?>, ?> mappingContext,
List<? extends TypeInformationMapper> 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<TypeInformationMapper> mappers = new ArrayList<>(additionalMappers.size() + 1);
if (mappingContext != null) {
@@ -111,7 +111,7 @@ public class DefaultTypeMapper<S> implements TypeMapper<S>, 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<S> implements TypeMapper<S>, BeanClassLoaderAware
@Override
public <T> TypeInformation<? extends T> readType(S source, TypeInformation<T> 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<S> implements TypeMapper<S>, 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<S> implements TypeMapper<S>, 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) {

View File

@@ -54,9 +54,9 @@ public class DtoInstantiatingConverter implements Converter<Object, Object> {
MappingContext<? extends PersistentEntity<?, ?>, ? 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;

View File

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

View File

@@ -89,7 +89,7 @@ final class PropertyValueConverterFactories {
public <S, T, C extends ValueConversionContext<?>> PropertyValueConverter<S, T, C> getConverter(
Class<? extends PropertyValueConverter<S, T, C>> converterType) {
Assert.notNull(converterType, "ConverterType must not be null!");
Assert.notNull(converterType, "ConverterType must not be null");
if (converterType.isEnum()) {
return (PropertyValueConverter<S, T, C>) EnumSet.allOf((Class) converterType).iterator().next();

View File

@@ -108,7 +108,7 @@ public class PropertyValueConverterRegistrar<P extends PersistentProperty<P>> {
*/
public void registerConvertersIn(@NonNull ValueConverterRegistry<P> 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));

View File

@@ -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;

View File

@@ -89,7 +89,7 @@ public interface ValueConversionContext<P extends PersistentProperty<P>> {
}
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<P extends PersistentProperty<P>> {
}
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));
}
}

View File

@@ -46,7 +46,7 @@ public class AbstractAggregateRoot<A extends AbstractAggregateRoot<A>> {
*/
protected <T> 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<A extends AbstractAggregateRoot<A>> {
@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());

View File

@@ -47,8 +47,8 @@ abstract class Chunk<T> implements Slice<T>, Serializable {
*/
public Chunk(List<T> 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<T> implements Slice<T>, Serializable {
*/
protected <U> List<U> getConvertedContent(Function<? super T, ? extends U> 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());
}

View File

@@ -121,8 +121,8 @@ public interface ExampleMatcher {
*/
default ExampleMatcher withMatcher(String propertyPath, MatcherConfigurer<GenericPropertyMatcher> 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);
}

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -44,8 +44,8 @@ public final class Range<T> {
private Range(Bound<T> lowerBound, Bound<T> 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<T> {
*/
public static <T> RangeBuilder<T> from(Bound<T> 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<T> {
*/
public boolean contains(T value, Comparator<T> 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<T> {
*/
public static <T> Bound<T> 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<T> {
*/
public static <T> Bound<T> 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<T> {
*/
public Range<T> to(Bound<T> upper) {
Assert.notNull(upper, "Upper bound must not be null!");
Assert.notNull(upper, "Upper bound must not be null");
return new Range<>(lower, upper);
}
}

View File

@@ -81,7 +81,7 @@ public class Sort implements Streamable<org.springframework.data.domain.Sort.Ord
*/
public static Sort by(String... properties) {
Assert.notNull(properties, "Properties must not be null!");
Assert.notNull(properties, "Properties must not be null");
return properties.length == 0 //
? Sort.unsorted() //
@@ -96,7 +96,7 @@ public class Sort implements Streamable<org.springframework.data.domain.Sort.Ord
*/
public static Sort by(List<Order> 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<org.springframework.data.domain.Sort.Ord
*/
public static Sort by(Order... orders) {
Assert.notNull(orders, "Orders must not be null!");
Assert.notNull(orders, "Orders must not be null");
return new Sort(Arrays.asList(orders));
}
@@ -123,9 +123,9 @@ public class Sort implements Streamable<org.springframework.data.domain.Sort.Ord
*/
public static Sort by(Direction direction, String... properties) {
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!");
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<org.springframework.data.domain.Sort.Ord
*/
public Sort and(Sort sort) {
Assert.notNull(sort, "Sort must not be null!");
Assert.notNull(sort, "Sort must not be null");
ArrayList<Order> these = new ArrayList<Order>(this.toList());
@@ -305,7 +305,7 @@ public class Sort implements Streamable<org.springframework.data.domain.Sort.Ord
return Direction.valueOf(value.toUpperCase(Locale.US));
} catch (Exception e) {
throw new IllegalArgumentException(String.format(
"Invalid value '%s' for orders given! Has to be either 'desc' or 'asc' (case insensitive)", value), e);
"Invalid value '%s' for orders given; Has to be either 'desc' or 'asc' (case insensitive)", value), e);
}
}

View File

@@ -58,8 +58,8 @@ class TypedExampleMatcher implements ExampleMatcher {
@Override
public ExampleMatcher withIgnorePaths(String... ignoredPaths) {
Assert.notEmpty(ignoredPaths, "IgnoredPaths must not be empty!");
Assert.noNullElements(ignoredPaths, "IgnoredPaths must not contain null elements!");
Assert.notEmpty(ignoredPaths, "IgnoredPaths must not be empty");
Assert.noNullElements(ignoredPaths, "IgnoredPaths must not contain null elements");
Set<String> 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);
}

View File

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

View File

@@ -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]);

View File

@@ -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;

View File

@@ -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;

View File

@@ -61,7 +61,7 @@ public final class Distance implements Serializable, Comparable<Distance> {
*/
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<Distance> {
*/
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<Distance> {
*/
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<Distance> {
*/
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);
}

View File

@@ -70,8 +70,8 @@ public class GeoResults<T> implements Iterable<GeoResult<T>>, Serializable {
@PersistenceConstructor
public GeoResults(List<? extends GeoResult<T>> 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<T> implements Iterable<GeoResult<T>>, Serializable {
private static Distance calculateAverageDistance(List<? extends GeoResult<?>> 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);

View File

@@ -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;

View File

@@ -50,10 +50,10 @@ public class Polygon implements Iterable<Point>, 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<Point> points = new ArrayList<>(3 + others.length);
points.addAll(Arrays.asList(x, y, z));
@@ -70,13 +70,13 @@ public class Polygon implements Iterable<Point>, Shape {
@PersistenceConstructor
public Polygon(List<? extends Point> points) {
Assert.notNull(points, "Points must not be null!");
Assert.notNull(points, "Points must not be null");
List<Point> 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);
}

View File

@@ -43,7 +43,7 @@ public enum DistanceFormatter implements Converter<String, Distance>, Formatter<
INSTANCE;
private static final Map<String, Metric> 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 {

View File

@@ -35,7 +35,7 @@ public enum PointFormatter implements Converter<String, Point>, Formatter<Point>
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

View File

@@ -73,10 +73,10 @@ public class AnnotationRevisionMetadata<N extends Number & Comparable<N>> implem
public AnnotationRevisionMetadata(Object entity, Class<? extends Annotation> revisionNumberAnnotation,
Class<? extends Annotation> 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);

View File

@@ -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();

View File

@@ -56,7 +56,7 @@ public class Revisions<N extends Number & Comparable<N>, T> implements Streamabl
*/
private Revisions(List<? extends Revision<N, T>> 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())//

View File

@@ -112,8 +112,8 @@ public class AccessOptions {
*/
public GetOptions registerHandler(PersistentProperty<?> property, Function<Object, Object> 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<PersistentProperty<?>, Function<Object, Object>> newHandlers = new HashMap<>(handlers);
newHandlers.put(property, handler);
@@ -184,7 +184,7 @@ public class AccessOptions {
Function<? super T, Object> 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<Object, T> caster = (Function<Object, T>) 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);

View File

@@ -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);
}

View File

@@ -46,8 +46,8 @@ class InstanceCreatorMetadataSupport<T, P extends PersistentProperty<P>> impleme
@SafeVarargs
public InstanceCreatorMetadataSupport(Executable executable, Parameter<Object, P>... 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<T, P extends PersistentProperty<P>> 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);

View File

@@ -56,8 +56,8 @@ public class Parameter<T, P extends PersistentProperty<P>> {
public Parameter(@Nullable String name, TypeInformation<T> type, Annotation[] annotations,
@Nullable PersistentEntity<T, P> 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;

View File

@@ -279,7 +279,7 @@ public interface PersistentEntity<T, P extends PersistentProperty<P>> extends It
*/
default void doWithAll(PropertyHandler<P> handler) {
Assert.notNull(handler, "PropertyHandler must not be null!");
Assert.notNull(handler, "PropertyHandler must not be null");
doWithProperties(handler);
doWithAssociations(

View File

@@ -341,7 +341,7 @@ public interface PersistentProperty<P extends PersistentProperty<P>> {
}
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<P extends PersistentProperty<P>> {
*/
default boolean hasActualTypeAnnotation(Class<? extends Annotation> 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<P extends PersistentProperty<P>> {
*/
default <T> PersistentPropertyAccessor<T> getAccessorForOwner(T owner) {
Assert.notNull(owner, "Owner must not be null!");
Assert.notNull(owner, "Owner must not be null");
return getOwner().getPropertyAccessor(owner);
}

View File

@@ -59,8 +59,8 @@ public interface PersistentPropertyAccessor<T> {
@Deprecated
default void setProperty(PersistentPropertyPath<? extends PersistentProperty<?>> 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<? extends PersistentProperty<?>> parentPath = path.getParentPath();
PersistentProperty<? extends PersistentProperty<?>> leafProperty = path.getRequiredLeafProperty();
@@ -76,7 +76,7 @@ public interface PersistentPropertyAccessor<T> {
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<T> {
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()));

View File

@@ -108,7 +108,7 @@ public final class PreferredConstructor<T, P extends PersistentProperty<P>> exte
*/
public boolean isEnclosingClassParameter(Parameter<?, P> 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<T, P extends PersistentProperty<P>> exte
return parameters.get(0).equals(parameter);
}
}

View File

@@ -45,7 +45,7 @@ import org.springframework.util.StringUtils;
*/
public class PropertyPath implements Streamable<PropertyPath> {
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> {
*/
PropertyPath(String name, TypeInformation<?> owningType, List<PropertyPath> 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<PropertyPath> {
*/
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<PropertyPath> {
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<PropertyPath> {
*/
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 -> {

View File

@@ -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<PropertyPath> 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;

View File

@@ -49,8 +49,8 @@ public class TraversalContext {
*/
public TraversalContext registerHandler(PersistentProperty<?> property, Function<Object, Object> 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<? super T, Object> 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<Object, T> caster = (Function<Object, T>) it -> type.cast(it);

View File

@@ -63,7 +63,7 @@ class DefaultEntityCallbacks implements EntityCallbacks {
@Override
public <T> T callback(Class<? extends EntityCallback> callbackType, T entity, Object... args) {
Assert.notNull(entity, "Entity must not be null!");
Assert.notNull(entity, "Entity must not be null");
Class<T> entityType = (Class<T>) (entity != null ? ClassUtils.getUserClass(entity.getClass())
: callbackDiscoverer.resolveDeclaredEntityType(callbackType).getRawClass());

View File

@@ -64,7 +64,7 @@ class DefaultReactiveEntityCallbacks implements ReactiveEntityCallbacks {
@Override
public <T> Mono<T> callback(Class<? extends EntityCallback> callbackType, T entity, Object... args) {
Assert.notNull(entity, "Entity must not be null!");
Assert.notNull(entity, "Entity must not be null");
Class<T> entityType = (Class<T>) (entity != null ? ClassUtils.getUserClass(entity.getClass())
: callbackDiscoverer.resolveDeclaredEntityType(callbackType).getRawClass());

View File

@@ -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) {

View File

@@ -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);
}
}

View File

@@ -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);
}
}

View File

@@ -166,7 +166,7 @@ public abstract class AbstractMappingContext<E extends MutablePersistentEntity<?
*/
public void setSimpleTypeHolder(SimpleTypeHolder simpleTypes) {
Assert.notNull(simpleTypes, "SimpleTypeHolder must not be null!");
Assert.notNull(simpleTypes, "SimpleTypeHolder must not be null");
this.simpleTypeHolder = simpleTypes;
}
@@ -195,7 +195,7 @@ public abstract class AbstractMappingContext<E extends MutablePersistentEntity<?
@Override
public boolean hasPersistentEntityFor(Class<?> 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<E extends MutablePersistentEntity<?
@Override
public E getPersistentEntity(TypeInformation<?> 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<E extends MutablePersistentEntity<?
@Override
public E getPersistentEntity(P persistentProperty) {
Assert.notNull(persistentProperty, "PersistentProperty must not be null!");
Assert.notNull(persistentProperty, "PersistentProperty must not be null");
if (!persistentProperty.isEntity()) {
return null;
@@ -293,8 +293,8 @@ public abstract class AbstractMappingContext<E extends MutablePersistentEntity<?
@Override
public <T> PersistentPropertyPaths<T, P> findPersistentPropertyPaths(Class<T> type, Predicate<? super P> 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<E extends MutablePersistentEntity<?
*/
protected Optional<E> 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<E extends MutablePersistentEntity<?
*/
public boolean matches(Property property) {
Assert.notNull(property, "Property must not be null!");
Assert.notNull(property, "Property must not be null");
if (!property.hasAccessor()) {
return false;
@@ -728,7 +728,7 @@ public abstract class AbstractMappingContext<E extends MutablePersistentEntity<?
*/
public PropertyMatch(@Nullable String namePattern, @Nullable String typeName) {
Assert.isTrue(!(namePattern == null && typeName == null), "Either name pattern or type name must be given!");
Assert.isTrue(!(namePattern == null && typeName == null), "Either name pattern or type name must be given");
this.namePattern = namePattern;
this.typeName = typeName;
@@ -743,8 +743,8 @@ public abstract class AbstractMappingContext<E extends MutablePersistentEntity<?
*/
public boolean matches(String name, Class<?> 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;

View File

@@ -50,7 +50,7 @@ class DefaultPersistentPropertyPath<P extends PersistentProperty<P>> implements
*/
public DefaultPersistentPropertyPath(List<P> 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<P extends PersistentProperty<P>> implements
*/
public DefaultPersistentPropertyPath<P> 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<P extends PersistentProperty<P>> 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<P> properties = new ArrayList<>(this.properties);
properties.add(property);
@@ -109,8 +109,8 @@ class DefaultPersistentPropertyPath<P extends PersistentProperty<P>> implements
@Nullable
public String toPath(String delimiter, Converter<? super P, String> 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<P extends PersistentProperty<P>> implements
public boolean isBasePathOf(PersistentPropertyPath<P> path) {
Assert.notNull(path, "PersistentPropertyPath must not be null!");
Assert.notNull(path, "PersistentPropertyPath must not be null");
Iterator<P> iterator = path.iterator();

View File

@@ -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;

View File

@@ -46,8 +46,8 @@ public class MappingContextEvent<E extends PersistentEntity<?, P>, 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;

View File

@@ -56,7 +56,7 @@ public class PersistentEntities implements Streamable<PersistentEntity<?, ? exte
@SuppressWarnings("unchecked")
public PersistentEntities(Iterable<? extends MappingContext<?, ?>> contexts) {
Assert.notNull(contexts, "MappingContexts must not be null!");
Assert.notNull(contexts, "MappingContexts must not be null");
this.contexts = contexts instanceof Collection
? (Collection<? extends MappingContext<?, ? extends PersistentProperty<?>>>) contexts
@@ -71,7 +71,7 @@ public class PersistentEntities implements Streamable<PersistentEntity<?, ? exte
*/
public static PersistentEntities of(MappingContext<?, ?>... 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<PersistentEntity<?, ? exte
*/
public PersistentEntity<?, ? extends PersistentProperty<?>> 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<PersistentEntity<?, ? exte
return getPersistentEntity(type).orElseThrow(() -> {
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<PersistentEntity<?, ? exte
public <T> Optional<T> mapOnContext(Class<?> type,
BiFunction<MappingContext<?, ? extends PersistentProperty<?>>, 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<PersistentEntity<?, ? exte
*/
public TypeInformation<?> getTypeUltimatelyReferredToBy(PersistentProperty<?> property) {
Assert.notNull(property, "PersistentProperty must not be null!");
Assert.notNull(property, "PersistentProperty must not be null");
PersistentEntity<?, ? extends PersistentProperty<?>> entity = getEntityUltimatelyReferredToBy(property);
@@ -254,7 +254,7 @@ public class PersistentEntities implements Streamable<PersistentEntity<?, ? exte
String message = "Found multiple entities identified by " + type.getType() + ": ";
message += entities.stream().map(it -> 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);
}

View File

@@ -65,8 +65,8 @@ class PersistentPropertyPathFactory<E extends PersistentEntity<?, P>, P extends
*/
public PersistentPropertyPath<P> 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<E extends PersistentEntity<?, P>, P extends
*/
public PersistentPropertyPath<P> 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<E extends PersistentEntity<?, P>, P extends
*/
public PersistentPropertyPath<P> 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<E extends PersistentEntity<?, P>, P extends
*/
public <T> PersistentPropertyPaths<T, P> from(Class<T> type, Predicate<? super P> 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<E extends PersistentEntity<?, P>, P extends
public <T> PersistentPropertyPaths<T, P> from(Class<T> type, Predicate<? super P> propertyFilter,
Predicate<P> 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<E extends PersistentEntity<?, P>, P extends
public <T> PersistentPropertyPaths<T, P> from(TypeInformation<T> type, Predicate<? super P> propertyFilter,
Predicate<P> 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<E extends PersistentEntity<?, P>, 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<E extends PersistentEntity<?, P>, P extends
@Override
public PersistentPropertyPaths<T, P> dropPathIfSegmentMatches(Predicate<? super P> predicate) {
Assert.notNull(predicate, "Predicate must not be null!");
Assert.notNull(predicate, "Predicate must not be null");
List<PersistentPropertyPath<P>> paths = this.stream() //
.filter(it -> !it.stream().anyMatch(predicate)) //

View File

@@ -75,8 +75,8 @@ public abstract class AbstractPersistentProperty<P extends PersistentProperty<P>
public AbstractPersistentProperty(Property property, PersistentEntity<?, P> 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());

View File

@@ -128,8 +128,8 @@ public abstract class AnnotationBasedPersistentProperty<P extends PersistentProp
Annotation mergedAnnotation = AnnotatedElementUtils.getMergedAnnotation(it, annotationType);
validateAnnotation(mergedAnnotation,
"Ambiguous mapping! Annotation %s configured "
+ "multiple times on accessor methods of property %s in class %s!",
"Ambiguous mapping; Annotation %s configured "
+ "multiple times on accessor methods of property %s in class %s",
annotationType.getSimpleName(), getName(), getOwner().getType().getSimpleName());
annotationCache.put(annotationType, Optional.of(mergedAnnotation));
@@ -144,7 +144,7 @@ public abstract class AnnotationBasedPersistentProperty<P extends PersistentProp
Annotation mergedAnnotation = AnnotatedElementUtils.getMergedAnnotation(it, annotationType);
validateAnnotation(mergedAnnotation,
"Ambiguous mapping! Annotation %s configured " + "on field %s and one of its accessor methods in class %s!",
"Ambiguous mapping; Annotation %s configured " + "on field %s and one of its accessor methods in class %s",
annotationType.getSimpleName(), it.getName(), getOwner().getType().getSimpleName());
annotationCache.put(annotationType, Optional.of(mergedAnnotation));
@@ -229,7 +229,7 @@ public abstract class AnnotationBasedPersistentProperty<P extends PersistentProp
@Nullable
public <A extends Annotation> A findAnnotation(Class<A> annotationType) {
Assert.notNull(annotationType, "Annotation type must not be null!");
Assert.notNull(annotationType, "Annotation type must not be null");
return doFindAnnotation(annotationType).orElse(null);
}

View File

@@ -62,7 +62,7 @@ import org.springframework.util.StringUtils;
*/
public class BasicPersistentEntity<T, P extends PersistentProperty<P>> implements MutablePersistentEntity<T, P> {
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<P> creator;
private final TypeInformation<T> information;
@@ -104,7 +104,7 @@ public class BasicPersistentEntity<T, P extends PersistentProperty<P>> implement
*/
public BasicPersistentEntity(TypeInformation<T> information, @Nullable Comparator<P> 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<T, P extends PersistentProperty<P>> 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<T, P extends PersistentProperty<P>> 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<T, P extends PersistentProperty<P>> 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<T, P extends PersistentProperty<P>> implement
public void addAssociation(Association<P> 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<T, P extends PersistentProperty<P>> implement
@Override
public Iterable<P> getPersistentProperties(Class<? extends Annotation> 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<T, P extends PersistentProperty<P>> implement
public void doWithProperties(PropertyHandler<P> 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<T, P extends PersistentProperty<P>> 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<T, P extends PersistentProperty<P>> implement
public void doWithAssociations(AssociationHandler<P> handler) {
Assert.notNull(handler, "Handler must not be null!");
Assert.notNull(handler, "Handler must not be null");
for (Association<P> association : associations) {
handler.doWithAssociation(association);
@@ -320,7 +320,7 @@ public class BasicPersistentEntity<T, P extends PersistentProperty<P>> implement
public void doWithAssociations(SimpleAssociationHandler handler) {
Assert.notNull(handler, "Handler must not be null!");
Assert.notNull(handler, "Handler must not be null");
for (Association<? extends PersistentProperty<?>> association : associations) {
handler.doWithAssociation(association);
@@ -462,7 +462,7 @@ public class BasicPersistentEntity<T, P extends PersistentProperty<P>> 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()));
}

View File

@@ -52,14 +52,14 @@ class BeanWrapper<T> implements PersistentPropertyAccessor<T> {
*/
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<T> implements PersistentPropertyAccessor<T> {
@Nullable
public <S> Object getProperty(PersistentProperty<?> property, Class<? extends S> type) {
Assert.notNull(property, "PersistentProperty must not be null!");
Assert.notNull(property, "PersistentProperty must not be null");
try {

View File

@@ -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;
}

View File

@@ -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);
}

View File

@@ -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 }));
* }
* </pre>
*/
@@ -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);
}

View File

@@ -48,8 +48,8 @@ public class ConvertingPropertyAccessor<T> 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<T> extends SimplePersistentPropertyPathA
@Nullable
public <S> S getProperty(PersistentProperty<?> property, Class<S> 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);
}

View File

@@ -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;

View File

@@ -71,8 +71,8 @@ public class EntityInstantiators {
public EntityInstantiators(EntityInstantiator defaultInstantiator,
Map<Class<?>, 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)) {

View File

@@ -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);

View File

@@ -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));
}
}
}

View File

@@ -39,8 +39,8 @@ import org.springframework.util.Assert;
*/
public class InstantiationAwarePropertyAccessor<T> implements PersistentPropertyAccessor<T> {
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<T, PersistentPropertyAccessor<T>> delegateFunction;
private final EntityInstantiators instantiators;
@@ -60,9 +60,9 @@ public class InstantiationAwarePropertyAccessor<T> implements PersistentProperty
public InstantiationAwarePropertyAccessor(T bean, Function<T, PersistentPropertyAccessor<T>> 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;

View File

@@ -76,7 +76,7 @@ class KotlinCopyMethod {
*/
public static Optional<KotlinCopyMethod> findCopyMethod(Class<?> type) {
Assert.notNull(type, "Type must not be null!");
Assert.notNull(type, "Type must not be null");
Optional<Method> syntheticCopyMethod = findSyntheticCopyMethod(type);

View File

@@ -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));
}
}

View File

@@ -60,7 +60,7 @@ public interface PreferredConstructorDiscoverer<T, P extends PersistentProperty<
@Nullable
static <T, P extends PersistentProperty<P>> PreferredConstructor<T, P> discover(Class<T> 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<T, P extends PersistentProperty<
@Nullable
static <T, P extends PersistentProperty<P>> PreferredConstructor<T, P> discover(PersistentEntity<T, P> 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);

View File

@@ -54,8 +54,8 @@ public class Property {
private Property(TypeInformation<?> type, Optional<Field> field, Optional<PropertyDescriptor> 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<Method> findWither(TypeInformation<?> owner, String propertyName, Class<?> rawType) {

View File

@@ -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) {

View File

@@ -119,8 +119,8 @@ class SimplePersistentPropertyPathAccessor<T> implements PersistentPropertyPathA
public void setProperty(PersistentPropertyPath<? extends PersistentProperty<?>> 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<? extends PersistentProperty<?>> parentPath = path.getParentPath();
PersistentProperty<? extends PersistentProperty<?>> leafProperty = path.getRequiredLeafProperty();
@@ -199,7 +199,7 @@ class SimplePersistentPropertyPathAccessor<T> 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<T> implements PersistentPropertyPathA
@Nullable
protected <S> S getTypedProperty(PersistentProperty<?> property, Class<S> 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<T> 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()));
}

View File

@@ -92,7 +92,7 @@ public class SimpleTypeHolder {
*/
public SimpleTypeHolder(Set<? extends Class<?>> 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<? extends Class<?>> 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<Class<?>, Boolean> localSimpleTypes = this.simpleTypes;
Boolean isSimpleType = localSimpleTypes.get(type);

View File

@@ -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;

View File

@@ -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);

View File

@@ -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();
}
}

View File

@@ -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;

View File

@@ -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);
}

View File

@@ -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> T createProjection(Class<T> 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> T createProjection(Class<T> projectionType) {
Assert.notNull(projectionType, "Projection type must not be null!");
Assert.notNull(projectionType, "Projection type must not be null");
return createProjection(projectionType, new HashMap<String, Object>());
}
@@ -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;
}

View File

@@ -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<Value> callback = new AnnotationDetectionMethodCallback<Value>(Value.class);
ReflectionUtils.doWithMethods(type, callback);

View File

@@ -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();

View File

@@ -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;
}

View File

@@ -80,7 +80,7 @@ public class QSort extends Sort implements Serializable {
*/
private static List<Order> toOrders(List<OrderSpecifier<?>> 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<OrderSpecifier<?>> orderSpecifiers) {
Assert.notEmpty(orderSpecifiers, "OrderSpecifiers must not be null or empty!");
Assert.notEmpty(orderSpecifiers, "OrderSpecifiers must not be null or empty");
List<OrderSpecifier<?>> 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));
}

View File

@@ -49,8 +49,8 @@ public class QuerydslRepositoryInvokerAdapter implements RepositoryInvoker {
public QuerydslRepositoryInvokerAdapter(RepositoryInvoker delegate, QuerydslPredicateExecutor<Object> 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;

View File

@@ -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;
}

Some files were not shown because too many files have changed in this diff Show More