From 6a23723f07669e5d4031b3378b3af40e0d15eb82 Mon Sep 17 00:00:00 2001 From: jo Date: Sat, 4 Jun 2022 16:05:30 +0200 Subject: [PATCH] Remove punctuation in all exception messages. Closes #2603. --- .../data/auditing/AnnotationAuditingMetadata.java | 3 ++- .../DefaultAuditableBeanWrapperFactory.java | 5 +++-- .../data/config/ConfigurationUtils.java | 7 ++++--- .../ConfigurableTypeInformationMapper.java | 3 ++- .../data/convert/CustomConversions.java | 1 + .../data/convert/DefaultConverterBuilder.java | 5 +++-- .../MappingContextTypeInformationMapper.java | 5 +++-- ...ChangeSetBackedTransactionSynchronization.java | 8 +++++--- .../data/domain/AbstractPageRequest.java | 5 +++-- .../org/springframework/data/domain/Sort.java | 7 ++++--- .../data/history/AnnotationRevisionMetadata.java | 3 ++- .../data/history/RevisionMetadata.java | 5 +++-- .../data/mapping/IdentifierAccessor.java | 3 ++- .../data/mapping/PersistentEntity.java | 9 +++++---- .../data/mapping/PersistentProperty.java | 11 ++++++----- .../data/mapping/PersistentPropertyAccessor.java | 5 +++-- .../data/mapping/PersistentPropertyPath.java | 3 ++- .../data/mapping/PropertyPath.java | 7 ++++--- .../mapping/TargetAwareIdentifierAccessor.java | 3 ++- .../callback/EntityCallbackDiscoverer.java | 3 ++- .../data/mapping/context/MappingContext.java | 7 ++++--- .../data/mapping/context/PersistentEntities.java | 5 +++-- .../data/mapping/model/BasicPersistentEntity.java | 9 +++++---- .../data/mapping/model/BeanWrapper.java | 9 +++++---- .../ClassGeneratingPropertyAccessorFactory.java | 5 +++-- .../model/InstantiationAwarePropertyAccessor.java | 3 ++- .../KotlinClassGeneratingEntityInstantiator.java | 3 ++- .../model/PersistentEntityIsNewStrategy.java | 5 +++-- .../PersistentEntityParameterValueProvider.java | 5 +++-- .../SimplePersistentPropertyPathAccessor.java | 3 ++- .../springframework/data/projection/Accessor.java | 3 ++- .../DefaultMethodInvokingMethodInterceptor.java | 7 ++++--- .../projection/DefaultProjectionInformation.java | 3 ++- .../projection/MapAccessingMethodInterceptor.java | 3 ++- .../projection/ProjectingMethodInterceptor.java | 3 ++- .../PropertyAccessingMethodInterceptor.java | 5 +++-- .../SpelEvaluatingMethodInterceptor.java | 3 ++- .../data/querydsl/binding/QuerydslBindings.java | 3 ++- .../querydsl/binding/QuerydslDefaultBinding.java | 3 ++- .../querydsl/binding/QuerydslPathInformation.java | 3 ++- .../binding/QuerydslPredicateBuilder.java | 3 ++- .../data/repository/cdi/CdiRepositoryBean.java | 5 +++-- .../AnnotationRepositoryConfigurationSource.java | 7 ++++--- .../config/DefaultRepositoryConfiguration.java | 3 ++- .../data/repository/config/FragmentMetadata.java | 5 +++-- .../ImplementationDetectionConfiguration.java | 3 ++- .../config/RepositoryBeanNameGenerator.java | 5 +++-- .../RepositoryConfigurationExtensionSupport.java | 3 ++- .../config/RepositoryConfigurationSource.java | 3 ++- ...erRepositoryPopulatorBeanDefinitionParser.java | 3 ++- .../data/repository/config/SelectionSet.java | 3 ++- .../data/repository/core/EntityInformation.java | 3 ++- .../core/support/AbstractEntityInformation.java | 3 ++- .../support/AnnotationRepositoryMetadata.java | 3 ++- .../core/support/MethodInvocationValidator.java | 5 +++-- ...onTranslationRepositoryProxyPostProcessor.java | 3 ++- .../support/QueryExecutorMethodInterceptor.java | 3 ++- .../support/ReactiveRepositoryFactorySupport.java | 7 ++++--- .../core/support/RepositoryComposition.java | 3 ++- .../support/RepositoryFactoryBeanSupport.java | 3 ++- .../core/support/RepositoryFactorySupport.java | 7 ++++--- .../AbstractRepositoryPopulatorFactoryBean.java | 3 ++- .../repository/init/Jackson2ResourceReader.java | 3 ++- ...nmarshallerRepositoryPopulatorFactoryBean.java | 3 ++- ...AwareQueryMethodEvaluationContextProvider.java | 3 ++- .../data/repository/query/Parameter.java | 3 ++- .../data/repository/query/Parameters.java | 3 ++- .../data/repository/query/QueryMethod.java | 5 +++-- .../query/parser/AbstractQueryCreator.java | 3 ++- .../data/repository/query/parser/PartTree.java | 3 ++- .../repository/support/DomainClassConverter.java | 5 +++-- .../QueryMethodParameterConversionException.java | 7 ++++--- .../support/ReflectionRepositoryInvoker.java | 15 ++++++++------- .../data/repository/support/Repositories.java | 3 ++- .../data/repository/util/ClassUtils.java | 3 ++- .../springframework/data/spel/spi/Function.java | 3 ++- .../data/support/PersistableIsNewStrategy.java | 3 ++- .../data/util/AnnotatedTypeScanner.java | 3 ++- .../util/AnnotationDetectionFieldCallback.java | 3 ++- .../util/AnnotationDetectionMethodCallback.java | 3 ++- .../DirectFieldAccessFallbackBeanWrapper.java | 5 +++-- .../data/util/KotlinReflectionUtils.java | 7 ++++--- .../java/org/springframework/data/util/Lazy.java | 3 ++- .../data/util/MethodInvocationRecorder.java | 3 ++- .../data/util/ReflectionUtils.java | 5 +++-- .../springframework/data/util/TypeDiscoverer.java | 3 ++- .../data/util/TypeInformation.java | 11 ++++++----- .../springframework/data/web/MapDataBinder.java | 8 +++++--- .../PagedResourcesAssemblerArgumentResolver.java | 3 ++- .../SortHandlerMethodArgumentResolverSupport.java | 5 +++-- .../data/web/SpringDataAnnotationUtils.java | 7 ++++--- .../data/web/XmlBeamHttpMessageConverter.java | 3 ++- .../ProjectingArgumentResolverRegistrar.java | 3 ++- .../QuerydslPredicateArgumentResolverSupport.java | 7 ++++--- .../context/AbstractMappingContextUnitTests.java | 3 ++- .../DefaultRepositoryInformationUnitTests.java | 3 ++- .../RepositoryFactorySupportUnitTests.java | 9 +++++---- .../support/RepositoryMethodInvokerUnitTests.java | 5 +++-- .../util/QueryExecutionConvertersUnitTests.java | 5 +++-- 99 files changed, 275 insertions(+), 174 deletions(-) diff --git a/src/main/java/org/springframework/data/auditing/AnnotationAuditingMetadata.java b/src/main/java/org/springframework/data/auditing/AnnotationAuditingMetadata.java index d0375851b..7076f974a 100644 --- a/src/main/java/org/springframework/data/auditing/AnnotationAuditingMetadata.java +++ b/src/main/java/org/springframework/data/auditing/AnnotationAuditingMetadata.java @@ -41,6 +41,7 @@ import org.springframework.util.Assert; * @author Ranie Jade Ramiso * @author Oliver Gierke * @author Christoph Strobl + * @author Johannes Englmeier * @since 1.5 */ final class AnnotationAuditingMetadata { @@ -108,7 +109,7 @@ final class AnnotationAuditingMetadata { } throw new IllegalStateException(String.format( - "Found created/modified date field with type %s but only %s as well as java.time types are supported!", type, + "Found created/modified date field with type %s but only %s as well as java.time types are supported", type, SUPPORTED_DATE_TYPES)); }); } diff --git a/src/main/java/org/springframework/data/auditing/DefaultAuditableBeanWrapperFactory.java b/src/main/java/org/springframework/data/auditing/DefaultAuditableBeanWrapperFactory.java index 60682cdde..a6e286790 100644 --- a/src/main/java/org/springframework/data/auditing/DefaultAuditableBeanWrapperFactory.java +++ b/src/main/java/org/springframework/data/auditing/DefaultAuditableBeanWrapperFactory.java @@ -38,6 +38,7 @@ import org.springframework.util.Assert; * @author Christoph Strobl * @author Jens Schauder * @author Pavel Horal + * @author Johannes Englmeier * @since 1.5 */ class DefaultAuditableBeanWrapperFactory implements AuditableBeanWrapperFactory { @@ -187,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)); } @@ -227,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)); } diff --git a/src/main/java/org/springframework/data/config/ConfigurationUtils.java b/src/main/java/org/springframework/data/config/ConfigurationUtils.java index 2abca4a15..251c59440 100644 --- a/src/main/java/org/springframework/data/config/ConfigurationUtils.java +++ b/src/main/java/org/springframework/data/config/ConfigurationUtils.java @@ -25,6 +25,7 @@ import org.springframework.util.Assert; * implementation. * * @author Oliver Gierke + * @author Johannes Englmeier * @since 2.0 * @soundtrack Richard Spaven - The Self (feat. Jordan Rakei) */ @@ -44,7 +45,7 @@ public interface ConfigurationUtils { ResourceLoader resourceLoader = context.getResourceLoader(); if (resourceLoader == null) { - throw new IllegalArgumentException("Could not obtain ResourceLoader from XmlReaderContext!"); + throw new IllegalArgumentException("Could not obtain ResourceLoader from XmlReaderContext"); } return resourceLoader; @@ -75,7 +76,7 @@ public interface ConfigurationUtils { ClassLoader classLoader = resourceLoader.getClassLoader(); if (classLoader == null) { - throw new IllegalArgumentException("Could not obtain ClassLoader from ResourceLoader!"); + throw new IllegalArgumentException("Could not obtain ClassLoader from ResourceLoader"); } return classLoader; @@ -96,7 +97,7 @@ public interface ConfigurationUtils { if (result == null) { throw new IllegalArgumentException( - String.format("Could not obtain required bean class name from BeanDefinition!", beanDefinition)); + String.format("Could not obtain required bean class name from BeanDefinition", beanDefinition)); } return result; diff --git a/src/main/java/org/springframework/data/convert/ConfigurableTypeInformationMapper.java b/src/main/java/org/springframework/data/convert/ConfigurableTypeInformationMapper.java index c00d32fe9..f1a062246 100644 --- a/src/main/java/org/springframework/data/convert/ConfigurableTypeInformationMapper.java +++ b/src/main/java/org/springframework/data/convert/ConfigurableTypeInformationMapper.java @@ -33,6 +33,7 @@ import org.springframework.util.Assert; * inspecting the {@link PersistentEntity} instances for type alias information. * * @author Oliver Gierke + * @author Johannes Englmeier */ public class ConfigurableTypeInformationMapper implements TypeInformationMapper { @@ -58,7 +59,7 @@ public class ConfigurableTypeInformationMapper implements TypeInformationMapper if (typeToAlias.containsValue(alias)) { throw new IllegalArgumentException( - String.format("Detected mapping ambiguity! String %s cannot be mapped to more than one type!", alias)); + String.format("Detected mapping ambiguity! String %s cannot be mapped to more than one type", alias)); } this.typeToAlias.put(type, alias); diff --git a/src/main/java/org/springframework/data/convert/CustomConversions.java b/src/main/java/org/springframework/data/convert/CustomConversions.java index f728f1932..4e4642cc2 100644 --- a/src/main/java/org/springframework/data/convert/CustomConversions.java +++ b/src/main/java/org/springframework/data/convert/CustomConversions.java @@ -54,6 +54,7 @@ import org.springframework.util.ObjectUtils; * @author Christoph Strobl * @author Mark Paluch * @author Xeno Amess + * @author Johannes Englmeier * @since 2.0 */ public class CustomConversions { diff --git a/src/main/java/org/springframework/data/convert/DefaultConverterBuilder.java b/src/main/java/org/springframework/data/convert/DefaultConverterBuilder.java index 2dc06055d..b968bf3ff 100644 --- a/src/main/java/org/springframework/data/convert/DefaultConverterBuilder.java +++ b/src/main/java/org/springframework/data/convert/DefaultConverterBuilder.java @@ -38,6 +38,7 @@ import org.springframework.util.ObjectUtils; * * @author Oliver Gierke * @author Mark Paluch + * @author Johannes Englmeier * @since 2.0 * @see ConverterBuilder#writing(Class, Class, Function) * @see ConverterBuilder#reading(Class, Class, Function) @@ -61,13 +62,13 @@ record DefaultConverterBuilder (ConvertiblePair convertiblePair, @Override public GenericConverter getReadingConverter() { return getOptionalReadingConverter() - .orElseThrow(() -> new IllegalStateException("No reading converter specified!")); + .orElseThrow(() -> new IllegalStateException("No reading converter specified")); } @Override public GenericConverter getWritingConverter() { return getOptionalWritingConverter() - .orElseThrow(() -> new IllegalStateException("No writing converter specified!")); + .orElseThrow(() -> new IllegalStateException("No writing converter specified")); } @Override diff --git a/src/main/java/org/springframework/data/convert/MappingContextTypeInformationMapper.java b/src/main/java/org/springframework/data/convert/MappingContextTypeInformationMapper.java index 1c0f5a60f..6f1290f88 100644 --- a/src/main/java/org/springframework/data/convert/MappingContextTypeInformationMapper.java +++ b/src/main/java/org/springframework/data/convert/MappingContextTypeInformationMapper.java @@ -34,6 +34,7 @@ import org.springframework.util.Assert; * * @author Oliver Gierke * @author Christoph Strobl + * @author Johannes Englmeier */ public class MappingContextTypeInformationMapper implements TypeInformationMapper { @@ -87,7 +88,7 @@ public class MappingContextTypeInformationMapper implements TypeInformationMappe if (existingAlias.isPresentButDifferent(alias)) { throw new IllegalArgumentException( - String.format("Trying to register alias '%s', but found already registered alias '%s' for type %s!", alias, + String.format("Trying to register alias '%s', but found already registered alias '%s' for type %s", alias, existingAlias, key)); } @@ -100,7 +101,7 @@ public class MappingContextTypeInformationMapper implements TypeInformationMappe .findFirst().ifPresent(it -> { throw new IllegalArgumentException(String.format( - "Detected existing type mapping of %s to alias '%s' but attempted to bind the same alias to %s!", key, + "Detected existing type mapping of %s to alias '%s' but attempted to bind the same alias to %s", key, alias, it.getKey())); }); } diff --git a/src/main/java/org/springframework/data/crossstore/ChangeSetBackedTransactionSynchronization.java b/src/main/java/org/springframework/data/crossstore/ChangeSetBackedTransactionSynchronization.java index 2fe185d2f..db32f3d17 100644 --- a/src/main/java/org/springframework/data/crossstore/ChangeSetBackedTransactionSynchronization.java +++ b/src/main/java/org/springframework/data/crossstore/ChangeSetBackedTransactionSynchronization.java @@ -19,7 +19,9 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.transaction.support.TransactionSynchronization; - +/** + * @author Johannes Englmeier + */ public class ChangeSetBackedTransactionSynchronization implements TransactionSynchronization { private static final Log logger = LogFactory.getLog(ChangeSetBackedTransactionSynchronization.class); @@ -63,12 +65,12 @@ public class ChangeSetBackedTransactionSynchronization implements TransactionSyn public void resume() { throw new IllegalStateException( - "ChangedSetBackedTransactionSynchronization does not support transaction suspension currently."); + "ChangedSetBackedTransactionSynchronization does not support transaction suspension currently"); } public void suspend() { throw new IllegalStateException( - "ChangedSetBackedTransactionSynchronization does not support transaction suspension currently."); + "ChangedSetBackedTransactionSynchronization does not support transaction suspension currently"); } } diff --git a/src/main/java/org/springframework/data/domain/AbstractPageRequest.java b/src/main/java/org/springframework/data/domain/AbstractPageRequest.java index 34dbbef63..9deec38c4 100644 --- a/src/main/java/org/springframework/data/domain/AbstractPageRequest.java +++ b/src/main/java/org/springframework/data/domain/AbstractPageRequest.java @@ -23,6 +23,7 @@ import java.io.Serializable; * @author Thomas Darimont * @author Oliver Gierke * @author Alex Bondarev + * @author Johannes Englmeier */ public abstract class AbstractPageRequest implements Pageable, Serializable { @@ -41,11 +42,11 @@ public abstract class AbstractPageRequest implements Pageable, Serializable { public AbstractPageRequest(int page, int size) { if (page < 0) { - throw new IllegalArgumentException("Page index must not be less than zero!"); + throw new IllegalArgumentException("Page index must not be less than zero"); } if (size < 1) { - throw new IllegalArgumentException("Page size must not be less than one!"); + throw new IllegalArgumentException("Page size must not be less than one"); } this.page = page; diff --git a/src/main/java/org/springframework/data/domain/Sort.java b/src/main/java/org/springframework/data/domain/Sort.java index e07b56bfb..f42283859 100644 --- a/src/main/java/org/springframework/data/domain/Sort.java +++ b/src/main/java/org/springframework/data/domain/Sort.java @@ -40,6 +40,7 @@ import org.springframework.util.StringUtils; * @author Oliver Gierke * @author Thomas Darimont * @author Mark Paluch + * @author Johannes Englmeier */ public class Sort implements Streamable, Serializable { @@ -64,7 +65,7 @@ public class Sort implements Streamable properties) { if (properties == null || properties.isEmpty()) { - throw new IllegalArgumentException("You have to provide at least one property to sort by!"); + throw new IllegalArgumentException("You have to provide at least one property to sort by"); } this.orders = properties.stream() // @@ -304,7 +305,7 @@ public class Sort implements Streamable> implements RevisionMetadata { @@ -135,6 +136,6 @@ public class AnnotationRevisionMetadata> implem return ((Date) timestamp).toInstant(); } - throw new IllegalArgumentException(String.format("Can't convert %s to Instant!", timestamp)); + throw new IllegalArgumentException(String.format("Can't convert %s to Instant", timestamp)); } } diff --git a/src/main/java/org/springframework/data/history/RevisionMetadata.java b/src/main/java/org/springframework/data/history/RevisionMetadata.java index 26859377c..f397352d6 100755 --- a/src/main/java/org/springframework/data/history/RevisionMetadata.java +++ b/src/main/java/org/springframework/data/history/RevisionMetadata.java @@ -24,6 +24,7 @@ import java.util.Optional; * @author Philipp Huegelmeyer * @author Oliver Gierke * @author Jens Schauder + * @author Johannes Englmeier */ public interface RevisionMetadata> { @@ -43,7 +44,7 @@ public interface RevisionMetadata> { default N getRequiredRevisionNumber() { return getRevisionNumber().orElseThrow( - () -> new IllegalStateException(String.format("No revision number found on %s!", this. getDelegate()))); + () -> new IllegalStateException(String.format("No revision number found on %s", this. getDelegate()))); } /** @@ -62,7 +63,7 @@ public interface RevisionMetadata> { default Instant getRequiredRevisionInstant() { return getRevisionInstant().orElseThrow( - () -> new IllegalStateException(String.format("No revision date found on %s!", this. getDelegate()))); + () -> new IllegalStateException(String.format("No revision date found on %s", this. getDelegate()))); } /** diff --git a/src/main/java/org/springframework/data/mapping/IdentifierAccessor.java b/src/main/java/org/springframework/data/mapping/IdentifierAccessor.java index e49575e83..967ff4610 100644 --- a/src/main/java/org/springframework/data/mapping/IdentifierAccessor.java +++ b/src/main/java/org/springframework/data/mapping/IdentifierAccessor.java @@ -22,6 +22,7 @@ import org.springframework.lang.Nullable; * * @author Oliver Gierke * @author Mark Paluch + * @author Johannes Englmeier * @see TargetAwareIdentifierAccessor */ public interface IdentifierAccessor { @@ -51,6 +52,6 @@ public interface IdentifierAccessor { return identifier; } - throw new IllegalStateException("Could not obtain identifier!"); + throw new IllegalStateException("Could not obtain identifier"); } } diff --git a/src/main/java/org/springframework/data/mapping/PersistentEntity.java b/src/main/java/org/springframework/data/mapping/PersistentEntity.java index b3b8624e3..8232e7644 100644 --- a/src/main/java/org/springframework/data/mapping/PersistentEntity.java +++ b/src/main/java/org/springframework/data/mapping/PersistentEntity.java @@ -32,6 +32,7 @@ import org.springframework.util.Assert; * @author Patryk Wasik * @author Mark Paluch * @author Christoph Strobl + * @author Johannes Englmeier */ public interface PersistentEntity> extends Iterable

{ @@ -131,7 +132,7 @@ public interface PersistentEntity> extends It return property; } - throw new IllegalStateException(String.format("Required identifier property not found for %s!", getType())); + throw new IllegalStateException(String.format("Required identifier property not found for %s", getType())); } /** @@ -159,7 +160,7 @@ public interface PersistentEntity> extends It return property; } - throw new IllegalStateException(String.format("Required version property not found for %s!", getType())); + throw new IllegalStateException(String.format("Required version property not found for %s", getType())); } /** @@ -186,7 +187,7 @@ public interface PersistentEntity> extends It return property; } - throw new IllegalStateException(String.format("Required property %s not found for %s!", name, getType())); + throw new IllegalStateException(String.format("Required property %s not found for %s", name, getType())); } /** @@ -312,7 +313,7 @@ public interface PersistentEntity> extends It } throw new IllegalStateException( - String.format("Required annotation %s not found for %s!", annotationType, getType())); + String.format("Required annotation %s not found for %s", annotationType, getType())); } /** diff --git a/src/main/java/org/springframework/data/mapping/PersistentProperty.java b/src/main/java/org/springframework/data/mapping/PersistentProperty.java index d157269b7..11826a9b6 100644 --- a/src/main/java/org/springframework/data/mapping/PersistentProperty.java +++ b/src/main/java/org/springframework/data/mapping/PersistentProperty.java @@ -34,6 +34,7 @@ import org.springframework.util.Assert; * @author Mark Paluch * @author Jens Schauder * @author Christoph Strobl + * @author Johannes Englmeier */ public interface PersistentProperty

> { @@ -89,7 +90,7 @@ public interface PersistentProperty

> { Method getter = getGetter(); if (getter == null) { - throw new IllegalArgumentException(String.format("No getter available for persistent property %s!", this)); + throw new IllegalArgumentException(String.format("No getter available for persistent property %s", this)); } return getter; @@ -109,7 +110,7 @@ public interface PersistentProperty

> { Method setter = getSetter(); if (setter == null) { - throw new IllegalArgumentException(String.format("No setter available for persistent property %s!", this)); + throw new IllegalArgumentException(String.format("No setter available for persistent property %s", this)); } return setter; @@ -147,7 +148,7 @@ public interface PersistentProperty

> { Method wither = getWither(); if (wither == null) { - throw new IllegalArgumentException(String.format("No wither available for persistent property %s!", this)); + throw new IllegalArgumentException(String.format("No wither available for persistent property %s", this)); } return wither; @@ -161,7 +162,7 @@ public interface PersistentProperty

> { Field field = getField(); if (field == null) { - throw new IllegalArgumentException(String.format("No field backing persistent property %s!", this)); + throw new IllegalArgumentException(String.format("No field backing persistent property %s", this)); } return field; @@ -193,7 +194,7 @@ public interface PersistentProperty

> { return association; } - throw new IllegalStateException("No association found!"); + throw new IllegalStateException("No association found"); } /** diff --git a/src/main/java/org/springframework/data/mapping/PersistentPropertyAccessor.java b/src/main/java/org/springframework/data/mapping/PersistentPropertyAccessor.java index 20e13b5d2..534ff3a9c 100644 --- a/src/main/java/org/springframework/data/mapping/PersistentPropertyAccessor.java +++ b/src/main/java/org/springframework/data/mapping/PersistentPropertyAccessor.java @@ -29,6 +29,7 @@ import org.springframework.util.Assert; * * @author Oliver Gierke * @author Mark Paluch + * @author Johannes Englmeier * @since 1.10 * @see PersistentEntity#getPropertyAccessor(Object) * @see ConvertingPropertyAccessor @@ -75,7 +76,7 @@ public interface PersistentPropertyAccessor { if (parent == null) { - String nullIntermediateMessage = "Cannot lookup property %s on null intermediate! Original path was: %s on %s."; + String nullIntermediateMessage = "Cannot lookup property %s on null intermediate! Original path was: %s on %s"; throw new MappingException( String.format(nullIntermediateMessage, parentProperty, path.toDotPath(), getBean().getClass().getName())); @@ -151,7 +152,7 @@ public interface PersistentPropertyAccessor { if (current == null) { - String nullIntermediateMessage = "Cannot lookup property %s on null intermediate! Original path was: %s on %s."; + String nullIntermediateMessage = "Cannot lookup property %s on null intermediate! Original path was: %s on %s"; throw new MappingException( String.format(nullIntermediateMessage, property, path.toDotPath(), bean.getClass().getName())); diff --git a/src/main/java/org/springframework/data/mapping/PersistentPropertyPath.java b/src/main/java/org/springframework/data/mapping/PersistentPropertyPath.java index 4be58391e..3cab135d6 100644 --- a/src/main/java/org/springframework/data/mapping/PersistentPropertyPath.java +++ b/src/main/java/org/springframework/data/mapping/PersistentPropertyPath.java @@ -23,6 +23,7 @@ import org.springframework.lang.Nullable; * Abstraction of a path of {@link PersistentProperty}s. * * @author Oliver Gierke + * @author Johannes Englmeier */ public interface PersistentPropertyPath

> extends Streamable

{ @@ -79,7 +80,7 @@ public interface PersistentPropertyPath

> extends P property = getLeafProperty(); if (property == null) { - throw new IllegalStateException("No leaf property found!"); + throw new IllegalStateException("No leaf property found"); } return property; diff --git a/src/main/java/org/springframework/data/mapping/PropertyPath.java b/src/main/java/org/springframework/data/mapping/PropertyPath.java index e51a3369a..0e88d2a65 100644 --- a/src/main/java/org/springframework/data/mapping/PropertyPath.java +++ b/src/main/java/org/springframework/data/mapping/PropertyPath.java @@ -41,10 +41,11 @@ import org.springframework.util.StringUtils; * @author Christoph Strobl * @author Mark Paluch * @author Mariusz Mączkowski + * @author Johannes Englmeier */ public class PropertyPath implements Streamable { - private static final String PARSE_DEPTH_EXCEEDED = "Trying to parse a path with depth greater than 1000! This has been disabled for security reasons to prevent parsing overflows."; + private static final String PARSE_DEPTH_EXCEEDED = "Trying to parse a path with depth greater than 1000! This has been disabled for security reasons to prevent parsing overflows"; private static final String DELIMITERS = "_\\."; private static final Pattern SPLITTER = Pattern.compile("(?:[%s]?([%s]*?[^%s]+))".replaceAll("%s", DELIMITERS)); @@ -300,7 +301,7 @@ public class PropertyPath implements Streamable { if (result == null) { throw new IllegalStateException( - "No next path available! Clients should call hasNext() before invoking this method!"); + "No next path available! Clients should call hasNext() before invoking this method"); } return result; @@ -358,7 +359,7 @@ public class PropertyPath implements Streamable { if (result == null) { throw new IllegalStateException( - String.format("Expected parsing to yield a PropertyPath from %s but got null!", source)); + String.format("Expected parsing to yield a PropertyPath from %s but got null", source)); } return result; diff --git a/src/main/java/org/springframework/data/mapping/TargetAwareIdentifierAccessor.java b/src/main/java/org/springframework/data/mapping/TargetAwareIdentifierAccessor.java index 8130339db..f417d48d4 100644 --- a/src/main/java/org/springframework/data/mapping/TargetAwareIdentifierAccessor.java +++ b/src/main/java/org/springframework/data/mapping/TargetAwareIdentifierAccessor.java @@ -21,6 +21,7 @@ package org.springframework.data.mapping; * * @author Oliver Gierke * @author Mark Paluch + * @author Johannes Englmeier * @since 2.0 * @soundtrack Anika Nilles - Greenfield (Pikalar) */ @@ -41,6 +42,6 @@ public abstract class TargetAwareIdentifierAccessor implements IdentifierAccesso return identifier; } - throw new IllegalStateException(String.format("Could not obtain identifier from %s!", target)); + throw new IllegalStateException(String.format("Could not obtain identifier from %s", target)); } } diff --git a/src/main/java/org/springframework/data/mapping/callback/EntityCallbackDiscoverer.java b/src/main/java/org/springframework/data/mapping/callback/EntityCallbackDiscoverer.java index 213993dd0..e3bec0535 100644 --- a/src/main/java/org/springframework/data/mapping/callback/EntityCallbackDiscoverer.java +++ b/src/main/java/org/springframework/data/mapping/callback/EntityCallbackDiscoverer.java @@ -44,6 +44,7 @@ import org.springframework.util.comparator.Comparators; * @author Mark Paluch * @author Christoph Strobl * @author Myeonghyeon Lee + * @author Johannes Englmeier * @since 2.2 */ class EntityCallbackDiscoverer { @@ -322,7 +323,7 @@ class EntityCallbackDiscoverer { } throw new IllegalStateException( - String.format("%s does not define a callback method accepting %s and %s additional arguments.", + String.format("%s does not define a callback method accepting %s and %s additional arguments", ClassUtils.getShortName(callbackType), ClassUtils.getShortName(entityType), args.length)); } diff --git a/src/main/java/org/springframework/data/mapping/context/MappingContext.java b/src/main/java/org/springframework/data/mapping/context/MappingContext.java index 6481d92d9..c71979fcf 100644 --- a/src/main/java/org/springframework/data/mapping/context/MappingContext.java +++ b/src/main/java/org/springframework/data/mapping/context/MappingContext.java @@ -37,6 +37,7 @@ import org.springframework.lang.Nullable; * @author Graeme Rocher * @author Mark Paluch * @author Christoph Strobl + * @author Johannes Englmeier */ public interface MappingContext, P extends PersistentProperty

> { @@ -76,7 +77,7 @@ public interface MappingContext, P extends Pers return entity; } - throw new MappingException(String.format("Couldn't find PersistentEntity for type %s!", type)); + throw new MappingException(String.format("Couldn't find PersistentEntity for type %s", type)); } /** @@ -116,7 +117,7 @@ public interface MappingContext, P extends Pers return entity; } - throw new MappingException(String.format("Couldn't find PersistentEntity for type %s!", type)); + throw new MappingException(String.format("Couldn't find PersistentEntity for type %s", type)); } /** @@ -149,7 +150,7 @@ public interface MappingContext, P extends Pers return entity; } - throw new MappingException(String.format("Couldn't find PersistentEntity for property %s!", persistentProperty)); + throw new MappingException(String.format("Couldn't find PersistentEntity for property %s", persistentProperty)); } /** diff --git a/src/main/java/org/springframework/data/mapping/context/PersistentEntities.java b/src/main/java/org/springframework/data/mapping/context/PersistentEntities.java index f38b9a7b6..577a89211 100644 --- a/src/main/java/org/springframework/data/mapping/context/PersistentEntities.java +++ b/src/main/java/org/springframework/data/mapping/context/PersistentEntities.java @@ -41,6 +41,7 @@ import org.springframework.util.Assert; * @author Oliver Gierke * @author Christoph Strobl * @author Mark Paluch + * @author Johannes Englmeier * @since 1.8 */ public class PersistentEntities implements Streamable>> { @@ -117,7 +118,7 @@ public class PersistentEntities implements Streamable { return new MappingException(String.format( - "Cannot get or create PersistentEntity for type %s! PersistentEntities knows about %s MappingContext instances and therefore cannot identify a single responsible one. Please configure the initialEntitySet through an entity scan using the base package in your configuration to pre initialize contexts.", + "Cannot get or create PersistentEntity for type %s! PersistentEntities knows about %s MappingContext instances and therefore cannot identify a single responsible one. Please configure the initialEntitySet through an entity scan using the base package in your configuration to pre initialize contexts", type.getName(), contexts.size())); }); } @@ -253,7 +254,7 @@ public class PersistentEntities implements Streamable it.getType().getName()).collect(Collectors.joining(", ")); - message += "! Introduce dedicated unique identifier types or explicitly define the target type in @Reference!"; + message += "! Introduce dedicated unique identifier types or explicitly define the target type in @Reference"; throw new IllegalStateException(message); } diff --git a/src/main/java/org/springframework/data/mapping/model/BasicPersistentEntity.java b/src/main/java/org/springframework/data/mapping/model/BasicPersistentEntity.java index 977ced80b..8fbd9c5aa 100644 --- a/src/main/java/org/springframework/data/mapping/model/BasicPersistentEntity.java +++ b/src/main/java/org/springframework/data/mapping/model/BasicPersistentEntity.java @@ -58,6 +58,7 @@ import org.springframework.util.StringUtils; * @author Thomas Darimont * @author Christoph Strobl * @author Mark Paluch + * @author Johannes Englmeier */ public class BasicPersistentEntity> implements MutablePersistentEntity { @@ -206,7 +207,7 @@ public class BasicPersistentEntity> implement throw new MappingException( String.format( "Attempt to add version property %s but already have property %s registered " - + "as version. Check your mapping configuration!", + + "as version. Check your mapping configuration", property.getField(), versionProperty.getField())); } @@ -236,7 +237,7 @@ public class BasicPersistentEntity> implement if (idProperty != null) { throw new MappingException(String.format("Attempt to add id property %s but already have property %s registered " - + "as id. Check your mapping configuration!", property.getField(), idProperty.getField())); + + "as id. Check your mapping configuration ", property.getField(), idProperty.getField())); } return property; @@ -520,11 +521,11 @@ public class BasicPersistentEntity> implement public int compare(@Nullable Association

left, @Nullable Association

right) { if (left == null) { - throw new IllegalArgumentException("Left argument must not be null!"); + throw new IllegalArgumentException("Left argument must not be null"); } if (right == null) { - throw new IllegalArgumentException("Right argument must not be null!"); + throw new IllegalArgumentException("Right argument must not be null"); } return delegate.compare(left.getInverse(), right.getInverse()); diff --git a/src/main/java/org/springframework/data/mapping/model/BeanWrapper.java b/src/main/java/org/springframework/data/mapping/model/BeanWrapper.java index 879a3b29f..df39b10c8 100644 --- a/src/main/java/org/springframework/data/mapping/model/BeanWrapper.java +++ b/src/main/java/org/springframework/data/mapping/model/BeanWrapper.java @@ -39,6 +39,7 @@ import org.springframework.util.ReflectionUtils; * * @author Oliver Gierke * @author Mark Paluch + * @author Johannes Englmeier */ class BeanWrapper implements PersistentPropertyAccessor { @@ -80,7 +81,7 @@ class BeanWrapper implements PersistentPropertyAccessor { } throw new UnsupportedOperationException( - String.format("Cannot set immutable property %s.%s!", property.getOwner().getName(), property.getName())); + String.format("Cannot set immutable property %s.%s ", property.getOwner().getName(), property.getName())); } if (!property.usePropertyAccess()) { @@ -98,7 +99,7 @@ class BeanWrapper implements PersistentPropertyAccessor { ReflectionUtils.invokeMethod(setter, bean, value); } catch (IllegalStateException e) { - throw new MappingException("Could not set object property!", e); + throw new MappingException("Could not set object property", e); } } @@ -138,7 +139,7 @@ class BeanWrapper implements PersistentPropertyAccessor { } catch (IllegalStateException e) { throw new MappingException( - String.format("Could not read property %s of %s!", property.toString(), bean.toString()), e); + String.format("Could not read property %s of %s", property.toString(), bean.toString()), e); } } @@ -168,7 +169,7 @@ class BeanWrapper implements PersistentPropertyAccessor { if (copy == null) { throw new UnsupportedOperationException(String.format( - "Kotlin class %s has no .copy(…) method for property %s!", type.getName(), property.getName())); + "Kotlin class %s has no .copy(…) method for property %s", type.getName(), property.getName())); } return copy.callBy(getCallArgs(copy, property, bean, value)); diff --git a/src/main/java/org/springframework/data/mapping/model/ClassGeneratingPropertyAccessorFactory.java b/src/main/java/org/springframework/data/mapping/model/ClassGeneratingPropertyAccessorFactory.java index 600244566..b6438d817 100644 --- a/src/main/java/org/springframework/data/mapping/model/ClassGeneratingPropertyAccessorFactory.java +++ b/src/main/java/org/springframework/data/mapping/model/ClassGeneratingPropertyAccessorFactory.java @@ -64,6 +64,7 @@ import org.springframework.util.ReflectionUtils; * @author Oliver Gierke * @author Christoph Strobl * @author Jens Schauder + * @author Johannes Englmeier * @since 1.13 */ public class ClassGeneratingPropertyAccessorFactory implements PersistentPropertyAccessorFactory { @@ -775,7 +776,7 @@ public class ClassGeneratingPropertyAccessorFactory implements PersistentPropert visitGetPropertySwitch(entity, persistentProperties, internalClassName, mv); mv.visitLabel(l1); - visitThrowUnsupportedOperationException(mv, "No accessor to get property %s!"); + visitThrowUnsupportedOperationException(mv, "No accessor to get property %s"); mv.visitLocalVariable(THIS_REF, referenceName(internalClassName), null, l0, l1, 0); mv.visitLocalVariable("property", referenceName(PERSISTENT_PROPERTY), @@ -938,7 +939,7 @@ public class ClassGeneratingPropertyAccessorFactory implements PersistentPropert Label l1 = new Label(); mv.visitLabel(l1); - visitThrowUnsupportedOperationException(mv, "No accessor to set property %s!"); + visitThrowUnsupportedOperationException(mv, "No accessor to set property %s"); mv.visitLocalVariable(THIS_REF, referenceName(internalClassName), null, l0, l1, 0); mv.visitLocalVariable("property", "Lorg/springframework/data/mapping/PersistentProperty;", diff --git a/src/main/java/org/springframework/data/mapping/model/InstantiationAwarePropertyAccessor.java b/src/main/java/org/springframework/data/mapping/model/InstantiationAwarePropertyAccessor.java index d560fbc7c..7ae8c5887 100644 --- a/src/main/java/org/springframework/data/mapping/model/InstantiationAwarePropertyAccessor.java +++ b/src/main/java/org/springframework/data/mapping/model/InstantiationAwarePropertyAccessor.java @@ -34,6 +34,7 @@ import org.springframework.util.Assert; * * @author Oliver Drotbohm * @author Mark Paluch + * @author Johannes Englmeier * @since 2.3 */ public class InstantiationAwarePropertyAccessor implements PersistentPropertyAccessor { @@ -98,7 +99,7 @@ public class InstantiationAwarePropertyAccessor implements PersistentProperty if (it.getName() == null) { throw new IllegalStateException( - String.format("Cannot detect parameter names of copy creator of %s!", owner.getType())); + String.format("Cannot detect parameter names of copy creator of %s", owner.getType())); } }); diff --git a/src/main/java/org/springframework/data/mapping/model/KotlinClassGeneratingEntityInstantiator.java b/src/main/java/org/springframework/data/mapping/model/KotlinClassGeneratingEntityInstantiator.java index 2f0b1d905..a28fefd76 100644 --- a/src/main/java/org/springframework/data/mapping/model/KotlinClassGeneratingEntityInstantiator.java +++ b/src/main/java/org/springframework/data/mapping/model/KotlinClassGeneratingEntityInstantiator.java @@ -39,6 +39,7 @@ import org.springframework.lang.Nullable; * * @author Mark Paluch * @author Oliver Gierke + * @author Johannes Englmeier * @since 2.0 */ class KotlinClassGeneratingEntityInstantiator extends ClassGeneratingEntityInstantiator { @@ -205,7 +206,7 @@ class KotlinClassGeneratingEntityInstantiator extends ClassGeneratingEntityInsta @Nullable InstanceCreatorMetadata

entityCreator, ParameterValueProvider

provider) { if (entityCreator == null) { - throw new IllegalArgumentException("EntityCreator must not be null!"); + throw new IllegalArgumentException("EntityCreator must not be null"); } Object[] params = allocateArguments(synthetic.getParameterCount() diff --git a/src/main/java/org/springframework/data/mapping/model/PersistentEntityIsNewStrategy.java b/src/main/java/org/springframework/data/mapping/model/PersistentEntityIsNewStrategy.java index 246bde31b..45402ba78 100644 --- a/src/main/java/org/springframework/data/mapping/model/PersistentEntityIsNewStrategy.java +++ b/src/main/java/org/springframework/data/mapping/model/PersistentEntityIsNewStrategy.java @@ -28,6 +28,7 @@ import org.springframework.util.ClassUtils; * * @author Oliver Gierke * @author Mark Paluch + * @author Johannes Englmeier * @soundtrack Scary Pockets - Crash Into Me (Dave Matthews Band Cover feat. Julia Nunes) - * https://www.youtube.com/watch?v=syGlBNVGEqU */ @@ -60,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)); } } } @@ -104,6 +105,6 @@ class PersistentEntityIsNewStrategy implements IsNewStrategy { } throw new IllegalArgumentException( - String.format("Could not determine whether %s is new! Unsupported identifier or version property!", entity)); + String.format("Could not determine whether %s is new! Unsupported identifier or version property", entity)); } } diff --git a/src/main/java/org/springframework/data/mapping/model/PersistentEntityParameterValueProvider.java b/src/main/java/org/springframework/data/mapping/model/PersistentEntityParameterValueProvider.java index d964b143d..d40fab20c 100644 --- a/src/main/java/org/springframework/data/mapping/model/PersistentEntityParameterValueProvider.java +++ b/src/main/java/org/springframework/data/mapping/model/PersistentEntityParameterValueProvider.java @@ -29,6 +29,7 @@ import org.springframework.lang.Nullable; * expression evaluation. * * @author Oliver Gierke + * @author Johannes Englmeier */ public class PersistentEntityParameterValueProvider

> implements ParameterValueProvider

{ @@ -57,14 +58,14 @@ public class PersistentEntityParameterValueProvider

implements PersistentPropertyPathA } if (!type.isInstance(value)) { - throw new MappingException(String.format("Invalid property value type! Need %s but got %s!", // + throw new MappingException(String.format("Invalid property value type! Need %s but got %s", // type.getName(), value.getClass().getName())); } diff --git a/src/main/java/org/springframework/data/projection/Accessor.java b/src/main/java/org/springframework/data/projection/Accessor.java index 63b020a3b..660fb1131 100644 --- a/src/main/java/org/springframework/data/projection/Accessor.java +++ b/src/main/java/org/springframework/data/projection/Accessor.java @@ -26,6 +26,7 @@ import org.springframework.util.Assert; * * @author Oliver Gierke * @author Christoph Strobl + * @author Johannes Englmeier * @soundtrack Benny Greb - Soulfood (Live) * @since 1.13 */ @@ -47,7 +48,7 @@ public final class Accessor { PropertyDescriptor descriptor = BeanUtils.findPropertyForMethod(method); if (descriptor == null) { - throw new IllegalArgumentException(String.format("Invoked method %s is no accessor method!", method)); + throw new IllegalArgumentException(String.format("Invoked method %s is no accessor method", method)); } this.descriptor = descriptor; diff --git a/src/main/java/org/springframework/data/projection/DefaultMethodInvokingMethodInterceptor.java b/src/main/java/org/springframework/data/projection/DefaultMethodInvokingMethodInterceptor.java index 0b556e766..c242bbc91 100644 --- a/src/main/java/org/springframework/data/projection/DefaultMethodInvokingMethodInterceptor.java +++ b/src/main/java/org/springframework/data/projection/DefaultMethodInvokingMethodInterceptor.java @@ -40,6 +40,7 @@ import org.springframework.util.ReflectionUtils; * @author Oliver Gierke * @author Jens Schauder * @author Mark Paluch + * @author Johannes Englmeier */ public class DefaultMethodInvokingMethodInterceptor implements MethodInterceptor { @@ -114,7 +115,7 @@ public class DefaultMethodInvokingMethodInterceptor implements MethodInterceptor MethodHandle lookup(Method method) throws ReflectiveOperationException { if (privateLookupIn == null) { - throw new IllegalStateException("Could not obtain MethodHandles.privateLookupIn!"); + throw new IllegalStateException("Could not obtain MethodHandles.privateLookupIn"); } return doLookup(method, getLookup(method.getDeclaringClass(), privateLookupIn)); @@ -149,7 +150,7 @@ public class DefaultMethodInvokingMethodInterceptor implements MethodInterceptor MethodHandle lookup(Method method) throws ReflectiveOperationException { if (!isAvailable()) { - throw new IllegalStateException("Could not obtain MethodHandles.lookup constructor!"); + throw new IllegalStateException("Could not obtain MethodHandles.lookup constructor"); } Constructor constructor = this.constructor.get(); @@ -222,7 +223,7 @@ public class DefaultMethodInvokingMethodInterceptor implements MethodInterceptor } } - throw new IllegalStateException("No MethodHandleLookup available!"); + throw new IllegalStateException("No MethodHandleLookup available"); } @Nullable diff --git a/src/main/java/org/springframework/data/projection/DefaultProjectionInformation.java b/src/main/java/org/springframework/data/projection/DefaultProjectionInformation.java index 41b211871..7d72ec44c 100644 --- a/src/main/java/org/springframework/data/projection/DefaultProjectionInformation.java +++ b/src/main/java/org/springframework/data/projection/DefaultProjectionInformation.java @@ -47,6 +47,7 @@ import org.springframework.util.ClassUtils; * @author Oliver Gierke * @author Christoph Strobl * @author Mark Paluch + * @author Johannes Englmeier * @since 1.12 */ class DefaultProjectionInformation implements ProjectionInformation { @@ -245,7 +246,7 @@ class DefaultProjectionInformation implements ProjectionInformation { .filter(it -> name.equals(it.getName())) // .findFirst() .orElseThrow(() -> new IllegalStateException( - String.format("Did not find type %s in %s!", name, Arrays.toString(types)))); + String.format("Did not find type %s in %s", name, Arrays.toString(types)))); } /** diff --git a/src/main/java/org/springframework/data/projection/MapAccessingMethodInterceptor.java b/src/main/java/org/springframework/data/projection/MapAccessingMethodInterceptor.java index 75359d251..beb6cdce4 100644 --- a/src/main/java/org/springframework/data/projection/MapAccessingMethodInterceptor.java +++ b/src/main/java/org/springframework/data/projection/MapAccessingMethodInterceptor.java @@ -29,6 +29,7 @@ import org.springframework.util.ReflectionUtils; * {@link MethodInterceptor} to support accessor methods to store and retrieve values from a {@link Map}. * * @author Oliver Gierke + * @author Johannes Englmeier * @since 1.10 */ class MapAccessingMethodInterceptor implements MethodInterceptor { @@ -61,6 +62,6 @@ class MapAccessingMethodInterceptor implements MethodInterceptor { return null; } - throw new IllegalStateException("Should never get here!"); + throw new IllegalStateException("Should never get here"); } } diff --git a/src/main/java/org/springframework/data/projection/ProjectingMethodInterceptor.java b/src/main/java/org/springframework/data/projection/ProjectingMethodInterceptor.java index 15861f51a..b5ab7c7df 100644 --- a/src/main/java/org/springframework/data/projection/ProjectingMethodInterceptor.java +++ b/src/main/java/org/springframework/data/projection/ProjectingMethodInterceptor.java @@ -45,6 +45,7 @@ import org.springframework.util.ObjectUtils; * @author Oliver Gierke * @author Mark Paluch * @author Christoph Strobl + * @author Johannes Englmeier * @since 1.10 */ class ProjectingMethodInterceptor implements MethodInterceptor { @@ -108,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))); } } diff --git a/src/main/java/org/springframework/data/projection/PropertyAccessingMethodInterceptor.java b/src/main/java/org/springframework/data/projection/PropertyAccessingMethodInterceptor.java index a30d697d9..4e3bf61a5 100644 --- a/src/main/java/org/springframework/data/projection/PropertyAccessingMethodInterceptor.java +++ b/src/main/java/org/springframework/data/projection/PropertyAccessingMethodInterceptor.java @@ -32,6 +32,7 @@ import org.springframework.util.ReflectionUtils; * * @author Oliver Gierke * @author Mark Paluch + * @author Johannes Englmeier * @since 1.10 */ class PropertyAccessingMethodInterceptor implements MethodInterceptor { @@ -62,7 +63,7 @@ class PropertyAccessingMethodInterceptor implements MethodInterceptor { PropertyDescriptor descriptor = BeanUtils.findPropertyForMethod(method); if (descriptor == null) { - throw new IllegalStateException("Invoked method is not a property accessor!"); + throw new IllegalStateException("Invoked method is not a property accessor"); } if (!isSetterMethod(method, descriptor)) { @@ -70,7 +71,7 @@ class PropertyAccessingMethodInterceptor implements MethodInterceptor { } if (invocation.getArguments().length != 1) { - throw new IllegalStateException("Invoked setter method requires exactly one argument!"); + throw new IllegalStateException("Invoked setter method requires exactly one argument"); } target.setPropertyValue(descriptor.getName(), invocation.getArguments()[0]); diff --git a/src/main/java/org/springframework/data/projection/SpelEvaluatingMethodInterceptor.java b/src/main/java/org/springframework/data/projection/SpelEvaluatingMethodInterceptor.java index c396bf520..f45587e7c 100644 --- a/src/main/java/org/springframework/data/projection/SpelEvaluatingMethodInterceptor.java +++ b/src/main/java/org/springframework/data/projection/SpelEvaluatingMethodInterceptor.java @@ -47,6 +47,7 @@ import org.springframework.util.StringUtils; * @author Thomas Darimont * @author Christoph Strobl * @author Xeno Amess + * @author Johannes Englmeier * @see 1.10 */ class SpelEvaluatingMethodInterceptor implements MethodInterceptor { @@ -116,7 +117,7 @@ class SpelEvaluatingMethodInterceptor implements MethodInterceptor { } if (!StringUtils.hasText(value.value())) { - throw new IllegalStateException(String.format("@Value annotation on %s contains empty expression!", method)); + throw new IllegalStateException(String.format("@Value annotation on %s contains empty expression", method)); } expressions.put(method.hashCode(), parser.parseExpression(value.value(), PARSER_CONTEXT)); diff --git a/src/main/java/org/springframework/data/querydsl/binding/QuerydslBindings.java b/src/main/java/org/springframework/data/querydsl/binding/QuerydslBindings.java index 93c0b1234..8dcb91f0b 100644 --- a/src/main/java/org/springframework/data/querydsl/binding/QuerydslBindings.java +++ b/src/main/java/org/springframework/data/querydsl/binding/QuerydslBindings.java @@ -60,6 +60,7 @@ import com.querydsl.core.types.Path; * @author Christoph Strobl * @author Oliver Gierke * @author Mark Paluch + * @author Johannes Englmeier * @since 1.11 * @see QuerydslBinderCustomizer */ @@ -357,7 +358,7 @@ public class QuerydslBindings { Path rootPath = path.getMetadata().getRootPath(); if (rootPath == null) { - throw new IllegalStateException(String.format("Couldn't find root path on path %s!", path)); + throw new IllegalStateException(String.format("Couldn't find root path on path %s", path)); } return path.toString().substring(rootPath.getMetadata().getName().length() + 1); diff --git a/src/main/java/org/springframework/data/querydsl/binding/QuerydslDefaultBinding.java b/src/main/java/org/springframework/data/querydsl/binding/QuerydslDefaultBinding.java index 066bbf7ab..5a33e70d6 100644 --- a/src/main/java/org/springframework/data/querydsl/binding/QuerydslDefaultBinding.java +++ b/src/main/java/org/springframework/data/querydsl/binding/QuerydslDefaultBinding.java @@ -38,6 +38,7 @@ import com.querydsl.core.types.dsl.SimpleExpression; * @author Christoph Strobl * @author Oliver Gierke * @author Colin Gao + * @author Johannes Englmeier * @since 1.11 */ class QuerydslDefaultBinding implements MultiValueBinding, Object> { @@ -78,6 +79,6 @@ class QuerydslDefaultBinding implements MultiValueBinding } throw new IllegalArgumentException( - String.format("Cannot create predicate for path '%s' with type '%s'.", path, path.getMetadata().getPathType())); + String.format("Cannot create predicate for path '%s' with type '%s'", path, path.getMetadata().getPathType())); } } diff --git a/src/main/java/org/springframework/data/querydsl/binding/QuerydslPathInformation.java b/src/main/java/org/springframework/data/querydsl/binding/QuerydslPathInformation.java index c94b33fa3..055583200 100644 --- a/src/main/java/org/springframework/data/querydsl/binding/QuerydslPathInformation.java +++ b/src/main/java/org/springframework/data/querydsl/binding/QuerydslPathInformation.java @@ -30,6 +30,7 @@ import com.querydsl.core.types.Path; * * @author Oliver Gierke * @author Mark Paluch + * @author Johannes Englmeier * @since 1.13 */ class QuerydslPathInformation implements PathInformation { @@ -60,7 +61,7 @@ class QuerydslPathInformation implements PathInformation { Path parent = path.getMetadata().getParent(); if (parent == null) { - throw new IllegalStateException(String.format("Could not obtain metadata for parent node of %s!", path)); + throw new IllegalStateException(String.format("Could not obtain metadata for parent node of %s", path)); } return parent.getType(); diff --git a/src/main/java/org/springframework/data/querydsl/binding/QuerydslPredicateBuilder.java b/src/main/java/org/springframework/data/querydsl/binding/QuerydslPredicateBuilder.java index 481c5d835..f2ffad1ef 100644 --- a/src/main/java/org/springframework/data/querydsl/binding/QuerydslPredicateBuilder.java +++ b/src/main/java/org/springframework/data/querydsl/binding/QuerydslPredicateBuilder.java @@ -47,6 +47,7 @@ import com.querydsl.core.types.Predicate; * @author Christoph Strobl * @author Oliver Gierke * @author Mark Paluch + * @author Johannes Englmeier * @since 1.11 */ public class QuerydslPredicateBuilder { @@ -224,7 +225,7 @@ public class QuerydslPredicateBuilder { .nested(new Property(owningType, descriptor.getReadMethod(), descriptor.getWriteMethod(), leafProperty), 0); if (result == null) { - throw new IllegalStateException(String.format("Could not obtain TypeDescriptor for PathInformation %s!", path)); + throw new IllegalStateException(String.format("Could not obtain TypeDescriptor for PathInformation %s", path)); } return result; diff --git a/src/main/java/org/springframework/data/repository/cdi/CdiRepositoryBean.java b/src/main/java/org/springframework/data/repository/cdi/CdiRepositoryBean.java index 9faae59ea..29eb8f107 100644 --- a/src/main/java/org/springframework/data/repository/cdi/CdiRepositoryBean.java +++ b/src/main/java/org/springframework/data/repository/cdi/CdiRepositoryBean.java @@ -63,6 +63,7 @@ import org.springframework.util.StringUtils; * @author Christoph Strobl * @author Ariel Carrera * @author Xeno Amess + * @author Johannes Englmeier */ public abstract class CdiRepositoryBean implements Bean, PassivationCapable { @@ -108,7 +109,7 @@ public abstract class CdiRepositoryBean implements Bean, PassivationCapabl this.repositoryType = repositoryType; this.beanManager = beanManager; this.context = new CdiRepositoryContext(getClass().getClassLoader(), detector - .orElseThrow(() -> new IllegalArgumentException("CustomRepositoryImplementationDetector must be present!"))); + .orElseThrow(() -> new IllegalArgumentException("CustomRepositoryImplementationDetector must be present"))); this.passivationId = createPassivationId(qualifiers, repositoryType); } @@ -356,7 +357,7 @@ public abstract class CdiRepositoryBean implements Bean, PassivationCapabl return Arrays.stream(repositoryType.getInterfaces()) // .filter(it -> it.getName().equals(interfaceName)) // .findFirst() // - .orElseThrow(() -> new IllegalArgumentException(String.format("Did not find type %s in %s!", interfaceName, + .orElseThrow(() -> new IllegalArgumentException(String.format("Did not find type %s in %s", interfaceName, Arrays.asList(repositoryType.getInterfaces())))); } diff --git a/src/main/java/org/springframework/data/repository/config/AnnotationRepositoryConfigurationSource.java b/src/main/java/org/springframework/data/repository/config/AnnotationRepositoryConfigurationSource.java index e9aa49c6b..d65b85471 100644 --- a/src/main/java/org/springframework/data/repository/config/AnnotationRepositoryConfigurationSource.java +++ b/src/main/java/org/springframework/data/repository/config/AnnotationRepositoryConfigurationSource.java @@ -57,6 +57,7 @@ import org.springframework.util.StringUtils; * @author Peter Rietzler * @author Jens Schauder * @author Mark Paluch + * @author Johannes Englmeier */ public class AnnotationRepositoryConfigurationSource extends RepositoryConfigurationSourceSupport { @@ -118,7 +119,7 @@ public class AnnotationRepositoryConfigurationSource extends RepositoryConfigura Map annotationAttributes = metadata.getAnnotationAttributes(annotation.getName()); if (annotationAttributes == null) { - throw new IllegalStateException(String.format("Unable to obtain annotation attributes for %s!", annotation)); + throw new IllegalStateException(String.format("Unable to obtain annotation attributes for %s", annotation)); } this.attributes = new AnnotationAttributes(annotationAttributes); @@ -228,7 +229,7 @@ public class AnnotationRepositoryConfigurationSource extends RepositoryConfigura public Optional getAttribute(String name, Class type) { if (!attributes.containsKey(name)) { - throw new IllegalArgumentException(String.format("No attribute named %s found!", name)); + throw new IllegalArgumentException(String.format("No attribute named %s found", name)); } Object value = attributes.get(name); @@ -238,7 +239,7 @@ public class AnnotationRepositoryConfigurationSource extends RepositoryConfigura } Assert.isInstanceOf(type, value, - () -> String.format("Attribute value for %s is of type %s but was expected to be of type %s!", name, + () -> String.format("Attribute value for %s is of type %s but was expected to be of type %s", name, value.getClass(), type)); Object result = value instanceof String // diff --git a/src/main/java/org/springframework/data/repository/config/DefaultRepositoryConfiguration.java b/src/main/java/org/springframework/data/repository/config/DefaultRepositoryConfiguration.java index cfa260bbb..3d39c236b 100644 --- a/src/main/java/org/springframework/data/repository/config/DefaultRepositoryConfiguration.java +++ b/src/main/java/org/springframework/data/repository/config/DefaultRepositoryConfiguration.java @@ -34,6 +34,7 @@ import org.springframework.util.StringUtils; * @author Oliver Gierke * @author Jens Schauder * @author Mark Paluch + * @author Johannes Englmeier */ public class DefaultRepositoryConfiguration implements RepositoryConfiguration { @@ -55,7 +56,7 @@ public class DefaultRepositoryConfiguration new IllegalStateException("Can't create bean identifier without a repository base class defined!")))); + () -> new IllegalStateException("Can't create bean identifier without a repository base class defined")))); } public Object getQueryLookupStrategyKey() { diff --git a/src/main/java/org/springframework/data/repository/config/FragmentMetadata.java b/src/main/java/org/springframework/data/repository/config/FragmentMetadata.java index f639ac28e..d76d046fb 100644 --- a/src/main/java/org/springframework/data/repository/config/FragmentMetadata.java +++ b/src/main/java/org/springframework/data/repository/config/FragmentMetadata.java @@ -31,6 +31,7 @@ import org.springframework.util.Assert; * * @author Mark Paluch * @author Oliver Gierke + * @author Johannes Englmeier * @since 2.1 */ public class FragmentMetadata { @@ -76,7 +77,7 @@ public class FragmentMetadata { try { return factory.getMetadataReader(className).getAnnotationMetadata(); } catch (IOException e) { - throw new BeanDefinitionStoreException(String.format("Cannot parse %s metadata.", className), e); + throw new BeanDefinitionStoreException(String.format("Cannot parse %s metadata", className), e); } } @@ -85,7 +86,7 @@ public class FragmentMetadata { try { return factory.getMetadataReader(className).getClassMetadata(); } catch (IOException e) { - throw new BeanDefinitionStoreException(String.format("Cannot parse %s metadata.", className), e); + throw new BeanDefinitionStoreException(String.format("Cannot parse %s metadata", className), e); } } } diff --git a/src/main/java/org/springframework/data/repository/config/ImplementationDetectionConfiguration.java b/src/main/java/org/springframework/data/repository/config/ImplementationDetectionConfiguration.java index f2a969a2a..c477efd9b 100644 --- a/src/main/java/org/springframework/data/repository/config/ImplementationDetectionConfiguration.java +++ b/src/main/java/org/springframework/data/repository/config/ImplementationDetectionConfiguration.java @@ -28,6 +28,7 @@ import org.springframework.util.ClassUtils; * Expresses configuration to be used to detect implementation classes for repositories and repository fragments. * * @author Oliver Gierke + * @author Johannes Englmeier * @since 2.1 */ public interface ImplementationDetectionConfiguration { @@ -73,7 +74,7 @@ public interface ImplementationDetectionConfiguration { String beanName = definition.getBeanClassName(); if (beanName == null) { - throw new IllegalStateException("Cannot generate bean name for BeanDefinition without bean class name!"); + throw new IllegalStateException("Cannot generate bean name for BeanDefinition without bean class name"); } return Introspector.decapitalize(ClassUtils.getShortName(beanName)); diff --git a/src/main/java/org/springframework/data/repository/config/RepositoryBeanNameGenerator.java b/src/main/java/org/springframework/data/repository/config/RepositoryBeanNameGenerator.java index 94c8e0911..ba866f1b6 100644 --- a/src/main/java/org/springframework/data/repository/config/RepositoryBeanNameGenerator.java +++ b/src/main/java/org/springframework/data/repository/config/RepositoryBeanNameGenerator.java @@ -33,6 +33,7 @@ import org.springframework.util.ClassUtils; * @author Oliver Gierke * @author Jens Schauder * @author Mark Paluch + * @author Johannes Englmeier */ class RepositoryBeanNameGenerator { @@ -91,7 +92,7 @@ class RepositoryBeanNameGenerator { if (argumentValue == null) { throw new IllegalStateException( - String.format("Failed to obtain first constructor parameter value of BeanDefinition %s!", beanDefinition)); + String.format("Failed to obtain first constructor parameter value of BeanDefinition %s", beanDefinition)); } Object value = argumentValue.getValue(); @@ -99,7 +100,7 @@ class RepositoryBeanNameGenerator { if (value == null) { throw new IllegalStateException( - String.format("Value of first constructor parameter value of BeanDefinition %s is null!", beanDefinition)); + String.format("Value of first constructor parameter value of BeanDefinition %s is null", beanDefinition)); } else if (value instanceof Class) { diff --git a/src/main/java/org/springframework/data/repository/config/RepositoryConfigurationExtensionSupport.java b/src/main/java/org/springframework/data/repository/config/RepositoryConfigurationExtensionSupport.java index 7f4293290..18328dcc8 100644 --- a/src/main/java/org/springframework/data/repository/config/RepositoryConfigurationExtensionSupport.java +++ b/src/main/java/org/springframework/data/repository/config/RepositoryConfigurationExtensionSupport.java @@ -50,6 +50,7 @@ import org.springframework.util.StringUtils; * @author Oliver Gierke * @author Mark Paluch * @author Christoph Strobl + * @author Johannes Englmeier */ public abstract class RepositoryConfigurationExtensionSupport implements RepositoryConfigurationExtension { @@ -333,7 +334,7 @@ public abstract class RepositoryConfigurationExtensionSupport implements Reposit if (metadata.isReactiveRepository()) { throw new InvalidDataAccessApiUsageException( - String.format("Reactive Repositories are not supported by %s. Offending repository is %s!", getModuleName(), + String.format("Reactive Repositories are not supported by %s. Offending repository is %s", getModuleName(), metadata.getRepositoryInterface().getName())); } diff --git a/src/main/java/org/springframework/data/repository/config/RepositoryConfigurationSource.java b/src/main/java/org/springframework/data/repository/config/RepositoryConfigurationSource.java index e359be425..f2f44700b 100644 --- a/src/main/java/org/springframework/data/repository/config/RepositoryConfigurationSource.java +++ b/src/main/java/org/springframework/data/repository/config/RepositoryConfigurationSource.java @@ -34,6 +34,7 @@ import org.springframework.util.Assert; * @author Peter Rietzler * @author Jens Schauder * @author Mark Paluch + * @author Johannes Englmeier */ public interface RepositoryConfigurationSource { @@ -126,7 +127,7 @@ public interface RepositoryConfigurationSource { Assert.hasText(name, "Attribute name must not be null or empty!"); return getAttribute(name, type) - .orElseThrow(() -> new IllegalArgumentException(String.format("No attribute named %s found!", name))); + .orElseThrow(() -> new IllegalArgumentException(String.format("No attribute named %s found", name))); } /** diff --git a/src/main/java/org/springframework/data/repository/config/ResourceReaderRepositoryPopulatorBeanDefinitionParser.java b/src/main/java/org/springframework/data/repository/config/ResourceReaderRepositoryPopulatorBeanDefinitionParser.java index c06ab634a..0c21d6315 100644 --- a/src/main/java/org/springframework/data/repository/config/ResourceReaderRepositoryPopulatorBeanDefinitionParser.java +++ b/src/main/java/org/springframework/data/repository/config/ResourceReaderRepositoryPopulatorBeanDefinitionParser.java @@ -31,6 +31,7 @@ import org.w3c.dom.Element; * {@link BeanDefinitionParser} to parse repository initializers. * * @author Oliver Gierke + * @author Johannes Englmeier */ public class ResourceReaderRepositoryPopulatorBeanDefinitionParser extends AbstractSingleBeanDefinitionParser { @@ -46,7 +47,7 @@ public class ResourceReaderRepositoryPopulatorBeanDefinitionParser extends Abstr return Jackson2RepositoryPopulatorFactoryBean.class.getName(); } - throw new IllegalStateException("Unsupported populator type " + name + "!"); + throw new IllegalStateException("Unsupported populator type " + name); } @Override diff --git a/src/main/java/org/springframework/data/repository/config/SelectionSet.java b/src/main/java/org/springframework/data/repository/config/SelectionSet.java index f28bc8f9b..865a0bf7f 100644 --- a/src/main/java/org/springframework/data/repository/config/SelectionSet.java +++ b/src/main/java/org/springframework/data/repository/config/SelectionSet.java @@ -27,6 +27,7 @@ import java.util.stream.Collectors; * * @author Jens Schauder * @author Oliver Gierke + * @author Johannes Englmeier * @since 2.0 */ class SelectionSet { @@ -82,7 +83,7 @@ class SelectionSet { if (c.isEmpty()) { return Optional.empty(); } else { - throw new IllegalStateException("More then one element in collection."); + throw new IllegalStateException("More then one element in collection"); } }; } diff --git a/src/main/java/org/springframework/data/repository/core/EntityInformation.java b/src/main/java/org/springframework/data/repository/core/EntityInformation.java index 7edc68ddc..3789de688 100644 --- a/src/main/java/org/springframework/data/repository/core/EntityInformation.java +++ b/src/main/java/org/springframework/data/repository/core/EntityInformation.java @@ -23,6 +23,7 @@ import org.springframework.util.Assert; * * @author Oliver Gierke * @author Mark Paluch + * @author Johannes Englmeier * @see org.springframework.data.repository.core.support.PersistentEntityInformation */ public interface EntityInformation extends EntityMetadata { @@ -62,7 +63,7 @@ public interface EntityInformation extends EntityMetadata { return id; } - throw new IllegalArgumentException(String.format("Could not obtain required identifier from entity %s!", entity)); + throw new IllegalArgumentException(String.format("Could not obtain required identifier from entity %s", entity)); } /** diff --git a/src/main/java/org/springframework/data/repository/core/support/AbstractEntityInformation.java b/src/main/java/org/springframework/data/repository/core/support/AbstractEntityInformation.java index aafd60bfd..e2c463ee0 100644 --- a/src/main/java/org/springframework/data/repository/core/support/AbstractEntityInformation.java +++ b/src/main/java/org/springframework/data/repository/core/support/AbstractEntityInformation.java @@ -26,6 +26,7 @@ import org.springframework.util.Assert; * @author Oliver Gierke * @author Nick Williams * @author Mark Paluch + * @author Johannes Englmeier */ public abstract class AbstractEntityInformation implements EntityInformation { @@ -51,7 +52,7 @@ public abstract class AbstractEntityInformation implements EntityInformat return ((Number) id).longValue() == 0L; } - throw new IllegalArgumentException(String.format("Unsupported primitive id type %s!", idType)); + throw new IllegalArgumentException(String.format("Unsupported primitive id type %s", idType)); } public Class getJavaType() { diff --git a/src/main/java/org/springframework/data/repository/core/support/AnnotationRepositoryMetadata.java b/src/main/java/org/springframework/data/repository/core/support/AnnotationRepositoryMetadata.java index 12ba5fb7c..f54d36ff4 100644 --- a/src/main/java/org/springframework/data/repository/core/support/AnnotationRepositoryMetadata.java +++ b/src/main/java/org/springframework/data/repository/core/support/AnnotationRepositoryMetadata.java @@ -32,6 +32,7 @@ import org.springframework.util.Assert; * @author Thomas Darimont * @author Xeno Amess * @author Alessandro Nistico + * @author Johannes Englmeier */ public class AnnotationRepositoryMetadata extends AbstractRepositoryMetadata { @@ -74,7 +75,7 @@ public class AnnotationRepositoryMetadata extends AbstractRepositoryMetadata { RepositoryDefinition annotation = AnnotationUtils.findAnnotation(repositoryInterface, RepositoryDefinition.class); if ((annotation == null) || (extractor.apply(annotation) == null)) { - throw new IllegalArgumentException(String.format("Could not resolve domain type of %s!", repositoryInterface)); + throw new IllegalArgumentException(String.format("Could not resolve domain type of %s", repositoryInterface)); } return ClassTypeInformation.from(extractor.apply(annotation)); diff --git a/src/main/java/org/springframework/data/repository/core/support/MethodInvocationValidator.java b/src/main/java/org/springframework/data/repository/core/support/MethodInvocationValidator.java index 1e8f41687..08cd53013 100644 --- a/src/main/java/org/springframework/data/repository/core/support/MethodInvocationValidator.java +++ b/src/main/java/org/springframework/data/repository/core/support/MethodInvocationValidator.java @@ -40,6 +40,7 @@ import org.springframework.util.ObjectUtils; * Supports Kotlin nullability markers and JSR-305 Non-null annotations. * * @author Mark Paluch + * @author Johannes Englmeier * @since 2.0 * @see org.springframework.lang.NonNull * @see ReflectionUtils#isNullable(MethodParameter) @@ -86,7 +87,7 @@ public class MethodInvocationValidator implements MethodInterceptor { if (arguments.length < i || arguments[i] == null) { throw new IllegalArgumentException( - String.format("Parameter %s in %s.%s must not be null!", nullability.getMethodParameterName(i), + String.format("Parameter %s in %s.%s must not be null", nullability.getMethodParameterName(i), ClassUtils.getShortName(method.getDeclaringClass()), method.getName())); } } @@ -94,7 +95,7 @@ public class MethodInvocationValidator implements MethodInterceptor { Object result = invocation.proceed(); if (result == null && !nullability.isNullableReturn()) { - throw new EmptyResultDataAccessException("Result must not be null!", 1); + throw new EmptyResultDataAccessException("Result must not be null", 1); } return result; diff --git a/src/main/java/org/springframework/data/repository/core/support/PersistenceExceptionTranslationRepositoryProxyPostProcessor.java b/src/main/java/org/springframework/data/repository/core/support/PersistenceExceptionTranslationRepositoryProxyPostProcessor.java index da189ffef..e10f5e6ee 100644 --- a/src/main/java/org/springframework/data/repository/core/support/PersistenceExceptionTranslationRepositoryProxyPostProcessor.java +++ b/src/main/java/org/springframework/data/repository/core/support/PersistenceExceptionTranslationRepositoryProxyPostProcessor.java @@ -26,6 +26,7 @@ import org.springframework.util.Assert; * repository proxy. * * @author Oliver Gierke + * @author Johannes Englmeier */ public class PersistenceExceptionTranslationRepositoryProxyPostProcessor implements RepositoryProxyPostProcessor { @@ -39,7 +40,7 @@ public class PersistenceExceptionTranslationRepositoryProxyPostProcessor impleme */ public PersistenceExceptionTranslationRepositoryProxyPostProcessor(ListableBeanFactory beanFactory) { - Assert.notNull(beanFactory, "BeanFactory must not be null!"); + Assert.notNull(beanFactory, "BeanFactory must not be null"); this.interceptor = new PersistenceExceptionTranslationInterceptor(); this.interceptor.setBeanFactory(beanFactory); diff --git a/src/main/java/org/springframework/data/repository/core/support/QueryExecutorMethodInterceptor.java b/src/main/java/org/springframework/data/repository/core/support/QueryExecutorMethodInterceptor.java index 56eb74064..cc1d8f5db 100644 --- a/src/main/java/org/springframework/data/repository/core/support/QueryExecutorMethodInterceptor.java +++ b/src/main/java/org/springframework/data/repository/core/support/QueryExecutorMethodInterceptor.java @@ -47,6 +47,7 @@ import org.springframework.util.ConcurrentReferenceHashMap; * @author Mark Paluch * @author Christoph Strobl * @author John Blum + * @author Johannes Englmeier */ class QueryExecutorMethodInterceptor implements MethodInterceptor { @@ -79,7 +80,7 @@ class QueryExecutorMethodInterceptor implements MethodInterceptor { throw new IllegalStateException("You have defined query methods in the repository" + " but do not have any query lookup strategy defined." - + " The infrastructure apparently does not support query methods!"); + + " The infrastructure apparently does not support query methods"); } this.queries = queryLookupStrategy // diff --git a/src/main/java/org/springframework/data/repository/core/support/ReactiveRepositoryFactorySupport.java b/src/main/java/org/springframework/data/repository/core/support/ReactiveRepositoryFactorySupport.java index c648fefb7..f749f944e 100644 --- a/src/main/java/org/springframework/data/repository/core/support/ReactiveRepositoryFactorySupport.java +++ b/src/main/java/org/springframework/data/repository/core/support/ReactiveRepositoryFactorySupport.java @@ -34,6 +34,7 @@ import org.springframework.util.ClassUtils; * * @author Mark Paluch * @author Oliver Gierke + * @author Johannes Englmeier * @since 2.0 */ public abstract class ReactiveRepositoryFactorySupport extends RepositoryFactorySupport { @@ -44,7 +45,7 @@ public abstract class ReactiveRepositoryFactorySupport extends RepositoryFactory if (!ReactiveWrappers.isAvailable()) { throw new InvalidDataAccessApiUsageException( - String.format("Cannot implement repository %s without reactive library support.", + String.format("Cannot implement repository %s without reactive library support", repositoryMetadata.getRepositoryInterface().getName())); } @@ -94,7 +95,7 @@ public abstract class ReactiveRepositoryFactorySupport extends RepositoryFactory && !ReactiveWrapperConverters.supports(method.getReturnType())) { throw new InvalidDataAccessApiUsageException( - String.format("No reactive type converter found for type %s used in %s, method %s.", + String.format("No reactive type converter found for type %s used in %s, method %s", method.getReturnType().getName(), method.getDeclaringClass().getName(), method)); } @@ -104,7 +105,7 @@ public abstract class ReactiveRepositoryFactorySupport extends RepositoryFactory .filter(parameterType -> !ReactiveWrapperConverters.supports(parameterType)) // .forEach(parameterType -> { throw new InvalidDataAccessApiUsageException( - String.format("No reactive type converter found for type %s used in %s, method %s.", + String.format("No reactive type converter found for type %s used in %s, method %s", parameterType.getName(), method.getDeclaringClass().getName(), method)); }); } diff --git a/src/main/java/org/springframework/data/repository/core/support/RepositoryComposition.java b/src/main/java/org/springframework/data/repository/core/support/RepositoryComposition.java index 098074eaa..e2ca4b57e 100644 --- a/src/main/java/org/springframework/data/repository/core/support/RepositoryComposition.java +++ b/src/main/java/org/springframework/data/repository/core/support/RepositoryComposition.java @@ -59,6 +59,7 @@ import org.springframework.util.ReflectionUtils; * * @author Mark Paluch * @author Christoph Strobl + * @author Johannes Englmeier * @soundtrack Masterboy - Anybody (Fj Gauder Mix) * @since 2.0 * @see RepositoryFragment @@ -317,7 +318,7 @@ public class RepositoryComposition { fragments.stream().forEach(it -> it.getImplementation() // .orElseThrow(() -> { Class repositoryInterface = metadata != null ? metadata.getRepositoryInterface() : Object.class; - return new FragmentNotImplementedException(String.format("Fragment %s used in %s has no implementation.", + return new FragmentNotImplementedException(String.format("Fragment %s used in %s has no implementation", ClassUtils.getQualifiedName(it.getSignatureContributor()), ClassUtils.getQualifiedName(repositoryInterface)), repositoryInterface, it); })); diff --git a/src/main/java/org/springframework/data/repository/core/support/RepositoryFactoryBeanSupport.java b/src/main/java/org/springframework/data/repository/core/support/RepositoryFactoryBeanSupport.java index 2515980ac..8cd8cc379 100644 --- a/src/main/java/org/springframework/data/repository/core/support/RepositoryFactoryBeanSupport.java +++ b/src/main/java/org/springframework/data/repository/core/support/RepositoryFactoryBeanSupport.java @@ -53,6 +53,7 @@ import org.springframework.util.Assert; * @author Oliver Gierke * @author Thomas Darimont * @author Mark Paluch + * @author Johannes Englmeier */ public abstract class RepositoryFactoryBeanSupport, S, ID> implements InitializingBean, RepositoryFactoryInformation, FactoryBean, BeanClassLoaderAware, @@ -225,7 +226,7 @@ public abstract class RepositoryFactoryBeanSupport, public PersistentEntity getPersistentEntity() { - return mappingContext.orElseThrow(() -> new IllegalStateException("No MappingContext available!")) + return mappingContext.orElseThrow(() -> new IllegalStateException("No MappingContext available")) .getRequiredPersistentEntity(repositoryMetadata.getDomainType()); } diff --git a/src/main/java/org/springframework/data/repository/core/support/RepositoryFactorySupport.java b/src/main/java/org/springframework/data/repository/core/support/RepositoryFactorySupport.java index f57481f90..a853e5e32 100644 --- a/src/main/java/org/springframework/data/repository/core/support/RepositoryFactorySupport.java +++ b/src/main/java/org/springframework/data/repository/core/support/RepositoryFactorySupport.java @@ -80,6 +80,7 @@ import org.springframework.util.ObjectUtils; * @author Christoph Strobl * @author Jens Schauder * @author John Blum + * @author Johannes Englmeier */ public abstract class RepositoryFactorySupport implements BeanClassLoaderAware, BeanFactoryAware { @@ -629,7 +630,7 @@ public abstract class RepositoryFactorySupport implements BeanClassLoaderAware, org.springframework.data.repository.util.ClassUtils.unwrapReflectionException(e); } - throw new IllegalStateException("Should not occur!"); + throw new IllegalStateException("Should not occur"); } } @@ -771,7 +772,7 @@ public abstract class RepositoryFactorySupport implements BeanClassLoaderAware, if (composition.isEmpty()) { throw new IncompleteRepositoryCompositionException( - String.format("You have custom methods in %s but have not provided a custom implementation!", + String.format("You have custom methods in %s but have not provided a custom implementation", org.springframework.util.ClassUtils.getQualifiedName(repositoryInterface)), repositoryInterface); } @@ -788,7 +789,7 @@ public abstract class RepositoryFactorySupport implements BeanClassLoaderAware, if (!containsFragmentImplementation(composition, executorInterface)) { throw new UnsupportedFragmentException( - String.format("Repository %s implements %s but %s does not support %s!", + String.format("Repository %s implements %s but %s does not support %s", ClassUtils.getQualifiedName(repositoryInterface), ClassUtils.getQualifiedName(executorInterface), ClassUtils.getShortName(source), entry.getValue()), repositoryInterface, executorInterface); diff --git a/src/main/java/org/springframework/data/repository/init/AbstractRepositoryPopulatorFactoryBean.java b/src/main/java/org/springframework/data/repository/init/AbstractRepositoryPopulatorFactoryBean.java index 163ac16f8..212d8410b 100644 --- a/src/main/java/org/springframework/data/repository/init/AbstractRepositoryPopulatorFactoryBean.java +++ b/src/main/java/org/springframework/data/repository/init/AbstractRepositoryPopulatorFactoryBean.java @@ -33,6 +33,7 @@ import org.springframework.util.Assert; * * @author Oliver Gierke * @author Christoph Strobl + * @author Johannes Englmeier */ public abstract class AbstractRepositoryPopulatorFactoryBean extends AbstractFactoryBean @@ -83,7 +84,7 @@ public abstract class AbstractRepositoryPopulatorFactoryBean RepositoryPopulator populator = this.populator; if (populator == null) { - throw new IllegalStateException("RepositoryPopulator was not properly initialized!"); + throw new IllegalStateException("RepositoryPopulator was not properly initialized"); } if (event.getApplicationContext().equals(context)) { diff --git a/src/main/java/org/springframework/data/repository/init/Jackson2ResourceReader.java b/src/main/java/org/springframework/data/repository/init/Jackson2ResourceReader.java index 21c173cef..c43eb1919 100644 --- a/src/main/java/org/springframework/data/repository/init/Jackson2ResourceReader.java +++ b/src/main/java/org/springframework/data/repository/init/Jackson2ResourceReader.java @@ -37,6 +37,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; * @author Oliver Gierke * @author Christoph Strobl * @author Mark Paluch + * @author Johannes Englmeier * @since 1.6 */ public class Jackson2ResourceReader implements ResourceReader { @@ -112,7 +113,7 @@ public class Jackson2ResourceReader implements ResourceReader { JsonNode typeNode = node.findValue(typeKey); if (typeNode == null) { - throw new IllegalArgumentException(String.format("Could not find type for type key '%s'!", typeKey)); + throw new IllegalArgumentException(String.format("Could not find type for type key '%s'", typeKey)); } String typeName = typeNode.asText(); diff --git a/src/main/java/org/springframework/data/repository/init/UnmarshallerRepositoryPopulatorFactoryBean.java b/src/main/java/org/springframework/data/repository/init/UnmarshallerRepositoryPopulatorFactoryBean.java index 617859aa6..41df0b4f1 100644 --- a/src/main/java/org/springframework/data/repository/init/UnmarshallerRepositoryPopulatorFactoryBean.java +++ b/src/main/java/org/springframework/data/repository/init/UnmarshallerRepositoryPopulatorFactoryBean.java @@ -25,6 +25,7 @@ import org.springframework.util.Assert; * * @author Oliver Gierke * @author Christoph Strobl + * @author Johannes Englmeier */ public class UnmarshallerRepositoryPopulatorFactoryBean extends AbstractRepositoryPopulatorFactoryBean { @@ -45,7 +46,7 @@ public class UnmarshallerRepositoryPopulatorFactoryBean extends AbstractReposito Unmarshaller unmarshaller = this.unmarshaller; if (unmarshaller == null) { - throw new IllegalStateException("No Unmarshaller configured!"); + throw new IllegalStateException("No Unmarshaller configured"); } return new UnmarshallingResourceReader(unmarshaller); diff --git a/src/main/java/org/springframework/data/repository/query/ExtensionAwareQueryMethodEvaluationContextProvider.java b/src/main/java/org/springframework/data/repository/query/ExtensionAwareQueryMethodEvaluationContextProvider.java index 71ff867c7..44de294ff 100644 --- a/src/main/java/org/springframework/data/repository/query/ExtensionAwareQueryMethodEvaluationContextProvider.java +++ b/src/main/java/org/springframework/data/repository/query/ExtensionAwareQueryMethodEvaluationContextProvider.java @@ -36,6 +36,7 @@ import org.springframework.util.StringUtils; * @author Oliver Gierke * @author Christoph Strobl * @author Jens Schauder + * @author Johannes Englmeier * @since 1.9 */ public class ExtensionAwareQueryMethodEvaluationContextProvider implements QueryMethodEvaluationContextProvider { @@ -110,7 +111,7 @@ public class ExtensionAwareQueryMethodEvaluationContextProvider implements Query parameters.stream()// .filter(Parameter::isNamedParameter)// .forEach(it -> variables.put(// - it.getName().orElseThrow(() -> new IllegalStateException("Should never occur!")), // + it.getName().orElseThrow(() -> new IllegalStateException("Should never occur")), // arguments[it.getIndex()])); return variables; diff --git a/src/main/java/org/springframework/data/repository/query/Parameter.java b/src/main/java/org/springframework/data/repository/query/Parameter.java index 26df978c1..c80356045 100644 --- a/src/main/java/org/springframework/data/repository/query/Parameter.java +++ b/src/main/java/org/springframework/data/repository/query/Parameter.java @@ -43,6 +43,7 @@ import org.springframework.util.Assert; * @author Mark Paluch * @author Jens Schauder * @author Greg Turnquist + * @author Johannes Englmeier */ public class Parameter { @@ -213,7 +214,7 @@ public class Parameter { Method method = parameter.getMethod(); if (method == null) { - throw new IllegalStateException(String.format("Method parameter %s is not backed by a method!", parameter)); + throw new IllegalStateException(String.format("Method parameter %s is not backed by a method", parameter)); } ClassTypeInformation ownerType = ClassTypeInformation.from(parameter.getDeclaringClass()); diff --git a/src/main/java/org/springframework/data/repository/query/Parameters.java b/src/main/java/org/springframework/data/repository/query/Parameters.java index a2aaed681..d66bb1d01 100644 --- a/src/main/java/org/springframework/data/repository/query/Parameters.java +++ b/src/main/java/org/springframework/data/repository/query/Parameters.java @@ -37,6 +37,7 @@ import org.springframework.util.Assert; * * @author Oliver Gierke * @author Christoph Strobl + * @author Johannes Englmeier */ public abstract class Parameters, T extends Parameter> implements Streamable { @@ -236,7 +237,7 @@ public abstract class Parameters, T extends Parameter return parameters.get(index); } catch (IndexOutOfBoundsException e) { throw new ParameterOutOfBoundsException( - "Invalid parameter index! You seem to have declared too little query method parameters!", e); + "Invalid parameter index! You seem to have declared too little query method parameters", e); } } diff --git a/src/main/java/org/springframework/data/repository/query/QueryMethod.java b/src/main/java/org/springframework/data/repository/query/QueryMethod.java index 60e635e29..2252a73e1 100644 --- a/src/main/java/org/springframework/data/repository/query/QueryMethod.java +++ b/src/main/java/org/springframework/data/repository/query/QueryMethod.java @@ -44,6 +44,7 @@ import org.springframework.util.Assert; * @author Christoph Strobl * @author Maciek Opała * @author Mark Paluch + * @author Johannes Englmeier */ public class QueryMethod { @@ -285,7 +286,7 @@ public class QueryMethod { if (componentType == null) { throw new IllegalStateException( - String.format("Couldn't find component type for return value of method %s!", method)); + String.format("Couldn't find component type for return value of method %s", method)); } return componentType.getType(); @@ -311,6 +312,6 @@ public class QueryMethod { } } - throw new IllegalStateException("Method has to have one of the following return types! " + types); + throw new IllegalStateException("Method has to have one of the following return types" + types); } } diff --git a/src/main/java/org/springframework/data/repository/query/parser/AbstractQueryCreator.java b/src/main/java/org/springframework/data/repository/query/parser/AbstractQueryCreator.java index 40deb631f..b5fd5d545 100644 --- a/src/main/java/org/springframework/data/repository/query/parser/AbstractQueryCreator.java +++ b/src/main/java/org/springframework/data/repository/query/parser/AbstractQueryCreator.java @@ -33,6 +33,7 @@ import org.springframework.util.Assert; * @author Oliver Gierke * @author Mark Paluch * @author Christoph Strobl + * @author Johannes Englmeier */ public abstract class AbstractQueryCreator { @@ -112,7 +113,7 @@ public abstract class AbstractQueryCreator { Iterator parts = node.iterator(); if (!parts.hasNext()) { - throw new IllegalStateException(String.format("No part found in PartTree %s!", tree)); + throw new IllegalStateException(String.format("No part found in PartTree %s", tree)); } S criteria = create(parts.next(), iterator); diff --git a/src/main/java/org/springframework/data/repository/query/parser/PartTree.java b/src/main/java/org/springframework/data/repository/query/parser/PartTree.java index dac93e8f0..9d64dc773 100644 --- a/src/main/java/org/springframework/data/repository/query/parser/PartTree.java +++ b/src/main/java/org/springframework/data/repository/query/parser/PartTree.java @@ -42,6 +42,7 @@ import org.springframework.util.StringUtils; * @author Christoph Strobl * @author Mark Paluch * @author Shaun Chyxion + * @author Johannes Englmeier */ public class PartTree implements Streamable { @@ -363,7 +364,7 @@ public class PartTree implements Streamable { String[] parts = split(detectAndSetAllIgnoreCase(predicate), ORDER_BY); if (parts.length > 2) { - throw new IllegalArgumentException("OrderBy must not be used more than once in a method name!"); + throw new IllegalArgumentException("OrderBy must not be used more than once in a method name"); } this.nodes = Arrays.stream(split(parts[0], "Or")) // diff --git a/src/main/java/org/springframework/data/repository/support/DomainClassConverter.java b/src/main/java/org/springframework/data/repository/support/DomainClassConverter.java index 0a6f6a3e6..7bf183d60 100644 --- a/src/main/java/org/springframework/data/repository/support/DomainClassConverter.java +++ b/src/main/java/org/springframework/data/repository/support/DomainClassConverter.java @@ -43,6 +43,7 @@ import org.springframework.util.StringUtils; * @author Oliver Gierke * @author Thomas Darimont * @author Alessandro Nistico + * @author Johannes Englmeier */ public class DomainClassConverter implements ConditionalGenericConverter, ApplicationContextAware { @@ -178,7 +179,7 @@ public class DomainClassConverter new IllegalStateException(String.format("Couldn't find RepositoryInformation for %s!", domainType))); + () -> new IllegalStateException(String.format("Couldn't find RepositoryInformation for %s", domainType))); } } @@ -247,7 +248,7 @@ public class DomainClassConverter new IllegalStateException(String.format("Couldn't find RepositoryInformation for %s!", domainType))); + () -> new IllegalStateException(String.format("Couldn't find RepositoryInformation for %s", domainType))); } } } diff --git a/src/main/java/org/springframework/data/repository/support/QueryMethodParameterConversionException.java b/src/main/java/org/springframework/data/repository/support/QueryMethodParameterConversionException.java index dbaac955e..f4202d29b 100644 --- a/src/main/java/org/springframework/data/repository/support/QueryMethodParameterConversionException.java +++ b/src/main/java/org/springframework/data/repository/support/QueryMethodParameterConversionException.java @@ -23,6 +23,7 @@ import org.springframework.util.Assert; * Exception to represent a failed attempt to convert a source value into a query method parameter. * * @author Oliver Gierke + * @author Johannes Englmeier * @soundtrack Dave Matthews Band - The Dreaming Tree (DMB 2009-2018 Europe) * @since 1.11 */ @@ -43,10 +44,10 @@ public class QueryMethodParameterConversionException extends RuntimeException { */ public QueryMethodParameterConversionException(Object source, MethodParameter parameter, ConversionException cause) { - super(String.format("Failed to convert %s into %s!", source, parameter.getParameterType().getName()), cause); + super(String.format("Failed to convert %s into %s", source, parameter.getParameterType().getName()), cause); - Assert.notNull(parameter, "Method parameter must not be null!"); - Assert.notNull(cause, "ConversionException must not be null!"); + Assert.notNull(parameter, "Method parameter must not be null"); + Assert.notNull(cause, "ConversionException must not be null"); this.parameter = parameter; this.source = source; diff --git a/src/main/java/org/springframework/data/repository/support/ReflectionRepositoryInvoker.java b/src/main/java/org/springframework/data/repository/support/ReflectionRepositoryInvoker.java index c9c8abd7c..f09bc931a 100644 --- a/src/main/java/org/springframework/data/repository/support/ReflectionRepositoryInvoker.java +++ b/src/main/java/org/springframework/data/repository/support/ReflectionRepositoryInvoker.java @@ -43,6 +43,7 @@ import org.springframework.util.StringUtils; * * @author Oliver Gierke * @author Alessandro Nistico + * @author Johannes Englmeier * @since 1.10 */ class ReflectionRepositoryInvoker implements RepositoryInvoker { @@ -101,7 +102,7 @@ class ReflectionRepositoryInvoker implements RepositoryInvoker { public T invokeSave(T object) { Method method = methods.getSaveMethod()// - .orElseThrow(() -> new IllegalStateException("Repository doesn't have a save-method declared!")); + .orElseThrow(() -> new IllegalStateException("Repository doesn't have a save-method declared")); return invokeForNonNullResult(method, object); } @@ -115,7 +116,7 @@ class ReflectionRepositoryInvoker implements RepositoryInvoker { public Optional invokeFindById(Object id) { Method method = methods.getFindOneMethod()// - .orElseThrow(() -> new IllegalStateException("Repository doesn't have a find-one-method declared!")); + .orElseThrow(() -> new IllegalStateException("Repository doesn't have a find-one-method declared")); return returnAsOptional(invoke(method, convertId(id))); } @@ -131,7 +132,7 @@ class ReflectionRepositoryInvoker implements RepositoryInvoker { Assert.notNull(id, "Identifier must not be null!"); Method method = methods.getDeleteMethod() - .orElseThrow(() -> new IllegalStateException("Repository doesn't have a delete-method declared!")); + .orElseThrow(() -> new IllegalStateException("Repository doesn't have a delete-method declared")); if (method.getName().endsWith("ById")) { invoke(method, convertId(id)); @@ -224,7 +225,7 @@ class ReflectionRepositoryInvoker implements RepositoryInvoker { T result = invoke(method, arguments); if (result == null) { - throw new IllegalStateException(String.format("Invocation of method %s(%s) on %s unexpectedly returned null!", + throw new IllegalStateException(String.format("Invocation of method %s(%s) on %s unexpectedly returned null", method, Arrays.toString(arguments), repository)); } @@ -258,7 +259,7 @@ class ReflectionRepositoryInvoker implements RepositoryInvoker { if (result == null) { throw new IllegalStateException( - String.format("Identifier conversion of %s to %s unexpectedly returned null!", id, + String.format("Identifier conversion of %s to %s unexpectedly returned null", id, idTypeDescriptor.getType())); } @@ -268,7 +269,7 @@ class ReflectionRepositoryInvoker implements RepositoryInvoker { protected Iterable invokeFindAllReflectively(Pageable pageable) { Method method = methods.getFindAllMethod() - .orElseThrow(() -> new IllegalStateException("Repository doesn't have a find-all-method declared!")); + .orElseThrow(() -> new IllegalStateException("Repository doesn't have a find-all-method declared")); if (method.getParameterCount() == 0) { return invokeForNonNullResult(method); @@ -286,7 +287,7 @@ class ReflectionRepositoryInvoker implements RepositoryInvoker { protected Iterable invokeFindAllReflectively(Sort sort) { Method method = methods.getFindAllMethod() - .orElseThrow(() -> new IllegalStateException("Repository doesn't have a find-all-method declared!")); + .orElseThrow(() -> new IllegalStateException("Repository doesn't have a find-all-method declared")); if (method.getParameterCount() == 0) { return invokeForNonNullResult(method); diff --git a/src/main/java/org/springframework/data/repository/support/Repositories.java b/src/main/java/org/springframework/data/repository/support/Repositories.java index 49d4cf897..ddb8504b8 100644 --- a/src/main/java/org/springframework/data/repository/support/Repositories.java +++ b/src/main/java/org/springframework/data/repository/support/Repositories.java @@ -49,6 +49,7 @@ import org.springframework.util.ConcurrentLruCache; * @author Thomas Eizinger * @author Christoph Strobl * @author Alessandro Nistico + * @author Johannes Englmeier */ public class Repositories implements Iterable> { @@ -223,7 +224,7 @@ public class Repositories implements Iterable> { public RepositoryInformation getRequiredRepositoryInformation(Class domainType) { return getRepositoryInformationFor(domainType).orElseThrow(() -> new IllegalArgumentException( - "No required RepositoryInformation found for domain type " + domainType.getName() + "!")); + "No required RepositoryInformation found for domain type " + domainType.getName())); } /** diff --git a/src/main/java/org/springframework/data/repository/util/ClassUtils.java b/src/main/java/org/springframework/data/repository/util/ClassUtils.java index 7619c5759..f35a906a7 100644 --- a/src/main/java/org/springframework/data/repository/util/ClassUtils.java +++ b/src/main/java/org/springframework/data/repository/util/ClassUtils.java @@ -35,6 +35,7 @@ import org.springframework.util.StringUtils; * * @author Oliver Gierke * @author Mark Paluch + * @author Johannes Englmeier */ public abstract class ClassUtils { @@ -146,7 +147,7 @@ public abstract class ClassUtils { Arrays.stream(types)// .filter(it -> it.isAssignableFrom(returnType.getType()))// .findAny().orElseThrow(() -> new IllegalStateException( - "Method has to have one of the following return types! " + Arrays.toString(types))); + "Method has to have one of the following return types " + Arrays.toString(types))); } /** diff --git a/src/main/java/org/springframework/data/spel/spi/Function.java b/src/main/java/org/springframework/data/spel/spi/Function.java index 7ddcf066f..7cb7bca2e 100644 --- a/src/main/java/org/springframework/data/spel/spi/Function.java +++ b/src/main/java/org/springframework/data/spel/spi/Function.java @@ -34,6 +34,7 @@ import org.springframework.util.Assert; * @author Thomas Darimont * @author Oliver Gierke * @author Jens Schauder + * @author Johannes Englmeier * @since 1.9 */ public class Function { @@ -107,7 +108,7 @@ public class Function { return method.invoke(target, argumentsToUse.size() == 1 ? argumentsToUse.get(0) : argumentsToUse.toArray()); } - throw new IllegalStateException(String.format("Could not invoke method %s for arguments %s!", method, arguments)); + throw new IllegalStateException(String.format("Could not invoke method %s for arguments %s", method, arguments)); } /** diff --git a/src/main/java/org/springframework/data/support/PersistableIsNewStrategy.java b/src/main/java/org/springframework/data/support/PersistableIsNewStrategy.java index 358a19282..47cc3794c 100644 --- a/src/main/java/org/springframework/data/support/PersistableIsNewStrategy.java +++ b/src/main/java/org/springframework/data/support/PersistableIsNewStrategy.java @@ -22,6 +22,7 @@ import org.springframework.util.Assert; * {@link IsNewStrategy} that invokes {@link Persistable#isNew()} on the given object. * * @author Oliver Gierke + * @author Johannes Englmeier */ public enum PersistableIsNewStrategy implements IsNewStrategy { @@ -34,7 +35,7 @@ public enum PersistableIsNewStrategy implements IsNewStrategy { if (!(entity instanceof Persistable)) { throw new IllegalArgumentException( - String.format("Given object of type %s does not implement %s!", entity.getClass(), Persistable.class)); + String.format("Given object of type %s does not implement %s", entity.getClass(), Persistable.class)); } return ((Persistable) entity).isNew(); diff --git a/src/main/java/org/springframework/data/util/AnnotatedTypeScanner.java b/src/main/java/org/springframework/data/util/AnnotatedTypeScanner.java index dbb6ace0f..5f8b95531 100644 --- a/src/main/java/org/springframework/data/util/AnnotatedTypeScanner.java +++ b/src/main/java/org/springframework/data/util/AnnotatedTypeScanner.java @@ -36,6 +36,7 @@ import org.springframework.util.ClassUtils; * * @author Oliver Gierke * @author Christoph Strobl + * @author Johannes Englmeier */ public class AnnotatedTypeScanner implements ResourceLoaderAware, EnvironmentAware { @@ -111,7 +112,7 @@ public class AnnotatedTypeScanner implements ResourceLoaderAware, EnvironmentAwa if (beanClassName == null) { throw new IllegalStateException( - String.format("Unable to obtain bean class name from bean definition %s!", definition)); + String.format("Unable to obtain bean class name from bean definition %s", definition)); } try { diff --git a/src/main/java/org/springframework/data/util/AnnotationDetectionFieldCallback.java b/src/main/java/org/springframework/data/util/AnnotationDetectionFieldCallback.java index 6e03568a8..6dfe1b766 100755 --- a/src/main/java/org/springframework/data/util/AnnotationDetectionFieldCallback.java +++ b/src/main/java/org/springframework/data/util/AnnotationDetectionFieldCallback.java @@ -31,6 +31,7 @@ import org.springframework.util.ReflectionUtils.FieldCallback; * @author Oliver Gierke * @author Christoph Strobl * @author Mark Paluch + * @author Johannes Englmeier */ public class AnnotationDetectionFieldCallback implements FieldCallback { @@ -81,7 +82,7 @@ public class AnnotationDetectionFieldCallback implements FieldCallback { Field field = this.field; if (field == null) { - throw new IllegalStateException(String.format("No field found for annotation %s!", annotationType)); + throw new IllegalStateException(String.format("No field found for annotation %s", annotationType)); } return field; diff --git a/src/main/java/org/springframework/data/util/AnnotationDetectionMethodCallback.java b/src/main/java/org/springframework/data/util/AnnotationDetectionMethodCallback.java index 4bf4aa04e..e9dbeda12 100644 --- a/src/main/java/org/springframework/data/util/AnnotationDetectionMethodCallback.java +++ b/src/main/java/org/springframework/data/util/AnnotationDetectionMethodCallback.java @@ -30,6 +30,7 @@ import org.springframework.util.ReflectionUtils.MethodCallback; * @author Oliver Gierke * @author Christoph Strobl * @author Mark Paluch + * @author Johannes Englmeier */ public class AnnotationDetectionMethodCallback implements MethodCallback { @@ -83,7 +84,7 @@ public class AnnotationDetectionMethodCallback implements Method method = this.foundMethod; if (method == null) { - throw new IllegalStateException(String.format("No method with annotation %s found!", annotationType)); + throw new IllegalStateException(String.format("No method with annotation %s found", annotationType)); } return method; diff --git a/src/main/java/org/springframework/data/util/DirectFieldAccessFallbackBeanWrapper.java b/src/main/java/org/springframework/data/util/DirectFieldAccessFallbackBeanWrapper.java index 9c8df8f9b..27394743d 100644 --- a/src/main/java/org/springframework/data/util/DirectFieldAccessFallbackBeanWrapper.java +++ b/src/main/java/org/springframework/data/util/DirectFieldAccessFallbackBeanWrapper.java @@ -29,6 +29,7 @@ import org.springframework.lang.Nullable; * wrapped does not use accessor methods. * * @author Oliver Gierke + * @author Johannes Englmeier */ public class DirectFieldAccessFallbackBeanWrapper extends BeanWrapperImpl { @@ -52,7 +53,7 @@ public class DirectFieldAccessFallbackBeanWrapper extends BeanWrapperImpl { if (field == null) { throw new NotReadablePropertyException(getWrappedClass(), propertyName, - "Could not find field for property during fallback access!"); + "Could not find field for property during fallback access"); } makeAccessible(field); @@ -71,7 +72,7 @@ public class DirectFieldAccessFallbackBeanWrapper extends BeanWrapperImpl { if (field == null) { throw new NotWritablePropertyException(getWrappedClass(), propertyName, - "Could not find field for property during fallback access!", e); + "Could not find field for property during fallback access", e); } makeAccessible(field); diff --git a/src/main/java/org/springframework/data/util/KotlinReflectionUtils.java b/src/main/java/org/springframework/data/util/KotlinReflectionUtils.java index 1383592f4..56f21a641 100644 --- a/src/main/java/org/springframework/data/util/KotlinReflectionUtils.java +++ b/src/main/java/org/springframework/data/util/KotlinReflectionUtils.java @@ -41,6 +41,7 @@ import org.springframework.lang.Nullable; * * @author Mark Paluch * @author Christoph Strobl + * @author Johannes Englmeier * @since 2.3 * @see org.springframework.core.KotlinDetector#isKotlinReflectPresent() */ @@ -125,7 +126,7 @@ public final class KotlinReflectionUtils { KFunction kotlinFunction = KotlinReflectionUtils.findKotlinFunction(method); if (kotlinFunction == null) { - throw new IllegalArgumentException(String.format("Cannot resolve %s to a KFunction!", method)); + throw new IllegalArgumentException(String.format("Cannot resolve %s to a KFunction", method)); } return JvmClassMappingKt.getJavaClass(KTypesJvm.getJvmErasure(kotlinFunction.getReturnType())); @@ -143,13 +144,13 @@ public final class KotlinReflectionUtils { Method method = parameter.getMethod(); if (method == null) { - throw new IllegalStateException(String.format("Cannot obtain method from parameter %s!", parameter)); + throw new IllegalStateException(String.format("Cannot obtain method from parameter %s", parameter)); } KFunction kotlinFunction = findKotlinFunction(method); if (kotlinFunction == null) { - throw new IllegalArgumentException(String.format("Cannot resolve %s to a Kotlin function!", parameter)); + throw new IllegalArgumentException(String.format("Cannot resolve %s to a Kotlin function", parameter)); } // Special handling for Coroutines diff --git a/src/main/java/org/springframework/data/util/Lazy.java b/src/main/java/org/springframework/data/util/Lazy.java index 9a5f7a35e..33a70e416 100644 --- a/src/main/java/org/springframework/data/util/Lazy.java +++ b/src/main/java/org/springframework/data/util/Lazy.java @@ -31,6 +31,7 @@ import org.springframework.util.ObjectUtils; * @author Oliver Gierke * @author Mark Paluch * @author Henning Rohlfs + * @author Johannes Englmeier * @since 2.0 */ public class Lazy implements Supplier { @@ -112,7 +113,7 @@ public class Lazy implements Supplier { T value = getNullable(); if (value == null) { - throw new IllegalStateException("Expected lazy evaluation to yield a non-null value but got null!"); + throw new IllegalStateException("Expected lazy evaluation to yield a non-null value but got null"); } return value; diff --git a/src/main/java/org/springframework/data/util/MethodInvocationRecorder.java b/src/main/java/org/springframework/data/util/MethodInvocationRecorder.java index 685f42ac3..9e6543f23 100644 --- a/src/main/java/org/springframework/data/util/MethodInvocationRecorder.java +++ b/src/main/java/org/springframework/data/util/MethodInvocationRecorder.java @@ -40,6 +40,7 @@ import org.springframework.util.StringUtils; * API to record method invocations via method references on a proxy. * * @author Oliver Gierke + * @author Johannes Englmeier * @since 2.2 * @soundtrack The Intersphere - Don't Think Twice (The Grand Delusion) */ @@ -203,7 +204,7 @@ public class MethodInvocationRecorder { .map(it -> it.getPropertyName(invokedMethod)) // .findFirst() // .orElseThrow(() -> new IllegalArgumentException( - String.format("No property name found for method %s!", invokedMethod))); + String.format("No property name found for method %s", invokedMethod))); } public Recorded getRecorded() { diff --git a/src/main/java/org/springframework/data/util/ReflectionUtils.java b/src/main/java/org/springframework/data/util/ReflectionUtils.java index bffc859c5..2d1f6fb10 100644 --- a/src/main/java/org/springframework/data/util/ReflectionUtils.java +++ b/src/main/java/org/springframework/data/util/ReflectionUtils.java @@ -43,6 +43,7 @@ import org.springframework.util.ReflectionUtils.FieldFilter; * @author Thomas Darimont * @author Christoph Strobl * @author Mark Paluch + * @author Johannes Englmeier * @since 1.5 */ public final class ReflectionUtils { @@ -223,7 +224,7 @@ public final class ReflectionUtils { Field result = org.springframework.util.ReflectionUtils.findField(type, name); if (result == null) { - throw new IllegalArgumentException(String.format("Unable to find field %s on %s!", name, type)); + throw new IllegalArgumentException(String.format("Unable to find field %s on %s", name, type)); } return result; @@ -440,7 +441,7 @@ public final class ReflectionUtils { return Boolean.FALSE; } - throw new IllegalArgumentException(String.format("Primitive type %s not supported!", type)); + throw new IllegalArgumentException(String.format("Primitive type %s not supported", type)); } /** diff --git a/src/main/java/org/springframework/data/util/TypeDiscoverer.java b/src/main/java/org/springframework/data/util/TypeDiscoverer.java index ab5ac72d8..951e50997 100644 --- a/src/main/java/org/springframework/data/util/TypeDiscoverer.java +++ b/src/main/java/org/springframework/data/util/TypeDiscoverer.java @@ -51,6 +51,7 @@ import org.springframework.util.ReflectionUtils; * @author Mark Paluch * @author Jürgen Diez * @author Alessandro Nistico + * @author Johannes Englmeier */ class TypeDiscoverer implements TypeInformation { @@ -415,7 +416,7 @@ class TypeDiscoverer implements TypeInformation { TypeInformation superTypeInformation = target.getSuperTypeInformation(getType()); - return superTypeInformation == null ? false : superTypeInformation.equals(this); + return superTypeInformation != null && superTypeInformation.equals(this); } @Override diff --git a/src/main/java/org/springframework/data/util/TypeInformation.java b/src/main/java/org/springframework/data/util/TypeInformation.java index d822db888..2847764ee 100644 --- a/src/main/java/org/springframework/data/util/TypeInformation.java +++ b/src/main/java/org/springframework/data/util/TypeInformation.java @@ -29,6 +29,7 @@ import org.springframework.lang.Nullable; * @author Oliver Gierke * @author Mark Paluch * @author Alessandro Nistico + * @author Johannes Englmeier */ public interface TypeInformation { @@ -68,7 +69,7 @@ public interface TypeInformation { } throw new IllegalArgumentException( - String.format("Could not find required property %s on %s!", property, getType())); + String.format("Could not find required property %s on %s", property, getType())); } /** @@ -105,7 +106,7 @@ public interface TypeInformation { return componentType; } - throw new IllegalStateException(String.format("Can't resolve required component type for %s!", getType())); + throw new IllegalStateException(String.format("Can't resolve required component type for %s", getType())); } /** @@ -141,7 +142,7 @@ public interface TypeInformation { return mapValueType; } - throw new IllegalStateException(String.format("Can't resolve required map value type for %s!", getType())); + throw new IllegalStateException(String.format("Can't resolve required map value type for %s", getType())); } /** @@ -197,7 +198,7 @@ public interface TypeInformation { if (result == null) { throw new IllegalStateException( - "Expected to be able to resolve a type but got null! This usually stems from types implementing raw Map or Collection interfaces!"); + "Expected to be able to resolve a type but got null! This usually stems from types implementing raw Map or Collection interfaces"); } return result; @@ -244,7 +245,7 @@ public interface TypeInformation { if (result == null) { throw new IllegalArgumentException(String.format( - "Can't retrieve super type information for %s! Does current type really implement the given one?", + "Can't retrieve super type information for %s! Does current type really implement the given one", superType)); } diff --git a/src/main/java/org/springframework/data/web/MapDataBinder.java b/src/main/java/org/springframework/data/web/MapDataBinder.java index 1f4c292bd..8dda90e34 100644 --- a/src/main/java/org/springframework/data/web/MapDataBinder.java +++ b/src/main/java/org/springframework/data/web/MapDataBinder.java @@ -51,6 +51,7 @@ import org.springframework.web.bind.WebDataBinder; * A {@link WebDataBinder} that automatically binds all properties exposed in the given type using a {@link Map}. * * @author Oliver Gierke + * @author Johannes Englmeier * @since 1.10 */ class MapDataBinder extends WebDataBinder { @@ -80,7 +81,7 @@ class MapDataBinder extends WebDataBinder { Object target = super.getTarget(); if (target == null) { - throw new IllegalStateException("Target bean should never be null!"); + throw new IllegalStateException("Target bean should never be null"); } return (Map) target; @@ -96,6 +97,7 @@ class MapDataBinder extends WebDataBinder { * deeply nested Map structures. * * @author Oliver Gierke + * @author Johannes Englmeier * @since 1.10 */ private static class MapPropertyAccessor extends AbstractPropertyAccessor { @@ -160,7 +162,7 @@ class MapDataBinder extends WebDataBinder { leafProperty.getSegment()); if (descriptor == null) { - throw new IllegalStateException(String.format("Couldn't find PropertyDescriptor for %s on %s!", + throw new IllegalStateException(String.format("Couldn't find PropertyDescriptor for %s on %s", leafProperty.getSegment(), owningType.getType())); } @@ -186,7 +188,7 @@ class MapDataBinder extends WebDataBinder { try { expression.setValue(context, value); } catch (SpelEvaluationException o_O) { - throw new NotWritablePropertyException(type, propertyName, "Could not write property!", o_O); + throw new NotWritablePropertyException(type, propertyName, "Could not write property", o_O); } } diff --git a/src/main/java/org/springframework/data/web/PagedResourcesAssemblerArgumentResolver.java b/src/main/java/org/springframework/data/web/PagedResourcesAssemblerArgumentResolver.java index 7e38a266d..27e60d14a 100644 --- a/src/main/java/org/springframework/data/web/PagedResourcesAssemblerArgumentResolver.java +++ b/src/main/java/org/springframework/data/web/PagedResourcesAssemblerArgumentResolver.java @@ -41,6 +41,7 @@ import org.springframework.web.method.support.ModelAndViewContainer; * @author Oliver Gierke * @author Nick Williams * @author Christoph Strobl + * @author Johannes Englmeier */ public class PagedResourcesAssemblerArgumentResolver implements HandlerMethodArgumentResolver { @@ -93,7 +94,7 @@ public class PagedResourcesAssemblerArgumentResolver implements HandlerMethodArg Method method = parameter.getMethod(); if (method == null) { - throw new IllegalArgumentException(String.format("Could not obtain method from parameter %s!", parameter)); + throw new IllegalArgumentException(String.format("Could not obtain method from parameter %s", parameter)); } MethodParameters parameters = MethodParameters.of(method); diff --git a/src/main/java/org/springframework/data/web/SortHandlerMethodArgumentResolverSupport.java b/src/main/java/org/springframework/data/web/SortHandlerMethodArgumentResolverSupport.java index 71fd4eecd..bd1f4ecc1 100644 --- a/src/main/java/org/springframework/data/web/SortHandlerMethodArgumentResolverSupport.java +++ b/src/main/java/org/springframework/data/web/SortHandlerMethodArgumentResolverSupport.java @@ -40,6 +40,7 @@ import org.springframework.util.StringUtils; * @see ReactiveSortHandlerMethodArgumentResolver * @author Mark Paluch * @author Vedran Pavic + * @author Johannes Englmeier */ public abstract class SortHandlerMethodArgumentResolverSupport { @@ -125,7 +126,7 @@ public abstract class SortHandlerMethodArgumentResolverSupport { if (annotatedDefault != null && annotatedDefaults != null) { throw new IllegalArgumentException( - String.format("Cannot use both @%s and @%s on parameter %s! Move %s into %s to define sorting order!", + String.format("Cannot use both @%s and @%s on parameter %s! Move %s into %s to define sorting order", SORT_DEFAULTS_NAME, SORT_DEFAULT_NAME, parameter.toString(), SORT_DEFAULT_NAME, SORT_DEFAULTS_NAME)); } @@ -273,7 +274,7 @@ public abstract class SortHandlerMethodArgumentResolverSupport { builder = new ExpressionBuilder(direction); } else if (!builder.hasSameDirectionAs(order)) { throw new IllegalArgumentException(String.format( - "%s in legacy configuration only supports a single direction to sort by!", getClass().getSimpleName())); + "%s in legacy configuration only supports a single direction to sort by", getClass().getSimpleName())); } builder.add(order.getProperty()); diff --git a/src/main/java/org/springframework/data/web/SpringDataAnnotationUtils.java b/src/main/java/org/springframework/data/web/SpringDataAnnotationUtils.java index 16d094c90..7f250bfaa 100644 --- a/src/main/java/org/springframework/data/web/SpringDataAnnotationUtils.java +++ b/src/main/java/org/springframework/data/web/SpringDataAnnotationUtils.java @@ -35,6 +35,7 @@ import org.springframework.util.ObjectUtils; * * @author Oliver Gierke * @author Mark Paluch + * @author Johannes Englmeier */ abstract class SpringDataAnnotationUtils { @@ -50,7 +51,7 @@ abstract class SpringDataAnnotationUtils { Method method = parameter.getMethod(); if (method == null) { - throw new IllegalArgumentException(String.format("Method parameter %s is not backed by a method.", parameter)); + throw new IllegalArgumentException(String.format("Method parameter %s is not backed by a method", parameter)); } if (containsMoreThanOnePageableParameter(method)) { @@ -102,7 +103,7 @@ abstract class SpringDataAnnotationUtils { : propertyValue; if (result == null) { - throw new IllegalStateException("Exepected to be able to look up an annotation property value but failed!"); + throw new IllegalStateException("Exepected to be able to look up an annotation property value but failed"); } return (T) result; @@ -151,7 +152,7 @@ abstract class SpringDataAnnotationUtils { } if (values.contains(qualifier.value())) { - throw new IllegalStateException("Values of the user Qualifiers must be unique!"); + throw new IllegalStateException("Values of the user Qualifiers must be unique"); } values.add(qualifier.value()); diff --git a/src/main/java/org/springframework/data/web/XmlBeamHttpMessageConverter.java b/src/main/java/org/springframework/data/web/XmlBeamHttpMessageConverter.java index 3135b8f71..b25f287ae 100644 --- a/src/main/java/org/springframework/data/web/XmlBeamHttpMessageConverter.java +++ b/src/main/java/org/springframework/data/web/XmlBeamHttpMessageConverter.java @@ -42,6 +42,7 @@ import org.xmlbeam.config.DefaultXMLFactoriesConfig; * * @author Oliver Gierke * @author Christoph Strobl + * @author Johannes Englmeier * @see https://www.xmlbeam.org * @soundtrack Dr. Kobayashi Maru & The Mothership Connection - Anthem (EPisode One) */ @@ -121,7 +122,7 @@ public class XmlBeamHttpMessageConverter extends AbstractHttpMessageConverter newResolvers = new ArrayList( diff --git a/src/main/java/org/springframework/data/web/querydsl/QuerydslPredicateArgumentResolverSupport.java b/src/main/java/org/springframework/data/web/querydsl/QuerydslPredicateArgumentResolverSupport.java index 76867ec8e..852faee0e 100644 --- a/src/main/java/org/springframework/data/web/querydsl/QuerydslPredicateArgumentResolverSupport.java +++ b/src/main/java/org/springframework/data/web/querydsl/QuerydslPredicateArgumentResolverSupport.java @@ -45,6 +45,7 @@ import com.querydsl.core.types.Predicate; * @author Christoph Strobl * @author Oliver Gierke * @author Matías Hermosilla + * @author Johannes Englmeier * @since 2.5 */ public abstract class QuerydslPredicateArgumentResolverSupport { @@ -83,7 +84,7 @@ public abstract class QuerydslPredicateArgumentResolverSupport { MergedAnnotations annotations = MergedAnnotations.from(parameter.getParameter()); if (annotations.isPresent(QuerydslPredicate.class)) { - throw new IllegalArgumentException(String.format("Parameter at position %s must be of type Predicate but was %s.", + throw new IllegalArgumentException(String.format("Parameter at position %s must be of type Predicate but was %s", parameter.getParameterIndex(), parameter.getParameterType())); } @@ -143,7 +144,7 @@ public abstract class QuerydslPredicateArgumentResolverSupport { Method method = parameter.getMethod(); if (method == null) { - throw new IllegalArgumentException("Method parameter is not backed by a method!"); + throw new IllegalArgumentException("Method parameter is not backed by a method"); } return detectDomainType(ClassTypeInformation.fromReturnTypeOf(method)); @@ -158,7 +159,7 @@ public abstract class QuerydslPredicateArgumentResolverSupport { TypeInformation actualType = source.getActualType(); if (actualType == null) { - throw new IllegalArgumentException(String.format("Could not determine domain type from %s!", source)); + throw new IllegalArgumentException(String.format("Could not determine domain type from %s", source)); } if (source != actualType) { diff --git a/src/test/java/org/springframework/data/mapping/context/AbstractMappingContextUnitTests.java b/src/test/java/org/springframework/data/mapping/context/AbstractMappingContextUnitTests.java index fe1cff15b..c87de3e08 100755 --- a/src/test/java/org/springframework/data/mapping/context/AbstractMappingContextUnitTests.java +++ b/src/test/java/org/springframework/data/mapping/context/AbstractMappingContextUnitTests.java @@ -63,6 +63,7 @@ import org.springframework.data.util.TypeInformation; * @author Thomas Darimont * @author Mark Paluch * @author Christoph Stobl + * @author Johannes Englmeier */ class AbstractMappingContextUnitTests { @@ -78,7 +79,7 @@ class AbstractMappingContextUnitTests { @Test // DATACMNS-92 void doesNotAddInvalidEntity() { - context = TypeRejectingMappingContext.rejecting(() -> new MappingException("Not supported!"), Unsupported.class); + context = TypeRejectingMappingContext.rejecting(() -> new MappingException("Not supported"), Unsupported.class); assertThatExceptionOfType(MappingException.class) // .isThrownBy(() -> context.getPersistentEntity(Unsupported.class)); diff --git a/src/test/java/org/springframework/data/repository/core/support/DefaultRepositoryInformationUnitTests.java b/src/test/java/org/springframework/data/repository/core/support/DefaultRepositoryInformationUnitTests.java index 331c77bd7..6d2e6a3ea 100755 --- a/src/test/java/org/springframework/data/repository/core/support/DefaultRepositoryInformationUnitTests.java +++ b/src/test/java/org/springframework/data/repository/core/support/DefaultRepositoryInformationUnitTests.java @@ -54,6 +54,7 @@ import org.springframework.data.repository.core.support.DefaultRepositoryMetadat * @author Oliver Gierke * @author Thomas Darimont * @author Mark Paluch + * @author Johannes Englmeier */ @ExtendWith(MockitoExtension.class) @MockitoSettings(strictness = Strictness.LENIENT) @@ -279,7 +280,7 @@ class DefaultRepositoryInformationUnitTests { return Arrays.stream(type.getMethods())// .filter(method -> method.getName().equals(name))// .findFirst()// - .orElseThrow(() -> new IllegalStateException("No method found with name ".concat(name).concat("!"))); + .orElseThrow(() -> new IllegalStateException("No method found with name ".concat(name))); } @Target(ElementType.METHOD) diff --git a/src/test/java/org/springframework/data/repository/core/support/RepositoryFactorySupportUnitTests.java b/src/test/java/org/springframework/data/repository/core/support/RepositoryFactorySupportUnitTests.java index b4477ba32..371e3ab75 100755 --- a/src/test/java/org/springframework/data/repository/core/support/RepositoryFactorySupportUnitTests.java +++ b/src/test/java/org/springframework/data/repository/core/support/RepositoryFactorySupportUnitTests.java @@ -84,6 +84,7 @@ import org.springframework.util.concurrent.ListenableFuture; * @author Oliver Gierke * @author Mark Paluch * @author Ariel Carrera + * @author Johannes Englmeier */ @ExtendWith(MockitoExtension.class) @MockitoSettings(strictness = Strictness.LENIENT) @@ -360,7 +361,7 @@ class RepositoryFactorySupportUnitTests { assertThatThrownBy( // () -> repository.findById("")) // .isInstanceOf(EmptyResultDataAccessException.class) // - .hasMessageContaining("Result must not be null!"); + .hasMessageContaining("Result must not be null"); assertThat(repository.findByUsername("")).isNull(); } @@ -373,7 +374,7 @@ class RepositoryFactorySupportUnitTests { assertThatThrownBy( // () -> repository.findByClass(null)) // .isInstanceOf(IllegalArgumentException.class) // - .hasMessageContaining("must not be null!"); + .hasMessageContaining("must not be null"); } @Test // DATACMNS-1154 @@ -394,7 +395,7 @@ class RepositoryFactorySupportUnitTests { assertThatThrownBy( // () -> repository.findById(null)) // .isInstanceOf(IllegalArgumentException.class) // - .hasMessageContaining("must not be null!"); // + .hasMessageContaining("must not be null"); // } @Test // DATACMNS-1154 @@ -437,7 +438,7 @@ class RepositoryFactorySupportUnitTests { void dummyRepositoryNotSupportingReactiveQuerydslShouldRaiseException() { assertThatThrownBy(() -> factory.getRepository(WithReactiveQuerydsl.class, backingRepo)) .isInstanceOf(UnsupportedFragmentException.class).hasMessage( - "Repository org.springframework.data.repository.core.support.RepositoryFactorySupportUnitTests$WithReactiveQuerydsl implements org.springframework.data.repository.query.ReactiveQueryByExampleExecutor but DummyRepositoryFactory does not support Reactive Query by Example!"); + "Repository org.springframework.data.repository.core.support.RepositoryFactorySupportUnitTests$WithReactiveQuerydsl implements org.springframework.data.repository.query.ReactiveQueryByExampleExecutor but DummyRepositoryFactory does not support Reactive Query by Example"); } @Test // GH-2341 diff --git a/src/test/java/org/springframework/data/repository/core/support/RepositoryMethodInvokerUnitTests.java b/src/test/java/org/springframework/data/repository/core/support/RepositoryMethodInvokerUnitTests.java index 40c741978..5e116e830 100644 --- a/src/test/java/org/springframework/data/repository/core/support/RepositoryMethodInvokerUnitTests.java +++ b/src/test/java/org/springframework/data/repository/core/support/RepositoryMethodInvokerUnitTests.java @@ -64,6 +64,7 @@ import org.springframework.util.ReflectionUtils; /** * @author Christoph Strobl + * @author Johannes Englmeier */ @ExtendWith(MockitoExtension.class) class RepositoryMethodInvokerUnitTests { @@ -212,7 +213,7 @@ class RepositoryMethodInvokerUnitTests { @Test // DATACMNS-1764 void capturesImperativeErrorCorrectly() { - when(query.execute(any())).thenThrow(new IllegalStateException("I'll be back!")); + when(query.execute(any())).thenThrow(new IllegalStateException("I'll be back")); assertThatIllegalStateException().isThrownBy(() -> repositoryMethodInvoker("findAll").invoke()); assertThat(multicaster.first().getResult().getState()).isEqualTo(State.ERROR); @@ -223,7 +224,7 @@ class RepositoryMethodInvokerUnitTests { void capturesReactiveErrorCorrectly() throws Exception { when(query.execute(any())).thenReturn(Mono.fromSupplier(() -> { - throw new IllegalStateException("I'll be back!"); + throw new IllegalStateException("I'll be back"); })); repositoryMethodInvokerForReactive("findByName").> invoke().as(StepVerifier::create).verifyError(); diff --git a/src/test/java/org/springframework/data/repository/util/QueryExecutionConvertersUnitTests.java b/src/test/java/org/springframework/data/repository/util/QueryExecutionConvertersUnitTests.java index c8711759b..abbd01472 100755 --- a/src/test/java/org/springframework/data/repository/util/QueryExecutionConvertersUnitTests.java +++ b/src/test/java/org/springframework/data/repository/util/QueryExecutionConvertersUnitTests.java @@ -57,6 +57,7 @@ import com.google.common.base.Optional; * @author Oliver Gierke * @author Mark Paluch * @author Maciek Opała + * @author Johannes Englmeier */ class QueryExecutionConvertersUnitTests { @@ -194,7 +195,7 @@ class QueryExecutionConvertersUnitTests { void exposesExecutionAdapterForJavaslangTry() throws Throwable { var result = getExecutionAdapter(Try.class).apply(() -> { - throw new IOException("Some message!"); + throw new IOException("Some message"); }); assertThat(result).isInstanceOf(Failure.class); @@ -218,7 +219,7 @@ class QueryExecutionConvertersUnitTests { void exposesExecutionAdapterForVavrTry() throws Throwable { var result = getExecutionAdapter(io.vavr.control.Try.class).apply(() -> { - throw new IOException("Some message!"); + throw new IOException("Some message"); }); assertThat(result).isInstanceOf(io.vavr.control.Try.Failure.class);