From f15fd2a4182fa34d68b280fcd5c2f150ec43455f Mon Sep 17 00:00:00 2001 From: John Blum Date: Wed, 8 Jun 2022 14:54:38 -0700 Subject: [PATCH] Remove punctuation in Exception messages. Closes #4079. --- .../AbstractMicrobenchmark.java | 2 +- .../data/mongodb/CodecRegistryProvider.java | 2 +- .../data/mongodb/MongoDatabaseUtils.java | 2 +- .../data/mongodb/MongoResourceHolder.java | 2 +- .../data/mongodb/MongoTransactionManager.java | 10 +- .../mongodb/ReactiveMongoDatabaseUtils.java | 2 +- .../ReactiveMongoTransactionManager.java | 10 +- .../SessionAwareMethodInterceptor.java | 14 +- .../config/MappingMongoConverterParser.java | 2 +- .../config/MongoAuditingRegistrar.java | 10 +- .../config/MongoCredentialPropertyEditor.java | 12 +- .../mongodb/config/MongoDbFactoryParser.java | 2 +- .../ReactiveMongoAuditingRegistrar.java | 6 +- .../config/ServerAddressPropertyEditor.java | 6 +- .../mongodb/core/ChangeStreamOptions.java | 14 +- .../data/mongodb/core/CollectionOptions.java | 12 +- .../data/mongodb/core/CountQuery.java | 2 +- .../data/mongodb/core/CursorPreparer.java | 4 +- .../mongodb/core/DefaultBulkOperations.java | 40 ++-- .../mongodb/core/DefaultIndexOperations.java | 12 +- .../core/DefaultReactiveIndexOperations.java | 6 +- .../mongodb/core/DefaultScriptOperations.java | 10 +- .../data/mongodb/core/EntityOperations.java | 20 +- ...ExecutableAggregationOperationSupport.java | 6 +- .../core/ExecutableFindOperationSupport.java | 16 +- .../ExecutableInsertOperationSupport.java | 12 +- .../ExecutableMapReduceOperationSupport.java | 16 +- .../ExecutableRemoveOperationSupport.java | 6 +- .../ExecutableUpdateOperationSupport.java | 16 +- .../mongodb/core/FindAndModifyOptions.java | 2 +- .../mongodb/core/FindAndReplaceOptions.java | 2 +- .../mongodb/core/FindPublisherPreparer.java | 4 +- .../mongodb/core/GeoCommandStatistics.java | 4 +- .../core/MappingMongoJsonSchemaCreator.java | 2 +- .../data/mongodb/core/MongoAction.java | 4 +- .../data/mongodb/core/MongoAdmin.java | 2 +- .../mongodb/core/MongoClientFactoryBean.java | 2 +- .../MongoDataIntegrityViolationException.java | 4 +- .../core/MongoDatabaseFactorySupport.java | 8 +- .../mongodb/core/MongoJsonSchemaCreator.java | 2 +- .../data/mongodb/core/MongoOperations.java | 6 +- .../data/mongodb/core/MongoTemplate.java | 222 +++++++++--------- .../ReactiveAggregationOperationSupport.java | 8 +- .../ReactiveChangeStreamOperationSupport.java | 8 +- .../core/ReactiveFindOperationSupport.java | 16 +- .../core/ReactiveInsertOperationSupport.java | 8 +- .../ReactiveMapReduceOperationSupport.java | 14 +- .../core/ReactiveMongoClientFactoryBean.java | 2 +- .../mongodb/core/ReactiveMongoContext.java | 4 +- .../mongodb/core/ReactiveMongoOperations.java | 6 +- .../mongodb/core/ReactiveMongoTemplate.java | 138 +++++------ .../core/ReactiveRemoveOperationSupport.java | 6 +- .../core/ReactiveUpdateOperationSupport.java | 16 +- .../SimpleReactiveMongoDatabaseFactory.java | 8 +- .../AbstractAggregationExpression.java | 10 +- .../aggregation/AccumulatorOperators.java | 58 ++--- .../mongodb/core/aggregation/Aggregation.java | 10 +- .../AggregationExpressionTransformer.java | 2 +- .../AggregationOperationContext.java | 2 +- .../core/aggregation/AggregationOptions.java | 2 +- .../core/aggregation/AggregationPipeline.java | 8 +- .../core/aggregation/AggregationResults.java | 6 +- .../AggregationSpELExpression.java | 2 +- .../core/aggregation/AggregationUpdate.java | 16 +- .../core/aggregation/AggregationUtils.java | 4 +- .../core/aggregation/ArithmeticOperators.java | 196 ++++++++-------- .../core/aggregation/ArrayOperators.java | 118 +++++----- .../core/aggregation/BooleanOperators.java | 30 +-- .../core/aggregation/BucketAutoOperation.java | 8 +- .../core/aggregation/BucketOperation.java | 6 +- .../aggregation/BucketOperationSupport.java | 30 +-- .../core/aggregation/ComparisonOperators.java | 74 +++--- .../aggregation/ConditionalOperators.java | 64 ++--- .../core/aggregation/ConvertOperators.java | 4 +- .../core/aggregation/CountOperation.java | 2 +- .../core/aggregation/DataTypeOperators.java | 2 +- .../core/aggregation/DateOperators.java | 158 ++++++------- .../DocumentEnhancingOperation.java | 6 +- .../core/aggregation/EvaluationOperators.java | 8 +- .../core/aggregation/ExposedFields.java | 6 +- ...osedFieldsAggregationOperationContext.java | 8 +- .../core/aggregation/FacetOperation.java | 14 +- .../data/mongodb/core/aggregation/Fields.java | 14 +- .../core/aggregation/GeoNearOperation.java | 4 +- .../aggregation/GraphLookupOperation.java | 26 +- .../core/aggregation/GroupOperation.java | 10 +- .../core/aggregation/LimitOperation.java | 2 +- .../core/aggregation/LiteralOperators.java | 6 +- .../core/aggregation/LookupOperation.java | 16 +- .../core/aggregation/MatchOperation.java | 4 +- .../core/aggregation/MergeOperation.java | 12 +- ...ExpressionAggregationOperationContext.java | 2 +- .../core/aggregation/ObjectOperators.java | 2 +- .../core/aggregation/OutOperation.java | 8 +- .../core/aggregation/ProjectionOperation.java | 64 ++--- .../core/aggregation/RedactOperation.java | 4 +- .../aggregation/ReplaceRootOperation.java | 22 +- .../aggregation/ReplaceWithOperation.java | 2 +- .../core/aggregation/SampleOperation.java | 2 +- .../core/aggregation/ScriptOperators.java | 8 +- .../core/aggregation/SetOperators.java | 54 ++--- .../aggregation/SetWindowFieldsOperation.java | 4 +- .../core/aggregation/SkipOperation.java | 2 +- .../aggregation/SortByCountOperation.java | 4 +- .../core/aggregation/SortOperation.java | 2 +- .../SpelExpressionTransformer.java | 20 +- .../core/aggregation/StringOperators.java | 198 ++++++++-------- .../TypeBasedAggregationOperationContext.java | 8 +- .../core/aggregation/TypedAggregation.java | 4 +- .../core/aggregation/UnionWithOperation.java | 4 +- .../core/aggregation/UnsetOperation.java | 4 +- .../core/aggregation/UnwindOperation.java | 10 +- .../core/aggregation/VariableOperators.java | 32 +-- .../core/convert/AbstractMongoConverter.java | 2 +- .../core/convert/DefaultDbRefResolver.java | 16 +- .../convert/DefaultReferenceResolver.java | 4 +- .../core/convert/DocumentAccessor.java | 8 +- .../core/convert/DocumentPointerFactory.java | 2 +- .../mongodb/core/convert/GeoConverters.java | 32 +-- .../core/convert/LazyLoadingProxyFactory.java | 4 +- .../core/convert/MappingMongoConverter.java | 48 ++-- .../mongodb/core/convert/MongoConverter.java | 4 +- .../mongodb/core/convert/MongoConverters.java | 2 +- .../core/convert/MongoCustomConversions.java | 10 +- .../MongoDatabaseFactoryReferenceLoader.java | 4 +- .../core/convert/MongoExampleMapper.java | 6 +- .../core/convert/MongoJsonSchemaMapper.java | 8 +- .../core/convert/NoOpDbRefResolver.java | 2 +- .../data/mongodb/core/convert/ObjectPath.java | 10 +- .../mongodb/core/convert/QueryMapper.java | 22 +- .../core/convert/ReferenceResolver.java | 2 +- .../mongodb/core/convert/UpdateMapper.java | 2 +- .../core/geo/GeoJsonGeometryCollection.java | 2 +- .../core/geo/GeoJsonMultiLineString.java | 4 +- .../mongodb/core/geo/GeoJsonMultiPoint.java | 12 +- .../mongodb/core/geo/GeoJsonMultiPolygon.java | 2 +- .../data/mongodb/core/geo/GeoJsonPolygon.java | 2 +- .../data/mongodb/core/geo/Sphere.java | 6 +- .../core/index/CompoundIndexDefinition.java | 2 +- .../mongodb/core/index/GeospatialIndex.java | 4 +- .../data/mongodb/core/index/HashedIndex.java | 2 +- .../data/mongodb/core/index/Index.java | 4 +- .../data/mongodb/core/index/IndexField.java | 4 +- .../data/mongodb/core/index/IndexInfo.java | 2 +- .../core/index/IndexOperationsAdapter.java | 2 +- .../mongodb/core/index/IndexResolver.java | 2 +- .../index/MongoMappingEventPublisher.java | 4 +- .../MongoPersistentEntityIndexCreator.java | 14 +- .../MongoPersistentEntityIndexResolver.java | 16 +- .../core/index/PartialIndexFilter.java | 4 +- ...tiveMongoPersistentEntityIndexCreator.java | 14 +- .../core/index/TextIndexDefinition.java | 8 +- .../mongodb/core/index/WildcardIndex.java | 8 +- .../mapping/BasicMongoPersistentEntity.java | 12 +- .../mapping/BasicMongoPersistentProperty.java | 4 +- .../UnwrappedMongoPersistentEntity.java | 2 +- .../core/mapping/event/AfterLoadEvent.java | 2 +- .../mapping/event/AuditingEntityCallback.java | 2 +- .../event/ReactiveAuditingEntityCallback.java | 2 +- .../event/ValidatingMongoEventListener.java | 2 +- .../core/mapreduce/MapReduceResults.java | 4 +- .../core/messaging/ChangeStreamRequest.java | 36 +-- .../core/messaging/CursorReadingTask.java | 6 +- .../DefaultMessageListenerContainer.java | 6 +- .../data/mongodb/core/messaging/Message.java | 4 +- .../mongodb/core/messaging/SimpleMessage.java | 2 +- .../core/messaging/SubscriptionRequest.java | 8 +- .../core/messaging/TailableCursorRequest.java | 16 +- .../mongodb/core/messaging/TaskFactory.java | 8 +- .../data/mongodb/core/query/Collation.java | 14 +- .../data/mongodb/core/query/Criteria.java | 52 ++-- .../data/mongodb/core/query/Field.java | 12 +- .../data/mongodb/core/query/GeoCommand.java | 4 +- .../data/mongodb/core/query/Meta.java | 6 +- .../data/mongodb/core/query/NearQuery.java | 36 +-- .../data/mongodb/core/query/Query.java | 22 +- .../data/mongodb/core/query/TextCriteria.java | 4 +- .../data/mongodb/core/query/Update.java | 24 +- .../core/schema/DefaultMongoJsonSchema.java | 2 +- .../core/schema/DocumentJsonSchema.java | 2 +- .../IdentifiableJsonSchemaProperty.java | 6 +- .../mongodb/core/schema/JsonSchemaObject.java | 2 +- .../core/schema/MergedJsonSchemaProperty.java | 2 +- .../mongodb/core/schema/MongoJsonSchema.java | 12 +- .../core/schema/TypedJsonSchemaObject.java | 34 +-- .../core/schema/UntypedJsonSchemaObject.java | 10 +- .../core/script/ExecutableMongoScript.java | 2 +- .../mongodb/core/script/NamedMongoScript.java | 4 +- .../mongodb/core/spel/ExpressionNode.java | 10 +- ...xpressionTransformationContextSupport.java | 4 +- .../core/spel/MethodReferenceNode.java | 2 +- .../data/mongodb/core/spel/OperatorNode.java | 2 +- .../core/validation/CriteriaValidator.java | 2 +- .../core/validation/DocumentValidator.java | 2 +- .../core/validation/JsonSchemaValidator.java | 2 +- .../mongodb/core/validation/Validator.java | 6 +- .../data/mongodb/gridfs/AntPath.java | 2 +- .../gridfs/GridFsOperationsSupport.java | 2 +- .../data/mongodb/gridfs/GridFsTemplate.java | 6 +- .../gridfs/ReactiveGridFsTemplate.java | 12 +- .../repository/cdi/MongoRepositoryBean.java | 2 +- .../repository/query/AbstractMongoQuery.java | 10 +- .../query/AbstractReactiveMongoQuery.java | 10 +- .../query/ConvertingParameterAccessor.java | 4 +- .../repository/query/MongoParameters.java | 6 +- .../MongoParametersParameterAccessor.java | 2 +- .../repository/query/MongoQueryCreator.java | 8 +- .../repository/query/MongoQueryExecution.java | 18 +- .../repository/query/MongoQueryMethod.java | 12 +- .../repository/query/PartTreeMongoQuery.java | 2 +- .../query/ReactiveMongoQueryExecution.java | 10 +- .../query/ReactiveMongoQueryMethod.java | 8 +- .../query/ReactivePartTreeMongoQuery.java | 2 +- .../query/ReactiveStringBasedMongoQuery.java | 6 +- .../query/SimpleMongoEntityMetadata.java | 4 +- .../query/StringBasedAggregation.java | 2 +- .../query/StringBasedMongoQuery.java | 6 +- .../support/FetchableFluentQuerySupport.java | 6 +- .../IndexEnsuringQueryCreationListener.java | 4 +- .../MongoEntityInformationSupport.java | 2 +- .../support/MongoRepositoryFactory.java | 2 +- .../support/MongoRepositoryFactoryBean.java | 2 +- .../QuerydslMongoPredicateExecutor.java | 28 +-- .../support/QuerydslRepositorySupport.java | 8 +- .../support/ReactiveFluentQuerySupport.java | 12 +- .../ReactiveMongoRepositoryFactory.java | 2 +- .../ReactiveMongoRepositoryFactoryBean.java | 2 +- .../ReactivePageableExecutionUtils.java | 6 +- ...eactiveQuerydslMongoPredicateExecutor.java | 24 +- .../support/SimpleMongoRepository.java | 52 ++-- .../SimpleReactiveMongoRepository.java | 62 ++--- .../support/SpringDataMongodbSerializer.java | 2 +- .../data/mongodb/util/BsonUtils.java | 8 +- .../util/encryption/EncryptionUtils.java | 2 +- .../data/mongodb/util/json/JsonScanner.java | 4 +- .../json/ParameterBindingDocumentCodec.java | 2 +- .../ReactiveTransactionIntegrationTests.java | 6 +- .../core/DefaultBulkOperationsUnitTests.java | 2 +- .../MongoExceptionTranslatorUnitTests.java | 2 +- .../data/mongodb/core/MongoTemplateTests.java | 14 +- .../mongodb/core/MongoTemplateUnitTests.java | 2 +- .../core/ReactiveMongoTemplateTests.java | 12 +- .../aggregation/AggregationOptionsTests.java | 8 +- .../core/aggregation/AggregationTests.java | 2 +- .../ProjectionOperationUnitTests.java | 4 +- .../DbRefMappingMongoConverterUnitTests.java | 8 +- .../MappingMongoConverterUnitTests.java | 2 +- .../core/mapping/GenericMappingTests.java | 10 +- .../DefaultMessageListenerContainerTests.java | 2 +- .../data/mongodb/core/query/QueryTests.java | 10 +- .../schema/JsonSchemaObjectUnitTests.java | 8 +- .../mongodb/performance/PerformanceTests.java | 2 +- .../performance/ReactivePerformanceTests.java | 2 +- ...RepositoryLazyLoadingIntegrationTests.java | 2 +- ...positoryIndexCreationIntegrationTests.java | 2 +- .../data/mongodb/test/util/CleanMongoDB.java | 6 +- .../mongodb/test/util/DocumentAssert.java | 4 +- .../test/util/MongoServerCondition.java | 4 +- 258 files changed, 1680 insertions(+), 1680 deletions(-) diff --git a/spring-data-mongodb-benchmarks/src/main/java/org/springframework/data/mongodb/microbenchmark/AbstractMicrobenchmark.java b/spring-data-mongodb-benchmarks/src/main/java/org/springframework/data/mongodb/microbenchmark/AbstractMicrobenchmark.java index ea940b3c8..d6c96b737 100644 --- a/spring-data-mongodb-benchmarks/src/main/java/org/springframework/data/mongodb/microbenchmark/AbstractMicrobenchmark.java +++ b/spring-data-mongodb-benchmarks/src/main/java/org/springframework/data/mongodb/microbenchmark/AbstractMicrobenchmark.java @@ -322,7 +322,7 @@ public class AbstractMicrobenchmark { try { ResultsWriter.forUri(uri).write(results); } catch (Exception e) { - System.err.println(String.format("Cannot save benchmark results to '%s'. Error was %s.", uri, e)); + System.err.println(String.format("Cannot save benchmark results to '%s'; Error was %s", uri, e)); } } } diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/CodecRegistryProvider.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/CodecRegistryProvider.java index 0bed30cce..6bc9e6624 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/CodecRegistryProvider.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/CodecRegistryProvider.java @@ -62,7 +62,7 @@ public interface CodecRegistryProvider { */ default Optional> getCodecFor(Class type) { - Assert.notNull(type, "Type must not be null!"); + Assert.notNull(type, "Type must not be null"); try { return Optional.of(getCodecRegistry().get(type)); diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/MongoDatabaseUtils.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/MongoDatabaseUtils.java index 8c518bced..a30ba96ee 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/MongoDatabaseUtils.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/MongoDatabaseUtils.java @@ -102,7 +102,7 @@ public class MongoDatabaseUtils { private static MongoDatabase doGetMongoDatabase(@Nullable String dbName, MongoDatabaseFactory factory, SessionSynchronization sessionSynchronization) { - Assert.notNull(factory, "Factory must not be null!"); + Assert.notNull(factory, "Factory must not be null"); if (sessionSynchronization == SessionSynchronization.NEVER || !TransactionSynchronizationManager.isSynchronizationActive()) { diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/MongoResourceHolder.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/MongoResourceHolder.java index 5528dce38..c0c67d827 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/MongoResourceHolder.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/MongoResourceHolder.java @@ -68,7 +68,7 @@ class MongoResourceHolder extends ResourceHolderSupport { ClientSession session = getSession(); if (session == null) { - throw new IllegalStateException("No session available!"); + throw new IllegalStateException("No session available"); } return session; diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/MongoTransactionManager.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/MongoTransactionManager.java index 34163cfe4..9573e033b 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/MongoTransactionManager.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/MongoTransactionManager.java @@ -100,7 +100,7 @@ public class MongoTransactionManager extends AbstractPlatformTransactionManager */ public MongoTransactionManager(MongoDatabaseFactory dbFactory, @Nullable TransactionOptions options) { - Assert.notNull(dbFactory, "DbFactory must not be null!"); + Assert.notNull(dbFactory, "DbFactory must not be null"); this.dbFactory = dbFactory; this.options = options; @@ -266,7 +266,7 @@ public class MongoTransactionManager extends AbstractPlatformTransactionManager */ public void setDbFactory(MongoDatabaseFactory dbFactory) { - Assert.notNull(dbFactory, "DbFactory must not be null!"); + Assert.notNull(dbFactory, "DbFactory must not be null"); this.dbFactory = dbFactory; } @@ -315,7 +315,7 @@ public class MongoTransactionManager extends AbstractPlatformTransactionManager private MongoDatabaseFactory getRequiredDbFactory() { Assert.state(dbFactory != null, - "MongoTransactionManager operates upon a MongoDbFactory. Did you forget to provide one? It's required."); + "MongoTransactionManager operates upon a MongoDbFactory; Did you forget to provide one; It's required"); return dbFactory; } @@ -450,14 +450,14 @@ public class MongoTransactionManager extends AbstractPlatformTransactionManager private MongoResourceHolder getRequiredResourceHolder() { - Assert.state(resourceHolder != null, "MongoResourceHolder is required but not present. o_O"); + Assert.state(resourceHolder != null, "MongoResourceHolder is required but not present; o_O"); return resourceHolder; } private ClientSession getRequiredSession() { ClientSession session = getSession(); - Assert.state(session != null, "A Session is required but it turned out to be null."); + Assert.state(session != null, "A Session is required but it turned out to be null"); return session; } diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/ReactiveMongoDatabaseUtils.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/ReactiveMongoDatabaseUtils.java index a79d8c049..d94b7e001 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/ReactiveMongoDatabaseUtils.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/ReactiveMongoDatabaseUtils.java @@ -136,7 +136,7 @@ public class ReactiveMongoDatabaseUtils { private static Mono doGetMongoDatabase(@Nullable String dbName, ReactiveMongoDatabaseFactory factory, SessionSynchronization sessionSynchronization) { - Assert.notNull(factory, "DatabaseFactory must not be null!"); + Assert.notNull(factory, "DatabaseFactory must not be null"); if (sessionSynchronization == SessionSynchronization.NEVER) { return getMongoDatabaseOrDefault(dbName, factory); diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/ReactiveMongoTransactionManager.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/ReactiveMongoTransactionManager.java index 5d56351dd..61f6a61ed 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/ReactiveMongoTransactionManager.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/ReactiveMongoTransactionManager.java @@ -104,7 +104,7 @@ public class ReactiveMongoTransactionManager extends AbstractReactiveTransaction public ReactiveMongoTransactionManager(ReactiveMongoDatabaseFactory databaseFactory, @Nullable TransactionOptions options) { - Assert.notNull(databaseFactory, "DatabaseFactory must not be null!"); + Assert.notNull(databaseFactory, "DatabaseFactory must not be null"); this.databaseFactory = databaseFactory; this.options = options; @@ -281,7 +281,7 @@ public class ReactiveMongoTransactionManager extends AbstractReactiveTransaction */ public void setDatabaseFactory(ReactiveMongoDatabaseFactory databaseFactory) { - Assert.notNull(databaseFactory, "DatabaseFactory must not be null!"); + Assert.notNull(databaseFactory, "DatabaseFactory must not be null"); this.databaseFactory = databaseFactory; } @@ -323,7 +323,7 @@ public class ReactiveMongoTransactionManager extends AbstractReactiveTransaction private ReactiveMongoDatabaseFactory getRequiredDatabaseFactory() { Assert.state(databaseFactory != null, - "ReactiveMongoTransactionManager operates upon a ReactiveMongoDatabaseFactory. Did you forget to provide one? It's required."); + "ReactiveMongoTransactionManager operates upon a ReactiveMongoDatabaseFactory; Did you forget to provide one; It's required"); return databaseFactory; } @@ -458,14 +458,14 @@ public class ReactiveMongoTransactionManager extends AbstractReactiveTransaction private ReactiveMongoResourceHolder getRequiredResourceHolder() { - Assert.state(resourceHolder != null, "ReactiveMongoResourceHolder is required but not present. o_O"); + Assert.state(resourceHolder != null, "ReactiveMongoResourceHolder is required but not present; o_O"); return resourceHolder; } private ClientSession getRequiredSession() { ClientSession session = getSession(); - Assert.state(session != null, "A Session is required but it turned out to be null."); + Assert.state(session != null, "A Session is required but it turned out to be null"); return session; } diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/SessionAwareMethodInterceptor.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/SessionAwareMethodInterceptor.java index f0aa65a7d..2a9a03504 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/SessionAwareMethodInterceptor.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/SessionAwareMethodInterceptor.java @@ -76,13 +76,13 @@ public class SessionAwareMethodInterceptor implements MethodInterceptor { Class databaseType, ClientSessionOperator databaseDecorator, Class collectionType, ClientSessionOperator collectionDecorator) { - Assert.notNull(session, "ClientSession must not be null!"); - Assert.notNull(target, "Target must not be null!"); - Assert.notNull(sessionType, "SessionType must not be null!"); - Assert.notNull(databaseType, "Database type must not be null!"); - Assert.notNull(databaseDecorator, "Database ClientSessionOperator must not be null!"); - Assert.notNull(collectionType, "Collection type must not be null!"); - Assert.notNull(collectionDecorator, "Collection ClientSessionOperator must not be null!"); + Assert.notNull(session, "ClientSession must not be null"); + Assert.notNull(target, "Target must not be null"); + Assert.notNull(sessionType, "SessionType must not be null"); + Assert.notNull(databaseType, "Database type must not be null"); + Assert.notNull(databaseDecorator, "Database ClientSessionOperator must not be null"); + Assert.notNull(collectionType, "Collection type must not be null"); + Assert.notNull(collectionDecorator, "Collection ClientSessionOperator must not be null"); this.session = session; this.target = target; diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/config/MappingMongoConverterParser.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/config/MappingMongoConverterParser.java index 5b659d420..9ed65757e 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/config/MappingMongoConverterParser.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/config/MappingMongoConverterParser.java @@ -255,7 +255,7 @@ public class MappingMongoConverterParser implements BeanDefinitionParser { && Boolean.parseBoolean(abbreviateFieldNames); if (fieldNamingStrategyReferenced && abbreviationActivated) { - context.error("Field name abbreviation cannot be activated if a field-naming-strategy-ref is configured!", + context.error("Field name abbreviation cannot be activated if a field-naming-strategy-ref is configured", element); return; } diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/config/MongoAuditingRegistrar.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/config/MongoAuditingRegistrar.java index 9f9aa2b6c..aef2be4e2 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/config/MongoAuditingRegistrar.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/config/MongoAuditingRegistrar.java @@ -55,8 +55,8 @@ class MongoAuditingRegistrar extends AuditingBeanDefinitionRegistrarSupport { @Override public void registerBeanDefinitions(AnnotationMetadata annotationMetadata, BeanDefinitionRegistry registry) { - Assert.notNull(annotationMetadata, "AnnotationMetadata must not be null!"); - Assert.notNull(registry, "BeanDefinitionRegistry must not be null!"); + Assert.notNull(annotationMetadata, "AnnotationMetadata must not be null"); + Assert.notNull(registry, "BeanDefinitionRegistry must not be null"); super.registerBeanDefinitions(annotationMetadata, registry); } @@ -64,7 +64,7 @@ class MongoAuditingRegistrar extends AuditingBeanDefinitionRegistrarSupport { @Override protected BeanDefinitionBuilder getAuditHandlerBeanDefinitionBuilder(AuditingConfiguration configuration) { - Assert.notNull(configuration, "AuditingConfiguration must not be null!"); + Assert.notNull(configuration, "AuditingConfiguration must not be null"); BeanDefinitionBuilder builder = BeanDefinitionBuilder.rootBeanDefinition(IsNewAwareAuditingHandler.class); @@ -79,8 +79,8 @@ class MongoAuditingRegistrar extends AuditingBeanDefinitionRegistrarSupport { protected void registerAuditListenerBeanDefinition(BeanDefinition auditingHandlerDefinition, BeanDefinitionRegistry registry) { - Assert.notNull(auditingHandlerDefinition, "BeanDefinition must not be null!"); - Assert.notNull(registry, "BeanDefinitionRegistry must not be null!"); + Assert.notNull(auditingHandlerDefinition, "BeanDefinition must not be null"); + Assert.notNull(registry, "BeanDefinitionRegistry must not be null"); BeanDefinitionBuilder listenerBeanDefinitionBuilder = BeanDefinitionBuilder .rootBeanDefinition(AuditingEntityCallback.class); diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/config/MongoCredentialPropertyEditor.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/config/MongoCredentialPropertyEditor.java index 8380cd1fd..b5f65ad17 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/config/MongoCredentialPropertyEditor.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/config/MongoCredentialPropertyEditor.java @@ -117,7 +117,7 @@ public class MongoCredentialPropertyEditor extends PropertyEditorSupport { userNameAndPassword[1].toCharArray())); } else { throw new IllegalArgumentException( - String.format("Cannot create MongoCredentials for unknown auth mechanism '%s'!", authMechanism)); + String.format("Cannot create MongoCredentials for unknown auth mechanism '%s'", authMechanism)); } } } else { @@ -194,7 +194,7 @@ public class MongoCredentialPropertyEditor extends PropertyEditorSupport { String[] optionArgs = option.split("="); if (optionArgs.length == 1) { - throw new IllegalArgumentException(String.format("Query parameter '%s' has no value!", optionArgs[0])); + throw new IllegalArgumentException(String.format("Query parameter '%s' has no value", optionArgs[0])); } properties.put(optionArgs[0], optionArgs[1]); @@ -209,21 +209,21 @@ public class MongoCredentialPropertyEditor extends PropertyEditorSupport { if (source.length != 2) { throw new IllegalArgumentException( - "Credentials need to specify username and password like in 'username:password@database'!"); + "Credentials need to specify username and password like in 'username:password@database'"); } } private static void verifyDatabasePresent(String source) { if (!StringUtils.hasText(source)) { - throw new IllegalArgumentException("Credentials need to specify database like in 'username:password@database'!"); + throw new IllegalArgumentException("Credentials need to specify database like in 'username:password@database'"); } } private static void verifyUserNamePresent(String[] source) { if (source.length == 0 || !StringUtils.hasText(source[0])) { - throw new IllegalArgumentException("Credentials need to specify username!"); + throw new IllegalArgumentException("Credentials need to specify username"); } } @@ -231,7 +231,7 @@ public class MongoCredentialPropertyEditor extends PropertyEditorSupport { try { return URLDecoder.decode(it, "UTF-8"); } catch (UnsupportedEncodingException e) { - throw new IllegalArgumentException("o_O UTF-8 not supported!", e); + throw new IllegalArgumentException("o_O UTF-8 not supported", e); } } } diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/config/MongoDbFactoryParser.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/config/MongoDbFactoryParser.java index 892d0a14b..0f1fcbffe 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/config/MongoDbFactoryParser.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/config/MongoDbFactoryParser.java @@ -163,7 +163,7 @@ public class MongoDbFactoryParser extends AbstractBeanDefinitionParser { if (element.getAttributes().getLength() > allowedAttributesCount) { - parserContext.getReaderContext().error("Configure either MongoDB " + type + " or details individually!", + parserContext.getReaderContext().error("Configure either MongoDB " + type + " or details individually", parserContext.extractSource(element)); } diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/config/ReactiveMongoAuditingRegistrar.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/config/ReactiveMongoAuditingRegistrar.java index 5cbc2bc54..acc18c37a 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/config/ReactiveMongoAuditingRegistrar.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/config/ReactiveMongoAuditingRegistrar.java @@ -51,7 +51,7 @@ class ReactiveMongoAuditingRegistrar extends AuditingBeanDefinitionRegistrarSupp @Override protected BeanDefinitionBuilder getAuditHandlerBeanDefinitionBuilder(AuditingConfiguration configuration) { - Assert.notNull(configuration, "AuditingConfiguration must not be null!"); + Assert.notNull(configuration, "AuditingConfiguration must not be null"); BeanDefinitionBuilder builder = BeanDefinitionBuilder.rootBeanDefinition(ReactiveIsNewAwareAuditingHandler.class); @@ -66,8 +66,8 @@ class ReactiveMongoAuditingRegistrar extends AuditingBeanDefinitionRegistrarSupp protected void registerAuditListenerBeanDefinition(BeanDefinition auditingHandlerDefinition, BeanDefinitionRegistry registry) { - Assert.notNull(auditingHandlerDefinition, "BeanDefinition must not be null!"); - Assert.notNull(registry, "BeanDefinitionRegistry must not be null!"); + Assert.notNull(auditingHandlerDefinition, "BeanDefinition must not be null"); + Assert.notNull(registry, "BeanDefinitionRegistry must not be null"); BeanDefinitionBuilder builder = BeanDefinitionBuilder.rootBeanDefinition(ReactiveAuditingEntityCallback.class); diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/config/ServerAddressPropertyEditor.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/config/ServerAddressPropertyEditor.java index 8c7b3c68c..6b57239b0 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/config/ServerAddressPropertyEditor.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/config/ServerAddressPropertyEditor.java @@ -43,7 +43,7 @@ public class ServerAddressPropertyEditor extends PropertyEditorSupport { * A port is a number without a leading 0 at the end of the address that is proceeded by just a single :. */ private static final String HOST_PORT_SPLIT_PATTERN = "(? initiateFind(MongoCollection collection, Function, FindIterable> find) { - Assert.notNull(collection, "Collection must not be null!"); - Assert.notNull(find, "Find function must not be null!"); + Assert.notNull(collection, "Collection must not be null"); + Assert.notNull(find, "Find function must not be null"); if (hasReadPreference()) { collection = collection.withReadPreference(getReadPreference()); diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/DefaultBulkOperations.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/DefaultBulkOperations.java index 854d2f7e3..ad97dea63 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/DefaultBulkOperations.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/DefaultBulkOperations.java @@ -90,9 +90,9 @@ class DefaultBulkOperations implements BulkOperations { DefaultBulkOperations(MongoOperations mongoOperations, String collectionName, BulkOperationContext bulkOperationContext) { - Assert.notNull(mongoOperations, "MongoOperations must not be null!"); - Assert.hasText(collectionName, "CollectionName must not be null nor empty!"); - Assert.notNull(bulkOperationContext, "BulkOperationContext must not be null!"); + Assert.notNull(mongoOperations, "MongoOperations must not be null"); + Assert.hasText(collectionName, "CollectionName must not be null nor empty"); + Assert.notNull(bulkOperationContext, "BulkOperationContext must not be null"); this.mongoOperations = mongoOperations; this.collectionName = collectionName; @@ -112,7 +112,7 @@ class DefaultBulkOperations implements BulkOperations { @Override public BulkOperations insert(Object document) { - Assert.notNull(document, "Document must not be null!"); + Assert.notNull(document, "Document must not be null"); maybeEmitEvent(new BeforeConvertEvent<>(document, collectionName)); Object source = maybeInvokeBeforeConvertCallback(document); @@ -124,7 +124,7 @@ class DefaultBulkOperations implements BulkOperations { @Override public BulkOperations insert(List documents) { - Assert.notNull(documents, "Documents must not be null!"); + Assert.notNull(documents, "Documents must not be null"); documents.forEach(this::insert); @@ -135,8 +135,8 @@ class DefaultBulkOperations implements BulkOperations { @SuppressWarnings("unchecked") public BulkOperations updateOne(Query query, Update update) { - Assert.notNull(query, "Query must not be null!"); - Assert.notNull(update, "Update must not be null!"); + Assert.notNull(query, "Query must not be null"); + Assert.notNull(update, "Update must not be null"); return updateOne(Collections.singletonList(Pair.of(query, update))); } @@ -144,7 +144,7 @@ class DefaultBulkOperations implements BulkOperations { @Override public BulkOperations updateOne(List> updates) { - Assert.notNull(updates, "Updates must not be null!"); + Assert.notNull(updates, "Updates must not be null"); for (Pair update : updates) { update(update.getFirst(), update.getSecond(), false, false); @@ -157,8 +157,8 @@ class DefaultBulkOperations implements BulkOperations { @SuppressWarnings("unchecked") public BulkOperations updateMulti(Query query, Update update) { - Assert.notNull(query, "Query must not be null!"); - Assert.notNull(update, "Update must not be null!"); + Assert.notNull(query, "Query must not be null"); + Assert.notNull(update, "Update must not be null"); return updateMulti(Collections.singletonList(Pair.of(query, update))); } @@ -166,7 +166,7 @@ class DefaultBulkOperations implements BulkOperations { @Override public BulkOperations updateMulti(List> updates) { - Assert.notNull(updates, "Updates must not be null!"); + Assert.notNull(updates, "Updates must not be null"); for (Pair update : updates) { update(update.getFirst(), update.getSecond(), false, true); @@ -193,7 +193,7 @@ class DefaultBulkOperations implements BulkOperations { @Override public BulkOperations remove(Query query) { - Assert.notNull(query, "Query must not be null!"); + Assert.notNull(query, "Query must not be null"); DeleteOptions deleteOptions = new DeleteOptions(); query.getCollation().map(Collation::toMongoCollation).ifPresent(deleteOptions::collation); @@ -206,7 +206,7 @@ class DefaultBulkOperations implements BulkOperations { @Override public BulkOperations remove(List removes) { - Assert.notNull(removes, "Removals must not be null!"); + Assert.notNull(removes, "Removals must not be null"); for (Query query : removes) { remove(query); @@ -218,9 +218,9 @@ class DefaultBulkOperations implements BulkOperations { @Override public BulkOperations replaceOne(Query query, Object replacement, FindAndReplaceOptions options) { - Assert.notNull(query, "Query must not be null!"); - Assert.notNull(replacement, "Replacement must not be null!"); - Assert.notNull(options, "Options must not be null!"); + Assert.notNull(query, "Query must not be null"); + Assert.notNull(replacement, "Replacement must not be null"); + Assert.notNull(options, "Options must not be null"); ReplaceOptions replaceOptions = new ReplaceOptions(); replaceOptions.upsert(options.isUpsert()); @@ -241,7 +241,7 @@ class DefaultBulkOperations implements BulkOperations { com.mongodb.bulk.BulkWriteResult result = mongoOperations.execute(collectionName, this::bulkWriteTo); - Assert.state(result != null, "Result must not be null."); + Assert.state(result != null, "Result must not be null"); models.forEach(this::maybeEmitAfterSaveEvent); models.forEach(this::maybeInvokeAfterSaveCallback); @@ -308,8 +308,8 @@ class DefaultBulkOperations implements BulkOperations { */ private BulkOperations update(Query query, Update update, boolean upsert, boolean multi) { - Assert.notNull(query, "Query must not be null!"); - Assert.notNull(update, "Update must not be null!"); + Assert.notNull(query, "Query must not be null"); + Assert.notNull(update, "Update must not be null"); UpdateOptions options = computeUpdateOptions(query, update, upsert); @@ -470,7 +470,7 @@ class DefaultBulkOperations implements BulkOperations { return options.ordered(false); } - throw new IllegalStateException("BulkMode was null!"); + throw new IllegalStateException("BulkMode was null"); } /** diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/DefaultIndexOperations.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/DefaultIndexOperations.java index 11267d13a..63b30aae9 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/DefaultIndexOperations.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/DefaultIndexOperations.java @@ -83,9 +83,9 @@ public class DefaultIndexOperations implements IndexOperations { public DefaultIndexOperations(MongoDatabaseFactory mongoDbFactory, String collectionName, QueryMapper queryMapper, @Nullable Class type) { - Assert.notNull(mongoDbFactory, "MongoDbFactory must not be null!"); - Assert.notNull(collectionName, "Collection name can not be null!"); - Assert.notNull(queryMapper, "QueryMapper must not be null!"); + Assert.notNull(mongoDbFactory, "MongoDbFactory must not be null"); + Assert.notNull(collectionName, "Collection name can not be null"); + Assert.notNull(queryMapper, "QueryMapper must not be null"); this.collectionName = collectionName; this.mapper = queryMapper; @@ -103,8 +103,8 @@ public class DefaultIndexOperations implements IndexOperations { */ public DefaultIndexOperations(MongoOperations mongoOperations, String collectionName, @Nullable Class type) { - Assert.notNull(mongoOperations, "MongoOperations must not be null!"); - Assert.hasText(collectionName, "Collection name must not be null or empty!"); + Assert.notNull(mongoOperations, "MongoOperations must not be null"); + Assert.hasText(collectionName, "Collection name must not be null or empty"); this.mongoOperations = mongoOperations; this.mapper = new QueryMapper(mongoOperations.getConverter()); @@ -189,7 +189,7 @@ public class DefaultIndexOperations implements IndexOperations { @Nullable public T execute(CollectionCallback callback) { - Assert.notNull(callback, "CollectionCallback must not be null!"); + Assert.notNull(callback, "CollectionCallback must not be null"); if (type != null) { return mongoOperations.execute(type, callback); diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/DefaultReactiveIndexOperations.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/DefaultReactiveIndexOperations.java index aaa14e4be..102b5929e 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/DefaultReactiveIndexOperations.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/DefaultReactiveIndexOperations.java @@ -76,9 +76,9 @@ public class DefaultReactiveIndexOperations implements ReactiveIndexOperations { private DefaultReactiveIndexOperations(ReactiveMongoOperations mongoOperations, String collectionName, QueryMapper queryMapper, Optional> type) { - Assert.notNull(mongoOperations, "ReactiveMongoOperations must not be null!"); - Assert.notNull(collectionName, "Collection must not be null!"); - Assert.notNull(queryMapper, "QueryMapper must not be null!"); + Assert.notNull(mongoOperations, "ReactiveMongoOperations must not be null"); + Assert.notNull(collectionName, "Collection must not be null"); + Assert.notNull(queryMapper, "QueryMapper must not be null"); this.mongoOperations = mongoOperations; this.collectionName = collectionName; diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/DefaultScriptOperations.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/DefaultScriptOperations.java index 7bc247039..5826ef28c 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/DefaultScriptOperations.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/DefaultScriptOperations.java @@ -65,7 +65,7 @@ class DefaultScriptOperations implements ScriptOperations { */ public DefaultScriptOperations(MongoOperations mongoOperations) { - Assert.notNull(mongoOperations, "MongoOperations must not be null!"); + Assert.notNull(mongoOperations, "MongoOperations must not be null"); this.mongoOperations = mongoOperations; } @@ -78,7 +78,7 @@ class DefaultScriptOperations implements ScriptOperations { @Override public NamedMongoScript register(NamedMongoScript script) { - Assert.notNull(script, "Script must not be null!"); + Assert.notNull(script, "Script must not be null"); mongoOperations.save(script, SCRIPT_COLLECTION_NAME); return script; @@ -87,7 +87,7 @@ class DefaultScriptOperations implements ScriptOperations { @Override public Object execute(final ExecutableMongoScript script, final Object... args) { - Assert.notNull(script, "Script must not be null!"); + Assert.notNull(script, "Script must not be null"); return mongoOperations.execute(new DbCallback() { @@ -106,7 +106,7 @@ class DefaultScriptOperations implements ScriptOperations { @Override public Object call(final String scriptName, final Object... args) { - Assert.hasText(scriptName, "ScriptName must not be null or empty!"); + Assert.hasText(scriptName, "ScriptName must not be null or empty"); return mongoOperations.execute(new DbCallback() { @@ -122,7 +122,7 @@ class DefaultScriptOperations implements ScriptOperations { @Override public boolean exists(String scriptName) { - Assert.hasText(scriptName, "ScriptName must not be null or empty!"); + Assert.hasText(scriptName, "ScriptName must not be null or empty"); return mongoOperations.exists(query(where("_id").is(scriptName)), NamedMongoScript.class, SCRIPT_COLLECTION_NAME); } diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/EntityOperations.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/EntityOperations.java index ca13e57f6..13a91aa62 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/EntityOperations.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/EntityOperations.java @@ -112,7 +112,7 @@ class EntityOperations { @SuppressWarnings({ "unchecked", "rawtypes" }) Entity forEntity(T entity) { - Assert.notNull(entity, "Bean must not be null!"); + Assert.notNull(entity, "Bean must not be null"); if (entity instanceof String) { return new UnmappedEntity(parse(entity.toString())); @@ -135,8 +135,8 @@ class EntityOperations { @SuppressWarnings({ "unchecked", "rawtypes" }) AdaptibleEntity forEntity(T entity, ConversionService conversionService) { - Assert.notNull(entity, "Bean must not be null!"); - Assert.notNull(conversionService, "ConversionService must not be null!"); + Assert.notNull(entity, "Bean must not be null"); + Assert.notNull(conversionService, "ConversionService must not be null"); if (entity instanceof String) { return new UnmappedEntity(parse(entity.toString())); @@ -171,7 +171,7 @@ class EntityOperations { if (entityClass == null) { throw new InvalidDataAccessApiUsageException( - "No class parameter provided, entity collection can't be determined!"); + "No class parameter provided, entity collection can't be determined"); } return context.getRequiredPersistentEntity(entityClass).getCollection(); @@ -201,7 +201,7 @@ class EntityOperations { */ public String getIdPropertyName(Class type) { - Assert.notNull(type, "Type must not be null!"); + Assert.notNull(type, "Type must not be null"); MongoPersistentEntity persistentEntity = context.getPersistentEntity(type); @@ -240,12 +240,12 @@ class EntityOperations { try { return Document.parse(source); } catch (org.bson.json.JsonParseException o_O) { - throw new MappingException("Could not parse given String to save into a JSON document!", o_O); + throw new MappingException("Could not parse given String to save into a JSON document", o_O); } catch (RuntimeException o_O) { // legacy 3.x exception if (ClassUtils.matchesTypeName(o_O.getClass(), "JSONParseException")) { - throw new MappingException("Could not parse given String to save into a JSON document!", o_O); + throw new MappingException("Could not parse given String to save into a JSON document", o_O); } throw o_O; } @@ -518,7 +518,7 @@ class EntityOperations { @Override public Query getQueryForVersion() { - throw new MappingException("Cannot query for version on plain Documents!"); + throw new MappingException("Cannot query for version on plain Documents"); } @Override @@ -614,7 +614,7 @@ class EntityOperations { public Query getByIdQuery() { if (!entity.hasIdProperty()) { - throw new MappingException("No id property found for object of type " + entity.getType() + "!"); + throw new MappingException("No id property found for object of type " + entity.getType()); } MongoPersistentProperty idProperty = entity.getRequiredIdProperty(); @@ -662,7 +662,7 @@ class EntityOperations { if (!MongoSimpleTypes.AUTOGENERATED_ID_TYPES.contains(property.getType())) { throw new InvalidDataAccessApiUsageException( - String.format("Cannot autogenerate id of type %s for entity of type %s!", property.getType().getName(), + String.format("Cannot autogenerate id of type %s for entity of type %s", property.getType().getName(), entity.getType().getName())); } } diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ExecutableAggregationOperationSupport.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ExecutableAggregationOperationSupport.java index c1c04b5f2..abd5873b1 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ExecutableAggregationOperationSupport.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ExecutableAggregationOperationSupport.java @@ -41,7 +41,7 @@ class ExecutableAggregationOperationSupport implements ExecutableAggregationOper @Override public ExecutableAggregation aggregateAndReturn(Class domainType) { - Assert.notNull(domainType, "DomainType must not be null!"); + Assert.notNull(domainType, "DomainType must not be null"); return new ExecutableAggregationSupport<>(template, domainType, null, null); } @@ -69,7 +69,7 @@ class ExecutableAggregationOperationSupport implements ExecutableAggregationOper @Override public AggregationWithAggregation inCollection(String collection) { - Assert.hasText(collection, "Collection must not be null nor empty!"); + Assert.hasText(collection, "Collection must not be null nor empty"); return new ExecutableAggregationSupport<>(template, domainType, aggregation, collection); } @@ -77,7 +77,7 @@ class ExecutableAggregationOperationSupport implements ExecutableAggregationOper @Override public TerminatingAggregation by(Aggregation aggregation) { - Assert.notNull(aggregation, "Aggregation must not be null!"); + Assert.notNull(aggregation, "Aggregation must not be null"); return new ExecutableAggregationSupport<>(template, domainType, aggregation, collection); } diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ExecutableFindOperationSupport.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ExecutableFindOperationSupport.java index ef4926089..02454130d 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ExecutableFindOperationSupport.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ExecutableFindOperationSupport.java @@ -53,7 +53,7 @@ class ExecutableFindOperationSupport implements ExecutableFindOperation { @Override public ExecutableFind query(Class domainType) { - Assert.notNull(domainType, "DomainType must not be null!"); + Assert.notNull(domainType, "DomainType must not be null"); return new ExecutableFindSupport<>(template, domainType, domainType, null, ALL_QUERY); } @@ -84,7 +84,7 @@ class ExecutableFindOperationSupport implements ExecutableFindOperation { @Override public FindWithProjection inCollection(String collection) { - Assert.hasText(collection, "Collection name must not be null nor empty!"); + Assert.hasText(collection, "Collection name must not be null nor empty"); return new ExecutableFindSupport<>(template, domainType, returnType, collection, query); } @@ -92,7 +92,7 @@ class ExecutableFindOperationSupport implements ExecutableFindOperation { @Override public FindWithQuery as(Class returnType) { - Assert.notNull(returnType, "ReturnType must not be null!"); + Assert.notNull(returnType, "ReturnType must not be null"); return new ExecutableFindSupport<>(template, domainType, returnType, collection, query); } @@ -100,7 +100,7 @@ class ExecutableFindOperationSupport implements ExecutableFindOperation { @Override public TerminatingFind matching(Query query) { - Assert.notNull(query, "Query must not be null!"); + Assert.notNull(query, "Query must not be null"); return new ExecutableFindSupport<>(template, domainType, returnType, collection, query); } @@ -115,7 +115,7 @@ class ExecutableFindOperationSupport implements ExecutableFindOperation { } if (result.size() > 1) { - throw new IncorrectResultSizeDataAccessException("Query " + asString() + " returned non unique result.", 1); + throw new IncorrectResultSizeDataAccessException("Query " + asString() + " returned non unique result", 1); } return result.iterator().next(); @@ -158,7 +158,7 @@ class ExecutableFindOperationSupport implements ExecutableFindOperation { @Override public TerminatingDistinct distinct(String field) { - Assert.notNull(field, "Field must not be null!"); + Assert.notNull(field, "Field must not be null"); return new DistinctOperationSupport(this, field); } @@ -246,7 +246,7 @@ class ExecutableFindOperationSupport implements ExecutableFindOperation { @SuppressWarnings("unchecked") public TerminatingDistinct as(Class resultType) { - Assert.notNull(resultType, "ResultType must not be null!"); + Assert.notNull(resultType, "ResultType must not be null"); return new DistinctOperationSupport<>((ExecutableFindSupport) delegate.as(resultType), field); } @@ -254,7 +254,7 @@ class ExecutableFindOperationSupport implements ExecutableFindOperation { @Override public TerminatingDistinct matching(Query query) { - Assert.notNull(query, "Query must not be null!"); + Assert.notNull(query, "Query must not be null"); return new DistinctOperationSupport<>((ExecutableFindSupport) delegate.matching(query), field); } diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ExecutableInsertOperationSupport.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ExecutableInsertOperationSupport.java index 9ac37c7ac..dd2a62955 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ExecutableInsertOperationSupport.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ExecutableInsertOperationSupport.java @@ -43,7 +43,7 @@ class ExecutableInsertOperationSupport implements ExecutableInsertOperation { @Override public ExecutableInsert insert(Class domainType) { - Assert.notNull(domainType, "DomainType must not be null!"); + Assert.notNull(domainType, "DomainType must not be null"); return new ExecutableInsertSupport<>(template, domainType, null, null); } @@ -70,7 +70,7 @@ class ExecutableInsertOperationSupport implements ExecutableInsertOperation { @Override public T one(T object) { - Assert.notNull(object, "Object must not be null!"); + Assert.notNull(object, "Object must not be null"); return template.insert(object, getCollectionName()); } @@ -78,7 +78,7 @@ class ExecutableInsertOperationSupport implements ExecutableInsertOperation { @Override public Collection all(Collection objects) { - Assert.notNull(objects, "Objects must not be null!"); + Assert.notNull(objects, "Objects must not be null"); return template.insert(objects, getCollectionName()); } @@ -86,7 +86,7 @@ class ExecutableInsertOperationSupport implements ExecutableInsertOperation { @Override public BulkWriteResult bulk(Collection objects) { - Assert.notNull(objects, "Objects must not be null!"); + Assert.notNull(objects, "Objects must not be null"); return template.bulkOps(bulkMode != null ? bulkMode : BulkMode.ORDERED, domainType, getCollectionName()) .insert(new ArrayList<>(objects)).execute(); @@ -95,7 +95,7 @@ class ExecutableInsertOperationSupport implements ExecutableInsertOperation { @Override public InsertWithBulkMode inCollection(String collection) { - Assert.hasText(collection, "Collection must not be null nor empty."); + Assert.hasText(collection, "Collection must not be null nor empty"); return new ExecutableInsertSupport<>(template, domainType, collection, bulkMode); } @@ -103,7 +103,7 @@ class ExecutableInsertOperationSupport implements ExecutableInsertOperation { @Override public TerminatingBulkInsert withBulkMode(BulkMode bulkMode) { - Assert.notNull(bulkMode, "BulkMode must not be null!"); + Assert.notNull(bulkMode, "BulkMode must not be null"); return new ExecutableInsertSupport<>(template, domainType, collection, bulkMode); } diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ExecutableMapReduceOperationSupport.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ExecutableMapReduceOperationSupport.java index 995d22c2b..5e3442932 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ExecutableMapReduceOperationSupport.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ExecutableMapReduceOperationSupport.java @@ -37,7 +37,7 @@ class ExecutableMapReduceOperationSupport implements ExecutableMapReduceOperatio ExecutableMapReduceOperationSupport(MongoTemplate template) { - Assert.notNull(template, "Template must not be null!"); + Assert.notNull(template, "Template must not be null"); this.template = template; } @@ -48,7 +48,7 @@ class ExecutableMapReduceOperationSupport implements ExecutableMapReduceOperatio @Override public ExecutableMapReduceSupport mapReduce(Class domainType) { - Assert.notNull(domainType, "DomainType must not be null!"); + Assert.notNull(domainType, "DomainType must not be null"); return new ExecutableMapReduceSupport<>(template, domainType, domainType, null, ALL_QUERY, null, null, null); } @@ -101,7 +101,7 @@ class ExecutableMapReduceOperationSupport implements ExecutableMapReduceOperatio @Override public MapReduceWithProjection inCollection(String collection) { - Assert.hasText(collection, "Collection name must not be null nor empty!"); + Assert.hasText(collection, "Collection name must not be null nor empty"); return new ExecutableMapReduceSupport<>(template, domainType, returnType, collection, query, mapFunction, reduceFunction, options); @@ -114,7 +114,7 @@ class ExecutableMapReduceOperationSupport implements ExecutableMapReduceOperatio @Override public TerminatingMapReduce matching(Query query) { - Assert.notNull(query, "Query must not be null!"); + Assert.notNull(query, "Query must not be null"); return new ExecutableMapReduceSupport<>(template, domainType, returnType, collection, query, mapFunction, reduceFunction, options); @@ -127,7 +127,7 @@ class ExecutableMapReduceOperationSupport implements ExecutableMapReduceOperatio @Override public MapReduceWithQuery as(Class resultType) { - Assert.notNull(resultType, "ResultType must not be null!"); + Assert.notNull(resultType, "ResultType must not be null"); return new ExecutableMapReduceSupport<>(template, domainType, resultType, collection, query, mapFunction, reduceFunction, options); @@ -140,7 +140,7 @@ class ExecutableMapReduceOperationSupport implements ExecutableMapReduceOperatio @Override public ExecutableMapReduce with(MapReduceOptions options) { - Assert.notNull(options, "Options must not be null! Please consider empty MapReduceOptions#options() instead."); + Assert.notNull(options, "Options must not be null Please consider empty MapReduceOptions#options() instead"); return new ExecutableMapReduceSupport<>(template, domainType, returnType, collection, query, mapFunction, reduceFunction, options); @@ -153,7 +153,7 @@ class ExecutableMapReduceOperationSupport implements ExecutableMapReduceOperatio @Override public MapReduceWithReduceFunction map(String mapFunction) { - Assert.hasText(mapFunction, "MapFunction name must not be null nor empty!"); + Assert.hasText(mapFunction, "MapFunction name must not be null nor empty"); return new ExecutableMapReduceSupport<>(template, domainType, returnType, collection, query, mapFunction, reduceFunction, options); @@ -166,7 +166,7 @@ class ExecutableMapReduceOperationSupport implements ExecutableMapReduceOperatio @Override public ExecutableMapReduce reduce(String reduceFunction) { - Assert.hasText(reduceFunction, "ReduceFunction name must not be null nor empty!"); + Assert.hasText(reduceFunction, "ReduceFunction name must not be null nor empty"); return new ExecutableMapReduceSupport<>(template, domainType, returnType, collection, query, mapFunction, reduceFunction, options); diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ExecutableRemoveOperationSupport.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ExecutableRemoveOperationSupport.java index 8337fcab4..aa9a19614 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ExecutableRemoveOperationSupport.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ExecutableRemoveOperationSupport.java @@ -44,7 +44,7 @@ class ExecutableRemoveOperationSupport implements ExecutableRemoveOperation { @Override public ExecutableRemove remove(Class domainType) { - Assert.notNull(domainType, "DomainType must not be null!"); + Assert.notNull(domainType, "DomainType must not be null"); return new ExecutableRemoveSupport<>(tempate, domainType, ALL_QUERY, null); } @@ -70,7 +70,7 @@ class ExecutableRemoveOperationSupport implements ExecutableRemoveOperation { @Override public RemoveWithQuery inCollection(String collection) { - Assert.hasText(collection, "Collection must not be null nor empty!"); + Assert.hasText(collection, "Collection must not be null nor empty"); return new ExecutableRemoveSupport<>(template, domainType, query, collection); } @@ -78,7 +78,7 @@ class ExecutableRemoveOperationSupport implements ExecutableRemoveOperation { @Override public TerminatingRemove matching(Query query) { - Assert.notNull(query, "Query must not be null!"); + Assert.notNull(query, "Query must not be null"); return new ExecutableRemoveSupport<>(template, domainType, query, collection); } diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ExecutableUpdateOperationSupport.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ExecutableUpdateOperationSupport.java index 0ca112031..88d103bc4 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ExecutableUpdateOperationSupport.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ExecutableUpdateOperationSupport.java @@ -43,7 +43,7 @@ class ExecutableUpdateOperationSupport implements ExecutableUpdateOperation { @Override public ExecutableUpdate update(Class domainType) { - Assert.notNull(domainType, "DomainType must not be null!"); + Assert.notNull(domainType, "DomainType must not be null"); return new ExecutableUpdateSupport<>(template, domainType, ALL_QUERY, null, null, null, null, null, domainType); } @@ -84,7 +84,7 @@ class ExecutableUpdateOperationSupport implements ExecutableUpdateOperation { @Override public TerminatingUpdate apply(UpdateDefinition update) { - Assert.notNull(update, "Update must not be null!"); + Assert.notNull(update, "Update must not be null"); return new ExecutableUpdateSupport<>(template, domainType, query, update, collection, findAndModifyOptions, findAndReplaceOptions, replacement, targetType); @@ -93,7 +93,7 @@ class ExecutableUpdateOperationSupport implements ExecutableUpdateOperation { @Override public UpdateWithQuery inCollection(String collection) { - Assert.hasText(collection, "Collection must not be null nor empty!"); + Assert.hasText(collection, "Collection must not be null nor empty"); return new ExecutableUpdateSupport<>(template, domainType, query, update, collection, findAndModifyOptions, findAndReplaceOptions, replacement, targetType); @@ -102,7 +102,7 @@ class ExecutableUpdateOperationSupport implements ExecutableUpdateOperation { @Override public TerminatingFindAndModify withOptions(FindAndModifyOptions options) { - Assert.notNull(options, "Options must not be null!"); + Assert.notNull(options, "Options must not be null"); return new ExecutableUpdateSupport<>(template, domainType, query, update, collection, options, findAndReplaceOptions, replacement, targetType); @@ -111,7 +111,7 @@ class ExecutableUpdateOperationSupport implements ExecutableUpdateOperation { @Override public FindAndReplaceWithProjection replaceWith(T replacement) { - Assert.notNull(replacement, "Replacement must not be null!"); + Assert.notNull(replacement, "Replacement must not be null"); return new ExecutableUpdateSupport<>(template, domainType, query, update, collection, findAndModifyOptions, findAndReplaceOptions, replacement, targetType); @@ -120,7 +120,7 @@ class ExecutableUpdateOperationSupport implements ExecutableUpdateOperation { @Override public FindAndReplaceWithProjection withOptions(FindAndReplaceOptions options) { - Assert.notNull(options, "Options must not be null!"); + Assert.notNull(options, "Options must not be null"); return new ExecutableUpdateSupport<>(template, domainType, query, update, collection, findAndModifyOptions, options, replacement, targetType); @@ -129,7 +129,7 @@ class ExecutableUpdateOperationSupport implements ExecutableUpdateOperation { @Override public UpdateWithUpdate matching(Query query) { - Assert.notNull(query, "Query must not be null!"); + Assert.notNull(query, "Query must not be null"); return new ExecutableUpdateSupport<>(template, domainType, query, update, collection, findAndModifyOptions, findAndReplaceOptions, replacement, targetType); @@ -138,7 +138,7 @@ class ExecutableUpdateOperationSupport implements ExecutableUpdateOperation { @Override public FindAndReplaceWithOptions as(Class resultType) { - Assert.notNull(resultType, "ResultType must not be null!"); + Assert.notNull(resultType, "ResultType must not be null"); return new ExecutableUpdateSupport<>(template, domainType, query, update, collection, findAndModifyOptions, findAndReplaceOptions, replacement, resultType); diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/FindAndModifyOptions.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/FindAndModifyOptions.java index b2085bcbc..6c81105d4 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/FindAndModifyOptions.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/FindAndModifyOptions.java @@ -35,7 +35,7 @@ public class FindAndModifyOptions { private static final FindAndModifyOptions NONE = new FindAndModifyOptions() { - private static final String ERROR_MSG = "FindAndModifyOptions.none() cannot be changed. Please use FindAndModifyOptions.options() instead."; + private static final String ERROR_MSG = "FindAndModifyOptions.none() cannot be changed; Please use FindAndModifyOptions.options() instead"; @Override public FindAndModifyOptions returnNew(boolean returnNew) { diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/FindAndReplaceOptions.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/FindAndReplaceOptions.java index b9be9c161..7edf533f3 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/FindAndReplaceOptions.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/FindAndReplaceOptions.java @@ -38,7 +38,7 @@ public class FindAndReplaceOptions { private static final FindAndReplaceOptions NONE = new FindAndReplaceOptions() { - private static final String ERROR_MSG = "FindAndReplaceOptions.none() cannot be changed. Please use FindAndReplaceOptions.options() instead."; + private static final String ERROR_MSG = "FindAndReplaceOptions.none() cannot be changed; Please use FindAndReplaceOptions.options() instead"; @Override public FindAndReplaceOptions returnNew() { diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/FindPublisherPreparer.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/FindPublisherPreparer.java index 15c0de470..9fdcadeef 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/FindPublisherPreparer.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/FindPublisherPreparer.java @@ -61,8 +61,8 @@ public interface FindPublisherPreparer extends ReadPreferenceAware { default FindPublisher initiateFind(MongoCollection collection, Function, FindPublisher> find) { - Assert.notNull(collection, "Collection must not be null!"); - Assert.notNull(find, "Find function must not be null!"); + Assert.notNull(collection, "Collection must not be null"); + Assert.notNull(find, "Find function must not be null"); if (hasReadPreference()) { collection = collection.withReadPreference(getReadPreference()); diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/GeoCommandStatistics.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/GeoCommandStatistics.java index 0271e9aa0..d9c68a9a2 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/GeoCommandStatistics.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/GeoCommandStatistics.java @@ -39,7 +39,7 @@ class GeoCommandStatistics { */ private GeoCommandStatistics(Document source) { - Assert.notNull(source, "Source document must not be null!"); + Assert.notNull(source, "Source document must not be null"); this.source = source; } @@ -51,7 +51,7 @@ class GeoCommandStatistics { */ public static GeoCommandStatistics from(Document commandResult) { - Assert.notNull(commandResult, "Command result must not be null!"); + Assert.notNull(commandResult, "Command result must not be null"); Object stats = commandResult.get("stats"); return stats == null ? NONE : new GeoCommandStatistics((Document) stats); diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MappingMongoJsonSchemaCreator.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MappingMongoJsonSchemaCreator.java index 784bf60a5..f892c0bdc 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MappingMongoJsonSchemaCreator.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MappingMongoJsonSchemaCreator.java @@ -81,7 +81,7 @@ class MappingMongoJsonSchemaCreator implements MongoJsonSchemaCreator { MappingContext, MongoPersistentProperty> mappingContext, Predicate filter, LinkedMultiValueMap> mergeProperties) { - Assert.notNull(converter, "Converter must not be null!"); + Assert.notNull(converter, "Converter must not be null"); this.converter = converter; this.mappingContext = mappingContext; this.filter = filter; diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoAction.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoAction.java index 60c884d67..a8fb54007 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoAction.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoAction.java @@ -57,8 +57,8 @@ public class MongoAction { public MongoAction(@Nullable WriteConcern defaultWriteConcern, MongoActionOperation mongoActionOperation, String collectionName, @Nullable Class entityType, @Nullable Document document, @Nullable Document query) { - Assert.hasText(collectionName, "Collection name must not be null or empty!"); - Assert.notNull(mongoActionOperation, "MongoActionOperation must not be null!"); + Assert.hasText(collectionName, "Collection name must not be null or empty"); + Assert.notNull(mongoActionOperation, "MongoActionOperation must not be null"); this.defaultWriteConcern = defaultWriteConcern; this.mongoActionOperation = mongoActionOperation; diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoAdmin.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoAdmin.java index 19f73a2cd..f25832cb1 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoAdmin.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoAdmin.java @@ -42,7 +42,7 @@ public class MongoAdmin implements MongoAdminOperations { */ public MongoAdmin(MongoClient client) { - Assert.notNull(client, "Client must not be null!"); + Assert.notNull(client, "Client must not be null"); this.mongoClient = client; } diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoClientFactoryBean.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoClientFactoryBean.java index d8c233d81..13eab4d6e 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoClientFactoryBean.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoClientFactoryBean.java @@ -146,7 +146,7 @@ public class MongoClientFactoryBean extends AbstractFactoryBean imp protected MongoClientSettings computeClientSetting() { if (connectionString != null && (StringUtils.hasText(host) || port != null)) { - throw new IllegalStateException("ConnectionString and host/port configuration exclude one another!"); + throw new IllegalStateException("ConnectionString and host/port configuration exclude one another"); } ConnectionString connectionString = this.connectionString != null ? this.connectionString diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoDataIntegrityViolationException.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoDataIntegrityViolationException.java index 2ea07ff08..1ee15eef8 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoDataIntegrityViolationException.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoDataIntegrityViolationException.java @@ -44,8 +44,8 @@ public class MongoDataIntegrityViolationException extends DataIntegrityViolation super(message); - Assert.notNull(writeResult, "WriteResult must not be null!"); - Assert.notNull(actionOperation, "MongoActionOperation must not be null!"); + Assert.notNull(writeResult, "WriteResult must not be null"); + Assert.notNull(actionOperation, "MongoActionOperation must not be null"); this.writeResult = writeResult; this.actionOperation = actionOperation; diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoDatabaseFactorySupport.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoDatabaseFactorySupport.java index e767e6639..63e08f08d 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoDatabaseFactorySupport.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoDatabaseFactorySupport.java @@ -64,10 +64,10 @@ public abstract class MongoDatabaseFactorySupport implements MongoDatabaseFac protected MongoDatabaseFactorySupport(C mongoClient, String databaseName, boolean mongoInstanceCreated, PersistenceExceptionTranslator exceptionTranslator) { - Assert.notNull(mongoClient, "MongoClient must not be null!"); - Assert.hasText(databaseName, "Database name must not be empty!"); + Assert.notNull(mongoClient, "MongoClient must not be null"); + Assert.hasText(databaseName, "Database name must not be empty"); Assert.isTrue(databaseName.matches("[^/\\\\.$\"\\s]+"), - "Database name must not contain slashes, dots, spaces, quotes, or dollar signs!"); + "Database name must not contain slashes, dots, spaces, quotes, or dollar signs"); this.mongoClient = mongoClient; this.databaseName = databaseName; @@ -91,7 +91,7 @@ public abstract class MongoDatabaseFactorySupport implements MongoDatabaseFac @Override public MongoDatabase getMongoDatabase(String dbName) throws DataAccessException { - Assert.hasText(dbName, "Database name must not be empty!"); + Assert.hasText(dbName, "Database name must not be empty"); MongoDatabase db = doGetMongoDatabase(dbName); diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoJsonSchemaCreator.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoJsonSchemaCreator.java index 7e6209566..0ff75aae9 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoJsonSchemaCreator.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoJsonSchemaCreator.java @@ -192,7 +192,7 @@ public interface MongoJsonSchemaCreator { */ static MongoJsonSchemaCreator create(MongoConverter mongoConverter) { - Assert.notNull(mongoConverter, "MongoConverter must not be null!"); + Assert.notNull(mongoConverter, "MongoConverter must not be null"); return new MappingMongoJsonSchemaCreator(mongoConverter); } diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoOperations.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoOperations.java index 69c1745f8..501c20771 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoOperations.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoOperations.java @@ -178,7 +178,7 @@ public interface MongoOperations extends FluentMongoOperations { */ default SessionScoped withSession(Supplier sessionProvider) { - Assert.notNull(sessionProvider, "SessionProvider must not be null!"); + Assert.notNull(sessionProvider, "SessionProvider must not be null"); return new SessionScoped() { @@ -985,7 +985,7 @@ public interface MongoOperations extends FluentMongoOperations { @Nullable default T findAndReplace(Query query, T replacement, FindAndReplaceOptions options, String collectionName) { - Assert.notNull(replacement, "Replacement must not be null!"); + Assert.notNull(replacement, "Replacement must not be null"); return findAndReplace(query, replacement, options, (Class) ClassUtils.getUserClass(replacement), collectionName); } @@ -1174,7 +1174,7 @@ public interface MongoOperations extends FluentMongoOperations { */ default long estimatedCount(Class entityClass) { - Assert.notNull(entityClass, "Entity class must not be null!"); + Assert.notNull(entityClass, "Entity class must not be null"); return estimatedCount(getCollectionName(entityClass)); } diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoTemplate.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoTemplate.java index 3cce23537..88269e7ed 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoTemplate.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoTemplate.java @@ -216,7 +216,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, */ public MongoTemplate(MongoDatabaseFactory mongoDbFactory, @Nullable MongoConverter mongoConverter) { - Assert.notNull(mongoDbFactory, "MongoDbFactory must not be null!"); + Assert.notNull(mongoDbFactory, "MongoDbFactory must not be null"); this.mongoDbFactory = mongoDbFactory; this.exceptionTranslator = mongoDbFactory.getExceptionTranslator(); @@ -338,7 +338,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, */ public void setEntityCallbacks(EntityCallbacks entityCallbacks) { - Assert.notNull(entityCallbacks, "EntityCallbacks must not be null!"); + Assert.notNull(entityCallbacks, "EntityCallbacks must not be null"); this.entityCallbacks = entityCallbacks; } @@ -430,10 +430,10 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, @SuppressWarnings("ConstantConditions") protected Stream doStream(Query query, Class entityType, String collectionName, Class returnType) { - Assert.notNull(query, "Query must not be null!"); - Assert.notNull(entityType, "Entity type must not be null!"); - Assert.hasText(collectionName, "Collection name must not be null or empty!"); - Assert.notNull(returnType, "ReturnType must not be null!"); + Assert.notNull(query, "Query must not be null"); + Assert.notNull(entityType, "Entity type must not be null"); + Assert.hasText(collectionName, "Collection name must not be null or empty"); + Assert.notNull(returnType, "ReturnType must not be null"); return execute(collectionName, (CollectionCallback>) collection -> { @@ -462,7 +462,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, @SuppressWarnings("ConstantConditions") public Document executeCommand(String jsonCommand) { - Assert.hasText(jsonCommand, "JsonCommand must not be null nor empty!"); + Assert.hasText(jsonCommand, "JsonCommand must not be null nor empty"); return execute(db -> db.runCommand(Document.parse(jsonCommand), Document.class)); } @@ -471,7 +471,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, @SuppressWarnings("ConstantConditions") public Document executeCommand(Document command) { - Assert.notNull(command, "Command must not be null!"); + Assert.notNull(command, "Command must not be null"); return execute(db -> db.runCommand(command, Document.class)); } @@ -480,7 +480,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, @SuppressWarnings("ConstantConditions") public Document executeCommand(Document command, @Nullable ReadPreference readPreference) { - Assert.notNull(command, "Command must not be null!"); + Assert.notNull(command, "Command must not be null"); return execute(db -> readPreference != null // ? db.runCommand(command, readPreference, Document.class) // @@ -506,9 +506,9 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, protected void executeQuery(Query query, String collectionName, DocumentCallbackHandler documentCallbackHandler, @Nullable CursorPreparer preparer) { - Assert.notNull(query, "Query must not be null!"); - Assert.notNull(collectionName, "CollectionName must not be null!"); - Assert.notNull(documentCallbackHandler, "DocumentCallbackHandler must not be null!"); + Assert.notNull(query, "Query must not be null"); + Assert.notNull(collectionName, "CollectionName must not be null"); + Assert.notNull(documentCallbackHandler, "DocumentCallbackHandler must not be null"); Document queryObject = queryMapper.getMappedObject(query.getQueryObject(), Optional.empty()); Document sortObject = query.getSortObject(); @@ -526,7 +526,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, @Override public T execute(DbCallback action) { - Assert.notNull(action, "DbCallback must not be null!"); + Assert.notNull(action, "DbCallback must not be null"); try { MongoDatabase db = prepareDatabase(this.doGetDatabase()); @@ -539,15 +539,15 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, @Override public T execute(Class entityClass, CollectionCallback callback) { - Assert.notNull(entityClass, "EntityClass must not be null!"); + Assert.notNull(entityClass, "EntityClass must not be null"); return execute(getCollectionName(entityClass), callback); } @Override public T execute(String collectionName, CollectionCallback callback) { - Assert.notNull(collectionName, "CollectionName must not be null!"); - Assert.notNull(callback, "CollectionCallback must not be null!"); + Assert.notNull(collectionName, "CollectionName must not be null"); + Assert.notNull(callback, "CollectionCallback must not be null"); try { MongoCollection collection = getAndPrepareCollection(doGetDatabase(), collectionName); @@ -560,7 +560,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, @Override public SessionScoped withSession(ClientSessionOptions options) { - Assert.notNull(options, "ClientSessionOptions must not be null!"); + Assert.notNull(options, "ClientSessionOptions must not be null"); return withSession(() -> mongoDbFactory.getSession(options)); } @@ -568,7 +568,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, @Override public MongoTemplate withSession(ClientSession session) { - Assert.notNull(session, "ClientSession must not be null!"); + Assert.notNull(session, "ClientSession must not be null"); return new SessionBoundMongoTemplate(session, MongoTemplate.this); } @@ -593,7 +593,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, public MongoCollection createCollection(Class entityClass, @Nullable CollectionOptions collectionOptions) { - Assert.notNull(entityClass, "EntityClass must not be null!"); + Assert.notNull(entityClass, "EntityClass must not be null"); return doCreateCollection(getCollectionName(entityClass), operations.convertToCreateCollectionOptions(collectionOptions, entityClass)); @@ -602,7 +602,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, @Override public MongoCollection createCollection(String collectionName) { - Assert.notNull(collectionName, "CollectionName must not be null!"); + Assert.notNull(collectionName, "CollectionName must not be null"); return doCreateCollection(collectionName, new Document()); } @@ -611,7 +611,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, public MongoCollection createCollection(String collectionName, @Nullable CollectionOptions collectionOptions) { - Assert.notNull(collectionName, "CollectionName must not be null!"); + Assert.notNull(collectionName, "CollectionName must not be null"); return doCreateCollection(collectionName, operations.convertToCreateCollectionOptions(collectionOptions, Object.class)); } @@ -620,7 +620,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, @SuppressWarnings("ConstantConditions") public MongoCollection getCollection(String collectionName) { - Assert.notNull(collectionName, "CollectionName must not be null!"); + Assert.notNull(collectionName, "CollectionName must not be null"); return execute(db -> db.getCollection(collectionName, Document.class)); } @@ -634,7 +634,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, @SuppressWarnings("ConstantConditions") public boolean collectionExists(String collectionName) { - Assert.notNull(collectionName, "CollectionName must not be null!"); + Assert.notNull(collectionName, "CollectionName must not be null"); return execute(db -> { @@ -655,7 +655,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, @Override public void dropCollection(String collectionName) { - Assert.notNull(collectionName, "CollectionName must not be null!"); + Assert.notNull(collectionName, "CollectionName must not be null"); execute(collectionName, (CollectionCallback) collection -> { collection.drop(); @@ -695,8 +695,8 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, @Override public BulkOperations bulkOps(BulkMode mode, @Nullable Class entityType, String collectionName) { - Assert.notNull(mode, "BulkMode must not be null!"); - Assert.hasText(collectionName, "Collection name must not be null or empty!"); + Assert.notNull(mode, "BulkMode must not be null"); + Assert.hasText(collectionName, "Collection name must not be null or empty"); DefaultBulkOperations operations = new DefaultBulkOperations(this, collectionName, new BulkOperationContext(mode, Optional.ofNullable(getPersistentEntity(entityType)), queryMapper, updateMapper, @@ -724,9 +724,9 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, @Override public T findOne(Query query, Class entityClass, String collectionName) { - Assert.notNull(query, "Query must not be null!"); - Assert.notNull(entityClass, "EntityClass must not be null!"); - Assert.notNull(collectionName, "CollectionName must not be null!"); + Assert.notNull(query, "Query must not be null"); + Assert.notNull(entityClass, "EntityClass must not be null"); + Assert.notNull(collectionName, "CollectionName must not be null"); if (ObjectUtils.isEmpty(query.getSortObject())) { @@ -756,7 +756,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, if (query == null) { throw new InvalidDataAccessApiUsageException("Query passed in to exist can't be null"); } - Assert.notNull(collectionName, "CollectionName must not be null!"); + Assert.notNull(collectionName, "CollectionName must not be null"); QueryContext queryContext = queryOperations.createQueryContext(query); Document mappedQuery = queryContext.getMappedQuery(entityClass, this::getPersistentEntity); @@ -775,9 +775,9 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, @Override public List find(Query query, Class entityClass, String collectionName) { - Assert.notNull(query, "Query must not be null!"); - Assert.notNull(collectionName, "CollectionName must not be null!"); - Assert.notNull(entityClass, "EntityClass must not be null!"); + Assert.notNull(query, "Query must not be null"); + Assert.notNull(collectionName, "CollectionName must not be null"); + Assert.notNull(entityClass, "EntityClass must not be null"); return doFind(collectionName, query.getQueryObject(), query.getFieldsObject(), entityClass, new QueryCursorPreparer(query, entityClass)); @@ -793,9 +793,9 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, @Override public T findById(Object id, Class entityClass, String collectionName) { - Assert.notNull(id, "Id must not be null!"); - Assert.notNull(entityClass, "EntityClass must not be null!"); - Assert.notNull(collectionName, "CollectionName must not be null!"); + Assert.notNull(id, "Id must not be null"); + Assert.notNull(entityClass, "EntityClass must not be null"); + Assert.notNull(collectionName, "CollectionName must not be null"); String idKey = operations.getIdPropertyName(entityClass); @@ -812,11 +812,11 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, public List findDistinct(Query query, String field, String collectionName, Class entityClass, Class resultClass) { - Assert.notNull(query, "Query must not be null!"); - Assert.notNull(field, "Field must not be null!"); - Assert.notNull(collectionName, "CollectionName must not be null!"); - Assert.notNull(entityClass, "EntityClass must not be null!"); - Assert.notNull(resultClass, "ResultClass must not be null!"); + Assert.notNull(query, "Query must not be null"); + Assert.notNull(field, "Field must not be null"); + Assert.notNull(collectionName, "CollectionName must not be null"); + Assert.notNull(entityClass, "EntityClass must not be null"); + Assert.notNull(resultClass, "ResultClass must not be null"); MongoPersistentEntity entity = entityClass != Object.class ? getPersistentEntity(entityClass) : null; DistinctQueryContext distinctQueryContext = queryOperations.distinctQueryContext(query, field); @@ -872,15 +872,15 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, public GeoResults geoNear(NearQuery near, Class domainType, String collectionName, Class returnType) { if (near == null) { - throw new InvalidDataAccessApiUsageException("NearQuery must not be null!"); + throw new InvalidDataAccessApiUsageException("NearQuery must not be null"); } if (domainType == null) { - throw new InvalidDataAccessApiUsageException("Entity class must not be null!"); + throw new InvalidDataAccessApiUsageException("Entity class must not be null"); } - Assert.notNull(collectionName, "CollectionName must not be null!"); - Assert.notNull(returnType, "ReturnType must not be null!"); + Assert.notNull(collectionName, "CollectionName must not be null"); + Assert.notNull(returnType, "ReturnType must not be null"); String collection = StringUtils.hasText(collectionName) ? collectionName : getCollectionName(domainType); String distanceField = operations.nearQueryDistanceFieldName(domainType); @@ -934,17 +934,17 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, public T findAndModify(Query query, UpdateDefinition update, FindAndModifyOptions options, Class entityClass, String collectionName) { - Assert.notNull(query, "Query must not be null!"); - Assert.notNull(update, "Update must not be null!"); - Assert.notNull(options, "Options must not be null!"); - Assert.notNull(entityClass, "EntityClass must not be null!"); - Assert.notNull(collectionName, "CollectionName must not be null!"); + Assert.notNull(query, "Query must not be null"); + Assert.notNull(update, "Update must not be null"); + Assert.notNull(options, "Options must not be null"); + Assert.notNull(entityClass, "EntityClass must not be null"); + Assert.notNull(collectionName, "CollectionName must not be null"); FindAndModifyOptions optionsToUse = FindAndModifyOptions.of(options); Optionals.ifAllPresent(query.getCollation(), optionsToUse.getCollation(), (l, r) -> { throw new IllegalArgumentException( - "Both Query and FindAndModifyOptions define a collation. Please provide the collation only via one of the two."); + "Both Query and FindAndModifyOptions define a collation; Please provide the collation only via one of the two"); }); if (!options.getCollation().isPresent()) { @@ -959,15 +959,15 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, public T findAndReplace(Query query, S replacement, FindAndReplaceOptions options, Class entityType, String collectionName, Class resultType) { - Assert.notNull(query, "Query must not be null!"); - Assert.notNull(replacement, "Replacement must not be null!"); - Assert.notNull(options, "Options must not be null! Use FindAndReplaceOptions#empty() instead."); - Assert.notNull(entityType, "EntityType must not be null!"); - Assert.notNull(collectionName, "CollectionName must not be null!"); - Assert.notNull(resultType, "ResultType must not be null! Use Object.class instead."); + Assert.notNull(query, "Query must not be null"); + Assert.notNull(replacement, "Replacement must not be null"); + Assert.notNull(options, "Options must not be null Use FindAndReplaceOptions#empty() instead"); + Assert.notNull(entityType, "EntityType must not be null"); + Assert.notNull(collectionName, "CollectionName must not be null"); + Assert.notNull(resultType, "ResultType must not be null Use Object.class instead"); - Assert.isTrue(query.getLimit() <= 1, "Query must not define a limit other than 1 ore none!"); - Assert.isTrue(query.getSkip() <= 0, "Query must not define skip."); + Assert.isTrue(query.getLimit() <= 1, "Query must not define a limit other than 1 ore none"); + Assert.isTrue(query.getSkip() <= 0, "Query must not define skip"); MongoPersistentEntity entity = mappingContext.getPersistentEntity(entityType); QueryContext queryContext = queryOperations.createQueryContext(query); @@ -1007,9 +1007,9 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, @Override public T findAndRemove(Query query, Class entityClass, String collectionName) { - Assert.notNull(query, "Query must not be null!"); - Assert.notNull(entityClass, "EntityClass must not be null!"); - Assert.notNull(collectionName, "CollectionName must not be null!"); + Assert.notNull(query, "Query must not be null"); + Assert.notNull(entityClass, "EntityClass must not be null"); + Assert.notNull(collectionName, "CollectionName must not be null"); return doFindAndRemove(collectionName, query.getQueryObject(), query.getFieldsObject(), getMappedSortObject(query, entityClass), operations.forType(entityClass).getCollation(query).orElse(null), @@ -1019,7 +1019,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, @Override public long count(Query query, Class entityClass) { - Assert.notNull(entityClass, "Entity class must not be null!"); + Assert.notNull(entityClass, "Entity class must not be null"); return count(query, entityClass, getCollectionName(entityClass)); } @@ -1035,8 +1035,8 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, @Override public long count(Query query, @Nullable Class entityClass, String collectionName) { - Assert.notNull(query, "Query must not be null!"); - Assert.hasText(collectionName, "Collection name must not be null or empty!"); + Assert.notNull(query, "Query must not be null"); + Assert.hasText(collectionName, "Collection name must not be null or empty"); CountContext countContext = queryOperations.countQueryContext(query); @@ -1103,7 +1103,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, @Override public T insert(T objectToSave) { - Assert.notNull(objectToSave, "ObjectToSave must not be null!"); + Assert.notNull(objectToSave, "ObjectToSave must not be null"); ensureNotCollectionLike(objectToSave); return insert(objectToSave, getCollectionName(ClassUtils.getUserClass(objectToSave))); @@ -1113,8 +1113,8 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, @SuppressWarnings("unchecked") public T insert(T objectToSave, String collectionName) { - Assert.notNull(objectToSave, "ObjectToSave must not be null!"); - Assert.notNull(collectionName, "CollectionName must not be null!"); + Assert.notNull(objectToSave, "ObjectToSave must not be null"); + Assert.notNull(collectionName, "CollectionName must not be null"); ensureNotCollectionLike(objectToSave); return (T) doInsert(collectionName, objectToSave, this.mongoConverter); @@ -1130,7 +1130,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, protected void ensureNotCollectionLike(@Nullable Object source) { if (EntityOperations.isCollectionLike(source)) { - throw new IllegalArgumentException("Cannot use a collection here."); + throw new IllegalArgumentException("Cannot use a collection here"); } } @@ -1202,7 +1202,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, @SuppressWarnings("unchecked") public Collection insert(Collection batchToSave, Class entityClass) { - Assert.notNull(batchToSave, "BatchToSave must not be null!"); + Assert.notNull(batchToSave, "BatchToSave must not be null"); return (Collection) doInsertBatch(getCollectionName(entityClass), batchToSave, this.mongoConverter); } @@ -1211,8 +1211,8 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, @SuppressWarnings("unchecked") public Collection insert(Collection batchToSave, String collectionName) { - Assert.notNull(batchToSave, "BatchToSave must not be null!"); - Assert.notNull(collectionName, "CollectionName must not be null!"); + Assert.notNull(batchToSave, "BatchToSave must not be null"); + Assert.notNull(collectionName, "CollectionName must not be null"); return (Collection) doInsertBatch(collectionName, batchToSave, this.mongoConverter); } @@ -1221,7 +1221,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, @SuppressWarnings("unchecked") public Collection insertAll(Collection objectsToSave) { - Assert.notNull(objectsToSave, "ObjectsToSave must not be null!"); + Assert.notNull(objectsToSave, "ObjectsToSave must not be null"); return (Collection) doInsertAll(objectsToSave, this.mongoConverter); } @@ -1258,7 +1258,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, protected Collection doInsertBatch(String collectionName, Collection batchToSave, MongoWriter writer) { - Assert.notNull(writer, "MongoWriter must not be null!"); + Assert.notNull(writer, "MongoWriter must not be null"); List documentList = new ArrayList<>(); List initializedBatchToSave = new ArrayList<>(batchToSave.size()); @@ -1303,7 +1303,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, @Override public T save(T objectToSave) { - Assert.notNull(objectToSave, "Object to save must not be null!"); + Assert.notNull(objectToSave, "Object to save must not be null"); return save(objectToSave, getCollectionName(ClassUtils.getUserClass(objectToSave))); } @@ -1311,8 +1311,8 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, @SuppressWarnings("unchecked") public T save(T objectToSave, String collectionName) { - Assert.notNull(objectToSave, "Object to save must not be null!"); - Assert.hasText(collectionName, "Collection name must not be null or empty!"); + Assert.notNull(objectToSave, "Object to save must not be null"); + Assert.hasText(collectionName, "Collection name must not be null or empty"); ensureNotCollectionLike(objectToSave); AdaptibleEntity source = operations.forEntity(objectToSave, mongoConverter.getConversionService()); @@ -1355,7 +1355,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, if (result.getModifiedCount() == 0) { throw new OptimisticLockingFailureException( - String.format("Cannot save entity %s with version %s to collection %s. Has it been modified meanwhile?", + String.format("Cannot save entity %s with version %s to collection %s; Has it been modified meanwhile", source.getId(), source.getVersion(), collectionName)); } maybeEmitEvent(new AfterSaveEvent<>(toSave, mapped.getDocument(), collectionName)); @@ -1492,7 +1492,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, @Override public UpdateResult upsert(Query query, UpdateDefinition update, Class entityClass, String collectionName) { - Assert.notNull(entityClass, "EntityClass must not be null!"); + Assert.notNull(entityClass, "EntityClass must not be null"); return doUpdate(collectionName, query, update, entityClass, true, false); } @@ -1510,7 +1510,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, @Override public UpdateResult updateFirst(Query query, UpdateDefinition update, Class entityClass, String collectionName) { - Assert.notNull(entityClass, "EntityClass must not be null!"); + Assert.notNull(entityClass, "EntityClass must not be null"); return doUpdate(collectionName, query, update, entityClass, false, false); } @@ -1528,7 +1528,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, @Override public UpdateResult updateMulti(Query query, UpdateDefinition update, Class entityClass, String collectionName) { - Assert.notNull(entityClass, "EntityClass must not be null!"); + Assert.notNull(entityClass, "EntityClass must not be null"); return doUpdate(collectionName, query, update, entityClass, false, true); } @@ -1537,13 +1537,13 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, protected UpdateResult doUpdate(String collectionName, Query query, UpdateDefinition update, @Nullable Class entityClass, boolean upsert, boolean multi) { - Assert.notNull(collectionName, "CollectionName must not be null!"); - Assert.notNull(query, "Query must not be null!"); - Assert.notNull(update, "Update must not be null!"); + Assert.notNull(collectionName, "CollectionName must not be null"); + Assert.notNull(query, "Query must not be null"); + Assert.notNull(update, "Update must not be null"); if (query.isSorted() && LOGGER.isWarnEnabled()) { - LOGGER.warn(String.format("%s does not support sort ('%s'). Please use findAndModify() instead.", + LOGGER.warn(String.format("%s does not support sort ('%s'); Please use findAndModify() instead", upsert ? "Upsert" : "UpdateFirst", serializeToJsonSafely(query.getSortObject()))); } @@ -1616,7 +1616,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, @Override public DeleteResult remove(Object object) { - Assert.notNull(object, "Object must not be null!"); + Assert.notNull(object, "Object must not be null"); return remove(object, getCollectionName(object.getClass())); } @@ -1624,8 +1624,8 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, @Override public DeleteResult remove(Object object, String collectionName) { - Assert.notNull(object, "Object must not be null!"); - Assert.hasText(collectionName, "Collection name must not be null or empty!"); + Assert.notNull(object, "Object must not be null"); + Assert.hasText(collectionName, "Collection name must not be null or empty"); Query query = operations.forEntity(object).getRemoveByQuery(); @@ -1645,7 +1645,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, @Override public DeleteResult remove(Query query, Class entityClass, String collectionName) { - Assert.notNull(entityClass, "EntityClass must not be null!"); + Assert.notNull(entityClass, "EntityClass must not be null"); return doRemove(collectionName, query, entityClass, true); } @@ -1653,8 +1653,8 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, protected DeleteResult doRemove(String collectionName, Query query, @Nullable Class entityClass, boolean multi) { - Assert.notNull(query, "Query must not be null!"); - Assert.hasText(collectionName, "Collection name must not be null or empty!"); + Assert.notNull(query, "Query must not be null"); + Assert.hasText(collectionName, "Collection name must not be null or empty"); MongoPersistentEntity entity = getPersistentEntity(entityClass); @@ -1764,11 +1764,11 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, public List mapReduce(Query query, Class domainType, String inputCollectionName, String mapFunction, String reduceFunction, @Nullable MapReduceOptions mapReduceOptions, Class resultType) { - Assert.notNull(domainType, "Domain type must not be null!"); - Assert.notNull(inputCollectionName, "Input collection name must not be null!"); - Assert.notNull(resultType, "Result type must not be null!"); - Assert.notNull(mapFunction, "Map function must not be null!"); - Assert.notNull(reduceFunction, "Reduce function must not be null!"); + Assert.notNull(domainType, "Domain type must not be null"); + Assert.notNull(inputCollectionName, "Input collection name must not be null"); + Assert.notNull(resultType, "Result type must not be null"); + Assert.notNull(mapFunction, "Map function must not be null"); + Assert.notNull(reduceFunction, "Reduce function must not be null"); String mapFunc = replaceWithResourceIfNecessary(mapFunction); String reduceFunc = replaceWithResourceIfNecessary(reduceFunction); @@ -1798,7 +1798,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, Optionals.ifAllPresent(collation, mapReduceOptions.getCollation(), (l, r) -> { throw new IllegalArgumentException( - "Both Query and MapReduceOptions define a collation. Please provide the collation only via one of the two."); + "Both Query and MapReduceOptions define a collation; Please provide the collation only via one of the two."); }); if (mapReduceOptions.getCollation().isPresent()) { @@ -1861,7 +1861,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, public AggregationResults aggregate(TypedAggregation aggregation, String inputCollectionName, Class outputType) { - Assert.notNull(aggregation, "Aggregation pipeline must not be null!"); + Assert.notNull(aggregation, "Aggregation pipeline must not be null"); return aggregate(aggregation, inputCollectionName, outputType, null); } @@ -1882,7 +1882,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, public Stream aggregateStream(TypedAggregation aggregation, String inputCollectionName, Class outputType) { - Assert.notNull(aggregation, "Aggregation pipeline must not be null!"); + Assert.notNull(aggregation, "Aggregation pipeline must not be null"); AggregationOperationContext context = new TypeBasedAggregationOperationContext(aggregation.getInputType(), mappingContext, queryMapper); @@ -1949,9 +1949,9 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, protected AggregationResults aggregate(Aggregation aggregation, String collectionName, Class outputType, @Nullable AggregationOperationContext context) { - Assert.hasText(collectionName, "Collection name must not be null or empty!"); - Assert.notNull(aggregation, "Aggregation pipeline must not be null!"); - Assert.notNull(outputType, "Output type must not be null!"); + Assert.hasText(collectionName, "Collection name must not be null or empty"); + Assert.notNull(aggregation, "Aggregation pipeline must not be null"); + Assert.notNull(outputType, "Output type must not be null"); return doAggregate(aggregation, collectionName, outputType, queryOperations.createAggregation(aggregation, context)); @@ -2043,10 +2043,10 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, protected Stream aggregateStream(Aggregation aggregation, String collectionName, Class outputType, @Nullable AggregationOperationContext context) { - Assert.hasText(collectionName, "Collection name must not be null or empty!"); - Assert.notNull(aggregation, "Aggregation pipeline must not be null!"); - Assert.notNull(outputType, "Output type must not be null!"); - Assert.isTrue(!aggregation.getOptions().isExplain(), "Can't use explain option with streaming!"); + Assert.hasText(collectionName, "Collection name must not be null or empty"); + Assert.notNull(aggregation, "Aggregation pipeline must not be null"); + Assert.notNull(outputType, "Output type must not be null"); + Assert.isTrue(!aggregation.getOptions().isExplain(), "Can't use explain option with streaming"); AggregationDefinition aggregationDefinition = queryOperations.createAggregation(aggregation, context); @@ -2123,7 +2123,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, Resource functionResource = resourceLoader.getResource(func); if (!functionResource.exists()) { - throw new InvalidDataAccessApiUsageException(String.format("Resource %s not found!", function)); + throw new InvalidDataAccessApiUsageException(String.format("Resource %s not found", function)); } Scanner scanner = null; @@ -2132,7 +2132,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, scanner = new Scanner(functionResource.getInputStream()); return scanner.useDelimiter("\\A").next(); } catch (IOException e) { - throw new InvalidDataAccessApiUsageException(String.format("Cannot read map-reduce file %s!", function), e); + throw new InvalidDataAccessApiUsageException(String.format("Cannot read map-reduce file %s", function), e); } finally { if (scanner != null) { scanner.close(); @@ -2809,8 +2809,8 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, public FindCallback(Document query, Document fields, @Nullable com.mongodb.client.model.Collation collation) { - Assert.notNull(query, "Query must not be null!"); - Assert.notNull(fields, "Fields must not be null!"); + Assert.notNull(query, "Query must not be null"); + Assert.notNull(fields, "Fields must not be null"); this.query = query; this.fields = fields; @@ -3197,7 +3197,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, */ GeoNearResultDocumentCallback(String distanceField, DocumentCallback delegate, Metric metric) { - Assert.notNull(delegate, "DocumentCallback must not be null!"); + Assert.notNull(delegate, "DocumentCallback must not be null"); this.distanceField = distanceField; this.delegate = delegate; diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ReactiveAggregationOperationSupport.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ReactiveAggregationOperationSupport.java index 4b680f763..48dab5bd6 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ReactiveAggregationOperationSupport.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ReactiveAggregationOperationSupport.java @@ -41,7 +41,7 @@ class ReactiveAggregationOperationSupport implements ReactiveAggregationOperatio */ ReactiveAggregationOperationSupport(ReactiveMongoTemplate template) { - Assert.notNull(template, "Template must not be null!"); + Assert.notNull(template, "Template must not be null"); this.template = template; } @@ -49,7 +49,7 @@ class ReactiveAggregationOperationSupport implements ReactiveAggregationOperatio @Override public ReactiveAggregation aggregateAndReturn(Class domainType) { - Assert.notNull(domainType, "DomainType must not be null!"); + Assert.notNull(domainType, "DomainType must not be null"); return new ReactiveAggregationSupport<>(template, domainType, null, null); } @@ -74,7 +74,7 @@ class ReactiveAggregationOperationSupport implements ReactiveAggregationOperatio @Override public AggregationOperationWithAggregation inCollection(String collection) { - Assert.hasText(collection, "Collection must not be null nor empty!"); + Assert.hasText(collection, "Collection must not be null nor empty"); return new ReactiveAggregationSupport<>(template, domainType, aggregation, collection); } @@ -82,7 +82,7 @@ class ReactiveAggregationOperationSupport implements ReactiveAggregationOperatio @Override public TerminatingAggregationOperation by(Aggregation aggregation) { - Assert.notNull(aggregation, "Aggregation must not be null!"); + Assert.notNull(aggregation, "Aggregation must not be null"); return new ReactiveAggregationSupport<>(template, domainType, aggregation, collection); } diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ReactiveChangeStreamOperationSupport.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ReactiveChangeStreamOperationSupport.java index 438289ac9..9706cf381 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ReactiveChangeStreamOperationSupport.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ReactiveChangeStreamOperationSupport.java @@ -49,7 +49,7 @@ class ReactiveChangeStreamOperationSupport implements ReactiveChangeStreamOperat @Override public ReactiveChangeStream changeStream(Class domainType) { - Assert.notNull(domainType, "DomainType must not be null!"); + Assert.notNull(domainType, "DomainType must not be null"); return new ReactiveChangeStreamSupport<>(template, domainType, domainType, null, null); } @@ -75,7 +75,7 @@ class ReactiveChangeStreamOperationSupport implements ReactiveChangeStreamOperat @Override public ChangeStreamWithFilterAndProjection watchCollection(String collection) { - Assert.hasText(collection, "Collection name must not be null nor empty!"); + Assert.hasText(collection, "Collection name must not be null nor empty"); return new ReactiveChangeStreamSupport<>(template, domainType, returnType, collection, options); } @@ -83,7 +83,7 @@ class ReactiveChangeStreamOperationSupport implements ReactiveChangeStreamOperat @Override public ChangeStreamWithFilterAndProjection watchCollection(Class entityClass) { - Assert.notNull(entityClass, "Collection type not be null!"); + Assert.notNull(entityClass, "Collection type not be null"); return watchCollection(template.getCollectionName(entityClass)); } @@ -129,7 +129,7 @@ class ReactiveChangeStreamOperationSupport implements ReactiveChangeStreamOperat @Override public ChangeStreamWithFilterAndProjection as(Class resultType) { - Assert.notNull(resultType, "ResultType must not be null!"); + Assert.notNull(resultType, "ResultType must not be null"); return new ReactiveChangeStreamSupport<>(template, domainType, resultType, collection, options); } diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ReactiveFindOperationSupport.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ReactiveFindOperationSupport.java index 084e16717..7b5ec67de 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ReactiveFindOperationSupport.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ReactiveFindOperationSupport.java @@ -47,7 +47,7 @@ class ReactiveFindOperationSupport implements ReactiveFindOperation { @Override public ReactiveFind query(Class domainType) { - Assert.notNull(domainType, "DomainType must not be null!"); + Assert.notNull(domainType, "DomainType must not be null"); return new ReactiveFindSupport<>(template, domainType, domainType, null, ALL_QUERY); } @@ -80,7 +80,7 @@ class ReactiveFindOperationSupport implements ReactiveFindOperation { @Override public FindWithProjection inCollection(String collection) { - Assert.hasText(collection, "Collection name must not be null nor empty!"); + Assert.hasText(collection, "Collection name must not be null nor empty"); return new ReactiveFindSupport<>(template, domainType, returnType, collection, query); } @@ -88,7 +88,7 @@ class ReactiveFindOperationSupport implements ReactiveFindOperation { @Override public FindWithQuery as(Class returnType) { - Assert.notNull(returnType, "ReturnType must not be null!"); + Assert.notNull(returnType, "ReturnType must not be null"); return new ReactiveFindSupport<>(template, domainType, returnType, collection, query); } @@ -96,7 +96,7 @@ class ReactiveFindOperationSupport implements ReactiveFindOperation { @Override public TerminatingFind matching(Query query) { - Assert.notNull(query, "Query must not be null!"); + Assert.notNull(query, "Query must not be null"); return new ReactiveFindSupport<>(template, domainType, returnType, collection, query); } @@ -124,7 +124,7 @@ class ReactiveFindOperationSupport implements ReactiveFindOperation { if (it.size() > 1) { return Mono.error( - new IncorrectResultSizeDataAccessException("Query " + asString() + " returned non unique result.", 1)); + new IncorrectResultSizeDataAccessException("Query " + asString() + " returned non unique result", 1)); } return Mono.just(it.get(0)); @@ -159,7 +159,7 @@ class ReactiveFindOperationSupport implements ReactiveFindOperation { @Override public TerminatingDistinct distinct(String field) { - Assert.notNull(field, "Field must not be null!"); + Assert.notNull(field, "Field must not be null"); return new DistinctOperationSupport<>(this, field); } @@ -210,7 +210,7 @@ class ReactiveFindOperationSupport implements ReactiveFindOperation { @Override public TerminatingDistinct as(Class resultType) { - Assert.notNull(resultType, "ResultType must not be null!"); + Assert.notNull(resultType, "ResultType must not be null"); return new DistinctOperationSupport<>((ReactiveFindSupport) delegate.as(resultType), field); } @@ -219,7 +219,7 @@ class ReactiveFindOperationSupport implements ReactiveFindOperation { @SuppressWarnings("unchecked") public TerminatingDistinct matching(Query query) { - Assert.notNull(query, "Query must not be null!"); + Assert.notNull(query, "Query must not be null"); return new DistinctOperationSupport<>((ReactiveFindSupport) delegate.matching(query), field); } diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ReactiveInsertOperationSupport.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ReactiveInsertOperationSupport.java index 8a7719cc7..9e4e330cb 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ReactiveInsertOperationSupport.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ReactiveInsertOperationSupport.java @@ -41,7 +41,7 @@ class ReactiveInsertOperationSupport implements ReactiveInsertOperation { @Override public ReactiveInsert insert(Class domainType) { - Assert.notNull(domainType, "DomainType must not be null!"); + Assert.notNull(domainType, "DomainType must not be null"); return new ReactiveInsertSupport<>(template, domainType, null); } @@ -62,7 +62,7 @@ class ReactiveInsertOperationSupport implements ReactiveInsertOperation { @Override public Mono one(T object) { - Assert.notNull(object, "Object must not be null!"); + Assert.notNull(object, "Object must not be null"); return template.insert(object, getCollectionName()); } @@ -70,7 +70,7 @@ class ReactiveInsertOperationSupport implements ReactiveInsertOperation { @Override public Flux all(Collection objects) { - Assert.notNull(objects, "Objects must not be null!"); + Assert.notNull(objects, "Objects must not be null"); return template.insert(objects, getCollectionName()); } @@ -78,7 +78,7 @@ class ReactiveInsertOperationSupport implements ReactiveInsertOperation { @Override public ReactiveInsert inCollection(String collection) { - Assert.hasText(collection, "Collection must not be null nor empty."); + Assert.hasText(collection, "Collection must not be null nor empty"); return new ReactiveInsertSupport<>(template, domainType, collection); } diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ReactiveMapReduceOperationSupport.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ReactiveMapReduceOperationSupport.java index d6ec0b3ec..9f059bf41 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ReactiveMapReduceOperationSupport.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ReactiveMapReduceOperationSupport.java @@ -46,7 +46,7 @@ class ReactiveMapReduceOperationSupport implements ReactiveMapReduceOperation { @Override public ReactiveMapReduceSupport mapReduce(Class domainType) { - Assert.notNull(domainType, "DomainType must not be null!"); + Assert.notNull(domainType, "DomainType must not be null"); return new ReactiveMapReduceSupport<>(template, domainType, domainType, null, ALL_QUERY, null, null, null); } @@ -100,7 +100,7 @@ class ReactiveMapReduceOperationSupport implements ReactiveMapReduceOperation { @Override public MapReduceWithProjection inCollection(String collection) { - Assert.hasText(collection, "Collection name must not be null nor empty!"); + Assert.hasText(collection, "Collection name must not be null nor empty"); return new ReactiveMapReduceSupport<>(template, domainType, returnType, collection, query, mapFunction, reduceFunction, options); @@ -113,7 +113,7 @@ class ReactiveMapReduceOperationSupport implements ReactiveMapReduceOperation { @Override public TerminatingMapReduce matching(Query query) { - Assert.notNull(query, "Query must not be null!"); + Assert.notNull(query, "Query must not be null"); return new ReactiveMapReduceSupport<>(template, domainType, returnType, collection, query, mapFunction, reduceFunction, options); @@ -126,7 +126,7 @@ class ReactiveMapReduceOperationSupport implements ReactiveMapReduceOperation { @Override public MapReduceWithQuery as(Class resultType) { - Assert.notNull(resultType, "ResultType must not be null!"); + Assert.notNull(resultType, "ResultType must not be null"); return new ReactiveMapReduceSupport<>(template, domainType, resultType, collection, query, mapFunction, reduceFunction, options); @@ -139,7 +139,7 @@ class ReactiveMapReduceOperationSupport implements ReactiveMapReduceOperation { @Override public ReactiveMapReduce with(MapReduceOptions options) { - Assert.notNull(options, "Options must not be null! Please consider empty MapReduceOptions#options() instead."); + Assert.notNull(options, "Options must not be null Please consider empty MapReduceOptions#options() instead"); return new ReactiveMapReduceSupport<>(template, domainType, returnType, collection, query, mapFunction, reduceFunction, options); @@ -152,7 +152,7 @@ class ReactiveMapReduceOperationSupport implements ReactiveMapReduceOperation { @Override public MapReduceWithReduceFunction map(String mapFunction) { - Assert.hasText(mapFunction, "MapFunction name must not be null nor empty!"); + Assert.hasText(mapFunction, "MapFunction name must not be null nor empty"); return new ReactiveMapReduceSupport<>(template, domainType, returnType, collection, query, mapFunction, reduceFunction, options); @@ -165,7 +165,7 @@ class ReactiveMapReduceOperationSupport implements ReactiveMapReduceOperation { @Override public ReactiveMapReduce reduce(String reduceFunction) { - Assert.hasText(reduceFunction, "ReduceFunction name must not be null nor empty!"); + Assert.hasText(reduceFunction, "ReduceFunction name must not be null nor empty"); return new ReactiveMapReduceSupport<>(template, domainType, returnType, collection, query, mapFunction, reduceFunction, options); diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ReactiveMongoClientFactoryBean.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ReactiveMongoClientFactoryBean.java index 4d828bd9b..1a7d22b5e 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ReactiveMongoClientFactoryBean.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ReactiveMongoClientFactoryBean.java @@ -115,7 +115,7 @@ public class ReactiveMongoClientFactoryBean extends AbstractFactoryBean session) { - Assert.notNull(context, "Context must not be null!"); - Assert.notNull(session, "Session publisher must not be null!"); + Assert.notNull(context, "Context must not be null"); + Assert.notNull(session, "Session publisher must not be null"); return context.put(SESSION_KEY, Mono.from(session)); } diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ReactiveMongoOperations.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ReactiveMongoOperations.java index d35727b23..48ef7adfe 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ReactiveMongoOperations.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ReactiveMongoOperations.java @@ -164,7 +164,7 @@ public interface ReactiveMongoOperations extends ReactiveFluentMongoOperations { */ default ReactiveSessionScoped withSession(Supplier sessionProvider) { - Assert.notNull(sessionProvider, "SessionProvider must not be null!"); + Assert.notNull(sessionProvider, "SessionProvider must not be null"); return withSession(Mono.fromSupplier(sessionProvider)); } @@ -756,7 +756,7 @@ public interface ReactiveMongoOperations extends ReactiveFluentMongoOperations { */ default Mono findAndReplace(Query query, T replacement, FindAndReplaceOptions options, String collectionName) { - Assert.notNull(replacement, "Replacement must not be null!"); + Assert.notNull(replacement, "Replacement must not be null"); return findAndReplace(query, replacement, options, (Class) ClassUtils.getUserClass(replacement), collectionName); } @@ -941,7 +941,7 @@ public interface ReactiveMongoOperations extends ReactiveFluentMongoOperations { */ default Mono estimatedCount(Class entityClass) { - Assert.notNull(entityClass, "Entity class must not be null!"); + Assert.notNull(entityClass, "Entity class must not be null"); return estimatedCount(getCollectionName(entityClass)); } diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ReactiveMongoTemplate.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ReactiveMongoTemplate.java index 67e36d358..d5f6ab936 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ReactiveMongoTemplate.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ReactiveMongoTemplate.java @@ -241,7 +241,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati public ReactiveMongoTemplate(ReactiveMongoDatabaseFactory mongoDatabaseFactory, @Nullable MongoConverter mongoConverter, Consumer subscriptionExceptionHandler) { - Assert.notNull(mongoDatabaseFactory, "ReactiveMongoDatabaseFactory must not be null!"); + Assert.notNull(mongoDatabaseFactory, "ReactiveMongoDatabaseFactory must not be null"); this.mongoDatabaseFactory = mongoDatabaseFactory; this.exceptionTranslator = mongoDatabaseFactory.getExceptionTranslator(); @@ -367,7 +367,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati */ public void setEntityCallbacks(ReactiveEntityCallbacks entityCallbacks) { - Assert.notNull(entityCallbacks, "EntityCallbacks must not be null!"); + Assert.notNull(entityCallbacks, "EntityCallbacks must not be null"); this.entityCallbacks = entityCallbacks; } @@ -468,7 +468,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati @Override public Mono executeCommand(String jsonCommand) { - Assert.notNull(jsonCommand, "Command must not be empty!"); + Assert.notNull(jsonCommand, "Command must not be empty"); return executeCommand(Document.parse(jsonCommand)); } @@ -481,7 +481,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati @Override public Mono executeCommand(Document command, @Nullable ReadPreference readPreference) { - Assert.notNull(command, "Command must not be null!"); + Assert.notNull(command, "Command must not be null"); return createFlux(db -> readPreference != null ? db.runCommand(command, readPreference, Document.class) : db.runCommand(command, Document.class)).next(); @@ -500,7 +500,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati @Override public Flux execute(String collectionName, ReactiveCollectionCallback callback) { - Assert.notNull(callback, "ReactiveCollectionCallback must not be null!"); + Assert.notNull(callback, "ReactiveCollectionCallback must not be null"); return createFlux(collectionName, callback); } @@ -565,7 +565,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati */ public Flux createFlux(ReactiveDatabaseCallback callback) { - Assert.notNull(callback, "ReactiveDatabaseCallback must not be null!"); + Assert.notNull(callback, "ReactiveDatabaseCallback must not be null"); return Mono.defer(this::doGetDatabase).flatMapMany(database -> callback.doInDB(prepareDatabase(database))) .onErrorMap(translateException()); @@ -580,7 +580,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati */ public Mono createMono(ReactiveDatabaseCallback callback) { - Assert.notNull(callback, "ReactiveDatabaseCallback must not be null!"); + Assert.notNull(callback, "ReactiveDatabaseCallback must not be null"); return Mono.defer(this::doGetDatabase).flatMap(database -> Mono.from(callback.doInDB(prepareDatabase(database)))) .onErrorMap(translateException()); @@ -595,8 +595,8 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati */ public Flux createFlux(String collectionName, ReactiveCollectionCallback callback) { - Assert.hasText(collectionName, "Collection name must not be null or empty!"); - Assert.notNull(callback, "ReactiveDatabaseCallback must not be null!"); + Assert.hasText(collectionName, "Collection name must not be null or empty"); + Assert.notNull(callback, "ReactiveDatabaseCallback must not be null"); Mono> collectionPublisher = doGetDatabase() .map(database -> getAndPrepareCollection(database, collectionName)); @@ -614,8 +614,8 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati */ public Mono createMono(String collectionName, ReactiveCollectionCallback callback) { - Assert.hasText(collectionName, "Collection name must not be null or empty!"); - Assert.notNull(callback, "ReactiveCollectionCallback must not be null!"); + Assert.hasText(collectionName, "Collection name must not be null or empty"); + Assert.notNull(callback, "ReactiveCollectionCallback must not be null"); Mono> collectionPublisher = doGetDatabase() .map(database -> getAndPrepareCollection(database, collectionName)); @@ -633,7 +633,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati public Mono> createCollection(Class entityClass, @Nullable CollectionOptions collectionOptions) { - Assert.notNull(entityClass, "EntityClass must not be null!"); + Assert.notNull(entityClass, "EntityClass must not be null"); CollectionOptions options = collectionOptions != null ? collectionOptions : CollectionOptions.empty(); options = Optionals @@ -658,7 +658,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati @Override public Mono> getCollection(String collectionName) { - Assert.notNull(collectionName, "Collection name must not be null!"); + Assert.notNull(collectionName, "Collection name must not be null"); return createMono(db -> Mono.just(db.getCollection(collectionName))); } @@ -795,11 +795,11 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati public Flux findDistinct(Query query, String field, String collectionName, Class entityClass, Class resultClass) { - Assert.notNull(query, "Query must not be null!"); - Assert.notNull(field, "Field must not be null!"); - Assert.notNull(collectionName, "CollectionName must not be null!"); - Assert.notNull(entityClass, "EntityClass must not be null!"); - Assert.notNull(resultClass, "ResultClass must not be null!"); + Assert.notNull(query, "Query must not be null"); + Assert.notNull(field, "Field must not be null"); + Assert.notNull(collectionName, "CollectionName must not be null"); + Assert.notNull(entityClass, "EntityClass must not be null"); + Assert.notNull(resultClass, "ResultClass must not be null"); MongoPersistentEntity entity = getPersistentEntity(entityClass); DistinctQueryContext distinctQueryContext = queryOperations.distinctQueryContext(query, field); @@ -839,7 +839,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati @Override public Flux aggregate(TypedAggregation aggregation, String inputCollectionName, Class outputType) { - Assert.notNull(aggregation, "Aggregation pipeline must not be null!"); + Assert.notNull(aggregation, "Aggregation pipeline must not be null"); return doAggregate(aggregation, inputCollectionName, aggregation.getInputType(), outputType); } @@ -862,12 +862,12 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati protected Flux doAggregate(Aggregation aggregation, String collectionName, @Nullable Class inputType, Class outputType) { - Assert.notNull(aggregation, "Aggregation pipeline must not be null!"); - Assert.hasText(collectionName, "Collection name must not be null or empty!"); - Assert.notNull(outputType, "Output type must not be null!"); + Assert.notNull(aggregation, "Aggregation pipeline must not be null"); + Assert.hasText(collectionName, "Collection name must not be null or empty"); + Assert.notNull(outputType, "Output type must not be null"); AggregationOptions options = aggregation.getOptions(); - Assert.isTrue(!options.isExplain(), "Cannot use explain option with streaming!"); + Assert.isTrue(!options.isExplain(), "Cannot use explain option with streaming"); AggregationDefinition ctx = queryOperations.createAggregation(aggregation, inputType); @@ -925,11 +925,11 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati Class returnType) { if (near == null) { - throw new InvalidDataAccessApiUsageException("NearQuery must not be null!"); + throw new InvalidDataAccessApiUsageException("NearQuery must not be null"); } if (entityClass == null) { - throw new InvalidDataAccessApiUsageException("Entity class must not be null!"); + throw new InvalidDataAccessApiUsageException("Entity class must not be null"); } String collection = StringUtils.hasText(collectionName) ? collectionName : getCollectionName(entityClass); @@ -966,14 +966,14 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati public Mono findAndModify(Query query, UpdateDefinition update, FindAndModifyOptions options, Class entityClass, String collectionName) { - Assert.notNull(options, "Options must not be null! "); - Assert.notNull(entityClass, "Entity class must not be null!"); + Assert.notNull(options, "Options must not be null "); + Assert.notNull(entityClass, "Entity class must not be null"); FindAndModifyOptions optionsToUse = FindAndModifyOptions.of(options); Optionals.ifAllPresent(query.getCollation(), optionsToUse.getCollation(), (l, r) -> { throw new IllegalArgumentException( - "Both Query and FindAndModifyOptions define a collation. Please provide the collation only via one of the two."); + "Both Query and FindAndModifyOptions define a collation; Please provide the collation only via one of the two"); }); if (!optionsToUse.getCollation().isPresent()) { @@ -988,15 +988,15 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati public Mono findAndReplace(Query query, S replacement, FindAndReplaceOptions options, Class entityType, String collectionName, Class resultType) { - Assert.notNull(query, "Query must not be null!"); - Assert.notNull(replacement, "Replacement must not be null!"); - Assert.notNull(options, "Options must not be null! Use FindAndReplaceOptions#empty() instead."); - Assert.notNull(entityType, "Entity class must not be null!"); - Assert.notNull(collectionName, "CollectionName must not be null!"); - Assert.notNull(resultType, "ResultType must not be null! Use Object.class instead."); + Assert.notNull(query, "Query must not be null"); + Assert.notNull(replacement, "Replacement must not be null"); + Assert.notNull(options, "Options must not be null Use FindAndReplaceOptions#empty() instead"); + Assert.notNull(entityType, "Entity class must not be null"); + Assert.notNull(collectionName, "CollectionName must not be null"); + Assert.notNull(resultType, "ResultType must not be null Use Object.class instead"); - Assert.isTrue(query.getLimit() <= 1, "Query must not define a limit other than 1 ore none!"); - Assert.isTrue(query.getSkip() <= 0, "Query must not define skip."); + Assert.isTrue(query.getLimit() <= 1, "Query must not define a limit other than 1 ore none"); + Assert.isTrue(query.getSkip() <= 0, "Query must not define skip"); MongoPersistentEntity entity = mappingContext.getPersistentEntity(entityType); QueryContext queryContext = queryOperations.createQueryContext(query); @@ -1053,7 +1053,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati @Override public Mono count(Query query, Class entityClass) { - Assert.notNull(entityClass, "Entity class must not be null!"); + Assert.notNull(entityClass, "Entity class must not be null"); return count(query, entityClass, getCollectionName(entityClass)); } @@ -1066,8 +1066,8 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati @Override public Mono count(Query query, @Nullable Class entityClass, String collectionName) { - Assert.notNull(query, "Query must not be null!"); - Assert.hasText(collectionName, "Collection name must not be null or empty!"); + Assert.notNull(query, "Query must not be null"); + Assert.hasText(collectionName, "Collection name must not be null or empty"); return createMono(collectionName, collection -> { @@ -1152,7 +1152,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati @Override public Mono insert(Mono objectToSave) { - Assert.notNull(objectToSave, "Mono to insert must not be null!"); + Assert.notNull(objectToSave, "Mono to insert must not be null"); return objectToSave.flatMap(this::insert); } @@ -1165,7 +1165,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati @Override public Flux insertAll(Mono> batchToSave, String collectionName) { - Assert.notNull(batchToSave, "Batch to insert must not be null!"); + Assert.notNull(batchToSave, "Batch to insert must not be null"); return Flux.from(batchToSave).flatMap(collection -> insert(collection, collectionName)); } @@ -1173,7 +1173,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati @Override public Mono insert(T objectToSave) { - Assert.notNull(objectToSave, "Object to insert must not be null!"); + Assert.notNull(objectToSave, "Object to insert must not be null"); ensureNotCollectionLike(objectToSave); return insert(objectToSave, getCollectionName(ClassUtils.getUserClass(objectToSave))); @@ -1182,7 +1182,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati @Override public Mono insert(T objectToSave, String collectionName) { - Assert.notNull(objectToSave, "Object to insert must not be null!"); + Assert.notNull(objectToSave, "Object to insert must not be null"); ensureNotCollectionLike(objectToSave); return doInsert(collectionName, objectToSave, this.mongoConverter); @@ -1257,7 +1257,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati protected Flux doInsertBatch(String collectionName, Collection batchToSave, MongoWriter writer) { - Assert.notNull(writer, "MongoWriter must not be null!"); + Assert.notNull(writer, "MongoWriter must not be null"); Mono, Document>>> prepareDocuments = Flux.fromIterable(batchToSave) .flatMap(uninitialized -> { @@ -1300,7 +1300,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati @Override public Mono save(Mono objectToSave) { - Assert.notNull(objectToSave, "Mono to save must not be null!"); + Assert.notNull(objectToSave, "Mono to save must not be null"); return objectToSave.flatMap(this::save); } @@ -1308,7 +1308,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati @Override public Mono save(Mono objectToSave, String collectionName) { - Assert.notNull(objectToSave, "Mono to save must not be null!"); + Assert.notNull(objectToSave, "Mono to save must not be null"); return objectToSave.flatMap(o -> save(o, collectionName)); } @@ -1316,15 +1316,15 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati @Override public Mono save(T objectToSave) { - Assert.notNull(objectToSave, "Object to save must not be null!"); + Assert.notNull(objectToSave, "Object to save must not be null"); return save(objectToSave, getCollectionName(ClassUtils.getUserClass(objectToSave))); } @Override public Mono save(T objectToSave, String collectionName) { - Assert.notNull(objectToSave, "Object to save must not be null!"); - Assert.hasText(collectionName, "Collection name must not be null or empty!"); + Assert.notNull(objectToSave, "Object to save must not be null"); + Assert.hasText(collectionName, "Collection name must not be null or empty"); AdaptibleEntity source = operations.forEntity(objectToSave, mongoConverter.getConversionService()); @@ -1568,7 +1568,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati if (query.isSorted() && LOGGER.isWarnEnabled()) { - LOGGER.warn(String.format("%s does not support sort ('%s'). Please use findAndModify() instead.", + LOGGER.warn(String.format("%s does not support sort ('%s'); Please use findAndModify() instead", upsert ? "Upsert" : "UpdateFirst", serializeToJsonSafely(query.getSortObject()))); } @@ -1682,7 +1682,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati @Override public Mono remove(Object object) { - Assert.notNull(object, "Object must not be null!"); + Assert.notNull(object, "Object must not be null"); return remove(operations.forEntity(object).getRemoveByQuery(), object.getClass()); } @@ -1690,8 +1690,8 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati @Override public Mono remove(Object object, String collectionName) { - Assert.notNull(object, "Object must not be null!"); - Assert.hasText(collectionName, "Collection name must not be null or empty!"); + Assert.notNull(object, "Object must not be null"); + Assert.hasText(collectionName, "Collection name must not be null or empty"); return doRemove(collectionName, operations.forEntity(object).getRemoveByQuery(), object.getClass()); } @@ -1711,7 +1711,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati if (!MongoSimpleTypes.AUTOGENERATED_ID_TYPES.contains(property.getType())) { throw new InvalidDataAccessApiUsageException( - String.format("Cannot autogenerate id of type %s for entity of type %s!", property.getType().getName(), + String.format("Cannot autogenerate id of type %s for entity of type %s", property.getType().getName(), value.getClass().getName())); } } @@ -1735,10 +1735,10 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati protected Mono doRemove(String collectionName, Query query, @Nullable Class entityClass) { if (query == null) { - throw new InvalidDataAccessApiUsageException("Query passed in to remove can't be null!"); + throw new InvalidDataAccessApiUsageException("Query passed in to remove can't be null"); } - Assert.hasText(collectionName, "Collection name must not be null or empty!"); + Assert.hasText(collectionName, "Collection name must not be null or empty"); MongoPersistentEntity entity = getPersistentEntity(entityClass); @@ -1895,13 +1895,13 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati public Flux mapReduce(Query filterQuery, Class domainType, String inputCollectionName, Class resultType, String mapFunction, String reduceFunction, MapReduceOptions options) { - Assert.notNull(filterQuery, "Filter query must not be null!"); - Assert.notNull(domainType, "Domain type must not be null!"); - Assert.hasText(inputCollectionName, "Input collection name must not be null or empty!"); - Assert.notNull(resultType, "Result type must not be null!"); - Assert.notNull(mapFunction, "Map function must not be null!"); - Assert.notNull(reduceFunction, "Reduce function must not be null!"); - Assert.notNull(options, "MapReduceOptions must not be null!"); + Assert.notNull(filterQuery, "Filter query must not be null"); + Assert.notNull(domainType, "Domain type must not be null"); + Assert.hasText(inputCollectionName, "Input collection name must not be null or empty"); + Assert.notNull(resultType, "Result type must not be null"); + Assert.notNull(mapFunction, "Map function must not be null"); + Assert.notNull(reduceFunction, "Reduce function must not be null"); + Assert.notNull(options, "MapReduceOptions must not be null"); assertLocalFunctionNames(mapFunction, reduceFunction); @@ -1927,7 +1927,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati if (filterQuery.getLimit() > 0 && (options.getLimit() != null)) { throw new IllegalArgumentException( - "Both Query and MapReduceOptions define a limit. Please provide the limit only via one of the two."); + "Both Query and MapReduceOptions define a limit; Please provide the limit only via one of the two."); } if (filterQuery.getLimit() > 0) { @@ -1943,7 +1943,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati Optionals.ifAllPresent(filterQuery.getCollation(), options.getCollation(), (l, r) -> { throw new IllegalArgumentException( - "Both Query and MapReduceOptions define a collation. Please provide the collation only via one of the two."); + "Both Query and MapReduceOptions define a collation; Please provide the collation only via one of the two."); }); if (options.getCollation().isPresent()) { @@ -1992,7 +1992,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati if (ResourceUtils.isUrl(function)) { throw new IllegalArgumentException(String.format( - "Blocking accessing to resource %s is not allowed using reactive infrastructure. You may load the resource at startup and cache its value.", + "Blocking accessing to resource %s is not allowed using reactive infrastructure; You may load the resource at startup and cache its value.", function)); } } @@ -2850,8 +2850,8 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati ReadDocumentCallback(EntityReader reader, Class type, String collectionName) { - Assert.notNull(reader, "EntityReader must not be null!"); - Assert.notNull(type, "Entity type must not be null!"); + Assert.notNull(reader, "EntityReader must not be null"); + Assert.notNull(type, "Entity type must not be null"); this.reader = reader; this.type = type; @@ -2939,7 +2939,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati */ GeoNearResultDocumentCallback(String distanceField, DocumentCallback delegate, Metric metric) { - Assert.notNull(delegate, "DocumentCallback must not be null!"); + Assert.notNull(delegate, "DocumentCallback must not be null"); this.distanceField = distanceField; this.delegate = delegate; diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ReactiveRemoveOperationSupport.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ReactiveRemoveOperationSupport.java index 8b9bf3ecc..1001bafc6 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ReactiveRemoveOperationSupport.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ReactiveRemoveOperationSupport.java @@ -44,7 +44,7 @@ class ReactiveRemoveOperationSupport implements ReactiveRemoveOperation { @Override public ReactiveRemove remove(Class domainType) { - Assert.notNull(domainType, "DomainType must not be null!"); + Assert.notNull(domainType, "DomainType must not be null"); return new ReactiveRemoveSupport<>(tempate, domainType, ALL_QUERY, null); } @@ -67,7 +67,7 @@ class ReactiveRemoveOperationSupport implements ReactiveRemoveOperation { @Override public RemoveWithQuery inCollection(String collection) { - Assert.hasText(collection, "Collection must not be null nor empty!"); + Assert.hasText(collection, "Collection must not be null nor empty"); return new ReactiveRemoveSupport<>(template, domainType, query, collection); } @@ -75,7 +75,7 @@ class ReactiveRemoveOperationSupport implements ReactiveRemoveOperation { @Override public TerminatingRemove matching(Query query) { - Assert.notNull(query, "Query must not be null!"); + Assert.notNull(query, "Query must not be null"); return new ReactiveRemoveSupport<>(template, domainType, query, collection); } diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ReactiveUpdateOperationSupport.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ReactiveUpdateOperationSupport.java index 91186780d..b52a34bee 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ReactiveUpdateOperationSupport.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ReactiveUpdateOperationSupport.java @@ -45,7 +45,7 @@ class ReactiveUpdateOperationSupport implements ReactiveUpdateOperation { @Override public ReactiveUpdate update(Class domainType) { - Assert.notNull(domainType, "DomainType must not be null!"); + Assert.notNull(domainType, "DomainType must not be null"); return new ReactiveUpdateSupport<>(template, domainType, ALL_QUERY, null, null, null, null, null, domainType); } @@ -82,7 +82,7 @@ class ReactiveUpdateOperationSupport implements ReactiveUpdateOperation { @Override public TerminatingUpdate apply(org.springframework.data.mongodb.core.query.UpdateDefinition update) { - Assert.notNull(update, "Update must not be null!"); + Assert.notNull(update, "Update must not be null"); return new ReactiveUpdateSupport<>(template, domainType, query, update, collection, findAndModifyOptions, findAndReplaceOptions, replacement, targetType); @@ -91,7 +91,7 @@ class ReactiveUpdateOperationSupport implements ReactiveUpdateOperation { @Override public UpdateWithQuery inCollection(String collection) { - Assert.hasText(collection, "Collection must not be null nor empty!"); + Assert.hasText(collection, "Collection must not be null nor empty"); return new ReactiveUpdateSupport<>(template, domainType, query, update, collection, findAndModifyOptions, findAndReplaceOptions, replacement, targetType); @@ -127,7 +127,7 @@ class ReactiveUpdateOperationSupport implements ReactiveUpdateOperation { @Override public UpdateWithUpdate matching(Query query) { - Assert.notNull(query, "Query must not be null!"); + Assert.notNull(query, "Query must not be null"); return new ReactiveUpdateSupport<>(template, domainType, query, update, collection, findAndModifyOptions, findAndReplaceOptions, replacement, targetType); @@ -141,7 +141,7 @@ class ReactiveUpdateOperationSupport implements ReactiveUpdateOperation { @Override public TerminatingFindAndModify withOptions(FindAndModifyOptions options) { - Assert.notNull(options, "Options must not be null!"); + Assert.notNull(options, "Options must not be null"); return new ReactiveUpdateSupport<>(template, domainType, query, update, collection, options, findAndReplaceOptions, replacement, targetType); @@ -150,7 +150,7 @@ class ReactiveUpdateOperationSupport implements ReactiveUpdateOperation { @Override public FindAndReplaceWithProjection replaceWith(T replacement) { - Assert.notNull(replacement, "Replacement must not be null!"); + Assert.notNull(replacement, "Replacement must not be null"); return new ReactiveUpdateSupport<>(template, domainType, query, update, collection, findAndModifyOptions, findAndReplaceOptions, replacement, targetType); @@ -159,7 +159,7 @@ class ReactiveUpdateOperationSupport implements ReactiveUpdateOperation { @Override public FindAndReplaceWithProjection withOptions(FindAndReplaceOptions options) { - Assert.notNull(options, "Options must not be null!"); + Assert.notNull(options, "Options must not be null"); return new ReactiveUpdateSupport<>(template, domainType, query, update, collection, findAndModifyOptions, options, replacement, targetType); @@ -168,7 +168,7 @@ class ReactiveUpdateOperationSupport implements ReactiveUpdateOperation { @Override public FindAndReplaceWithOptions as(Class resultType) { - Assert.notNull(resultType, "ResultType must not be null!"); + Assert.notNull(resultType, "ResultType must not be null"); return new ReactiveUpdateSupport<>(template, domainType, query, update, collection, findAndModifyOptions, findAndReplaceOptions, replacement, resultType); diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/SimpleReactiveMongoDatabaseFactory.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/SimpleReactiveMongoDatabaseFactory.java index 738cb02e4..8bc76388c 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/SimpleReactiveMongoDatabaseFactory.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/SimpleReactiveMongoDatabaseFactory.java @@ -77,10 +77,10 @@ public class SimpleReactiveMongoDatabaseFactory implements DisposableBean, React private SimpleReactiveMongoDatabaseFactory(MongoClient client, String databaseName, boolean mongoInstanceCreated) { - Assert.notNull(client, "MongoClient must not be null!"); - Assert.hasText(databaseName, "Database name must not be empty!"); + Assert.notNull(client, "MongoClient must not be null"); + Assert.hasText(databaseName, "Database name must not be empty"); Assert.isTrue(databaseName.matches("[^/\\\\.$\"\\s]+"), - "Database name must not contain slashes, dots, spaces, quotes, or dollar signs!"); + "Database name must not contain slashes, dots, spaces, quotes, or dollar signs"); this.mongo = client; this.databaseName = databaseName; @@ -103,7 +103,7 @@ public class SimpleReactiveMongoDatabaseFactory implements DisposableBean, React public Mono getMongoDatabase(String dbName) throws DataAccessException { - Assert.hasText(dbName, "Database name must not be empty."); + Assert.hasText(dbName, "Database name must not be empty"); return Mono.fromSupplier(() -> { diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/AbstractAggregationExpression.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/AbstractAggregationExpression.java index 2e714cb96..15092d670 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/AbstractAggregationExpression.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/AbstractAggregationExpression.java @@ -133,7 +133,7 @@ abstract class AbstractAggregationExpression implements AggregationExpression { @SuppressWarnings({ "unchecked", "rawtypes" }) protected Map append(String key, Object value) { - Assert.isInstanceOf(Map.class, this.value, "Value must be a type of Map!"); + Assert.isInstanceOf(Map.class, this.value, "Value must be a type of Map"); Map clone = new LinkedHashMap<>((java.util.Map) this.value); clone.put(key, value); @@ -144,7 +144,7 @@ abstract class AbstractAggregationExpression implements AggregationExpression { @SuppressWarnings({ "unchecked", "rawtypes" }) protected Map remove(String key) { - Assert.isInstanceOf(Map.class, this.value, "Value must be a type of Map!"); + Assert.isInstanceOf(Map.class, this.value, "Value must be a type of Map"); Map clone = new LinkedHashMap<>((java.util.Map) this.value); clone.remove(key); @@ -163,7 +163,7 @@ abstract class AbstractAggregationExpression implements AggregationExpression { @SuppressWarnings({ "unchecked" }) protected Map appendAt(int index, String key, Object value) { - Assert.isInstanceOf(Map.class, this.value, "Value must be a type of Map!"); + Assert.isInstanceOf(Map.class, this.value, "Value must be a type of Map"); Map clone = new LinkedHashMap<>(); @@ -223,7 +223,7 @@ abstract class AbstractAggregationExpression implements AggregationExpression { @SuppressWarnings("unchecked") protected T get(Object key) { - Assert.isInstanceOf(Map.class, this.value, "Value must be a type of Map!"); + Assert.isInstanceOf(Map.class, this.value, "Value must be a type of Map"); return (T) ((Map) this.value).get(key); } @@ -237,7 +237,7 @@ abstract class AbstractAggregationExpression implements AggregationExpression { @SuppressWarnings("unchecked") protected Map argumentMap() { - Assert.isInstanceOf(Map.class, this.value, "Value must be a type of Map!"); + Assert.isInstanceOf(Map.class, this.value, "Value must be a type of Map"); return Collections.unmodifiableMap((java.util.Map) value); } diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/AccumulatorOperators.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/AccumulatorOperators.java index f5a24e6b0..51fa0459f 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/AccumulatorOperators.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/AccumulatorOperators.java @@ -65,7 +65,7 @@ public class AccumulatorOperators { */ public AccumulatorOperatorFactory(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); this.fieldReference = fieldReference; this.expression = null; } @@ -77,7 +77,7 @@ public class AccumulatorOperators { */ public AccumulatorOperatorFactory(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); this.fieldReference = null; this.expression = expression; } @@ -278,7 +278,7 @@ public class AccumulatorOperators { */ public static Sum sumOf(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return new Sum(asFields(fieldReference)); } @@ -290,7 +290,7 @@ public class AccumulatorOperators { */ public static Sum sumOf(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new Sum(Collections.singletonList(expression)); } @@ -303,7 +303,7 @@ public class AccumulatorOperators { */ public Sum and(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return new Sum(append(Fields.field(fieldReference))); } @@ -316,7 +316,7 @@ public class AccumulatorOperators { */ public Sum and(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new Sum(append(expression)); } @@ -330,7 +330,7 @@ public class AccumulatorOperators { */ public Sum and(Number value) { - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(value, "Value must not be null"); return new Sum(append(value)); } @@ -372,7 +372,7 @@ public class AccumulatorOperators { */ public static Avg avgOf(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return new Avg(asFields(fieldReference)); } @@ -384,7 +384,7 @@ public class AccumulatorOperators { */ public static Avg avgOf(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new Avg(Collections.singletonList(expression)); } @@ -397,7 +397,7 @@ public class AccumulatorOperators { */ public Avg and(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return new Avg(append(Fields.field(fieldReference))); } @@ -410,7 +410,7 @@ public class AccumulatorOperators { */ public Avg and(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new Avg(append(expression)); } @@ -452,7 +452,7 @@ public class AccumulatorOperators { */ public static Max maxOf(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return new Max(asFields(fieldReference)); } @@ -464,7 +464,7 @@ public class AccumulatorOperators { */ public static Max maxOf(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new Max(Collections.singletonList(expression)); } @@ -477,7 +477,7 @@ public class AccumulatorOperators { */ public Max and(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return new Max(append(Fields.field(fieldReference))); } @@ -490,7 +490,7 @@ public class AccumulatorOperators { */ public Max and(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new Max(append(expression)); } @@ -532,7 +532,7 @@ public class AccumulatorOperators { */ public static Min minOf(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return new Min(asFields(fieldReference)); } @@ -544,7 +544,7 @@ public class AccumulatorOperators { */ public static Min minOf(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new Min(Collections.singletonList(expression)); } @@ -557,7 +557,7 @@ public class AccumulatorOperators { */ public Min and(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return new Min(append(Fields.field(fieldReference))); } @@ -570,7 +570,7 @@ public class AccumulatorOperators { */ public Min and(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new Min(append(expression)); } @@ -612,7 +612,7 @@ public class AccumulatorOperators { */ public static StdDevPop stdDevPopOf(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return new StdDevPop(asFields(fieldReference)); } @@ -624,7 +624,7 @@ public class AccumulatorOperators { */ public static StdDevPop stdDevPopOf(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new StdDevPop(Collections.singletonList(expression)); } @@ -637,7 +637,7 @@ public class AccumulatorOperators { */ public StdDevPop and(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return new StdDevPop(append(Fields.field(fieldReference))); } @@ -650,7 +650,7 @@ public class AccumulatorOperators { */ public StdDevPop and(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new StdDevPop(append(expression)); } @@ -692,7 +692,7 @@ public class AccumulatorOperators { */ public static StdDevSamp stdDevSampOf(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return new StdDevSamp(asFields(fieldReference)); } @@ -704,7 +704,7 @@ public class AccumulatorOperators { */ public static StdDevSamp stdDevSampOf(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new StdDevSamp(Collections.singletonList(expression)); } @@ -717,7 +717,7 @@ public class AccumulatorOperators { */ public StdDevSamp and(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return new StdDevSamp(append(Fields.field(fieldReference))); } @@ -730,7 +730,7 @@ public class AccumulatorOperators { */ public StdDevSamp and(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new StdDevSamp(append(expression)); } @@ -768,7 +768,7 @@ public class AccumulatorOperators { */ public static CovariancePop covariancePopOf(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return new CovariancePop(asFields(fieldReference)); } @@ -828,7 +828,7 @@ public class AccumulatorOperators { */ public static CovarianceSamp covarianceSampOf(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return new CovarianceSamp(asFields(fieldReference)); } diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/Aggregation.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/Aggregation.java index f8e56e110..f55454ed6 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/Aggregation.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/Aggregation.java @@ -138,7 +138,7 @@ public class Aggregation { */ public Aggregation withOptions(AggregationOptions options) { - Assert.notNull(options, "AggregationOptions must not be null."); + Assert.notNull(options, "AggregationOptions must not be null"); return new Aggregation(this.pipeline.getOperations(), options); } @@ -177,7 +177,7 @@ public class Aggregation { */ protected static List asAggregationList(AggregationOperation... aggregationOperations) { - Assert.notEmpty(aggregationOperations, "AggregationOperations must not be null or empty!"); + Assert.notEmpty(aggregationOperations, "AggregationOperations must not be null or empty"); return Arrays.asList(aggregationOperations); } @@ -199,8 +199,8 @@ public class Aggregation { */ protected Aggregation(List aggregationOperations, AggregationOptions options) { - Assert.notNull(aggregationOperations, "AggregationOperations must not be null!"); - Assert.notNull(options, "AggregationOptions must not be null!"); + Assert.notNull(aggregationOperations, "AggregationOperations must not be null"); + Assert.notNull(options, "AggregationOptions must not be null"); this.pipeline = new AggregationPipeline(aggregationOperations); this.options = options; @@ -267,7 +267,7 @@ public class Aggregation { */ public static ProjectionOperation project(Class type) { - Assert.notNull(type, "Type must not be null!"); + Assert.notNull(type, "Type must not be null"); return new ProjectionOperation(type); } diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/AggregationExpressionTransformer.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/AggregationExpressionTransformer.java index c04546abb..3b37a0d7a 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/AggregationExpressionTransformer.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/AggregationExpressionTransformer.java @@ -60,7 +60,7 @@ interface AggregationExpressionTransformer super(currentNode, parentNode, previousOperationObject); - Assert.notNull(context, "AggregationOperationContext must not be null!"); + Assert.notNull(context, "AggregationOperationContext must not be null"); this.aggregationContext = context; } diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/AggregationOperationContext.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/AggregationOperationContext.java index 89029952e..4ddb04047 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/AggregationOperationContext.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/AggregationOperationContext.java @@ -86,7 +86,7 @@ public interface AggregationOperationContext { */ default Fields getFields(Class type) { - Assert.notNull(type, "Type must not be null!"); + Assert.notNull(type, "Type must not be null"); return Fields.fields(Arrays.stream(BeanUtils.getPropertyDescriptors(type)) // .filter(it -> { // object and default methods diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/AggregationOptions.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/AggregationOptions.java index 58d1d35b8..e4ef7a7e4 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/AggregationOptions.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/AggregationOptions.java @@ -144,7 +144,7 @@ public class AggregationOptions { */ public static AggregationOptions fromDocument(Document document) { - Assert.notNull(document, "Document must not be null!"); + Assert.notNull(document, "Document must not be null"); boolean allowDiskUse = document.getBoolean(ALLOW_DISK_USE, false); boolean explain = document.getBoolean(EXPLAIN, false); diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/AggregationPipeline.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/AggregationPipeline.java index a316f0472..5ea9b2cbb 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/AggregationPipeline.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/AggregationPipeline.java @@ -48,7 +48,7 @@ public class AggregationPipeline { */ public AggregationPipeline(List aggregationOperations) { - Assert.notNull(aggregationOperations, "AggregationOperations must not be null!"); + Assert.notNull(aggregationOperations, "AggregationOperations must not be null"); pipeline = new ArrayList<>(aggregationOperations); } @@ -60,7 +60,7 @@ public class AggregationPipeline { */ public AggregationPipeline add(AggregationOperation aggregationOperation) { - Assert.notNull(aggregationOperation, "AggregationOperation must not be null!"); + Assert.notNull(aggregationOperation, "AggregationOperation must not be null"); pipeline.add(aggregationOperation); return this; @@ -100,11 +100,11 @@ public class AggregationPipeline { for (AggregationOperation operation : pipeline) { if (isOut(operation) && !isLast(operation)) { - throw new IllegalArgumentException("The $out operator must be the last stage in the pipeline."); + throw new IllegalArgumentException("The $out operator must be the last stage in the pipeline"); } if (isMerge(operation) && !isLast(operation)) { - throw new IllegalArgumentException("The $merge operator must be the last stage in the pipeline."); + throw new IllegalArgumentException("The $merge operator must be the last stage in the pipeline"); } } } diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/AggregationResults.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/AggregationResults.java index a8011237e..8e706e8c8 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/AggregationResults.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/AggregationResults.java @@ -48,8 +48,8 @@ public class AggregationResults implements Iterable { */ public AggregationResults(List mappedResults, Document rawResults) { - Assert.notNull(mappedResults, "List of mapped results must not be null!"); - Assert.notNull(rawResults, "Raw results must not be null!"); + Assert.notNull(mappedResults, "List of mapped results must not be null"); + Assert.notNull(rawResults, "Raw results must not be null"); this.mappedResults = Collections.unmodifiableList(mappedResults); this.rawResults = rawResults; @@ -73,7 +73,7 @@ public class AggregationResults implements Iterable { */ @Nullable public T getUniqueMappedResult() { - Assert.isTrue(mappedResults.size() < 2, "Expected unique result or null, but got more than one!"); + Assert.isTrue(mappedResults.size() < 2, "Expected unique result or null, but got more than one"); return mappedResults.size() == 1 ? mappedResults.get(0) : null; } diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/AggregationSpELExpression.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/AggregationSpELExpression.java index 03a9dfbd2..05d1f7451 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/AggregationSpELExpression.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/AggregationSpELExpression.java @@ -60,7 +60,7 @@ public class AggregationSpELExpression implements AggregationExpression { */ public static AggregationSpELExpression expressionOf(String expressionString, Object... parameters) { - Assert.notNull(expressionString, "ExpressionString must not be null!"); + Assert.notNull(expressionString, "ExpressionString must not be null"); return new AggregationSpELExpression(expressionString, parameters); } diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/AggregationUpdate.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/AggregationUpdate.java index 636168c60..8f7a38cb2 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/AggregationUpdate.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/AggregationUpdate.java @@ -133,7 +133,7 @@ public class AggregationUpdate extends Aggregation implements UpdateDefinition { */ public AggregationUpdate set(SetOperation setOperation) { - Assert.notNull(setOperation, "SetOperation must not be null!"); + Assert.notNull(setOperation, "SetOperation must not be null"); setOperation.getFields().forEach(it -> { keysTouched.add(it.getName()); @@ -152,7 +152,7 @@ public class AggregationUpdate extends Aggregation implements UpdateDefinition { */ public AggregationUpdate unset(UnsetOperation unsetOperation) { - Assert.notNull(unsetOperation, "UnsetOperation must not be null!"); + Assert.notNull(unsetOperation, "UnsetOperation must not be null"); pipeline.add(unsetOperation); keysTouched.addAll(unsetOperation.removedFieldNames()); @@ -170,7 +170,7 @@ public class AggregationUpdate extends Aggregation implements UpdateDefinition { */ public AggregationUpdate replaceWith(ReplaceWithOperation replaceWithOperation) { - Assert.notNull(replaceWithOperation, "ReplaceWithOperation must not be null!"); + Assert.notNull(replaceWithOperation, "ReplaceWithOperation must not be null"); pipeline.add(replaceWithOperation); return this; } @@ -183,7 +183,7 @@ public class AggregationUpdate extends Aggregation implements UpdateDefinition { */ public AggregationUpdate replaceWith(Object value) { - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(value, "Value must not be null"); return replaceWith(ReplaceWithOperation.replaceWithValue(value)); } @@ -197,7 +197,7 @@ public class AggregationUpdate extends Aggregation implements UpdateDefinition { */ public SetValueAppender set(String key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return new SetValueAppender() { @@ -209,7 +209,7 @@ public class AggregationUpdate extends Aggregation implements UpdateDefinition { @Override public AggregationUpdate toValueOf(Object value) { - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(value, "Value must not be null"); return set(SetOperation.builder().set(key).toValueOf(value)); } }; @@ -223,8 +223,8 @@ public class AggregationUpdate extends Aggregation implements UpdateDefinition { */ public AggregationUpdate unset(String... keys) { - Assert.notNull(keys, "Keys must not be null!"); - Assert.noNullElements(keys, "Keys must not contain null elements."); + Assert.notNull(keys, "Keys must not be null"); + Assert.noNullElements(keys, "Keys must not contain null elements"); return unset(new UnsetOperation(Arrays.stream(keys).map(Fields::field).collect(Collectors.toList()))); } diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/AggregationUtils.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/AggregationUtils.java index 0cc3592f7..3b4b8c511 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/AggregationUtils.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/AggregationUtils.java @@ -36,11 +36,11 @@ interface AggregationUtils { */ static List toRangeValues(Range range) { - Assert.notNull(range, "Range must not be null!"); + Assert.notNull(range, "Range must not be null"); List result = new ArrayList(2); result.add(range.getLowerBound().getValue() - .orElseThrow(() -> new IllegalArgumentException("Lower bound of range must be bounded!"))); + .orElseThrow(() -> new IllegalArgumentException("Lower bound of range must be bounded"))); range.getUpperBound().getValue().ifPresent(it -> result.add(it)); return result; diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/ArithmeticOperators.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/ArithmeticOperators.java index 89ed82c6a..173598763 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/ArithmeticOperators.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/ArithmeticOperators.java @@ -91,7 +91,7 @@ public class ArithmeticOperators { */ public ArithmeticOperatorFactory(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); this.fieldReference = fieldReference; this.expression = null; } @@ -103,7 +103,7 @@ public class ArithmeticOperators { */ public ArithmeticOperatorFactory(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); this.fieldReference = null; this.expression = expression; } @@ -126,7 +126,7 @@ public class ArithmeticOperators { */ public Add add(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return createAdd().add(fieldReference); } @@ -139,7 +139,7 @@ public class ArithmeticOperators { */ public Add add(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return createAdd().add(expression); } @@ -151,7 +151,7 @@ public class ArithmeticOperators { */ public Add add(Number value) { - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(value, "Value must not be null"); return createAdd().add(value); } @@ -218,7 +218,7 @@ public class ArithmeticOperators { */ public Divide divideBy(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return createDivide().divideBy(fieldReference); } @@ -231,7 +231,7 @@ public class ArithmeticOperators { */ public Divide divideBy(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return createDivide().divideBy(expression); } @@ -243,7 +243,7 @@ public class ArithmeticOperators { */ public Divide divideBy(Number value) { - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(value, "Value must not be null"); return createDivide().divideBy(value); } @@ -304,7 +304,7 @@ public class ArithmeticOperators { */ public Integral integral(String unit) { - Assert.hasText(unit, "Unit must not be empty!"); + Assert.hasText(unit, "Unit must not be empty"); return integral().unit(unit); } @@ -328,7 +328,7 @@ public class ArithmeticOperators { */ public Log log(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return createLog().log(fieldReference); } @@ -341,7 +341,7 @@ public class ArithmeticOperators { */ public Log log(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return createLog().log(fieldReference); } @@ -354,7 +354,7 @@ public class ArithmeticOperators { */ public Log log(Number base) { - Assert.notNull(base, "Base must not be null!"); + Assert.notNull(base, "Base must not be null"); return createLog().log(base); } @@ -380,7 +380,7 @@ public class ArithmeticOperators { */ public Mod mod(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return createMod().mod(fieldReference); } @@ -393,7 +393,7 @@ public class ArithmeticOperators { */ public Mod mod(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return createMod().mod(expression); } @@ -406,7 +406,7 @@ public class ArithmeticOperators { */ public Mod mod(Number value) { - Assert.notNull(value, "Base must not be null!"); + Assert.notNull(value, "Base must not be null"); return createMod().mod(value); } @@ -422,7 +422,7 @@ public class ArithmeticOperators { */ public Multiply multiplyBy(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return createMultiply().multiplyBy(fieldReference); } @@ -434,7 +434,7 @@ public class ArithmeticOperators { */ public Multiply multiplyBy(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return createMultiply().multiplyBy(expression); } @@ -446,7 +446,7 @@ public class ArithmeticOperators { */ public Multiply multiplyBy(Number value) { - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(value, "Value must not be null"); return createMultiply().multiplyBy(value); } @@ -462,7 +462,7 @@ public class ArithmeticOperators { */ public Pow pow(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return createPow().pow(fieldReference); } @@ -474,7 +474,7 @@ public class ArithmeticOperators { */ public Pow pow(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return createPow().pow(expression); } @@ -486,7 +486,7 @@ public class ArithmeticOperators { */ public Pow pow(Number value) { - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(value, "Value must not be null"); return createPow().pow(value); } @@ -511,7 +511,7 @@ public class ArithmeticOperators { */ public Subtract subtract(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return createSubtract().subtract(fieldReference); } @@ -523,7 +523,7 @@ public class ArithmeticOperators { */ public Subtract subtract(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return createSubtract().subtract(expression); } @@ -535,7 +535,7 @@ public class ArithmeticOperators { */ public Subtract subtract(Number value) { - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(value, "Value must not be null"); return createSubtract().subtract(value); } @@ -851,7 +851,7 @@ public class ArithmeticOperators { */ public ATan2 atan2(Number value) { - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(value, "Value must not be null"); return createATan2().atan2of(value); } @@ -865,7 +865,7 @@ public class ArithmeticOperators { */ public ATan2 atan2(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return createATan2().atan2of(fieldReference); } @@ -879,7 +879,7 @@ public class ArithmeticOperators { */ public ATan2 atan2(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return createATan2().atan2of(expression); } @@ -961,7 +961,7 @@ public class ArithmeticOperators { */ public static Abs absoluteValueOf(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return new Abs(Fields.field(fieldReference)); } @@ -973,7 +973,7 @@ public class ArithmeticOperators { */ public static Abs absoluteValueOf(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new Abs(expression); } @@ -985,7 +985,7 @@ public class ArithmeticOperators { */ public static Abs absoluteValueOf(Number value) { - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(value, "Value must not be null"); return new Abs(value); } } @@ -1014,7 +1014,7 @@ public class ArithmeticOperators { */ public static Add valueOf(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return new Add(asFields(fieldReference)); } @@ -1026,7 +1026,7 @@ public class ArithmeticOperators { */ public static Add valueOf(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new Add(Collections.singletonList(expression)); } @@ -1038,7 +1038,7 @@ public class ArithmeticOperators { */ public static Add valueOf(Number value) { - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(value, "Value must not be null"); return new Add(Collections.singletonList(value)); } @@ -1050,7 +1050,7 @@ public class ArithmeticOperators { */ public Add add(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return new Add(append(Fields.field(fieldReference))); } @@ -1062,7 +1062,7 @@ public class ArithmeticOperators { */ public Add add(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new Add(append(expression)); } @@ -1101,7 +1101,7 @@ public class ArithmeticOperators { */ public static Ceil ceilValueOf(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return new Ceil(Fields.field(fieldReference)); } @@ -1113,7 +1113,7 @@ public class ArithmeticOperators { */ public static Ceil ceilValueOf(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new Ceil(expression); } @@ -1125,7 +1125,7 @@ public class ArithmeticOperators { */ public static Ceil ceilValueOf(Number value) { - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(value, "Value must not be null"); return new Ceil(value); } } @@ -1154,7 +1154,7 @@ public class ArithmeticOperators { */ public static Divide valueOf(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return new Divide(asFields(fieldReference)); } @@ -1166,7 +1166,7 @@ public class ArithmeticOperators { */ public static Divide valueOf(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new Divide(Collections.singletonList(expression)); } @@ -1178,7 +1178,7 @@ public class ArithmeticOperators { */ public static Divide valueOf(Number value) { - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(value, "Value must not be null"); return new Divide(Collections.singletonList(value)); } @@ -1190,7 +1190,7 @@ public class ArithmeticOperators { */ public Divide divideBy(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return new Divide(append(Fields.field(fieldReference))); } @@ -1202,7 +1202,7 @@ public class ArithmeticOperators { */ public Divide divideBy(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new Divide(append(expression)); } @@ -1241,7 +1241,7 @@ public class ArithmeticOperators { */ public static Exp expValueOf(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return new Exp(Fields.field(fieldReference)); } @@ -1253,7 +1253,7 @@ public class ArithmeticOperators { */ public static Exp expValueOf(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new Exp(expression); } @@ -1265,7 +1265,7 @@ public class ArithmeticOperators { */ public static Exp expValueOf(Number value) { - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(value, "Value must not be null"); return new Exp(value); } } @@ -1294,7 +1294,7 @@ public class ArithmeticOperators { */ public static Floor floorValueOf(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return new Floor(Fields.field(fieldReference)); } @@ -1306,7 +1306,7 @@ public class ArithmeticOperators { */ public static Floor floorValueOf(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new Floor(expression); } @@ -1318,7 +1318,7 @@ public class ArithmeticOperators { */ public static Floor floorValueOf(Number value) { - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(value, "Value must not be null"); return new Floor(value); } } @@ -1347,7 +1347,7 @@ public class ArithmeticOperators { */ public static Ln lnValueOf(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return new Ln(Fields.field(fieldReference)); } @@ -1359,7 +1359,7 @@ public class ArithmeticOperators { */ public static Ln lnValueOf(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new Ln(expression); } @@ -1371,7 +1371,7 @@ public class ArithmeticOperators { */ public static Ln lnValueOf(Number value) { - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(value, "Value must not be null"); return new Ln(value); } } @@ -1400,7 +1400,7 @@ public class ArithmeticOperators { */ public static Log valueOf(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return new Log(asFields(fieldReference)); } @@ -1412,7 +1412,7 @@ public class ArithmeticOperators { */ public static Log valueOf(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new Log(Collections.singletonList(expression)); } @@ -1424,7 +1424,7 @@ public class ArithmeticOperators { */ public static Log valueOf(Number value) { - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(value, "Value must not be null"); return new Log(Collections.singletonList(value)); } @@ -1436,7 +1436,7 @@ public class ArithmeticOperators { */ public Log log(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return new Log(append(Fields.field(fieldReference))); } @@ -1448,7 +1448,7 @@ public class ArithmeticOperators { */ public Log log(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new Log(append(expression)); } @@ -1487,7 +1487,7 @@ public class ArithmeticOperators { */ public static Log10 log10ValueOf(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return new Log10(Fields.field(fieldReference)); } @@ -1499,7 +1499,7 @@ public class ArithmeticOperators { */ public static Log10 log10ValueOf(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new Log10(expression); } @@ -1511,7 +1511,7 @@ public class ArithmeticOperators { */ public static Log10 log10ValueOf(Number value) { - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(value, "Value must not be null"); return new Log10(value); } } @@ -1540,7 +1540,7 @@ public class ArithmeticOperators { */ public static Mod valueOf(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return new Mod(asFields(fieldReference)); } @@ -1552,7 +1552,7 @@ public class ArithmeticOperators { */ public static Mod valueOf(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new Mod(Collections.singletonList(expression)); } @@ -1564,7 +1564,7 @@ public class ArithmeticOperators { */ public static Mod valueOf(Number value) { - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(value, "Value must not be null"); return new Mod(Collections.singletonList(value)); } @@ -1576,7 +1576,7 @@ public class ArithmeticOperators { */ public Mod mod(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return new Mod(append(Fields.field(fieldReference))); } @@ -1588,7 +1588,7 @@ public class ArithmeticOperators { */ public Mod mod(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new Mod(append(expression)); } @@ -1627,7 +1627,7 @@ public class ArithmeticOperators { */ public static Multiply valueOf(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return new Multiply(asFields(fieldReference)); } @@ -1639,7 +1639,7 @@ public class ArithmeticOperators { */ public static Multiply valueOf(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new Multiply(Collections.singletonList(expression)); } @@ -1651,7 +1651,7 @@ public class ArithmeticOperators { */ public static Multiply valueOf(Number value) { - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(value, "Value must not be null"); return new Multiply(Collections.singletonList(value)); } @@ -1663,7 +1663,7 @@ public class ArithmeticOperators { */ public Multiply multiplyBy(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return new Multiply(append(Fields.field(fieldReference))); } @@ -1675,7 +1675,7 @@ public class ArithmeticOperators { */ public Multiply multiplyBy(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new Multiply(append(expression)); } @@ -1714,7 +1714,7 @@ public class ArithmeticOperators { */ public static Pow valueOf(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return new Pow(asFields(fieldReference)); } @@ -1726,7 +1726,7 @@ public class ArithmeticOperators { */ public static Pow valueOf(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new Pow(Collections.singletonList(expression)); } @@ -1738,7 +1738,7 @@ public class ArithmeticOperators { */ public static Pow valueOf(Number value) { - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(value, "Value must not be null"); return new Pow(Collections.singletonList(value)); } @@ -1750,7 +1750,7 @@ public class ArithmeticOperators { */ public Pow pow(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return new Pow(append(Fields.field(fieldReference))); } @@ -1762,7 +1762,7 @@ public class ArithmeticOperators { */ public Pow pow(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new Pow(append(expression)); } @@ -1801,7 +1801,7 @@ public class ArithmeticOperators { */ public static Sqrt sqrtOf(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return new Sqrt(Fields.field(fieldReference)); } @@ -1813,7 +1813,7 @@ public class ArithmeticOperators { */ public static Sqrt sqrtOf(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new Sqrt(expression); } @@ -1825,7 +1825,7 @@ public class ArithmeticOperators { */ public static Sqrt sqrtOf(Number value) { - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(value, "Value must not be null"); return new Sqrt(value); } } @@ -1854,7 +1854,7 @@ public class ArithmeticOperators { */ public static Subtract valueOf(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return new Subtract(asFields(fieldReference)); } @@ -1866,7 +1866,7 @@ public class ArithmeticOperators { */ public static Subtract valueOf(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new Subtract(Collections.singletonList(expression)); } @@ -1878,7 +1878,7 @@ public class ArithmeticOperators { */ public static Subtract valueOf(Number value) { - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(value, "Value must not be null"); return new Subtract(Collections.singletonList(value)); } @@ -1890,7 +1890,7 @@ public class ArithmeticOperators { */ public Subtract subtract(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return new Subtract(append(Fields.field(fieldReference))); } @@ -1902,7 +1902,7 @@ public class ArithmeticOperators { */ public Subtract subtract(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new Subtract(append(expression)); } @@ -1941,7 +1941,7 @@ public class ArithmeticOperators { */ public static Trunc truncValueOf(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return new Trunc(Fields.field(fieldReference)); } @@ -1953,7 +1953,7 @@ public class ArithmeticOperators { */ public static Trunc truncValueOf(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new Trunc(expression); } @@ -1965,7 +1965,7 @@ public class ArithmeticOperators { */ public static Trunc truncValueOf(Number value) { - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(value, "Value must not be null"); return new Trunc(value); } } @@ -1997,7 +1997,7 @@ public class ArithmeticOperators { */ public static Round roundValueOf(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return new Round(Collections.singletonList(Fields.field(fieldReference))); } @@ -2009,7 +2009,7 @@ public class ArithmeticOperators { */ public static Round roundValueOf(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new Round(Collections.singletonList(expression)); } @@ -2021,7 +2021,7 @@ public class ArithmeticOperators { */ public static Round round(Number value) { - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(value, "Value must not be null"); return new Round(Collections.singletonList(value)); } @@ -2043,7 +2043,7 @@ public class ArithmeticOperators { */ public Round placeOf(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new Round(append(expression)); } @@ -2056,7 +2056,7 @@ public class ArithmeticOperators { */ public Round placeOf(String fieldReference) { - Assert.notNull(fieldReference, "fieldReference must not be null!"); + Assert.notNull(fieldReference, "fieldReference must not be null"); return new Round(append(Fields.field(fieldReference))); } @@ -2400,7 +2400,7 @@ public class ArithmeticOperators { */ public static ASin asinOf(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return new ASin(Fields.field(fieldReference)); } @@ -2704,7 +2704,7 @@ public class ArithmeticOperators { */ public static ACos acosOf(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return new ACos(Fields.field(fieldReference)); } @@ -2905,7 +2905,7 @@ public class ArithmeticOperators { */ public static ATan atanOf(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return new ATan(Fields.field(fieldReference)); } @@ -2958,7 +2958,7 @@ public class ArithmeticOperators { */ public static ATan2 valueOf(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return new ATan2(asFields(fieldReference)); } @@ -2971,7 +2971,7 @@ public class ArithmeticOperators { */ public static ATan2 valueOf(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new ATan2((Collections.singletonList(expression))); } @@ -2985,7 +2985,7 @@ public class ArithmeticOperators { */ public ATan2 atan2of(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return new ATan2(append(Fields.field(fieldReference))); } @@ -2999,7 +2999,7 @@ public class ArithmeticOperators { */ public ATan2 atan2of(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new ATan2(append(expression)); } diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/ArrayOperators.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/ArrayOperators.java index efeef4167..4babbf6eb 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/ArrayOperators.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/ArrayOperators.java @@ -87,7 +87,7 @@ public class ArrayOperators { */ public ArrayOperatorFactory(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); this.fieldReference = fieldReference; this.expression = null; this.values = null; @@ -100,7 +100,7 @@ public class ArrayOperators { */ public ArrayOperatorFactory(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); this.fieldReference = null; this.expression = expression; this.values = null; @@ -114,7 +114,7 @@ public class ArrayOperators { */ public ArrayOperatorFactory(Collection values) { - Assert.notNull(values, "Values must not be null!"); + Assert.notNull(values, "Values must not be null"); this.fieldReference = null; this.expression = null; this.values = values; @@ -140,7 +140,7 @@ public class ArrayOperators { */ public ArrayElemAt elementAt(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return createArrayElemAt().elementAt(expression); } @@ -153,7 +153,7 @@ public class ArrayOperators { */ public ArrayElemAt elementAt(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return createArrayElemAt().elementAt(fieldReference); } @@ -175,7 +175,7 @@ public class ArrayOperators { */ public ConcatArrays concat(String arrayFieldReference) { - Assert.notNull(arrayFieldReference, "ArrayFieldReference must not be null!"); + Assert.notNull(arrayFieldReference, "ArrayFieldReference must not be null"); return createConcatArrays().concat(arrayFieldReference); } @@ -188,7 +188,7 @@ public class ArrayOperators { */ public ConcatArrays concat(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return createConcatArrays().concat(expression); } @@ -213,7 +213,7 @@ public class ArrayOperators { return Filter.filter(fieldReference); } - Assert.state(values != null, "Values must not be null!"); + Assert.state(values != null, "Values must not be null"); return Filter.filter(new ArrayList<>(values)); } @@ -224,7 +224,7 @@ public class ArrayOperators { */ public IsArray isArray() { - Assert.state(values == null, "Does it make sense to call isArray on an array? Maybe just skip it?"); + Assert.state(values == null, "Does it make sense to call isArray on an array; Maybe just skip it"); return usesFieldRef() ? IsArray.isArray(fieldReference) : IsArray.isArray(expression); } @@ -363,7 +363,7 @@ public class ArrayOperators { return usesExpression() ? ArrayToObject.arrayValueOfToObject(expression) : ArrayToObject.arrayToObject(values); } - + /** * Creates new {@link AggregationExpression} that return the first element in the associated array. * NOTE: Requires MongoDB 4.4 or later. @@ -379,7 +379,7 @@ public class ArrayOperators { return usesExpression() ? First.firstOf(expression) : First.first(values); } - + /** * Creates new {@link AggregationExpression} that return the last element in the given array. * NOTE: Requires MongoDB 4.4 or later. @@ -450,7 +450,7 @@ public class ArrayOperators { */ public static ArrayElemAt arrayOf(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return new ArrayElemAt(asFields(fieldReference)); } @@ -462,7 +462,7 @@ public class ArrayOperators { */ public static ArrayElemAt arrayOf(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new ArrayElemAt(Collections.singletonList(expression)); } @@ -475,7 +475,7 @@ public class ArrayOperators { */ public static ArrayElemAt arrayOf(Collection values) { - Assert.notNull(values, "Values must not be null!"); + Assert.notNull(values, "Values must not be null"); return new ArrayElemAt(Collections.singletonList(values)); } @@ -497,7 +497,7 @@ public class ArrayOperators { */ public ArrayElemAt elementAt(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new ArrayElemAt(append(expression)); } @@ -509,7 +509,7 @@ public class ArrayOperators { */ public ArrayElemAt elementAt(String arrayFieldReference) { - Assert.notNull(arrayFieldReference, "ArrayReference must not be null!"); + Assert.notNull(arrayFieldReference, "ArrayReference must not be null"); return new ArrayElemAt(append(Fields.field(arrayFieldReference))); } } @@ -538,7 +538,7 @@ public class ArrayOperators { */ public static ConcatArrays arrayOf(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return new ConcatArrays(asFields(fieldReference)); } @@ -550,7 +550,7 @@ public class ArrayOperators { */ public static ConcatArrays arrayOf(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new ConcatArrays(Collections.singletonList(expression)); } @@ -563,7 +563,7 @@ public class ArrayOperators { */ public static ConcatArrays arrayOf(Collection values) { - Assert.notNull(values, "Values must not be null!"); + Assert.notNull(values, "Values must not be null"); return new ConcatArrays(Collections.singletonList(values)); } @@ -575,7 +575,7 @@ public class ArrayOperators { */ public ConcatArrays concat(String arrayFieldReference) { - Assert.notNull(arrayFieldReference, "ArrayFieldReference must not be null!"); + Assert.notNull(arrayFieldReference, "ArrayFieldReference must not be null"); return new ConcatArrays(append(Fields.field(arrayFieldReference))); } @@ -587,7 +587,7 @@ public class ArrayOperators { */ public ConcatArrays concat(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new ConcatArrays(append(expression)); } } @@ -617,7 +617,7 @@ public class ArrayOperators { */ public static AsBuilder filter(String field) { - Assert.notNull(field, "Field must not be null!"); + Assert.notNull(field, "Field must not be null"); return filter(Fields.field(field)); } @@ -629,7 +629,7 @@ public class ArrayOperators { */ public static AsBuilder filter(Field field) { - Assert.notNull(field, "Field must not be null!"); + Assert.notNull(field, "Field must not be null"); return new FilterExpressionBuilder().filter(field); } @@ -641,7 +641,7 @@ public class ArrayOperators { */ public static AsBuilder filter(List values) { - Assert.notNull(values, "Values must not be null!"); + Assert.notNull(values, "Values must not be null"); return new FilterExpressionBuilder().filter(values); } @@ -768,7 +768,7 @@ public class ArrayOperators { @Override public AsBuilder filter(List array) { - Assert.notNull(array, "Array must not be null!"); + Assert.notNull(array, "Array must not be null"); filter.input = new ArrayList(array); return this; } @@ -776,7 +776,7 @@ public class ArrayOperators { @Override public AsBuilder filter(Field field) { - Assert.notNull(field, "Field must not be null!"); + Assert.notNull(field, "Field must not be null"); filter.input = field; return this; } @@ -784,7 +784,7 @@ public class ArrayOperators { @Override public ConditionBuilder as(String variableName) { - Assert.notNull(variableName, "Variable name must not be null!"); + Assert.notNull(variableName, "Variable name must not be null"); filter.as = new ExposedField(variableName, true); return this; } @@ -792,7 +792,7 @@ public class ArrayOperators { @Override public Filter by(AggregationExpression condition) { - Assert.notNull(condition, "Condition must not be null!"); + Assert.notNull(condition, "Condition must not be null"); filter.condition = condition; return filter; } @@ -800,7 +800,7 @@ public class ArrayOperators { @Override public Filter by(String expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); filter.condition = expression; return filter; } @@ -808,7 +808,7 @@ public class ArrayOperators { @Override public Filter by(Document expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); filter.condition = expression; return filter; } @@ -839,7 +839,7 @@ public class ArrayOperators { */ public static IsArray isArray(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return new IsArray(Fields.field(fieldReference)); } @@ -851,7 +851,7 @@ public class ArrayOperators { */ public static IsArray isArray(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new IsArray(expression); } } @@ -880,7 +880,7 @@ public class ArrayOperators { */ public static Size lengthOfArray(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return new Size(Fields.field(fieldReference)); } @@ -892,7 +892,7 @@ public class ArrayOperators { */ public static Size lengthOfArray(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new Size(expression); } @@ -905,7 +905,7 @@ public class ArrayOperators { */ public static Size lengthOfArray(Collection values) { - Assert.notNull(values, "Values must not be null!"); + Assert.notNull(values, "Values must not be null"); return new Size(Collections.singletonList(values)); } } @@ -934,7 +934,7 @@ public class ArrayOperators { */ public static Slice sliceArrayOf(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return new Slice(asFields(fieldReference)); } @@ -946,7 +946,7 @@ public class ArrayOperators { */ public static Slice sliceArrayOf(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new Slice(Collections.singletonList(expression)); } @@ -959,7 +959,7 @@ public class ArrayOperators { */ public static Slice sliceArrayOf(Collection values) { - Assert.notNull(values, "Values must not be null!"); + Assert.notNull(values, "Values must not be null"); return new Slice(Collections.singletonList(values)); } @@ -1029,7 +1029,7 @@ public class ArrayOperators { */ public static IndexOfArrayBuilder arrayOf(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return new IndexOfArrayBuilder(Fields.field(fieldReference)); } @@ -1041,7 +1041,7 @@ public class ArrayOperators { */ public static IndexOfArrayBuilder arrayOf(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new IndexOfArrayBuilder(expression); } @@ -1054,7 +1054,7 @@ public class ArrayOperators { */ public static IndexOfArrayBuilder arrayOf(Collection values) { - Assert.notNull(values, "Values must not be null!"); + Assert.notNull(values, "Values must not be null"); return new IndexOfArrayBuilder(values); } @@ -1087,7 +1087,7 @@ public class ArrayOperators { */ public IndexOfArray indexOf(Object value) { - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(value, "Value must not be null"); return new IndexOfArray(Arrays.asList(targetArray, value)); } } @@ -1411,8 +1411,8 @@ public class ArrayOperators { protected PropertyExpression(String propertyName, AggregationExpression aggregationExpression) { - Assert.notNull(propertyName, "Property name must not be null!"); - Assert.notNull(aggregationExpression, "AggregationExpression must not be null!"); + Assert.notNull(propertyName, "Property name must not be null"); + Assert.notNull(aggregationExpression, "AggregationExpression must not be null"); this.propertyName = propertyName; this.aggregationExpression = aggregationExpression; @@ -1559,7 +1559,7 @@ public class ArrayOperators { */ public static ZipBuilder arrayOf(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return new ZipBuilder(Fields.field(fieldReference)); } @@ -1571,7 +1571,7 @@ public class ArrayOperators { */ public static ZipBuilder arrayOf(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new ZipBuilder(expression); } @@ -1584,7 +1584,7 @@ public class ArrayOperators { */ public static ZipBuilder arrayOf(Collection values) { - Assert.notNull(values, "Expression must not be null!"); + Assert.notNull(values, "Expression must not be null"); return new ZipBuilder(values); } @@ -1605,7 +1605,7 @@ public class ArrayOperators { */ public Zip defaultTo(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return new Zip(append("defaults", Fields.field(fieldReference))); } @@ -1617,7 +1617,7 @@ public class ArrayOperators { */ public Zip defaultTo(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new Zip(append("defaults", expression)); } @@ -1629,7 +1629,7 @@ public class ArrayOperators { */ public Zip defaultTo(Object[] array) { - Assert.notNull(array, "Array must not be null!"); + Assert.notNull(array, "Array must not be null"); return new Zip(append("defaults", Arrays.asList(array))); } @@ -1653,7 +1653,7 @@ public class ArrayOperators { */ public Zip zip(Object... arrays) { - Assert.notNull(arrays, "Arrays must not be null!"); + Assert.notNull(arrays, "Arrays must not be null"); for (Object value : arrays) { if (value instanceof String) { @@ -1696,11 +1696,11 @@ public class ArrayOperators { */ public static InBuilder arrayOf(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return value -> { - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(value, "Value must not be null"); return new In(Arrays.asList(value, Fields.field(fieldReference))); }; } @@ -1713,11 +1713,11 @@ public class ArrayOperators { */ public static InBuilder arrayOf(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return value -> { - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(value, "Value must not be null"); return new In(Arrays.asList(value, expression)); }; @@ -1732,11 +1732,11 @@ public class ArrayOperators { */ public static InBuilder arrayOf(Collection values) { - Assert.notNull(values, "Values must not be null!"); + Assert.notNull(values, "Values must not be null"); return value -> { - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(value, "Value must not be null"); return new In(Arrays.asList(value, values)); }; @@ -1807,7 +1807,7 @@ public class ArrayOperators { return "$arrayToObject"; } } - + /** * {@link AggregationExpression} for {@code $first} that returns the first element in an array.
* NOTE: Requires MongoDB 4.4 or later. @@ -1861,7 +1861,7 @@ public class ArrayOperators { return "$first"; } } - + /** * {@link AggregationExpression} for {@code $last} that returns the last element in an array.
* NOTE: Requires MongoDB 4.4 or later. diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/BooleanOperators.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/BooleanOperators.java index faa4707d4..bab446c24 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/BooleanOperators.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/BooleanOperators.java @@ -87,7 +87,7 @@ public class BooleanOperators { */ public BooleanOperatorFactory(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); this.fieldReference = fieldReference; this.expression = null; } @@ -99,7 +99,7 @@ public class BooleanOperators { */ public BooleanOperatorFactory(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); this.fieldReference = null; this.expression = expression; } @@ -113,7 +113,7 @@ public class BooleanOperators { */ public And and(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return createAnd().andExpression(expression); } @@ -126,7 +126,7 @@ public class BooleanOperators { */ public And and(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return createAnd().andField(fieldReference); } @@ -143,7 +143,7 @@ public class BooleanOperators { */ public Or or(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return createOr().orExpression(expression); } @@ -156,7 +156,7 @@ public class BooleanOperators { */ public Or or(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return createOr().orField(fieldReference); } @@ -213,7 +213,7 @@ public class BooleanOperators { */ public And andExpression(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new And(append(expression)); } @@ -225,7 +225,7 @@ public class BooleanOperators { */ public And andField(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return new And(append(Fields.field(fieldReference))); } @@ -237,7 +237,7 @@ public class BooleanOperators { */ public And andValue(Object value) { - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(value, "Value must not be null"); return new And(append(value)); } } @@ -267,7 +267,7 @@ public class BooleanOperators { */ public static Or or(Object... expressions) { - Assert.notNull(expressions, "Expressions must not be null!"); + Assert.notNull(expressions, "Expressions must not be null"); return new Or(Arrays.asList(expressions)); } @@ -279,7 +279,7 @@ public class BooleanOperators { */ public Or orExpression(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new Or(append(expression)); } @@ -291,7 +291,7 @@ public class BooleanOperators { */ public Or orField(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return new Or(append(Fields.field(fieldReference))); } @@ -303,7 +303,7 @@ public class BooleanOperators { */ public Or orValue(Object value) { - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(value, "Value must not be null"); return new Or(append(value)); } } @@ -333,7 +333,7 @@ public class BooleanOperators { */ public static Not not(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return new Not(asFields(fieldReference)); } @@ -346,7 +346,7 @@ public class BooleanOperators { */ public static Not not(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new Not(Collections.singletonList(expression)); } } diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/BucketAutoOperation.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/BucketAutoOperation.java index 66a4be21f..88fb406b6 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/BucketAutoOperation.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/BucketAutoOperation.java @@ -50,7 +50,7 @@ public class BucketAutoOperation extends BucketOperationSupport 0, "Number of buckets must be greater 0!"); + Assert.isTrue(buckets > 0, "Number of buckets must be greater 0"); this.buckets = buckets; this.granularity = null; @@ -66,7 +66,7 @@ public class BucketAutoOperation extends BucketOperationSupport 0, "Number of buckets must be greater 0!"); + Assert.isTrue(buckets > 0, "Number of buckets must be greater 0"); this.buckets = buckets; this.granularity = null; @@ -117,7 +117,7 @@ public class BucketAutoOperation extends BucketOperationSupport 0, "Number of buckets must be greater 0!"); + Assert.isTrue(buckets > 0, "Number of buckets must be greater 0"); return new BucketAutoOperation(this, buckets, granularity); } @@ -132,7 +132,7 @@ public class BucketAutoOperation extends BucketOperationSupport newBoundaries = new ArrayList(this.boundaries.size() + boundaries.length); newBoundaries.addAll(this.boundaries); diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/BucketOperationSupport.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/BucketOperationSupport.java index 2e162dcbc..9cdf5920e 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/BucketOperationSupport.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/BucketOperationSupport.java @@ -51,7 +51,7 @@ public abstract class BucketOperationSupport operationSupport, Outputs outputs) { - Assert.notNull(operationSupport, "BucketOperationSupport must not be null!"); - Assert.notNull(outputs, "Outputs must not be null!"); + Assert.notNull(operationSupport, "BucketOperationSupport must not be null"); + Assert.notNull(outputs, "Outputs must not be null"); this.groupByField = operationSupport.groupByField; this.groupByExpression = operationSupport.groupByExpression; @@ -213,8 +213,8 @@ public abstract class BucketOperationSupport objects = new ArrayList(values.length + 1); objects.add(value); @@ -355,7 +355,7 @@ public abstract class BucketOperationSupport(values); @@ -616,8 +616,8 @@ public abstract class BucketOperationSupport conditions) { - Assert.notNull(conditions, "Conditions must not be null!"); + Assert.notNull(conditions, "Conditions must not be null"); return new Switch(Collections. singletonMap("branches", new ArrayList(conditions))); } @@ -511,14 +511,14 @@ public class ConditionalOperators { public static ThenBuilder when(final AggregationExpression condition) { - Assert.notNull(condition, "Condition must not be null!"); + Assert.notNull(condition, "Condition must not be null"); return new ThenBuilder() { @Override public CaseOperator then(Object value) { - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(value, "Value must not be null"); return new CaseOperator(condition, value); } }; @@ -598,9 +598,9 @@ public class ConditionalOperators { private Cond(Object condition, Object thenValue, Object otherwiseValue) { - Assert.notNull(condition, "Condition must not be null!"); - Assert.notNull(thenValue, "Then value must not be null!"); - Assert.notNull(otherwiseValue, "Otherwise value must not be null!"); + Assert.notNull(condition, "Condition must not be null"); + Assert.notNull(thenValue, "Then value must not be null"); + Assert.notNull(otherwiseValue, "Otherwise value must not be null"); assertNotBuilder(condition, "Condition"); assertNotBuilder(thenValue, "Then value"); @@ -657,7 +657,7 @@ public class ConditionalOperators { } throw new InvalidDataAccessApiUsageException( - String.format("Invalid value in condition. Supported: Document, Field references, Criteria, got: %s", value)); + String.format("Invalid value in condition; Supported: Document, Field references, Criteria, got: %s", value)); } private List getClauses(AggregationOperationContext context, Document mappedObject) { @@ -892,7 +892,7 @@ public class ConditionalOperators { @Override public ConditionalExpressionBuilder when(Document booleanExpression) { - Assert.notNull(booleanExpression, "'Boolean expression' must not be null!"); + Assert.notNull(booleanExpression, "'Boolean expression' must not be null"); this.condition = booleanExpression; return this; @@ -901,7 +901,7 @@ public class ConditionalOperators { @Override public ThenBuilder when(CriteriaDefinition criteria) { - Assert.notNull(criteria, "Criteria must not be null!"); + Assert.notNull(criteria, "Criteria must not be null"); this.condition = criteria; return this; } @@ -909,7 +909,7 @@ public class ConditionalOperators { @Override public ThenBuilder when(AggregationExpression expression) { - Assert.notNull(expression, "AggregationExpression field must not be null!"); + Assert.notNull(expression, "AggregationExpression field must not be null"); this.condition = expression; return this; } @@ -917,7 +917,7 @@ public class ConditionalOperators { @Override public ThenBuilder when(String booleanField) { - Assert.hasText(booleanField, "Boolean field name must not be null or empty!"); + Assert.hasText(booleanField, "Boolean field name must not be null or empty"); this.condition = Fields.field(booleanField); return this; } @@ -925,7 +925,7 @@ public class ConditionalOperators { @Override public OtherwiseBuilder then(Object thenValue) { - Assert.notNull(thenValue, "Then-value must not be null!"); + Assert.notNull(thenValue, "Then-value must not be null"); this.thenValue = thenValue; return this; } @@ -933,7 +933,7 @@ public class ConditionalOperators { @Override public OtherwiseBuilder thenValueOf(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); this.thenValue = Fields.field(fieldReference); return this; } @@ -941,7 +941,7 @@ public class ConditionalOperators { @Override public OtherwiseBuilder thenValueOf(AggregationExpression expression) { - Assert.notNull(expression, "AggregationExpression must not be null!"); + Assert.notNull(expression, "AggregationExpression must not be null"); this.thenValue = expression; return this; } @@ -949,21 +949,21 @@ public class ConditionalOperators { @Override public Cond otherwise(Object otherwiseValue) { - Assert.notNull(otherwiseValue, "Value must not be null!"); + Assert.notNull(otherwiseValue, "Value must not be null"); return new Cond(condition, thenValue, otherwiseValue); } @Override public Cond otherwiseValueOf(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return new Cond(condition, thenValue, Fields.field(fieldReference)); } @Override public Cond otherwiseValueOf(AggregationExpression expression) { - Assert.notNull(expression, "AggregationExpression must not be null!"); + Assert.notNull(expression, "AggregationExpression must not be null"); return new Cond(condition, thenValue, expression); } } diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/ConvertOperators.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/ConvertOperators.java index be939224f..e2dd660e4 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/ConvertOperators.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/ConvertOperators.java @@ -64,7 +64,7 @@ public class ConvertOperators { */ public ConvertOperatorFactory(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); this.fieldReference = fieldReference; this.expression = null; @@ -77,7 +77,7 @@ public class ConvertOperators { */ public ConvertOperatorFactory(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); this.fieldReference = null; this.expression = expression; diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/CountOperation.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/CountOperation.java index 4de5f901a..15d90bace 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/CountOperation.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/CountOperation.java @@ -39,7 +39,7 @@ public class CountOperation implements FieldsExposingAggregationOperation { */ public CountOperation(String fieldName) { - Assert.hasText(fieldName, "Field name must not be null or empty!"); + Assert.hasText(fieldName, "Field name must not be null or empty"); this.fieldName = fieldName; } diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/DataTypeOperators.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/DataTypeOperators.java index d10409dd0..4023ffe3a 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/DataTypeOperators.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/DataTypeOperators.java @@ -60,7 +60,7 @@ public class DataTypeOperators { */ public static Type typeOf(String field) { - Assert.notNull(field, "Field must not be null!"); + Assert.notNull(field, "Field must not be null"); return new Type(Fields.field(field)); } } diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/DateOperators.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/DateOperators.java index c6a4a243f..b39c9725f 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/DateOperators.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/DateOperators.java @@ -48,7 +48,7 @@ public class DateOperators { */ public static DateOperatorFactory dateOf(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return new DateOperatorFactory(fieldReference); } @@ -61,7 +61,7 @@ public class DateOperators { */ public static DateOperatorFactory zonedDateOf(String fieldReference, Timezone timezone) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return new DateOperatorFactory(fieldReference).withTimezone(timezone); } @@ -73,7 +73,7 @@ public class DateOperators { */ public static DateOperatorFactory dateOf(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new DateOperatorFactory(expression); } @@ -86,7 +86,7 @@ public class DateOperators { */ public static DateOperatorFactory zonedDateOf(AggregationExpression expression, Timezone timezone) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new DateOperatorFactory(expression).withTimezone(timezone); } @@ -109,7 +109,7 @@ public class DateOperators { */ public static DateOperatorFactory dateValue(Object value) { - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(value, "Value must not be null"); return new DateOperatorFactory(value); } @@ -194,7 +194,7 @@ public class DateOperators { */ public static Timezone valueOf(Object value) { - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(value, "Value must not be null"); return new Timezone(value); } @@ -207,7 +207,7 @@ public class DateOperators { */ public static Timezone fromOffset(TimeZone timeZone) { - Assert.notNull(timeZone, "TimeZone must not be null!"); + Assert.notNull(timeZone, "TimeZone must not be null"); return fromOffset( ZoneOffset.ofTotalSeconds(Math.toIntExact(TimeUnit.MILLISECONDS.toSeconds(timeZone.getRawOffset())))); @@ -222,7 +222,7 @@ public class DateOperators { */ public static Timezone fromOffset(ZoneOffset offset) { - Assert.notNull(offset, "ZoneOffset must not be null!"); + Assert.notNull(offset, "ZoneOffset must not be null"); return new Timezone(offset.toString()); } @@ -235,7 +235,7 @@ public class DateOperators { */ public static Timezone fromZone(TimeZone timeZone) { - Assert.notNull(timeZone, "TimeZone must not be null!"); + Assert.notNull(timeZone, "TimeZone must not be null"); return valueOf(timeZone.getID()); } @@ -249,7 +249,7 @@ public class DateOperators { */ public static Timezone fromZone(ZoneId zoneId) { - Assert.notNull(zoneId, "ZoneId must not be null!"); + Assert.notNull(zoneId, "ZoneId must not be null"); return new Timezone(zoneId.toString()); } @@ -316,7 +316,7 @@ public class DateOperators { this(fieldReference, null, null, Timezone.none()); - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); } /** @@ -328,7 +328,7 @@ public class DateOperators { this(null, expression, null, Timezone.none()); - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); } /** @@ -348,7 +348,7 @@ public class DateOperators { this(null, null, value, Timezone.none()); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(value, "Value must not be null"); } /** @@ -362,7 +362,7 @@ public class DateOperators { */ public DateOperatorFactory withTimezone(Timezone timezone) { - Assert.notNull(timezone, "Timezone must not be null!"); + Assert.notNull(timezone, "Timezone must not be null"); return new DateOperatorFactory(fieldReference, expression, dateValue, timezone); } @@ -811,7 +811,7 @@ public class DateOperators { */ public DateFromPartsOperatorFactory withTimezone(Timezone timezone) { - Assert.notNull(timezone, "Timezone must not be null!"); + Assert.notNull(timezone, "Timezone must not be null"); return new DateFromPartsOperatorFactory(timezone); } } @@ -893,7 +893,7 @@ public class DateOperators { */ public static DayOfYear dayOfYear(Object value) { - Assert.notNull(value, "value must not be null!"); + Assert.notNull(value, "value must not be null"); return new DayOfYear(value); } @@ -905,7 +905,7 @@ public class DateOperators { */ public static DayOfYear dayOfYear(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return dayOfYear(Fields.field(fieldReference)); } @@ -917,7 +917,7 @@ public class DateOperators { */ public static DayOfYear dayOfYear(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return dayOfYear((Object) expression); } @@ -933,7 +933,7 @@ public class DateOperators { @Override public DayOfYear withTimezone(Timezone timezone) { - Assert.notNull(timezone, "Timezone must not be null."); + Assert.notNull(timezone, "Timezone must not be null"); return new DayOfYear(appendTimezone(values().iterator().next(), timezone)); } @@ -965,7 +965,7 @@ public class DateOperators { */ public static DayOfMonth dayOfMonth(Object value) { - Assert.notNull(value, "value must not be null!"); + Assert.notNull(value, "value must not be null"); return new DayOfMonth(value); } @@ -977,7 +977,7 @@ public class DateOperators { */ public static DayOfMonth dayOfMonth(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return dayOfMonth(Fields.field(fieldReference)); } @@ -989,7 +989,7 @@ public class DateOperators { */ public static DayOfMonth dayOfMonth(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return dayOfMonth((Object) expression); } @@ -1005,7 +1005,7 @@ public class DateOperators { @Override public DayOfMonth withTimezone(Timezone timezone) { - Assert.notNull(timezone, "Timezone must not be null."); + Assert.notNull(timezone, "Timezone must not be null"); return new DayOfMonth(appendTimezone(values().iterator().next(), timezone)); } @@ -1037,7 +1037,7 @@ public class DateOperators { */ public static DayOfWeek dayOfWeek(Object value) { - Assert.notNull(value, "value must not be null!"); + Assert.notNull(value, "value must not be null"); return new DayOfWeek(value); } @@ -1049,7 +1049,7 @@ public class DateOperators { */ public static DayOfWeek dayOfWeek(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return dayOfWeek(Fields.field(fieldReference)); } @@ -1061,7 +1061,7 @@ public class DateOperators { */ public static DayOfWeek dayOfWeek(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return dayOfWeek((Object) expression); } @@ -1077,7 +1077,7 @@ public class DateOperators { @Override public DayOfWeek withTimezone(Timezone timezone) { - Assert.notNull(timezone, "Timezone must not be null."); + Assert.notNull(timezone, "Timezone must not be null"); return new DayOfWeek(appendTimezone(values().iterator().next(), timezone)); } @@ -1109,7 +1109,7 @@ public class DateOperators { */ public static Year year(Object value) { - Assert.notNull(value, "value must not be null!"); + Assert.notNull(value, "value must not be null"); return new Year(value); } @@ -1121,7 +1121,7 @@ public class DateOperators { */ public static Year yearOf(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return year(Fields.field(fieldReference)); } @@ -1133,7 +1133,7 @@ public class DateOperators { */ public static Year yearOf(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return year(expression); } @@ -1149,7 +1149,7 @@ public class DateOperators { @Override public Year withTimezone(Timezone timezone) { - Assert.notNull(timezone, "Timezone must not be null."); + Assert.notNull(timezone, "Timezone must not be null"); return new Year(appendTimezone(values().iterator().next(), timezone)); } @@ -1181,7 +1181,7 @@ public class DateOperators { */ public static Month month(Object value) { - Assert.notNull(value, "value must not be null!"); + Assert.notNull(value, "value must not be null"); return new Month(value); } @@ -1193,7 +1193,7 @@ public class DateOperators { */ public static Month monthOf(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return month(Fields.field(fieldReference)); } @@ -1205,7 +1205,7 @@ public class DateOperators { */ public static Month monthOf(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return month(expression); } @@ -1221,7 +1221,7 @@ public class DateOperators { @Override public Month withTimezone(Timezone timezone) { - Assert.notNull(timezone, "Timezone must not be null."); + Assert.notNull(timezone, "Timezone must not be null"); return new Month(appendTimezone(values().iterator().next(), timezone)); } @@ -1253,7 +1253,7 @@ public class DateOperators { */ public static Week week(Object value) { - Assert.notNull(value, "value must not be null!"); + Assert.notNull(value, "value must not be null"); return new Week(value); } @@ -1265,7 +1265,7 @@ public class DateOperators { */ public static Week weekOf(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return week(Fields.field(fieldReference)); } @@ -1277,7 +1277,7 @@ public class DateOperators { */ public static Week weekOf(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return week(expression); } @@ -1293,7 +1293,7 @@ public class DateOperators { @Override public Week withTimezone(Timezone timezone) { - Assert.notNull(timezone, "Timezone must not be null."); + Assert.notNull(timezone, "Timezone must not be null"); return new Week(appendTimezone(values().iterator().next(), timezone)); } @@ -1325,7 +1325,7 @@ public class DateOperators { */ public static Hour hour(Object value) { - Assert.notNull(value, "value must not be null!"); + Assert.notNull(value, "value must not be null"); return new Hour(value); } @@ -1337,7 +1337,7 @@ public class DateOperators { */ public static Hour hourOf(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return hour(Fields.field(fieldReference)); } @@ -1349,7 +1349,7 @@ public class DateOperators { */ public static Hour hourOf(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return hour(expression); } @@ -1365,7 +1365,7 @@ public class DateOperators { @Override public Hour withTimezone(Timezone timezone) { - Assert.notNull(timezone, "Timezone must not be null."); + Assert.notNull(timezone, "Timezone must not be null"); return new Hour(appendTimezone(values().iterator().next(), timezone)); } @@ -1397,7 +1397,7 @@ public class DateOperators { */ public static Minute minute(Object value) { - Assert.notNull(value, "value must not be null!"); + Assert.notNull(value, "value must not be null"); return new Minute(value); } @@ -1409,7 +1409,7 @@ public class DateOperators { */ public static Minute minuteOf(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return minute(Fields.field(fieldReference)); } @@ -1421,7 +1421,7 @@ public class DateOperators { */ public static Minute minuteOf(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return minute(expression); } @@ -1437,7 +1437,7 @@ public class DateOperators { @Override public Minute withTimezone(Timezone timezone) { - Assert.notNull(timezone, "Timezone must not be null."); + Assert.notNull(timezone, "Timezone must not be null"); return new Minute(appendTimezone(values().iterator().next(), timezone)); } @@ -1469,7 +1469,7 @@ public class DateOperators { */ public static Second second(Object value) { - Assert.notNull(value, "value must not be null!"); + Assert.notNull(value, "value must not be null"); return new Second(value); } @@ -1481,7 +1481,7 @@ public class DateOperators { */ public static Second secondOf(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return second(Fields.field(fieldReference)); } @@ -1493,7 +1493,7 @@ public class DateOperators { */ public static Second secondOf(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return second(expression); } @@ -1509,7 +1509,7 @@ public class DateOperators { @Override public Second withTimezone(Timezone timezone) { - Assert.notNull(timezone, "Timezone must not be null."); + Assert.notNull(timezone, "Timezone must not be null"); return new Second(appendTimezone(values().iterator().next(), timezone)); } @@ -1541,7 +1541,7 @@ public class DateOperators { */ public static Millisecond millisecond(Object value) { - Assert.notNull(value, "value must not be null!"); + Assert.notNull(value, "value must not be null"); return new Millisecond(value); } @@ -1553,7 +1553,7 @@ public class DateOperators { */ public static Millisecond millisecondOf(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return millisecond(Fields.field(fieldReference)); } @@ -1565,7 +1565,7 @@ public class DateOperators { */ public static Millisecond millisecondOf(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return millisecond(expression); } @@ -1581,7 +1581,7 @@ public class DateOperators { @Override public Millisecond withTimezone(Timezone timezone) { - Assert.notNull(timezone, "Timezone must not be null."); + Assert.notNull(timezone, "Timezone must not be null"); return new Millisecond(appendTimezone(values().iterator().next(), timezone)); } @@ -1613,14 +1613,14 @@ public class DateOperators { */ public static FormatBuilder dateToString(Object value) { - Assert.notNull(value, "value must not be null!"); + Assert.notNull(value, "value must not be null"); return new FormatBuilder() { @Override public DateToString toString(String format) { - Assert.notNull(format, "Format must not be null!"); + Assert.notNull(format, "Format must not be null"); return new DateToString(argumentMap(value, format, Timezone.none())); } @@ -1639,7 +1639,7 @@ public class DateOperators { */ public static FormatBuilder dateOf(final String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return dateToString(Fields.field(fieldReference)); } @@ -1651,7 +1651,7 @@ public class DateOperators { */ public static FormatBuilder dateOf(final AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return dateToString(expression); } @@ -1667,7 +1667,7 @@ public class DateOperators { @Override public DateToString withTimezone(Timezone timezone) { - Assert.notNull(timezone, "Timezone must not be null."); + Assert.notNull(timezone, "Timezone must not be null"); return new DateToString(append("timezone", timezone)); } @@ -1790,7 +1790,7 @@ public class DateOperators { */ public static IsoDayOfWeek isoDayWeek(Object value) { - Assert.notNull(value, "value must not be null!"); + Assert.notNull(value, "value must not be null"); return new IsoDayOfWeek(value); } @@ -1802,7 +1802,7 @@ public class DateOperators { */ public static IsoDayOfWeek isoDayOfWeek(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return isoDayWeek(Fields.field(fieldReference)); } @@ -1814,7 +1814,7 @@ public class DateOperators { */ public static IsoDayOfWeek isoDayOfWeek(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return isoDayWeek(expression); } @@ -1830,7 +1830,7 @@ public class DateOperators { @Override public IsoDayOfWeek withTimezone(Timezone timezone) { - Assert.notNull(timezone, "Timezone must not be null."); + Assert.notNull(timezone, "Timezone must not be null"); return new IsoDayOfWeek(appendTimezone(values().iterator().next(), timezone)); } @@ -1862,7 +1862,7 @@ public class DateOperators { */ public static IsoWeek isoWeek(Object value) { - Assert.notNull(value, "value must not be null!"); + Assert.notNull(value, "value must not be null"); return new IsoWeek(value); } @@ -1874,7 +1874,7 @@ public class DateOperators { */ public static IsoWeek isoWeekOf(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return isoWeek(Fields.field(fieldReference)); } @@ -1886,7 +1886,7 @@ public class DateOperators { */ public static IsoWeek isoWeekOf(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return isoWeek(expression); } @@ -1902,7 +1902,7 @@ public class DateOperators { @Override public IsoWeek withTimezone(Timezone timezone) { - Assert.notNull(timezone, "Timezone must not be null."); + Assert.notNull(timezone, "Timezone must not be null"); return new IsoWeek(appendTimezone(values().iterator().next(), timezone)); } @@ -1934,7 +1934,7 @@ public class DateOperators { */ public static IsoWeekYear isoWeekYear(Object value) { - Assert.notNull(value, "value must not be null!"); + Assert.notNull(value, "value must not be null"); return new IsoWeekYear(value); } @@ -1946,7 +1946,7 @@ public class DateOperators { */ public static IsoWeekYear isoWeekYearOf(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return isoWeekYear(Fields.field(fieldReference)); } @@ -1958,7 +1958,7 @@ public class DateOperators { */ public static IsoWeekYear isoWeekYearOf(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return isoWeekYear(expression); } @@ -1974,7 +1974,7 @@ public class DateOperators { @Override public IsoWeekYear withTimezone(Timezone timezone) { - Assert.notNull(timezone, "Timezone must not be null."); + Assert.notNull(timezone, "Timezone must not be null"); return new IsoWeekYear(appendTimezone(values().iterator().next(), timezone)); } @@ -2278,7 +2278,7 @@ public class DateOperators { */ default DateFromParts yearOf(String fieldReference) { - Assert.hasText(fieldReference, "Field reference must not be null nor empty."); + Assert.hasText(fieldReference, "Field reference must not be null nor empty"); return year(Fields.field(fieldReference)); } @@ -2291,7 +2291,7 @@ public class DateOperators { */ default DateFromParts yearOf(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return year(expression); } } @@ -2454,7 +2454,7 @@ public class DateOperators { */ default IsoDateFromParts isoWeekYearOf(String fieldReference) { - Assert.hasText(fieldReference, "Field reference must not be null nor empty."); + Assert.hasText(fieldReference, "Field reference must not be null nor empty"); return isoWeekYear(Fields.field(fieldReference)); } @@ -2467,7 +2467,7 @@ public class DateOperators { */ default IsoDateFromParts isoWeekYearOf(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return isoWeekYear(expression); } } @@ -2498,7 +2498,7 @@ public class DateOperators { */ public static DateToParts dateToParts(Object value) { - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(value, "Value must not be null"); return new DateToParts(Collections.singletonMap("date", value)); } @@ -2511,7 +2511,7 @@ public class DateOperators { */ public static DateToParts datePartsOf(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return dateToParts(Fields.field(fieldReference)); } @@ -2626,7 +2626,7 @@ public class DateOperators { */ public DateFromString withFormat(String format) { - Assert.notNull(format, "Format must not be null!"); + Assert.notNull(format, "Format must not be null"); return new DateFromString(append("format", format)); } diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/DocumentEnhancingOperation.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/DocumentEnhancingOperation.java index da0144b74..b4d4c0f0b 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/DocumentEnhancingOperation.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/DocumentEnhancingOperation.java @@ -93,7 +93,7 @@ abstract class DocumentEnhancingOperation implements InheritsFieldsAggregationOp return exposedFields.and(new ExposedField(Fields.field((String) field), true)); } - throw new IllegalArgumentException(String.format("Expected %s to be a field/property.", field)); + throw new IllegalArgumentException(String.format("Expected %s to be a field/property", field)); } private static Document toSetEntry(Entry entry, AggregationOperationContext context) { @@ -148,8 +148,8 @@ abstract class DocumentEnhancingOperation implements InheritsFieldsAggregationOp */ ExpressionProjection(String expression, Object[] parameters) { - Assert.notNull(expression, "Expression must not be null!"); - Assert.notNull(parameters, "Parameters must not be null!"); + Assert.notNull(expression, "Expression must not be null"); + Assert.notNull(parameters, "Parameters must not be null"); this.expression = expression; this.params = parameters.clone(); diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/EvaluationOperators.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/EvaluationOperators.java index 6fff6f8ca..2fa1cf545 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/EvaluationOperators.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/EvaluationOperators.java @@ -60,7 +60,7 @@ public class EvaluationOperators { */ public EvaluationOperatorFactory(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); this.fieldReference = fieldReference; this.expression = null; } @@ -72,7 +72,7 @@ public class EvaluationOperators { */ public EvaluationOperatorFactory(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); this.fieldReference = null; this.expression = expression; } @@ -108,7 +108,7 @@ public class EvaluationOperators { */ public static Expr valueOf(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return new Expr(Fields.field(fieldReference)); } @@ -120,7 +120,7 @@ public class EvaluationOperators { */ public static Expr valueOf(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new Expr(expression); } diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/ExposedFields.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/ExposedFields.java index 6e7bb74c9..858fb67fa 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/ExposedFields.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/ExposedFields.java @@ -109,7 +109,7 @@ public final class ExposedFields implements Iterable { */ private static ExposedFields createFields(Fields fields, boolean synthetic) { - Assert.notNull(fields, "Fields must not be null!"); + Assert.notNull(fields, "Fields must not be null"); List result = new ArrayList(); for (Field field : fields) { @@ -139,7 +139,7 @@ public final class ExposedFields implements Iterable { */ public ExposedFields and(ExposedField field) { - Assert.notNull(field, "Exposed field must not be null!"); + Assert.notNull(field, "Exposed field must not be null"); ArrayList result = new ArrayList(); result.addAll(field.synthetic ? syntheticFields : originalFields); @@ -361,7 +361,7 @@ public final class ExposedFields implements Iterable { */ public DirectFieldReference(ExposedField field) { - Assert.notNull(field, "ExposedField must not be null!"); + Assert.notNull(field, "ExposedField must not be null"); this.field = field; } diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/ExposedFieldsAggregationOperationContext.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/ExposedFieldsAggregationOperationContext.java index fc640c36b..0da9b7c3c 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/ExposedFieldsAggregationOperationContext.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/ExposedFieldsAggregationOperationContext.java @@ -47,8 +47,8 @@ class ExposedFieldsAggregationOperationContext implements AggregationOperationCo public ExposedFieldsAggregationOperationContext(ExposedFields exposedFields, AggregationOperationContext rootContext) { - Assert.notNull(exposedFields, "ExposedFields must not be null!"); - Assert.notNull(rootContext, "RootContext must not be null!"); + Assert.notNull(exposedFields, "ExposedFields must not be null"); + Assert.notNull(rootContext, "RootContext must not be null"); this.exposedFields = exposedFields; this.rootContext = rootContext; @@ -88,14 +88,14 @@ class ExposedFieldsAggregationOperationContext implements AggregationOperationCo */ private FieldReference getReference(@Nullable Field field, String name) { - Assert.notNull(name, "Name must not be null!"); + Assert.notNull(name, "Name must not be null"); FieldReference exposedField = resolveExposedField(field, name); if (exposedField != null) { return exposedField; } - throw new IllegalArgumentException(String.format("Invalid reference '%s'!", name)); + throw new IllegalArgumentException(String.format("Invalid reference '%s'", name)); } /** diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/FacetOperation.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/FacetOperation.java index 5dffe90e4..24e563f4a 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/FacetOperation.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/FacetOperation.java @@ -72,8 +72,8 @@ public class FacetOperation implements FieldsExposingAggregationOperation { */ public FacetOperationBuilder and(AggregationOperation... operations) { - Assert.notNull(operations, "AggregationOperations must not be null!"); - Assert.notEmpty(operations, "AggregationOperations must not be empty!"); + Assert.notNull(operations, "AggregationOperations must not be null"); + Assert.notEmpty(operations, "AggregationOperations must not be empty"); return new FacetOperationBuilder(facets, Arrays.asList(operations)); } @@ -118,7 +118,7 @@ public class FacetOperation implements FieldsExposingAggregationOperation { */ public FacetOperation as(String fieldName) { - Assert.hasText(fieldName, "FieldName must not be null or empty!"); + Assert.hasText(fieldName, "FieldName must not be null or empty"); return new FacetOperation(current.and(fieldName, operations)); } @@ -178,8 +178,8 @@ public class FacetOperation implements FieldsExposingAggregationOperation { */ Facets and(String fieldName, List operations) { - Assert.hasText(fieldName, "FieldName must not be null or empty!"); - Assert.notNull(operations, "AggregationOperations must not be null!"); + Assert.hasText(fieldName, "FieldName must not be null or empty"); + Assert.notNull(operations, "AggregationOperations must not be null"); List facets = new ArrayList(this.facets.size() + 1); facets.addAll(this.facets); @@ -207,8 +207,8 @@ public class FacetOperation implements FieldsExposingAggregationOperation { */ Facet(ExposedField exposedField, List operations) { - Assert.notNull(exposedField, "ExposedField must not be null!"); - Assert.notNull(operations, "AggregationOperations must not be null!"); + Assert.notNull(exposedField, "ExposedField must not be null"); + Assert.notNull(operations, "AggregationOperations must not be null"); this.exposedField = exposedField; this.operations = operations; diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/Fields.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/Fields.java index a1ae2d66d..f2283d28e 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/Fields.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/Fields.java @@ -37,8 +37,8 @@ import org.springframework.util.StringUtils; */ public final class Fields implements Iterable { - private static final String AMBIGUOUS_EXCEPTION = "Found two fields both using '%s' as name: %s and %s! Please " - + "customize your field definitions to get to unique field names!"; + private static final String AMBIGUOUS_EXCEPTION = "Found two fields both using '%s' as name: %s and %s; Please " + + "customize your field definitions to get to unique field names"; public static final String UNDERSCORE_ID = "_id"; public static final String UNDERSCORE_ID_REF = "$_id"; @@ -53,7 +53,7 @@ public final class Fields implements Iterable { */ public static Fields from(Field... fields) { - Assert.notNull(fields, "Fields must not be null!"); + Assert.notNull(fields, "Fields must not be null"); return new Fields(Arrays.asList(fields)); } @@ -65,7 +65,7 @@ public final class Fields implements Iterable { */ public static Fields fields(String... names) { - Assert.notNull(names, "Field names must not be null!"); + Assert.notNull(names, "Field names must not be null"); List fields = new ArrayList(); @@ -96,7 +96,7 @@ public final class Fields implements Iterable { * @return */ public static Field field(String name, String target) { - Assert.hasText(target, "Target must not be null or empty!"); + Assert.hasText(target, "Target must not be null or empty"); return new AggregationField(name, target); } @@ -107,7 +107,7 @@ public final class Fields implements Iterable { */ private Fields(List fields) { - Assert.notNull(fields, "Fields must not be null!"); + Assert.notNull(fields, "Fields must not be null"); this.fields = verify(fields); } @@ -228,7 +228,7 @@ public final class Fields implements Iterable { String nameToSet = name != null ? cleanUp(name) : null; String targetToSet = target != null ? cleanUp(target) : null; - Assert.hasText(nameToSet, "AggregationField name must not be null or empty!"); + Assert.hasText(nameToSet, "AggregationField name must not be null or empty"); if (target == null && name.contains(".")) { this.name = nameToSet.substring(nameToSet.indexOf('.') + 1); diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/GeoNearOperation.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/GeoNearOperation.java index 96867ca86..208541761 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/GeoNearOperation.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/GeoNearOperation.java @@ -64,8 +64,8 @@ public class GeoNearOperation implements AggregationOperation { */ private GeoNearOperation(NearQuery nearQuery, String distanceField, @Nullable String indexKey) { - Assert.notNull(nearQuery, "NearQuery must not be null."); - Assert.hasLength(distanceField, "Distance field must not be null or empty."); + Assert.notNull(nearQuery, "NearQuery must not be null"); + Assert.hasLength(distanceField, "Distance field must not be null or empty"); this.nearQuery = nearQuery; this.distanceField = distanceField; diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/GraphLookupOperation.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/GraphLookupOperation.java index 37b289d59..059d60447 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/GraphLookupOperation.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/GraphLookupOperation.java @@ -225,7 +225,7 @@ public class GraphLookupOperation implements InheritsFieldsAggregationOperation @Override public StartWithBuilder from(String collectionName) { - Assert.hasText(collectionName, "CollectionName must not be null or empty!"); + Assert.hasText(collectionName, "CollectionName must not be null or empty"); this.from = collectionName; return this; @@ -234,8 +234,8 @@ public class GraphLookupOperation implements InheritsFieldsAggregationOperation @Override public ConnectFromBuilder startWith(String... fieldReferences) { - Assert.notNull(fieldReferences, "FieldReferences must not be null!"); - Assert.noNullElements(fieldReferences, "FieldReferences must not contain null elements!"); + Assert.notNull(fieldReferences, "FieldReferences must not be null"); + Assert.noNullElements(fieldReferences, "FieldReferences must not contain null elements"); List fields = new ArrayList(fieldReferences.length); @@ -250,8 +250,8 @@ public class GraphLookupOperation implements InheritsFieldsAggregationOperation @Override public ConnectFromBuilder startWith(AggregationExpression... expressions) { - Assert.notNull(expressions, "AggregationExpressions must not be null!"); - Assert.noNullElements(expressions, "AggregationExpressions must not contain null elements!"); + Assert.notNull(expressions, "AggregationExpressions must not be null"); + Assert.noNullElements(expressions, "AggregationExpressions must not contain null elements"); this.startWith = Arrays.asList(expressions); return this; @@ -260,8 +260,8 @@ public class GraphLookupOperation implements InheritsFieldsAggregationOperation @Override public ConnectFromBuilder startWith(Object... expressions) { - Assert.notNull(expressions, "Expressions must not be null!"); - Assert.noNullElements(expressions, "Expressions must not contain null elements!"); + Assert.notNull(expressions, "Expressions must not be null"); + Assert.noNullElements(expressions, "Expressions must not contain null elements"); this.startWith = verifyAndPotentiallyTransformStartsWithTypes(expressions); return this; @@ -301,7 +301,7 @@ public class GraphLookupOperation implements InheritsFieldsAggregationOperation @Override public ConnectToBuilder connectFrom(String fieldName) { - Assert.hasText(fieldName, "ConnectFrom must not be null or empty!"); + Assert.hasText(fieldName, "ConnectFrom must not be null or empty"); this.connectFrom = fieldName; return this; @@ -310,7 +310,7 @@ public class GraphLookupOperation implements InheritsFieldsAggregationOperation @Override public GraphLookupOperationBuilder connectTo(String fieldName) { - Assert.hasText(fieldName, "ConnectTo must not be null or empty!"); + Assert.hasText(fieldName, "ConnectTo must not be null or empty"); return new GraphLookupOperationBuilder(from, startWith, connectFrom, fieldName); } @@ -346,7 +346,7 @@ public class GraphLookupOperation implements InheritsFieldsAggregationOperation */ public GraphLookupOperationBuilder maxDepth(long numberOfRecursions) { - Assert.isTrue(numberOfRecursions >= 0, "Max depth must be >= 0!"); + Assert.isTrue(numberOfRecursions >= 0, "Max depth must be >= 0"); this.maxDepth = numberOfRecursions; return this; @@ -360,7 +360,7 @@ public class GraphLookupOperation implements InheritsFieldsAggregationOperation */ public GraphLookupOperationBuilder depthField(String fieldName) { - Assert.hasText(fieldName, "Depth field name must not be null or empty!"); + Assert.hasText(fieldName, "Depth field name must not be null or empty"); this.depthField = Fields.field(fieldName); return this; @@ -374,7 +374,7 @@ public class GraphLookupOperation implements InheritsFieldsAggregationOperation */ public GraphLookupOperationBuilder restrict(CriteriaDefinition criteriaDefinition) { - Assert.notNull(criteriaDefinition, "CriteriaDefinition must not be null!"); + Assert.notNull(criteriaDefinition, "CriteriaDefinition must not be null"); this.restrictSearchWithMatch = criteriaDefinition; return this; @@ -389,7 +389,7 @@ public class GraphLookupOperation implements InheritsFieldsAggregationOperation */ public GraphLookupOperation as(String fieldName) { - Assert.hasText(fieldName, "As field name must not be null or empty!"); + Assert.hasText(fieldName, "As field name must not be null or empty"); return new GraphLookupOperation(from, startWith, connectFrom, connectTo, Fields.field(fieldName), maxDepth, depthField, restrictSearchWithMatch); diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/GroupOperation.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/GroupOperation.java index 02da93d3a..4773028c1 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/GroupOperation.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/GroupOperation.java @@ -80,8 +80,8 @@ public class GroupOperation implements FieldsExposingAggregationOperation { */ private GroupOperation(GroupOperation groupOperation, List nextOperations) { - Assert.notNull(groupOperation, "GroupOperation must not be null!"); - Assert.notNull(nextOperations, "NextOperations must not be null!"); + Assert.notNull(groupOperation, "GroupOperation must not be null"); + Assert.notNull(nextOperations, "NextOperations must not be null"); this.idFields = groupOperation.idFields; this.operations = new ArrayList(nextOperations.size() + 1); @@ -117,8 +117,8 @@ public class GroupOperation implements FieldsExposingAggregationOperation { */ private GroupOperationBuilder(GroupOperation groupOperation, Operation operation) { - Assert.notNull(groupOperation, "GroupOperation must not be null!"); - Assert.notNull(operation, "Operation must not be null!"); + Assert.notNull(groupOperation, "GroupOperation must not be null"); + Assert.notNull(operation, "Operation must not be null"); this.groupOperation = groupOperation; this.operation = operation; @@ -168,7 +168,7 @@ public class GroupOperation implements FieldsExposingAggregationOperation { */ public GroupOperationBuilder sum(AggregationExpression expr) { - Assert.notNull(expr, "Expr must not be null!"); + Assert.notNull(expr, "Expr must not be null"); return newBuilder(GroupOps.SUM, null, expr); } diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/LimitOperation.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/LimitOperation.java index 699c92fb4..bffff457d 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/LimitOperation.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/LimitOperation.java @@ -39,7 +39,7 @@ public class LimitOperation implements AggregationOperation { */ public LimitOperation(long maxElements) { - Assert.isTrue(maxElements >= 0, "Maximum number of elements must be greater or equal to zero!"); + Assert.isTrue(maxElements >= 0, "Maximum number of elements must be greater or equal to zero"); this.maxElements = maxElements; } diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/LiteralOperators.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/LiteralOperators.java index 232723065..b7d893c73 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/LiteralOperators.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/LiteralOperators.java @@ -33,7 +33,7 @@ public class LiteralOperators { */ public static LiteralOperatorFactory valueOf(Object value) { - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(value, "Value must not be null"); return new LiteralOperatorFactory(value); } @@ -51,7 +51,7 @@ public class LiteralOperators { */ public LiteralOperatorFactory(Object value) { - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(value, "Value must not be null"); this.value = value; } @@ -89,7 +89,7 @@ public class LiteralOperators { */ public static Literal asLiteral(Object value) { - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(value, "Value must not be null"); return new Literal(value); } } diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/LookupOperation.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/LookupOperation.java index 79f2430d4..70e081a62 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/LookupOperation.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/LookupOperation.java @@ -49,10 +49,10 @@ public class LookupOperation implements FieldsExposingAggregationOperation, Inhe */ public LookupOperation(Field from, Field localField, Field foreignField, Field as) { - Assert.notNull(from, "From must not be null!"); - Assert.notNull(localField, "LocalField must not be null!"); - Assert.notNull(foreignField, "ForeignField must not be null!"); - Assert.notNull(as, "As must not be null!"); + Assert.notNull(from, "From must not be null"); + Assert.notNull(localField, "LocalField must not be null"); + Assert.notNull(foreignField, "ForeignField must not be null"); + Assert.notNull(as, "As must not be null"); this.from = from; this.localField = localField; @@ -155,7 +155,7 @@ public class LookupOperation implements FieldsExposingAggregationOperation, Inhe @Override public LocalFieldBuilder from(String name) { - Assert.hasText(name, "'From' must not be null or empty!"); + Assert.hasText(name, "'From' must not be null or empty"); from = Fields.field(name); return this; } @@ -163,7 +163,7 @@ public class LookupOperation implements FieldsExposingAggregationOperation, Inhe @Override public LookupOperation as(String name) { - Assert.hasText(name, "'As' must not be null or empty!"); + Assert.hasText(name, "'As' must not be null or empty"); as = new ExposedField(Fields.field(name), true); return new LookupOperation(from, localField, foreignField, as); } @@ -171,7 +171,7 @@ public class LookupOperation implements FieldsExposingAggregationOperation, Inhe @Override public AsBuilder foreignField(String name) { - Assert.hasText(name, "'ForeignField' must not be null or empty!"); + Assert.hasText(name, "'ForeignField' must not be null or empty"); foreignField = Fields.field(name); return this; } @@ -179,7 +179,7 @@ public class LookupOperation implements FieldsExposingAggregationOperation, Inhe @Override public ForeignFieldBuilder localField(String name) { - Assert.hasText(name, "'LocalField' must not be null or empty!"); + Assert.hasText(name, "'LocalField' must not be null or empty"); localField = Fields.field(name); return this; } diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/MatchOperation.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/MatchOperation.java index 80e0d469b..db776e80e 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/MatchOperation.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/MatchOperation.java @@ -47,7 +47,7 @@ public class MatchOperation implements AggregationOperation { */ public MatchOperation(CriteriaDefinition criteriaDefinition) { - Assert.notNull(criteriaDefinition, "Criteria must not be null!"); + Assert.notNull(criteriaDefinition, "Criteria must not be null"); this.criteriaDefinition = criteriaDefinition; this.expression = null; @@ -61,7 +61,7 @@ public class MatchOperation implements AggregationOperation { */ public MatchOperation(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); this.criteriaDefinition = null; this.expression = expression; diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/MergeOperation.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/MergeOperation.java index f2604fa5a..7b2c39239 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/MergeOperation.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/MergeOperation.java @@ -62,8 +62,8 @@ public class MergeOperation implements FieldsExposingAggregationOperation, Inher public MergeOperation(MergeOperationTarget into, UniqueMergeId on, @Nullable Let let, @Nullable WhenDocumentsMatch whenMatched, @Nullable WhenDocumentsDontMatch whenNotMatched) { - Assert.notNull(into, "Into must not be null! Please provide a target collection."); - Assert.notNull(on, "On must not be null! Use UniqueMergeId.id() instead."); + Assert.notNull(into, "Into must not be null Please provide a target collection"); + Assert.notNull(on, "On must not be null Use UniqueMergeId.id() instead"); this.into = into; this.on = on; @@ -167,7 +167,7 @@ public class MergeOperation implements FieldsExposingAggregationOperation, Inher public static UniqueMergeId ofIdFields(String... fields) { - Assert.noNullElements(fields, "Fields must not contain null values!"); + Assert.noNullElements(fields, "Fields must not contain null values"); if (ObjectUtils.isEmpty(fields)) { return id(); @@ -225,7 +225,7 @@ public class MergeOperation implements FieldsExposingAggregationOperation, Inher private MergeOperationTarget(@Nullable String database, String collection) { - Assert.hasText(collection, "Collection must not be null nor empty!"); + Assert.hasText(collection, "Collection must not be null nor empty"); this.database = database; this.collection = collection; @@ -360,7 +360,7 @@ public class MergeOperation implements FieldsExposingAggregationOperation, Inher private WhenDocumentsDontMatch(String value) { - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(value, "Value must not be null"); this.value = value; } @@ -432,7 +432,7 @@ public class MergeOperation implements FieldsExposingAggregationOperation, Inher */ public MergeOperationBuilder intoCollection(String collection) { - Assert.hasText(collection, "Collection must not be null nor empty!"); + Assert.hasText(collection, "Collection must not be null nor empty"); this.collection = collection; return this; diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/NestedDelegatingExpressionAggregationOperationContext.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/NestedDelegatingExpressionAggregationOperationContext.java index e7094e0ed..30fdadd7e 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/NestedDelegatingExpressionAggregationOperationContext.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/NestedDelegatingExpressionAggregationOperationContext.java @@ -45,7 +45,7 @@ class NestedDelegatingExpressionAggregationOperationContext implements Aggregati NestedDelegatingExpressionAggregationOperationContext(AggregationOperationContext referenceContext, Collection inners) { - Assert.notNull(referenceContext, "Reference context must not be null!"); + Assert.notNull(referenceContext, "Reference context must not be null"); this.delegate = referenceContext; this.inners = inners; } diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/ObjectOperators.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/ObjectOperators.java index 3b5f76d9c..996e82a98 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/ObjectOperators.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/ObjectOperators.java @@ -65,7 +65,7 @@ public class ObjectOperators { */ public ObjectOperatorFactory(Object value) { - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(value, "Value must not be null"); this.value = value; } diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/OutOperation.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/OutOperation.java index f46d45f81..8c1ff22ee 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/OutOperation.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/OutOperation.java @@ -57,7 +57,7 @@ public class OutOperation implements AggregationOperation { private OutOperation(@Nullable String databaseName, String collectionName, @Nullable Document uniqueKey, @Nullable OutMode mode) { - Assert.notNull(collectionName, "Collection name must not be null!"); + Assert.notNull(collectionName, "Collection name must not be null"); this.databaseName = databaseName; this.collectionName = collectionName; @@ -128,7 +128,7 @@ public class OutOperation implements AggregationOperation { */ public OutOperation uniqueKeyOf(Iterable fields) { - Assert.notNull(fields, "Fields must not be null!"); + Assert.notNull(fields, "Fields must not be null"); Document uniqueKey = new Document(); fields.forEach(it -> uniqueKey.append(it, 1)); @@ -146,7 +146,7 @@ public class OutOperation implements AggregationOperation { */ public OutOperation mode(OutMode mode) { - Assert.notNull(mode, "Mode must not be null!"); + Assert.notNull(mode, "Mode must not be null"); return new OutOperation(databaseName, collectionName, uniqueKey, mode); } @@ -193,7 +193,7 @@ public class OutOperation implements AggregationOperation { return new Document("$out", collectionName); } - Assert.state(mode != null, "Mode must not be null!"); + Assert.state(mode != null, "Mode must not be null"); Document $out = new Document("to", collectionName) // .append("mode", mode.getMongoMode()); diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/ProjectionOperation.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/ProjectionOperation.java index 4af35b887..07fcfe3d2 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/ProjectionOperation.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/ProjectionOperation.java @@ -53,8 +53,8 @@ import org.springframework.util.Assert; public class ProjectionOperation implements FieldsExposingAggregationOperation { private static final List NONE = Collections.emptyList(); - private static final String EXCLUSION_ERROR = "Exclusion of field %s not allowed. Projections by the mongodb " - + "aggregation framework only support the exclusion of the %s field!"; + private static final String EXCLUSION_ERROR = "Exclusion of field %s not allowed; Projections by the mongodb" + + " aggregation framework only support the exclusion of the %s field"; private final List projections; @@ -93,8 +93,8 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation { */ private ProjectionOperation(List current, List projections) { - Assert.notNull(current, "Current projections must not be null!"); - Assert.notNull(projections, "Projections must not be null!"); + Assert.notNull(current, "Current projections must not be null"); + Assert.notNull(projections, "Projections must not be null"); this.projections = new ArrayList(current.size() + projections.size()); this.projections.addAll(current); @@ -275,8 +275,8 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation { */ public AbstractProjectionOperationBuilder(Object value, ProjectionOperation operation) { - Assert.notNull(value, "value must not be null or empty!"); - Assert.notNull(operation, "ProjectionOperation must not be null!"); + Assert.notNull(value, "value must not be null or empty"); + Assert.notNull(operation, "ProjectionOperation must not be null"); this.value = value; this.operation = operation; @@ -390,8 +390,8 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation { super(field); - Assert.hasText(expression, "Expression must not be null!"); - Assert.notNull(parameters, "Parameters must not be null!"); + Assert.hasText(expression, "Expression must not be null"); + Assert.notNull(parameters, "Parameters must not be null"); this.expression = expression; this.params = parameters.clone(); @@ -418,8 +418,8 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation { */ public static class ProjectionOperationBuilder extends AbstractProjectionOperationBuilder { - private static final String NUMBER_NOT_NULL = "Number must not be null!"; - private static final String FIELD_REFERENCE_NOT_NULL = "Field reference must not be null!"; + private static final String NUMBER_NOT_NULL = "Number must not be null"; + private static final String FIELD_REFERENCE_NOT_NULL = "Field reference must not be null"; private final @Nullable String name; private final @Nullable OperationProjection previousProjection; @@ -502,14 +502,14 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation { @Override public ProjectionOperation applyCondition(Cond cond) { - Assert.notNull(cond, "ConditionalOperator must not be null!"); + Assert.notNull(cond, "ConditionalOperator must not be null"); return this.operation.and(new ExpressionProjection(Fields.field(getRequiredName()), cond)); } @Override public ProjectionOperation applyCondition(IfNull ifNull) { - Assert.notNull(ifNull, "IfNullOperator must not be null!"); + Assert.notNull(ifNull, "IfNullOperator must not be null"); return this.operation.and(new ExpressionProjection(Fields.field(getRequiredName()), ifNull)); } @@ -533,7 +533,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation { */ public ProjectionOperationBuilder plus(String fieldReference) { - Assert.notNull(fieldReference, "Field reference must not be null!"); + Assert.notNull(fieldReference, "Field reference must not be null"); return project("add", Fields.field(fieldReference)); } @@ -545,7 +545,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation { */ public ProjectionOperationBuilder minus(Number number) { - Assert.notNull(number, "Number must not be null!"); + Assert.notNull(number, "Number must not be null"); return project("subtract", number); } @@ -572,7 +572,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation { */ public ProjectionOperationBuilder minus(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return project("subtract", expression); } @@ -611,7 +611,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation { */ public ProjectionOperationBuilder multiply(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return project("multiply", expression); } @@ -624,7 +624,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation { public ProjectionOperationBuilder divide(Number number) { Assert.notNull(number, FIELD_REFERENCE_NOT_NULL); - Assert.isTrue(Math.abs(number.intValue()) != 0, "Number must not be zero!"); + Assert.isTrue(Math.abs(number.intValue()) != 0, "Number must not be zero"); return project("divide", number); } @@ -651,7 +651,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation { */ public ProjectionOperationBuilder divide(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return project("divide", expression); } @@ -665,7 +665,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation { public ProjectionOperationBuilder mod(Number number) { Assert.notNull(number, NUMBER_NOT_NULL); - Assert.isTrue(Math.abs(number.intValue()) != 0, "Number must not be zero!"); + Assert.isTrue(Math.abs(number.intValue()) != 0, "Number must not be zero"); return project("mod", number); } @@ -692,7 +692,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation { */ public ProjectionOperationBuilder mod(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return project("mod", expression); } @@ -835,7 +835,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation { */ public ProjectionOperationBuilder equalsArrays(String... arrays) { - Assert.notEmpty(arrays, "Arrays must not be null or empty!"); + Assert.notEmpty(arrays, "Arrays must not be null or empty"); return project("setEquals", Fields.fields(arrays)); } @@ -849,7 +849,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation { */ public ProjectionOperationBuilder intersectsArrays(String... arrays) { - Assert.notEmpty(arrays, "Arrays must not be null or empty!"); + Assert.notEmpty(arrays, "Arrays must not be null or empty"); return project("setIntersection", Fields.fields(arrays)); } @@ -863,7 +863,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation { */ public ProjectionOperationBuilder unionArrays(String... arrays) { - Assert.notEmpty(arrays, "Arrays must not be null or empty!"); + Assert.notEmpty(arrays, "Arrays must not be null or empty"); return project("setUnion", Fields.fields(arrays)); } @@ -877,7 +877,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation { */ public ProjectionOperationBuilder differenceToArray(String array) { - Assert.hasText(array, "Array must not be null or empty!"); + Assert.hasText(array, "Array must not be null or empty"); return project("setDifference", Fields.fields(array)); } @@ -891,7 +891,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation { */ public ProjectionOperationBuilder subsetOfArray(String array) { - Assert.hasText(array, "Array must not be null or empty!"); + Assert.hasText(array, "Array must not be null or empty"); return project("setIsSubset", Fields.fields(array)); } @@ -1270,7 +1270,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation { private String getRequiredName() { - Assert.state(name != null, "Projection field name must not be null!"); + Assert.state(name != null, "Projection field name must not be null"); return name; } @@ -1368,7 +1368,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation { */ public static List from(Fields fields, @Nullable Object value) { - Assert.notNull(fields, "Fields must not be null!"); + Assert.notNull(fields, "Fields must not be null"); List projections = new ArrayList(); for (Field field : fields) { @@ -1437,8 +1437,8 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation { super(field); - Assert.hasText(operation, "Operation must not be null or empty!"); - Assert.notNull(values, "Values must not be null!"); + Assert.hasText(operation, "Operation must not be null or empty"); + Assert.notNull(values, "Values must not be null"); this.field = field; this.operation = operation; @@ -1655,7 +1655,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation { */ public Projection(Field field) { - Assert.notNull(field, "Field must not be null!"); + Assert.notNull(field, "Field must not be null"); this.field = new ExposedField(field, true); } @@ -1759,7 +1759,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation { */ public ArrayProjectionOperationBuilder and(AggregationExpression expression) { - Assert.notNull(expression, "AggregationExpression must not be null!"); + Assert.notNull(expression, "AggregationExpression must not be null"); this.projections.add(expression); return this; @@ -1773,7 +1773,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation { */ public ArrayProjectionOperationBuilder and(Field field) { - Assert.notNull(field, "Field must not be null!"); + Assert.notNull(field, "Field must not be null"); this.projections.add(field); return this; diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/RedactOperation.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/RedactOperation.java index afaecafdb..f40d1ec4e 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/RedactOperation.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/RedactOperation.java @@ -63,7 +63,7 @@ public class RedactOperation implements AggregationOperation { */ public RedactOperation(AggregationExpression condition) { - Assert.notNull(condition, "Condition must not be null!"); + Assert.notNull(condition, "Condition must not be null"); this.condition = condition; } @@ -237,7 +237,7 @@ public class RedactOperation implements AggregationOperation { } throw new IllegalArgumentException(String.format( - "Invalid Condition. Expected CriteriaDefinition, AggregationExpression or Document but was %s.", when)); + "Invalid Condition; Expected CriteriaDefinition, AggregationExpression or Document but was %s", when)); } } } diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/ReplaceRootOperation.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/ReplaceRootOperation.java index 0ad7d1d7c..3bb985781 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/ReplaceRootOperation.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/ReplaceRootOperation.java @@ -66,7 +66,7 @@ public class ReplaceRootOperation implements FieldsExposingAggregationOperation */ public ReplaceRootOperation(Replacement replacement) { - Assert.notNull(replacement, "Replacement must not be null!"); + Assert.notNull(replacement, "Replacement must not be null"); this.replacement = replacement; } @@ -152,7 +152,7 @@ public class ReplaceRootOperation implements FieldsExposingAggregationOperation */ public ReplaceRootOperation withDocument(Document document) { - Assert.notNull(document, "Document must not be null!"); + Assert.notNull(document, "Document must not be null"); return new ReplaceRootDocumentOperation().andValuesOf(document); } @@ -240,8 +240,8 @@ public class ReplaceRootOperation implements FieldsExposingAggregationOperation protected ReplaceRootDocumentOperationBuilder(ReplaceRootDocumentOperation currentOperation, Object value) { - Assert.notNull(currentOperation, "Current ReplaceRootDocumentOperation must not be null!"); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(currentOperation, "Current ReplaceRootDocumentOperation must not be null"); + Assert.notNull(value, "Value must not be null"); this.currentOperation = currentOperation; this.value = value; @@ -287,7 +287,7 @@ public class ReplaceRootOperation implements FieldsExposingAggregationOperation protected AggregationExpressionReplacement(AggregationExpression aggregationExpression) { - Assert.notNull(aggregationExpression, "AggregationExpression must not be null!"); + Assert.notNull(aggregationExpression, "AggregationExpression must not be null"); this.aggregationExpression = aggregationExpression; } @@ -311,7 +311,7 @@ public class ReplaceRootOperation implements FieldsExposingAggregationOperation */ protected FieldReplacement(Field field) { - Assert.notNull(field, "Field must not be null!"); + Assert.notNull(field, "Field must not be null"); this.field = field; } @@ -344,7 +344,7 @@ public class ReplaceRootOperation implements FieldsExposingAggregationOperation */ protected ReplacementDocument(ReplacementContributor contributor) { - Assert.notNull(contributor, "ReplacementContributor must not be null!"); + Assert.notNull(contributor, "ReplacementContributor must not be null"); replacements = Collections.singleton(contributor); } @@ -452,7 +452,7 @@ public class ReplaceRootOperation implements FieldsExposingAggregationOperation */ public DocumentContributor(Object value) { - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(value, "Value must not be null"); this.value = value; } @@ -482,7 +482,7 @@ public class ReplaceRootOperation implements FieldsExposingAggregationOperation */ public FieldContributorSupport(Field field) { - Assert.notNull(field, "Field must not be null!"); + Assert.notNull(field, "Field must not be null"); this.field = new ExposedField(field, true); } @@ -514,7 +514,7 @@ public class ReplaceRootOperation implements FieldsExposingAggregationOperation super(field); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(value, "Value must not be null"); this.value = value; } @@ -547,7 +547,7 @@ public class ReplaceRootOperation implements FieldsExposingAggregationOperation super(field); - Assert.notNull(aggregationExpression, "AggregationExpression must not be null!"); + Assert.notNull(aggregationExpression, "AggregationExpression must not be null"); this.aggregationExpression = aggregationExpression; } diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/ReplaceWithOperation.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/ReplaceWithOperation.java index faec912d8..e57a681bc 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/ReplaceWithOperation.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/ReplaceWithOperation.java @@ -61,7 +61,7 @@ public class ReplaceWithOperation extends ReplaceRootOperation { */ public static ReplaceWithOperation replaceWithValueOf(Object value) { - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(value, "Value must not be null"); return new ReplaceWithOperation((ctx) -> { Object target = value instanceof String ? Fields.field((String) value) : value; diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/SampleOperation.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/SampleOperation.java index fa2b46d7a..e9e359c4a 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/SampleOperation.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/SampleOperation.java @@ -38,7 +38,7 @@ public class SampleOperation implements AggregationOperation { */ public SampleOperation(long sampleSize) { - Assert.isTrue(sampleSize > 0, "Sample size must be greater than zero!"); + Assert.isTrue(sampleSize > 0, "Sample size must be greater than zero"); this.sampleSize = sampleSize; } diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/ScriptOperators.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/ScriptOperators.java index 7d2c7ffbf..57c106c3b 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/ScriptOperators.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/ScriptOperators.java @@ -99,7 +99,7 @@ public class ScriptOperators { */ public static Function function(String body) { - Assert.notNull(body, "Function body must not be null!"); + Assert.notNull(body, "Function body must not be null"); Map function = new LinkedHashMap<>(2); function.put(Fields.BODY.toString(), body); @@ -127,7 +127,7 @@ public class ScriptOperators { */ public Function args(List args) { - Assert.notNull(args, "Args must not be null! Use an empty list instead."); + Assert.notNull(args, "Args must not be null Use an empty list instead"); return new Function(appendAt(1, Fields.ARGS.toString(), args)); } @@ -140,7 +140,7 @@ public class ScriptOperators { */ public Function lang(String lang) { - Assert.hasText(lang, "Lang must not be null nor empty! The default would be 'js'."); + Assert.hasText(lang, "Lang must not be null nor empty; The default would be 'js'"); return new Function(appendAt(2, Fields.LANG.toString(), lang)); } @@ -528,7 +528,7 @@ public class ScriptOperators { */ public AccumulatorBuilder lang(String lang) { - Assert.hasText(lang, "Lang must not be null nor empty! The default would be 'js'."); + Assert.hasText(lang, "Lang must not be null nor empty; The default would be 'js'"); this.lang = lang; return this; diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/SetOperators.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/SetOperators.java index c62234a19..6811ebeef 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/SetOperators.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/SetOperators.java @@ -65,7 +65,7 @@ public class SetOperators { */ public SetOperatorFactory(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); this.fieldReference = fieldReference; this.expression = null; } @@ -77,7 +77,7 @@ public class SetOperators { */ public SetOperatorFactory(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); this.fieldReference = null; this.expression = expression; } @@ -261,7 +261,7 @@ public class SetOperators { */ public static SetEquals arrayAsSet(String arrayReference) { - Assert.notNull(arrayReference, "ArrayReference must not be null!"); + Assert.notNull(arrayReference, "ArrayReference must not be null"); return new SetEquals(asFields(arrayReference)); } @@ -273,7 +273,7 @@ public class SetOperators { */ public static SetEquals arrayAsSet(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new SetEquals(Collections.singletonList(expression)); } @@ -285,7 +285,7 @@ public class SetOperators { */ public SetEquals isEqualTo(String... arrayReferences) { - Assert.notNull(arrayReferences, "ArrayReferences must not be null!"); + Assert.notNull(arrayReferences, "ArrayReferences must not be null"); return new SetEquals(append(Fields.fields(arrayReferences).asList())); } @@ -297,7 +297,7 @@ public class SetOperators { */ public SetEquals isEqualTo(AggregationExpression... expressions) { - Assert.notNull(expressions, "Expressions must not be null!"); + Assert.notNull(expressions, "Expressions must not be null"); return new SetEquals(append(Arrays.asList(expressions))); } @@ -309,7 +309,7 @@ public class SetOperators { */ public SetEquals isEqualTo(Object[] array) { - Assert.notNull(array, "Array must not be null!"); + Assert.notNull(array, "Array must not be null"); return new SetEquals(append(array)); } } @@ -338,7 +338,7 @@ public class SetOperators { */ public static SetIntersection arrayAsSet(String arrayReference) { - Assert.notNull(arrayReference, "ArrayReference must not be null!"); + Assert.notNull(arrayReference, "ArrayReference must not be null"); return new SetIntersection(asFields(arrayReference)); } @@ -350,7 +350,7 @@ public class SetOperators { */ public static SetIntersection arrayAsSet(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new SetIntersection(Collections.singletonList(expression)); } @@ -362,7 +362,7 @@ public class SetOperators { */ public SetIntersection intersects(String... arrayReferences) { - Assert.notNull(arrayReferences, "ArrayReferences must not be null!"); + Assert.notNull(arrayReferences, "ArrayReferences must not be null"); return new SetIntersection(append(asFields(arrayReferences))); } @@ -374,7 +374,7 @@ public class SetOperators { */ public SetIntersection intersects(AggregationExpression... expressions) { - Assert.notNull(expressions, "Expressions must not be null!"); + Assert.notNull(expressions, "Expressions must not be null"); return new SetIntersection(append(Arrays.asList(expressions))); } } @@ -403,7 +403,7 @@ public class SetOperators { */ public static SetUnion arrayAsSet(String arrayReference) { - Assert.notNull(arrayReference, "ArrayReference must not be null!"); + Assert.notNull(arrayReference, "ArrayReference must not be null"); return new SetUnion(asFields(arrayReference)); } @@ -415,7 +415,7 @@ public class SetOperators { */ public static SetUnion arrayAsSet(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new SetUnion(Collections.singletonList(expression)); } @@ -427,7 +427,7 @@ public class SetOperators { */ public SetUnion union(String... arrayReferences) { - Assert.notNull(arrayReferences, "ArrayReferences must not be null!"); + Assert.notNull(arrayReferences, "ArrayReferences must not be null"); return new SetUnion(append(asFields(arrayReferences))); } @@ -439,7 +439,7 @@ public class SetOperators { */ public SetUnion union(AggregationExpression... expressions) { - Assert.notNull(expressions, "Expressions must not be null!"); + Assert.notNull(expressions, "Expressions must not be null"); return new SetUnion(append(Arrays.asList(expressions))); } } @@ -468,7 +468,7 @@ public class SetOperators { */ public static SetDifference arrayAsSet(String arrayReference) { - Assert.notNull(arrayReference, "ArrayReference must not be null!"); + Assert.notNull(arrayReference, "ArrayReference must not be null"); return new SetDifference(asFields(arrayReference)); } @@ -480,7 +480,7 @@ public class SetOperators { */ public static SetDifference arrayAsSet(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new SetDifference(Collections.singletonList(expression)); } @@ -492,7 +492,7 @@ public class SetOperators { */ public SetDifference differenceTo(String arrayReference) { - Assert.notNull(arrayReference, "ArrayReference must not be null!"); + Assert.notNull(arrayReference, "ArrayReference must not be null"); return new SetDifference(append(Fields.field(arrayReference))); } @@ -504,7 +504,7 @@ public class SetOperators { */ public SetDifference differenceTo(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new SetDifference(append(expression)); } } @@ -533,7 +533,7 @@ public class SetOperators { */ public static SetIsSubset arrayAsSet(String arrayReference) { - Assert.notNull(arrayReference, "ArrayReference must not be null!"); + Assert.notNull(arrayReference, "ArrayReference must not be null"); return new SetIsSubset(asFields(arrayReference)); } @@ -545,7 +545,7 @@ public class SetOperators { */ public static SetIsSubset arrayAsSet(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new SetIsSubset(Collections.singletonList(expression)); } @@ -557,7 +557,7 @@ public class SetOperators { */ public SetIsSubset isSubsetOf(String arrayReference) { - Assert.notNull(arrayReference, "ArrayReference must not be null!"); + Assert.notNull(arrayReference, "ArrayReference must not be null"); return new SetIsSubset(append(Fields.field(arrayReference))); } @@ -569,7 +569,7 @@ public class SetOperators { */ public SetIsSubset isSubsetOf(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new SetIsSubset(append(expression)); } } @@ -598,7 +598,7 @@ public class SetOperators { */ public static AnyElementTrue arrayAsSet(String arrayReference) { - Assert.notNull(arrayReference, "ArrayReference must not be null!"); + Assert.notNull(arrayReference, "ArrayReference must not be null"); return new AnyElementTrue(asFields(arrayReference)); } @@ -610,7 +610,7 @@ public class SetOperators { */ public static AnyElementTrue arrayAsSet(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new AnyElementTrue(Collections.singletonList(expression)); } @@ -643,7 +643,7 @@ public class SetOperators { */ public static AllElementsTrue arrayAsSet(String arrayReference) { - Assert.notNull(arrayReference, "ArrayReference must not be null!"); + Assert.notNull(arrayReference, "ArrayReference must not be null"); return new AllElementsTrue(asFields(arrayReference)); } @@ -655,7 +655,7 @@ public class SetOperators { */ public static AllElementsTrue arrayAsSet(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new AllElementsTrue(Collections.singletonList(expression)); } diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/SetWindowFieldsOperation.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/SetWindowFieldsOperation.java index b469d70fe..dff1a5274 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/SetWindowFieldsOperation.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/SetWindowFieldsOperation.java @@ -125,7 +125,7 @@ public class SetWindowFieldsOperation */ public WindowOutput(ComputedField outputField) { - Assert.notNull(outputField, "OutputField must not be null!"); + Assert.notNull(outputField, "OutputField must not be null"); this.fields = new ArrayList<>(); this.fields.add(outputField); @@ -139,7 +139,7 @@ public class SetWindowFieldsOperation */ public WindowOutput append(ComputedField field) { - Assert.notNull(field, "Field must not be null!"); + Assert.notNull(field, "Field must not be null"); fields.add(field); return this; diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/SkipOperation.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/SkipOperation.java index ebac7828a..f6669b136 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/SkipOperation.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/SkipOperation.java @@ -42,7 +42,7 @@ public class SkipOperation implements AggregationOperation { */ public SkipOperation(long skipCount) { - Assert.isTrue(skipCount >= 0, "Skip count must not be negative!"); + Assert.isTrue(skipCount >= 0, "Skip count must not be negative"); this.skipCount = skipCount; } diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/SortByCountOperation.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/SortByCountOperation.java index 4e505248c..3247cb891 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/SortByCountOperation.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/SortByCountOperation.java @@ -47,7 +47,7 @@ public class SortByCountOperation implements AggregationOperation { */ public SortByCountOperation(Field groupByField) { - Assert.notNull(groupByField, "Group by field must not be null!"); + Assert.notNull(groupByField, "Group by field must not be null"); this.groupByField = groupByField; this.groupByExpression = null; @@ -60,7 +60,7 @@ public class SortByCountOperation implements AggregationOperation { */ public SortByCountOperation(AggregationExpression groupByExpression) { - Assert.notNull(groupByExpression, "Group by expression must not be null!"); + Assert.notNull(groupByExpression, "Group by expression must not be null"); this.groupByExpression = groupByExpression; this.groupByField = null; diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/SortOperation.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/SortOperation.java index f12928cc4..d5492ae9a 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/SortOperation.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/SortOperation.java @@ -47,7 +47,7 @@ public class SortOperation implements AggregationOperation { */ public SortOperation(Sort sort) { - Assert.notNull(sort, "Sort must not be null!"); + Assert.notNull(sort, "Sort must not be null"); this.sort = sort; } diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/SpelExpressionTransformer.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/SpelExpressionTransformer.java index 6b3c045fc..92785956f 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/SpelExpressionTransformer.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/SpelExpressionTransformer.java @@ -94,9 +94,9 @@ class SpelExpressionTransformer implements AggregationExpressionTransformer { */ public Object transform(String expression, AggregationOperationContext context, Object... params) { - Assert.notNull(expression, "Expression must not be null!"); - Assert.notNull(context, "AggregationOperationContext must not be null!"); - Assert.notNull(params, "Parameters must not be null!"); + Assert.notNull(expression, "Expression must not be null"); + Assert.notNull(context, "AggregationOperationContext must not be null"); + Assert.notNull(params, "Parameters must not be null"); SpelExpression spelExpression = (SpelExpression) PARSER.parseExpression(expression); ExpressionState state = new ExpressionState(new StandardEvaluationContext(params), CONFIG); @@ -126,7 +126,7 @@ class SpelExpressionTransformer implements AggregationExpressionTransformer { } throw new IllegalArgumentException("Unsupported Element: " + node + " Type: " + node.getClass() - + " You probably have a syntax error in your SpEL expression!"); + + " You probably have a syntax error in your SpEL expression"); } /** @@ -149,7 +149,7 @@ class SpelExpressionTransformer implements AggregationExpressionTransformer { @SuppressWarnings("unchecked") public ExpressionNodeConversion(AggregationExpressionTransformer transformer) { - Assert.notNull(transformer, "Transformer must not be null!"); + Assert.notNull(transformer, "Transformer must not be null"); this.nodeType = (Class) GenericTypeResolver.resolveTypeArgument(this.getClass(), ExpressionNodeConversion.class); @@ -176,8 +176,8 @@ class SpelExpressionTransformer implements AggregationExpressionTransformer { */ protected Object transform(ExpressionNode node, AggregationExpressionTransformationContext context) { - Assert.notNull(node, "ExpressionNode must not be null!"); - Assert.notNull(context, "AggregationExpressionTransformationContext must not be null!"); + Assert.notNull(node, "ExpressionNode must not be null"); + Assert.notNull(context, "AggregationExpressionTransformationContext must not be null"); return transform(node, context.getParentNode(), null, context); } @@ -195,8 +195,8 @@ class SpelExpressionTransformer implements AggregationExpressionTransformer { protected Object transform(ExpressionNode node, @Nullable ExpressionNode parent, @Nullable Document operation, AggregationExpressionTransformationContext context) { - Assert.notNull(node, "ExpressionNode must not be null!"); - Assert.notNull(context, "AggregationExpressionTransformationContext must not be null!"); + Assert.notNull(node, "ExpressionNode must not be null"); + Assert.notNull(context, "AggregationExpressionTransformationContext must not be null"); return transform(new AggregationExpressionTransformationContext(node, parent, operation, context.getAggregationContext())); @@ -433,7 +433,7 @@ class SpelExpressionTransformer implements AggregationExpressionTransformer { MethodReferenceNode node = context.getCurrentNode(); AggregationMethodReference methodReference = node.getMethodReference(); - Assert.state(methodReference != null, "Cannot resolve current node to AggregationMethodReference!"); + Assert.state(methodReference != null, "Cannot resolve current node to AggregationMethodReference"); Object args = null; diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/StringOperators.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/StringOperators.java index c80c3809a..b01b9ad35 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/StringOperators.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/StringOperators.java @@ -70,7 +70,7 @@ public class StringOperators { */ public StringOperatorFactory(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); this.fieldReference = fieldReference; this.expression = null; } @@ -82,7 +82,7 @@ public class StringOperators { */ public StringOperatorFactory(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); this.fieldReference = null; this.expression = expression; } @@ -96,7 +96,7 @@ public class StringOperators { */ public Concat concatValueOf(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return createConcat().concatValueOf(fieldReference); } @@ -109,7 +109,7 @@ public class StringOperators { */ public Concat concatValueOf(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return createConcat().concatValueOf(expression); } @@ -122,7 +122,7 @@ public class StringOperators { */ public Concat concat(String value) { - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(value, "Value must not be null"); return createConcat().concat(value); } @@ -184,7 +184,7 @@ public class StringOperators { */ public StrCaseCmp strCaseCmp(String value) { - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(value, "Value must not be null"); return createStrCaseCmp().strcasecmp(value); } @@ -197,7 +197,7 @@ public class StringOperators { */ public StrCaseCmp strCaseCmpValueOf(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return createStrCaseCmp().strcasecmpValueOf(fieldReference); } @@ -210,7 +210,7 @@ public class StringOperators { */ public StrCaseCmp strCaseCmpValueOf(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return createStrCaseCmp().strcasecmpValueOf(expression); } @@ -228,7 +228,7 @@ public class StringOperators { */ public IndexOfBytes indexOf(String substring) { - Assert.notNull(substring, "Substring must not be null!"); + Assert.notNull(substring, "Substring must not be null"); return createIndexOfBytesSubstringBuilder().indexOf(substring); } @@ -242,7 +242,7 @@ public class StringOperators { */ public IndexOfBytes indexOf(Field fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return createIndexOfBytesSubstringBuilder().indexOf(fieldReference); } @@ -256,7 +256,7 @@ public class StringOperators { */ public IndexOfBytes indexOf(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return createIndexOfBytesSubstringBuilder().indexOf(expression); } @@ -274,7 +274,7 @@ public class StringOperators { */ public IndexOfCP indexOfCP(String substring) { - Assert.notNull(substring, "Substring must not be null!"); + Assert.notNull(substring, "Substring must not be null"); return createIndexOfCPSubstringBuilder().indexOf(substring); } @@ -288,7 +288,7 @@ public class StringOperators { */ public IndexOfCP indexOfCP(Field fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return createIndexOfCPSubstringBuilder().indexOf(fieldReference); } @@ -302,7 +302,7 @@ public class StringOperators { */ public IndexOfCP indexOfCP(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return createIndexOfCPSubstringBuilder().indexOf(expression); } @@ -776,7 +776,7 @@ public class StringOperators { */ public static Concat valueOf(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return new Concat(asFields(fieldReference)); } @@ -788,7 +788,7 @@ public class StringOperators { */ public static Concat valueOf(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new Concat(Collections.singletonList(expression)); } @@ -800,7 +800,7 @@ public class StringOperators { */ public static Concat stringValue(String value) { - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(value, "Value must not be null"); return new Concat(Collections.singletonList(value)); } @@ -812,7 +812,7 @@ public class StringOperators { */ public Concat concatValueOf(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return new Concat(append(Fields.field(fieldReference))); } @@ -824,7 +824,7 @@ public class StringOperators { */ public Concat concatValueOf(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new Concat(append(expression)); } @@ -863,7 +863,7 @@ public class StringOperators { */ public static Substr valueOf(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return new Substr(asFields(fieldReference)); } @@ -875,7 +875,7 @@ public class StringOperators { */ public static Substr valueOf(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new Substr(Collections.singletonList(expression)); } @@ -921,7 +921,7 @@ public class StringOperators { */ public static ToLower lowerValueOf(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return new ToLower(Fields.field(fieldReference)); } @@ -933,7 +933,7 @@ public class StringOperators { */ public static ToLower lowerValueOf(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new ToLower(Collections.singletonList(expression)); } @@ -945,7 +945,7 @@ public class StringOperators { */ public static ToLower lower(String value) { - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(value, "Value must not be null"); return new ToLower(value); } } @@ -974,7 +974,7 @@ public class StringOperators { */ public static ToUpper upperValueOf(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return new ToUpper(Fields.field(fieldReference)); } @@ -986,7 +986,7 @@ public class StringOperators { */ public static ToUpper upperValueOf(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new ToUpper(Collections.singletonList(expression)); } @@ -998,7 +998,7 @@ public class StringOperators { */ public static ToUpper upper(String value) { - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(value, "Value must not be null"); return new ToUpper(value); } } @@ -1027,7 +1027,7 @@ public class StringOperators { */ public static StrCaseCmp valueOf(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return new StrCaseCmp(asFields(fieldReference)); } @@ -1039,7 +1039,7 @@ public class StringOperators { */ public static StrCaseCmp valueOf(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new StrCaseCmp(Collections.singletonList(expression)); } @@ -1051,7 +1051,7 @@ public class StringOperators { */ public static StrCaseCmp stringValue(String value) { - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(value, "Value must not be null"); return new StrCaseCmp(Collections.singletonList(value)); } @@ -1061,13 +1061,13 @@ public class StringOperators { public StrCaseCmp strcasecmpValueOf(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return new StrCaseCmp(append(Fields.field(fieldReference))); } public StrCaseCmp strcasecmpValueOf(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new StrCaseCmp(append(expression)); } } @@ -1096,7 +1096,7 @@ public class StringOperators { */ public static SubstringBuilder valueOf(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return new SubstringBuilder(Fields.field(fieldReference)); } @@ -1108,7 +1108,7 @@ public class StringOperators { */ public static SubstringBuilder valueOf(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new SubstringBuilder(expression); } @@ -1186,7 +1186,7 @@ public class StringOperators { */ public static SubstringBuilder valueOf(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return new SubstringBuilder(Fields.field(fieldReference)); } @@ -1198,7 +1198,7 @@ public class StringOperators { */ public static SubstringBuilder valueOf(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new SubstringBuilder(expression); } @@ -1276,7 +1276,7 @@ public class StringOperators { */ public static Split valueOf(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return new Split(asFields(fieldReference)); } @@ -1288,7 +1288,7 @@ public class StringOperators { */ public static Split valueOf(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new Split(Collections.singletonList(expression)); } @@ -1300,7 +1300,7 @@ public class StringOperators { */ public Split split(String delimiter) { - Assert.notNull(delimiter, "Delimiter must not be null!"); + Assert.notNull(delimiter, "Delimiter must not be null"); return new Split(append(delimiter)); } @@ -1312,7 +1312,7 @@ public class StringOperators { */ public Split split(Field fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return new Split(append(fieldReference)); } @@ -1324,7 +1324,7 @@ public class StringOperators { */ public Split split(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new Split(append(expression)); } } @@ -1363,7 +1363,7 @@ public class StringOperators { */ public static StrLenBytes stringLengthOf(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new StrLenBytes(expression); } } @@ -1402,7 +1402,7 @@ public class StringOperators { */ public static StrLenCP stringLengthOfCP(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new StrLenCP(expression); } } @@ -1431,7 +1431,7 @@ public class StringOperators { */ public static SubstrCP valueOf(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return new SubstrCP(asFields(fieldReference)); } @@ -1443,7 +1443,7 @@ public class StringOperators { */ public static SubstrCP valueOf(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new SubstrCP(Collections.singletonList(expression)); } @@ -1478,7 +1478,7 @@ public class StringOperators { */ public static Trim valueOf(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return new Trim(Collections.singletonMap("input", Fields.field(fieldReference))); } @@ -1491,7 +1491,7 @@ public class StringOperators { */ public static Trim valueOf(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new Trim(Collections.singletonMap("input", expression)); } @@ -1503,7 +1503,7 @@ public class StringOperators { */ public Trim chars(String chars) { - Assert.notNull(chars, "Chars must not be null!"); + Assert.notNull(chars, "Chars must not be null"); return new Trim(append("chars", chars)); } @@ -1575,7 +1575,7 @@ public class StringOperators { */ public static LTrim valueOf(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return new LTrim(Collections.singletonMap("input", Fields.field(fieldReference))); } @@ -1588,7 +1588,7 @@ public class StringOperators { */ public static LTrim valueOf(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new LTrim(Collections.singletonMap("input", expression)); } @@ -1600,7 +1600,7 @@ public class StringOperators { */ public LTrim chars(String chars) { - Assert.notNull(chars, "Chars must not be null!"); + Assert.notNull(chars, "Chars must not be null"); return new LTrim(append("chars", chars)); } @@ -1654,7 +1654,7 @@ public class StringOperators { */ public static RTrim valueOf(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return new RTrim(Collections.singletonMap("input", Fields.field(fieldReference))); } @@ -1667,7 +1667,7 @@ public class StringOperators { */ public static RTrim valueOf(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new RTrim(Collections.singletonMap("input", expression)); } @@ -1679,7 +1679,7 @@ public class StringOperators { */ public RTrim chars(String chars) { - Assert.notNull(chars, "Chars must not be null!"); + Assert.notNull(chars, "Chars must not be null"); return new RTrim(append("chars", chars)); } @@ -1732,7 +1732,7 @@ public class StringOperators { */ public static RegexFind valueOf(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return new RegexFind(Collections.singletonMap("input", Fields.field(fieldReference))); } @@ -1746,7 +1746,7 @@ public class StringOperators { */ public static RegexFind valueOf(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new RegexFind(Collections.singletonMap("input", expression)); } @@ -1759,7 +1759,7 @@ public class StringOperators { */ public RegexFind options(String options) { - Assert.notNull(options, "Options must not be null!"); + Assert.notNull(options, "Options must not be null"); return new RegexFind(append("options", options)); } @@ -1773,7 +1773,7 @@ public class StringOperators { */ public RegexFind optionsOf(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return new RegexFind(append("options", Fields.field(fieldReference))); } @@ -1787,7 +1787,7 @@ public class StringOperators { */ public RegexFind optionsOf(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new RegexFind(append("options", expression)); } @@ -1800,7 +1800,7 @@ public class StringOperators { */ public RegexFind regex(String regex) { - Assert.notNull(regex, "Regex must not be null!"); + Assert.notNull(regex, "Regex must not be null"); return new RegexFind(append("regex", regex)); } @@ -1813,7 +1813,7 @@ public class StringOperators { */ public RegexFind pattern(Pattern pattern) { - Assert.notNull(pattern, "Pattern must not be null!"); + Assert.notNull(pattern, "Pattern must not be null"); Map regex = append("regex", pattern.pattern()); regex.put("options", RegexFlags.toRegexOptions(pattern.flags())); @@ -1829,7 +1829,7 @@ public class StringOperators { */ public RegexFind regexOf(String fieldReference) { - Assert.notNull(fieldReference, "fieldReference must not be null!"); + Assert.notNull(fieldReference, "fieldReference must not be null"); return new RegexFind(append("regex", Fields.field(fieldReference))); } @@ -1842,7 +1842,7 @@ public class StringOperators { */ public RegexFind regexOf(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new RegexFind(append("regex", expression)); } @@ -1875,7 +1875,7 @@ public class StringOperators { * @return new instance of {@link RegexFindAll}. */ public static RegexFindAll valueOf(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return new RegexFindAll(Collections.singletonMap("input", Fields.field(fieldReference))); } @@ -1888,7 +1888,7 @@ public class StringOperators { */ public static RegexFindAll valueOf(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new RegexFindAll(Collections.singletonMap("input", expression)); } @@ -1901,7 +1901,7 @@ public class StringOperators { */ public RegexFindAll options(String options) { - Assert.notNull(options, "Options must not be null!"); + Assert.notNull(options, "Options must not be null"); return new RegexFindAll(append("options", options)); } @@ -1915,7 +1915,7 @@ public class StringOperators { */ public RegexFindAll optionsOf(String fieldReference) { - Assert.notNull(fieldReference, "fieldReference must not be null!"); + Assert.notNull(fieldReference, "fieldReference must not be null"); return new RegexFindAll(append("options", Fields.field(fieldReference))); } @@ -1929,7 +1929,7 @@ public class StringOperators { */ public RegexFindAll optionsOf(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new RegexFindAll(append("options", expression)); } @@ -1942,7 +1942,7 @@ public class StringOperators { */ public RegexFindAll pattern(Pattern pattern) { - Assert.notNull(pattern, "Pattern must not be null!"); + Assert.notNull(pattern, "Pattern must not be null"); Map regex = append("regex", pattern.pattern()); regex.put("options", RegexFlags.toRegexOptions(pattern.flags())); @@ -1958,7 +1958,7 @@ public class StringOperators { */ public RegexFindAll regex(String regex) { - Assert.notNull(regex, "Regex must not be null!"); + Assert.notNull(regex, "Regex must not be null"); return new RegexFindAll(append("regex", regex)); } @@ -1971,7 +1971,7 @@ public class StringOperators { */ public RegexFindAll regexOf(String fieldReference) { - Assert.notNull(fieldReference, "fieldReference must not be null!"); + Assert.notNull(fieldReference, "fieldReference must not be null"); return new RegexFindAll(append("regex", Fields.field(fieldReference))); } @@ -1984,7 +1984,7 @@ public class StringOperators { */ public RegexFindAll regexOf(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new RegexFindAll(append("regex", expression)); } @@ -2018,7 +2018,7 @@ public class StringOperators { */ public static RegexMatch valueOf(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return new RegexMatch(Collections.singletonMap("input", Fields.field(fieldReference))); } @@ -2032,7 +2032,7 @@ public class StringOperators { */ public static RegexMatch valueOf(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new RegexMatch(Collections.singletonMap("input", expression)); } @@ -2045,7 +2045,7 @@ public class StringOperators { */ public RegexMatch options(String options) { - Assert.notNull(options, "Options must not be null!"); + Assert.notNull(options, "Options must not be null"); return new RegexMatch(append("options", options)); } @@ -2059,7 +2059,7 @@ public class StringOperators { */ public RegexMatch optionsOf(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return new RegexMatch(append("options", Fields.field(fieldReference))); } @@ -2073,7 +2073,7 @@ public class StringOperators { */ public RegexMatch optionsOf(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new RegexMatch(append("options", expression)); } @@ -2086,7 +2086,7 @@ public class StringOperators { */ public RegexMatch pattern(Pattern pattern) { - Assert.notNull(pattern, "Pattern must not be null!"); + Assert.notNull(pattern, "Pattern must not be null"); Map regex = append("regex", pattern.pattern()); regex.put("options", RegexFlags.toRegexOptions(pattern.flags())); @@ -2102,7 +2102,7 @@ public class StringOperators { */ public RegexMatch regex(String regex) { - Assert.notNull(regex, "Regex must not be null!"); + Assert.notNull(regex, "Regex must not be null"); return new RegexMatch(append("regex", regex)); } @@ -2115,7 +2115,7 @@ public class StringOperators { */ public RegexMatch regexOf(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return new RegexMatch(append("regex", Fields.field(fieldReference))); } @@ -2128,7 +2128,7 @@ public class StringOperators { */ public RegexMatch regexOf(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new RegexMatch(append("regex", expression)); } @@ -2162,7 +2162,7 @@ public class StringOperators { */ public static ReplaceOne value(String value) { - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(value, "Value must not be null"); return new ReplaceOne(Collections.singletonMap("input", value)); } @@ -2176,7 +2176,7 @@ public class StringOperators { */ public static ReplaceOne valueOf(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return new ReplaceOne(Collections.singletonMap("input", Fields.field(fieldReference))); } @@ -2190,7 +2190,7 @@ public class StringOperators { */ public static ReplaceOne valueOf(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new ReplaceOne(Collections.singletonMap("input", expression)); } @@ -2203,7 +2203,7 @@ public class StringOperators { */ public ReplaceOne replacement(String replacement) { - Assert.notNull(replacement, "Replacement must not be null!"); + Assert.notNull(replacement, "Replacement must not be null"); return new ReplaceOne(append("replacement", replacement)); } @@ -2217,7 +2217,7 @@ public class StringOperators { */ public ReplaceOne replacementOf(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return new ReplaceOne(append("replacement", Fields.field(fieldReference))); } @@ -2231,7 +2231,7 @@ public class StringOperators { */ public ReplaceOne replacementOf(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new ReplaceOne(append("replacement", expression)); } @@ -2244,7 +2244,7 @@ public class StringOperators { */ public ReplaceOne find(String value) { - Assert.notNull(value, "Search string must not be null!"); + Assert.notNull(value, "Search string must not be null"); return new ReplaceOne(append("find", value)); } @@ -2257,7 +2257,7 @@ public class StringOperators { */ public ReplaceOne findValueOf(String fieldReference) { - Assert.notNull(fieldReference, "fieldReference must not be null!"); + Assert.notNull(fieldReference, "fieldReference must not be null"); return new ReplaceOne(append("find", fieldReference)); } @@ -2271,7 +2271,7 @@ public class StringOperators { */ public ReplaceOne findValueOf(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new ReplaceOne(append("find", expression)); } @@ -2305,7 +2305,7 @@ public class StringOperators { */ public static ReplaceAll value(String value) { - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(value, "Value must not be null"); return new ReplaceAll(Collections.singletonMap("input", value)); } @@ -2319,7 +2319,7 @@ public class StringOperators { */ public static ReplaceAll valueOf(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return new ReplaceAll(Collections.singletonMap("input", Fields.field(fieldReference))); } @@ -2333,7 +2333,7 @@ public class StringOperators { */ public static ReplaceAll valueOf(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new ReplaceAll(Collections.singletonMap("input", expression)); } @@ -2346,7 +2346,7 @@ public class StringOperators { */ public ReplaceAll replacement(String replacement) { - Assert.notNull(replacement, "Replacement must not be null!"); + Assert.notNull(replacement, "Replacement must not be null"); return new ReplaceAll(append("replacement", replacement)); } @@ -2360,7 +2360,7 @@ public class StringOperators { */ public ReplaceAll replacementValueOf(String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return new ReplaceAll(append("replacement", Fields.field(fieldReference))); } @@ -2374,7 +2374,7 @@ public class StringOperators { */ public ReplaceAll replacementValueOf(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new ReplaceAll(append("replacement", expression)); } @@ -2387,7 +2387,7 @@ public class StringOperators { */ public ReplaceAll find(String value) { - Assert.notNull(value, "Search string must not be null!"); + Assert.notNull(value, "Search string must not be null"); return new ReplaceAll(append("find", value)); } @@ -2400,7 +2400,7 @@ public class StringOperators { */ public ReplaceAll findValueOf(String fieldReference) { - Assert.notNull(fieldReference, "fieldReference must not be null!"); + Assert.notNull(fieldReference, "fieldReference must not be null"); return new ReplaceAll(append("find", fieldReference)); } @@ -2413,7 +2413,7 @@ public class StringOperators { */ public ReplaceAll findValueOf(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new ReplaceAll(append("find", expression)); } diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/TypeBasedAggregationOperationContext.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/TypeBasedAggregationOperationContext.java index 1cd0fd742..c190c5948 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/TypeBasedAggregationOperationContext.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/TypeBasedAggregationOperationContext.java @@ -61,9 +61,9 @@ public class TypeBasedAggregationOperationContext implements AggregationOperatio public TypeBasedAggregationOperationContext(Class type, MappingContext, MongoPersistentProperty> mappingContext, QueryMapper mapper) { - Assert.notNull(type, "Type must not be null!"); - Assert.notNull(mappingContext, "MappingContext must not be null!"); - Assert.notNull(mapper, "QueryMapper must not be null!"); + Assert.notNull(type, "Type must not be null"); + Assert.notNull(mappingContext, "MappingContext must not be null"); + Assert.notNull(mapper, "QueryMapper must not be null"); this.type = type; this.mappingContext = mappingContext; @@ -94,7 +94,7 @@ public class TypeBasedAggregationOperationContext implements AggregationOperatio @Override public Fields getFields(Class type) { - Assert.notNull(type, "Type must not be null!"); + Assert.notNull(type, "Type must not be null"); MongoPersistentEntity entity = mappingContext.getPersistentEntity(type); diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/TypedAggregation.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/TypedAggregation.java index 9c772336a..eba94bcd2 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/TypedAggregation.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/TypedAggregation.java @@ -61,7 +61,7 @@ public class TypedAggregation extends Aggregation { super(operations, options); - Assert.notNull(inputType, "Input type must not be null!"); + Assert.notNull(inputType, "Input type must not be null"); this.inputType = inputType; } @@ -76,7 +76,7 @@ public class TypedAggregation extends Aggregation { public TypedAggregation withOptions(AggregationOptions options) { - Assert.notNull(options, "AggregationOptions must not be null."); + Assert.notNull(options, "AggregationOptions must not be null"); return new TypedAggregation(inputType, pipeline.getOperations(), options); } } diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/UnionWithOperation.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/UnionWithOperation.java index 7e38175a1..4a23ccbc0 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/UnionWithOperation.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/UnionWithOperation.java @@ -51,7 +51,7 @@ public class UnionWithOperation implements AggregationOperation { public UnionWithOperation(String collection, @Nullable AggregationPipeline pipeline, @Nullable Class domainType) { - Assert.notNull(collection, "Collection must not be null!"); + Assert.notNull(collection, "Collection must not be null"); this.collection = collection; this.pipeline = pipeline; @@ -120,7 +120,7 @@ public class UnionWithOperation implements AggregationOperation { */ public UnionWithOperation mapFieldsTo(Class domainType) { - Assert.notNull(domainType, "DomainType must not be null!"); + Assert.notNull(domainType, "DomainType must not be null"); return new UnionWithOperation(collection, pipeline, domainType); } diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/UnsetOperation.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/UnsetOperation.java index 138e69182..7e3a5b4c3 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/UnsetOperation.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/UnsetOperation.java @@ -45,8 +45,8 @@ public class UnsetOperation implements InheritsFieldsAggregationOperation { */ public UnsetOperation(Collection fields) { - Assert.notNull(fields, "Fields must not be null!"); - Assert.noNullElements(fields, "Fields must not contain null values."); + Assert.notNull(fields, "Fields must not be null"); + Assert.noNullElements(fields, "Fields must not contain null values"); this.fields = fields; } diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/UnwindOperation.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/UnwindOperation.java index 6628c6c67..da57620fb 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/UnwindOperation.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/UnwindOperation.java @@ -59,7 +59,7 @@ public class UnwindOperation * @since 1.10 */ public UnwindOperation(Field field, boolean preserveNullAndEmptyArrays) { - Assert.notNull(field, "Field must not be null!"); + Assert.notNull(field, "Field must not be null"); this.field = new ExposedField(field, true); this.arrayIndex = null; @@ -77,8 +77,8 @@ public class UnwindOperation */ public UnwindOperation(Field field, Field arrayIndex, boolean preserveNullAndEmptyArrays) { - Assert.notNull(field, "Field must not be null!"); - Assert.notNull(arrayIndex, "ArrayIndex must not be null!"); + Assert.notNull(field, "Field must not be null"); + Assert.notNull(arrayIndex, "ArrayIndex must not be null"); this.field = new ExposedField(field, true); this.arrayIndex = new ExposedField(arrayIndex, true); @@ -221,7 +221,7 @@ public class UnwindOperation @Override public EmptyArraysBuilder arrayIndex(String field) { - Assert.hasText(field, "'ArrayIndex' must not be null or empty!"); + Assert.hasText(field, "'ArrayIndex' must not be null or empty"); arrayIndex = Fields.field(field); return this; } @@ -236,7 +236,7 @@ public class UnwindOperation @Override public UnwindOperationBuilder path(String path) { - Assert.hasText(path, "'Path' must not be null or empty!"); + Assert.hasText(path, "'Path' must not be null or empty"); field = Fields.field(path); return this; } diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/VariableOperators.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/VariableOperators.java index 46630cf79..c90928900 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/VariableOperators.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/VariableOperators.java @@ -91,9 +91,9 @@ public class VariableOperators { private Map(Object sourceArray, String itemVariableName, AggregationExpression functionToApply) { - Assert.notNull(sourceArray, "SourceArray must not be null!"); - Assert.notNull(itemVariableName, "ItemVariableName must not be null!"); - Assert.notNull(functionToApply, "FunctionToApply must not be null!"); + Assert.notNull(sourceArray, "SourceArray must not be null"); + Assert.notNull(itemVariableName, "ItemVariableName must not be null"); + Assert.notNull(functionToApply, "FunctionToApply must not be null"); this.sourceArray = sourceArray; this.itemVariableName = itemVariableName; @@ -109,21 +109,21 @@ public class VariableOperators { */ public static AsBuilder itemsOf(final String fieldReference) { - Assert.notNull(fieldReference, "FieldReference must not be null!"); + Assert.notNull(fieldReference, "FieldReference must not be null"); return new AsBuilder() { @Override public FunctionBuilder as(final String variableName) { - Assert.notNull(variableName, "VariableName must not be null!"); + Assert.notNull(variableName, "VariableName must not be null"); return new FunctionBuilder() { @Override public Map andApply(final AggregationExpression expression) { - Assert.notNull(expression, "AggregationExpression must not be null!"); + Assert.notNull(expression, "AggregationExpression must not be null"); return new Map(Fields.field(fieldReference), variableName, expression); } }; @@ -141,21 +141,21 @@ public class VariableOperators { */ public static AsBuilder itemsOf(final AggregationExpression source) { - Assert.notNull(source, "AggregationExpression must not be null!"); + Assert.notNull(source, "AggregationExpression must not be null"); return new AsBuilder() { @Override public FunctionBuilder as(final String variableName) { - Assert.notNull(variableName, "VariableName must not be null!"); + Assert.notNull(variableName, "VariableName must not be null"); return new FunctionBuilder() { @Override public Map andApply(final AggregationExpression expression) { - Assert.notNull(expression, "AggregationExpression must not be null!"); + Assert.notNull(expression, "AggregationExpression must not be null"); return new Map(source, variableName, expression); } }; @@ -240,14 +240,14 @@ public class VariableOperators { */ public static LetBuilder define(final Collection variables) { - Assert.notNull(variables, "Variables must not be null!"); + Assert.notNull(variables, "Variables must not be null"); return new LetBuilder() { @Override public Let andApply(final AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new Let(new ArrayList(variables), expression); } }; @@ -261,14 +261,14 @@ public class VariableOperators { */ public static LetBuilder define(final ExpressionVariable... variables) { - Assert.notNull(variables, "Variables must not be null!"); + Assert.notNull(variables, "Variables must not be null"); return new LetBuilder() { @Override public Let andApply(final AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new Let(Arrays.asList(variables), expression); } }; @@ -357,7 +357,7 @@ public class VariableOperators { */ public static ExpressionVariable newVariable(String variableName) { - Assert.notNull(variableName, "VariableName must not be null!"); + Assert.notNull(variableName, "VariableName must not be null"); return new ExpressionVariable(variableName, null); } @@ -369,7 +369,7 @@ public class VariableOperators { */ public ExpressionVariable forExpression(AggregationExpression expression) { - Assert.notNull(expression, "Expression must not be null!"); + Assert.notNull(expression, "Expression must not be null"); return new ExpressionVariable(variableName, expression); } @@ -381,7 +381,7 @@ public class VariableOperators { */ public ExpressionVariable forExpression(Document expressionObject) { - Assert.notNull(expressionObject, "Expression must not be null!"); + Assert.notNull(expressionObject, "Expression must not be null"); return new ExpressionVariable(variableName, expressionObject); } } diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/AbstractMongoConverter.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/AbstractMongoConverter.java index d7fb9e26e..607aa0235 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/AbstractMongoConverter.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/AbstractMongoConverter.java @@ -65,7 +65,7 @@ public abstract class AbstractMongoConverter implements MongoConverter, Initiali */ public void setCustomConversions(CustomConversions conversions) { - Assert.notNull(conversions, "Conversions must not be null!"); + Assert.notNull(conversions, "Conversions must not be null"); this.conversions = conversions; } diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/DefaultDbRefResolver.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/DefaultDbRefResolver.java index 128e99bbb..a0f1b7c75 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/DefaultDbRefResolver.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/DefaultDbRefResolver.java @@ -65,7 +65,7 @@ public class DefaultDbRefResolver extends DefaultReferenceResolver implements Db super(new MongoDatabaseFactoryReferenceLoader(mongoDbFactory), mongoDbFactory.getExceptionTranslator()); - Assert.notNull(mongoDbFactory, "MongoDbFactory translator must not be null!"); + Assert.notNull(mongoDbFactory, "MongoDbFactory translator must not be null"); this.mongoDbFactory = mongoDbFactory; } @@ -74,9 +74,9 @@ public class DefaultDbRefResolver extends DefaultReferenceResolver implements Db public Object resolveDbRef(MongoPersistentProperty property, @Nullable DBRef dbref, DbRefResolverCallback callback, DbRefProxyHandler handler) { - Assert.notNull(property, "Property must not be null!"); - Assert.notNull(callback, "Callback must not be null!"); - Assert.notNull(handler, "Handler must not be null!"); + Assert.notNull(property, "Property must not be null"); + Assert.notNull(callback, "Callback must not be null"); + Assert.notNull(handler, "Handler must not be null"); if (isLazyDbRef(property)) { return createLazyLoadingProxy(property, dbref, callback, handler); @@ -94,8 +94,8 @@ public class DefaultDbRefResolver extends DefaultReferenceResolver implements Db @Override public List bulkFetch(List refs) { - Assert.notNull(mongoDbFactory, "Factory must not be null!"); - Assert.notNull(refs, "DBRef to fetch must not be null!"); + Assert.notNull(mongoDbFactory, "Factory must not be null"); + Assert.notNull(refs, "DBRef to fetch must not be null"); if (refs.isEmpty()) { return Collections.emptyList(); @@ -108,7 +108,7 @@ public class DefaultDbRefResolver extends DefaultReferenceResolver implements Db if (!collection.equals(ref.getCollectionName())) { throw new InvalidDataAccessApiUsageException( - "DBRefs must all target the same collection for bulk fetch operation."); + "DBRefs must all target the same collection for bulk fetch operation"); } ids.add(ref.getId()); @@ -118,7 +118,7 @@ public class DefaultDbRefResolver extends DefaultReferenceResolver implements Db MongoCollection mongoCollection = getCollection(databaseSource); if (LOGGER.isTraceEnabled()) { - LOGGER.trace(String.format("Bulk fetching DBRefs %s from %s.%s.", ids, + LOGGER.trace(String.format("Bulk fetching DBRefs %s from %s.%s", ids, StringUtils.hasText(databaseSource.getDatabaseName()) ? databaseSource.getDatabaseName() : mongoCollection.getNamespace().getDatabaseName(), databaseSource.getCollectionName())); diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/DefaultReferenceResolver.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/DefaultReferenceResolver.java index 4f34057ff..5bd21cdcb 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/DefaultReferenceResolver.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/DefaultReferenceResolver.java @@ -55,8 +55,8 @@ public class DefaultReferenceResolver implements ReferenceResolver { */ public DefaultReferenceResolver(ReferenceLoader referenceLoader, PersistenceExceptionTranslator exceptionTranslator) { - Assert.notNull(referenceLoader, "ReferenceLoader must not be null!"); - Assert.notNull(exceptionTranslator, "ExceptionTranslator must not be null!"); + Assert.notNull(referenceLoader, "ReferenceLoader must not be null"); + Assert.notNull(exceptionTranslator, "ExceptionTranslator must not be null"); this.referenceLoader = referenceLoader; this.proxyFactory = new LazyLoadingProxyFactory(exceptionTranslator); diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/DocumentAccessor.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/DocumentAccessor.java index c320079af..c68f0fbf5 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/DocumentAccessor.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/DocumentAccessor.java @@ -50,10 +50,10 @@ class DocumentAccessor { */ public DocumentAccessor(Bson document) { - Assert.notNull(document, "Document must not be null!"); + Assert.notNull(document, "Document must not be null"); if (!(document instanceof Document) && !(document instanceof DBObject)) { - Assert.isInstanceOf(Document.class, document, "Given Bson must be a Document or DBObject!"); + Assert.isInstanceOf(Document.class, document, "Given Bson must be a Document or DBObject"); } this.document = document; @@ -90,7 +90,7 @@ class DocumentAccessor { */ public void put(MongoPersistentProperty prop, @Nullable Object value) { - Assert.notNull(prop, "MongoPersistentProperty must not be null!"); + Assert.notNull(prop, "MongoPersistentProperty must not be null"); String fieldName = getFieldName(prop); if (!fieldName.contains(".")) { @@ -148,7 +148,7 @@ class DocumentAccessor { @SuppressWarnings("unchecked") public boolean hasValue(MongoPersistentProperty property) { - Assert.notNull(property, "Property must not be null!"); + Assert.notNull(property, "Property must not be null"); return BsonUtils.hasValue(document, getFieldName(property)); } diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/DocumentPointerFactory.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/DocumentPointerFactory.java index 51faa3d60..5695b5dc0 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/DocumentPointerFactory.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/DocumentPointerFactory.java @@ -205,7 +205,7 @@ class DocumentPointerFactory { if (entry.getKey().startsWith("$")) { throw new InvalidDataAccessApiUsageException(String.format( - "Cannot derive document pointer from lookup '%s' using query operator (%s). Please consider registering a custom converter.", + "Cannot derive document pointer from lookup '%s' using query operator (%s); Please consider registering a custom converter", lookup, entry.getKey())); } diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/GeoConverters.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/GeoConverters.java index 12921a140..4e4ea3ba9 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/GeoConverters.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/GeoConverters.java @@ -260,15 +260,15 @@ abstract class GeoConverters { Document center = (Document) source.get("center"); Number radius = (Number) source.get("radius"); - Assert.notNull(center, "Center must not be null!"); - Assert.notNull(radius, "Radius must not be null!"); + Assert.notNull(center, "Center must not be null"); + Assert.notNull(radius, "Radius must not be null"); Distance distance = new Distance(toPrimitiveDoubleValue(radius)); if (source.containsKey("metric")) { String metricString = (String) source.get("metric"); - Assert.notNull(metricString, "Metric must not be null!"); + Assert.notNull(metricString, "Metric must not be null"); distance = distance.in(Metrics.valueOf(metricString)); } @@ -323,15 +323,15 @@ abstract class GeoConverters { Document center = (Document) source.get("center"); Number radius = (Number) source.get("radius"); - Assert.notNull(center, "Center must not be null!"); - Assert.notNull(radius, "Radius must not be null!"); + Assert.notNull(center, "Center must not be null"); + Assert.notNull(radius, "Radius must not be null"); Distance distance = new Distance(toPrimitiveDoubleValue(radius)); if (source.containsKey("metric")) { String metricString = (String) source.get("metric"); - Assert.notNull(metricString, "Metric must not be null!"); + Assert.notNull(metricString, "Metric must not be null"); distance = distance.in(Metrics.valueOf(metricString)); } @@ -394,7 +394,7 @@ abstract class GeoConverters { for (Document element : points) { - Assert.notNull(element, "Point elements of polygon must not be null!"); + Assert.notNull(element, "Point elements of polygon must not be null"); newPoints.add(DocumentToPointConverter.INSTANCE.convert(element)); } @@ -559,7 +559,7 @@ abstract class GeoConverters { } Assert.isTrue(ObjectUtils.nullSafeEquals(source.get("type"), "Point"), - String.format("Cannot convert type '%s' to Point.", source.get("type"))); + String.format("Cannot convert type '%s' to Point", source.get("type"))); List dbl = (List) source.get("coordinates"); return new GeoJsonPoint(toPrimitiveDoubleValue(dbl.get(0)), toPrimitiveDoubleValue(dbl.get(1))); @@ -582,7 +582,7 @@ abstract class GeoConverters { } Assert.isTrue(ObjectUtils.nullSafeEquals(source.get("type"), "Polygon"), - String.format("Cannot convert type '%s' to Polygon.", source.get("type"))); + String.format("Cannot convert type '%s' to Polygon", source.get("type"))); return toGeoJsonPolygon((List) source.get("coordinates")); } @@ -604,7 +604,7 @@ abstract class GeoConverters { } Assert.isTrue(ObjectUtils.nullSafeEquals(source.get("type"), "MultiPolygon"), - String.format("Cannot convert type '%s' to MultiPolygon.", source.get("type"))); + String.format("Cannot convert type '%s' to MultiPolygon", source.get("type"))); List dbl = (List) source.get("coordinates"); List polygones = new ArrayList<>(); @@ -633,7 +633,7 @@ abstract class GeoConverters { } Assert.isTrue(ObjectUtils.nullSafeEquals(source.get("type"), "LineString"), - String.format("Cannot convert type '%s' to LineString.", source.get("type"))); + String.format("Cannot convert type '%s' to LineString", source.get("type"))); List cords = (List) source.get("coordinates"); @@ -657,7 +657,7 @@ abstract class GeoConverters { } Assert.isTrue(ObjectUtils.nullSafeEquals(source.get("type"), "MultiPoint"), - String.format("Cannot convert type '%s' to MultiPoint.", source.get("type"))); + String.format("Cannot convert type '%s' to MultiPoint", source.get("type"))); List cords = (List) source.get("coordinates"); @@ -681,7 +681,7 @@ abstract class GeoConverters { } Assert.isTrue(ObjectUtils.nullSafeEquals(source.get("type"), "MultiLineString"), - String.format("Cannot convert type '%s' to MultiLineString.", source.get("type"))); + String.format("Cannot convert type '%s' to MultiLineString", source.get("type"))); List lines = new ArrayList(); List cords = (List) source.get("coordinates"); @@ -710,7 +710,7 @@ abstract class GeoConverters { } Assert.isTrue(ObjectUtils.nullSafeEquals(source.get("type"), "GeometryCollection"), - String.format("Cannot convert type '%s' to GeometryCollection.", source.get("type"))); + String.format("Cannot convert type '%s' to GeometryCollection", source.get("type"))); List> geometries = new ArrayList<>(); for (Object o : (List) source.get("geometries")) { @@ -793,12 +793,12 @@ abstract class GeoConverters { } throw new IllegalArgumentException( - String.format("No converter found capable of converting GeoJson type %s.", type)); + String.format("No converter found capable of converting GeoJson type %s", type)); } private static double toPrimitiveDoubleValue(Object value) { - Assert.isInstanceOf(Number.class, value, "Argument must be a Number."); + Assert.isInstanceOf(Number.class, value, "Argument must be a Number"); return NumberUtils.convertNumberToTargetClass((Number) value, Double.class).doubleValue(); } } diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/LazyLoadingProxyFactory.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/LazyLoadingProxyFactory.java index 1b1bb8ad0..f4fc367e3 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/LazyLoadingProxyFactory.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/LazyLoadingProxyFactory.java @@ -291,10 +291,10 @@ class LazyLoadingProxyFactory { DataAccessException translatedException = exceptionTranslator.translateExceptionIfPossible(ex); if (translatedException instanceof ClientSessionException) { - throw new LazyLoadingException("Unable to lazily resolve DBRef! Invalid session state.", ex); + throw new LazyLoadingException("Unable to lazily resolve DBRef; Invalid session state", ex); } - throw new LazyLoadingException("Unable to lazily resolve DBRef!", + throw new LazyLoadingException("Unable to lazily resolve DBRef", translatedException != null ? translatedException : ex); } } diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/MappingMongoConverter.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/MappingMongoConverter.java index 9c4582102..9cdb5d9ce 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/MappingMongoConverter.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/MappingMongoConverter.java @@ -110,8 +110,8 @@ import com.mongodb.DBRef; */ public class MappingMongoConverter extends AbstractMongoConverter implements ApplicationContextAware { - private static final String INCOMPATIBLE_TYPES = "Cannot convert %1$s of type %2$s into an instance of %3$s! Implement a custom Converter<%2$s, %3$s> and register it with the CustomConversions. Parent object was: %4$s"; - private static final String INVALID_TYPE_TO_READ = "Expected to read Document %s into type %s but didn't find a PersistentEntity for the latter!"; + private static final String INCOMPATIBLE_TYPES = "Cannot convert %1$s of type %2$s into an instance of %3$s; Implement a custom Converter<%2$s, %3$s> and register it with the CustomConversions; Parent object was: %4$s"; + private static final String INVALID_TYPE_TO_READ = "Expected to read Document %s into type %s but didn't find a PersistentEntity for the latter"; public static final ClassTypeInformation BSON = ClassTypeInformation.from(Bson.class); @@ -145,8 +145,8 @@ public class MappingMongoConverter extends AbstractMongoConverter implements App super(new DefaultConversionService()); - Assert.notNull(dbRefResolver, "DbRefResolver must not be null!"); - Assert.notNull(mappingContext, "MappingContext must not be null!"); + Assert.notNull(dbRefResolver, "DbRefResolver must not be null"); + Assert.notNull(mappingContext, "MappingContext must not be null"); this.dbRefResolver = dbRefResolver; @@ -281,7 +281,7 @@ public class MappingMongoConverter extends AbstractMongoConverter implements App */ public void setEntityCallbacks(EntityCallbacks entityCallbacks) { - Assert.notNull(entityCallbacks, "EntityCallbacks must not be null!"); + Assert.notNull(entityCallbacks, "EntityCallbacks must not be null"); this.entityCallbacks = entityCallbacks; } @@ -731,7 +731,7 @@ public class MappingMongoConverter extends AbstractMongoConverter implements App if (referringProperty != null) { annotation = referringProperty.getDBRef(); - Assert.isTrue(annotation != null, "The referenced property has to be mapped with @DBRef!"); + Assert.isTrue(annotation != null, "The referenced property has to be mapped with @DBRef"); } // DATAMONGO-913 @@ -749,7 +749,7 @@ public class MappingMongoConverter extends AbstractMongoConverter implements App return () -> ((LazyLoadingProxy) source).getSource(); } - Assert.notNull(referringProperty, "Cannot create DocumentReference. The referringProperty must not be null!"); + Assert.notNull(referringProperty, "Cannot create DocumentReference; The referringProperty must not be null"); if (referringProperty.isDbReference()) { return () -> toDBRef(source, referringProperty); @@ -1070,8 +1070,8 @@ public class MappingMongoConverter extends AbstractMongoConverter implements App */ protected Bson createMap(Map map, MongoPersistentProperty property) { - Assert.notNull(map, "Given map must not be null!"); - Assert.notNull(property, "PersistentProperty must not be null!"); + Assert.notNull(map, "Given map must not be null"); + Assert.notNull(property, "PersistentProperty must not be null"); if (!property.isAssociation()) { return writeMapInternal(map, new Document(), property.getTypeInformation()); @@ -1095,7 +1095,7 @@ public class MappingMongoConverter extends AbstractMongoConverter implements App } } else { - throw new MappingException("Cannot use a complex object as a key value."); + throw new MappingException("Cannot use a complex object as a key value"); } } @@ -1170,7 +1170,7 @@ public class MappingMongoConverter extends AbstractMongoConverter implements App BsonUtils.addToMap(bson, simpleKey, document); } } else { - throw new MappingException("Cannot use a complex object as a key value."); + throw new MappingException("Cannot use a complex object as a key value"); } } @@ -1185,7 +1185,7 @@ public class MappingMongoConverter extends AbstractMongoConverter implements App */ private String prepareMapKey(Object key) { - Assert.notNull(key, "Map key must not be null!"); + Assert.notNull(key, "Map key must not be null"); String convertedKey = potentiallyConvertMapKey(key); return potentiallyEscapeMapKey(convertedKey); @@ -1206,8 +1206,8 @@ public class MappingMongoConverter extends AbstractMongoConverter implements App if (mapKeyDotReplacement == null) { throw new MappingException(String.format( - "Map key %s contains dots but no replacement was configured! Make " - + "sure map keys don't contain dots in the first place or configure an appropriate replacement!", + "Map key %s contains dots but no replacement was configured; Make" + + " sure map keys don't contain dots in the first place or configure an appropriate replacement", source)); } @@ -1357,7 +1357,7 @@ public class MappingMongoConverter extends AbstractMongoConverter implements App protected DBRef createDBRef(Object target, @Nullable MongoPersistentProperty property) { - Assert.notNull(target, "Target object must not be null!"); + Assert.notNull(target, "Target object must not be null"); if (target instanceof DBRef) { return (DBRef) target; @@ -1380,7 +1380,7 @@ public class MappingMongoConverter extends AbstractMongoConverter implements App : entity.getPropertyAccessor(target).getProperty(idProperty); if (null == id) { - throw new MappingException("Cannot create a reference to an object with a NULL id."); + throw new MappingException("Cannot create a reference to an object with a NULL id"); } return dbRefResolver.createDbRef(property == null ? null : property.getDBRef(), entity, @@ -1410,7 +1410,7 @@ public class MappingMongoConverter extends AbstractMongoConverter implements App protected Object readCollectionOrArray(ConversionContext context, Collection source, TypeInformation targetType) { - Assert.notNull(targetType, "Target type must not be null!"); + Assert.notNull(targetType, "Target type must not be null"); Class collectionType = targetType.isSubTypeOf(Collection.class) // ? targetType.getType() // @@ -1454,8 +1454,8 @@ public class MappingMongoConverter extends AbstractMongoConverter implements App */ protected Map readMap(ConversionContext context, Bson bson, TypeInformation targetType) { - Assert.notNull(bson, "Document must not be null!"); - Assert.notNull(targetType, "TypeInformation must not be null!"); + Assert.notNull(bson, "Document must not be null"); + Assert.notNull(targetType, "TypeInformation must not be null"); Class mapType = getTypeMapper().readType(bson, targetType).getType(); @@ -1836,7 +1836,7 @@ public class MappingMongoConverter extends AbstractMongoConverter implements App */ private static boolean isCollectionOfDbRefWhereBulkFetchIsPossible(Iterable source) { - Assert.notNull(source, "Iterable of DBRefs must not be null!"); + Assert.notNull(source, "Iterable of DBRefs must not be null"); Set collectionsFound = new HashSet<>(); @@ -1901,9 +1901,9 @@ public class MappingMongoConverter extends AbstractMongoConverter implements App MongoDbPropertyValueProvider(ConversionContext context, DocumentAccessor accessor, SpELExpressionEvaluator evaluator) { - Assert.notNull(context, "ConversionContext must no be null!"); - Assert.notNull(accessor, "DocumentAccessor must no be null!"); - Assert.notNull(evaluator, "SpELExpressionEvaluator must not be null!"); + Assert.notNull(context, "ConversionContext must no be null"); + Assert.notNull(accessor, "DocumentAccessor must no be null"); + Assert.notNull(evaluator, "SpELExpressionEvaluator must not be null"); this.context = context; this.accessor = accessor; @@ -2011,7 +2011,7 @@ public class MappingMongoConverter extends AbstractMongoConverter implements App super(evaluator, conversionService, delegate); - Assert.notNull(context, "ConversionContext must no be null!"); + Assert.notNull(context, "ConversionContext must no be null"); this.context = context; } diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/MongoConverter.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/MongoConverter.java index 489b3ddfb..f88e3195b 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/MongoConverter.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/MongoConverter.java @@ -103,8 +103,8 @@ public interface MongoConverter @Nullable default T mapValueToTargetType(S source, Class targetType, DbRefResolver dbRefResolver) { - Assert.notNull(targetType, "TargetType must not be null!"); - Assert.notNull(dbRefResolver, "DbRefResolver must not be null!"); + Assert.notNull(targetType, "TargetType must not be null"); + Assert.notNull(dbRefResolver, "DbRefResolver must not be null"); if (targetType != Object.class && ClassUtils.isAssignable(targetType, source.getClass())) { return (T) source; diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/MongoConverters.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/MongoConverters.java index 3e083f5df..8b7ccc2f4 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/MongoConverters.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/MongoConverters.java @@ -393,7 +393,7 @@ abstract class MongoConverters { */ public NumberToNumberConverter(Class targetType) { - Assert.notNull(targetType, "Target type must not be null!"); + Assert.notNull(targetType, "Target type must not be null"); this.targetType = targetType; } diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/MongoCustomConversions.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/MongoCustomConversions.java index b89d5590f..64eb42ab7 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/MongoCustomConversions.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/MongoCustomConversions.java @@ -225,7 +225,7 @@ public class MongoCustomConversions extends org.springframework.data.convert.Cus */ public MongoConverterConfigurationAdapter registerConverter(Converter converter) { - Assert.notNull(converter, "Converter must not be null!"); + Assert.notNull(converter, "Converter must not be null"); customConverters.add(converter); return this; } @@ -241,7 +241,7 @@ public class MongoCustomConversions extends org.springframework.data.convert.Cus Consumer> configurationAdapter) { Assert.state(valueConversions() instanceof SimplePropertyValueConversions, - "Configured PropertyValueConversions does not allow setting custom ConverterRegistry."); + "Configured PropertyValueConversions does not allow setting custom ConverterRegistry"); PropertyValueConverterRegistrar propertyValueConverterRegistrar = new PropertyValueConverterRegistrar(); configurationAdapter.accept(propertyValueConverterRegistrar); @@ -259,7 +259,7 @@ public class MongoCustomConversions extends org.springframework.data.convert.Cus */ public MongoConverterConfigurationAdapter registerConverterFactory(ConverterFactory converterFactory) { - Assert.notNull(converterFactory, "ConverterFactory must not be null!"); + Assert.notNull(converterFactory, "ConverterFactory must not be null"); customConverters.add(converterFactory); return this; } @@ -274,7 +274,7 @@ public class MongoCustomConversions extends org.springframework.data.convert.Cus public MongoConverterConfigurationAdapter registerConverters(Collection converters) { Assert.notNull(converters, "Converters must not be null"); - Assert.noNullElements(converters, "Converters must not be null nor contain null values!"); + Assert.noNullElements(converters, "Converters must not be null nor contain null values"); customConverters.addAll(converters); return this; @@ -292,7 +292,7 @@ public class MongoCustomConversions extends org.springframework.data.convert.Cus PropertyValueConverterFactory converterFactory) { Assert.state(valueConversions() instanceof SimplePropertyValueConversions, - "Configured PropertyValueConversions does not allow setting custom ConverterRegistry."); + "Configured PropertyValueConversions does not allow setting custom ConverterRegistry"); ((SimplePropertyValueConversions) valueConversions()).setConverterFactory(converterFactory); return this; diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/MongoDatabaseFactoryReferenceLoader.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/MongoDatabaseFactoryReferenceLoader.java index a8b1bea11..f1f0c5c57 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/MongoDatabaseFactoryReferenceLoader.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/MongoDatabaseFactoryReferenceLoader.java @@ -45,7 +45,7 @@ public class MongoDatabaseFactoryReferenceLoader implements ReferenceLoader { */ public MongoDatabaseFactoryReferenceLoader(MongoDatabaseFactory mongoDbFactory) { - Assert.notNull(mongoDbFactory, "MongoDbFactory translator must not be null!"); + Assert.notNull(mongoDbFactory, "MongoDbFactory translator must not be null"); this.mongoDbFactory = mongoDbFactory; } @@ -56,7 +56,7 @@ public class MongoDatabaseFactoryReferenceLoader implements ReferenceLoader { MongoCollection collection = getCollection(context); if (LOGGER.isTraceEnabled()) { - LOGGER.trace(String.format("Bulk fetching %s from %s.%s.", referenceQuery, + LOGGER.trace(String.format("Bulk fetching %s from %s.%s", referenceQuery, StringUtils.hasText(context.getDatabase()) ? context.getDatabase() : collection.getNamespace().getDatabaseName(), context.getCollection())); diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/MongoExampleMapper.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/MongoExampleMapper.java index c51cd6483..0719a57ea 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/MongoExampleMapper.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/MongoExampleMapper.java @@ -84,7 +84,7 @@ public class MongoExampleMapper { */ public Document getMappedExample(Example example) { - Assert.notNull(example, "Example must not be null!"); + Assert.notNull(example, "Example must not be null"); return getMappedExample(example, mappingContext.getRequiredPersistentEntity(example.getProbeType())); } @@ -99,8 +99,8 @@ public class MongoExampleMapper { */ public Document getMappedExample(Example example, MongoPersistentEntity entity) { - Assert.notNull(example, "Example must not be null!"); - Assert.notNull(entity, "MongoPersistentEntity must not be null!"); + Assert.notNull(example, "Example must not be null"); + Assert.notNull(entity, "MongoPersistentEntity must not be null"); Document reference = (Document) converter.convertToMongoType(example.getProbe()); diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/MongoJsonSchemaMapper.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/MongoJsonSchemaMapper.java index a5e3d0940..dba9e5382 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/MongoJsonSchemaMapper.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/MongoJsonSchemaMapper.java @@ -54,7 +54,7 @@ public class MongoJsonSchemaMapper implements JsonSchemaMapper { */ public MongoJsonSchemaMapper(MongoConverter converter) { - Assert.notNull(converter, "Converter must not be null!"); + Assert.notNull(converter, "Converter must not be null"); this.converter = converter; this.mappingContext = converter.getMappingContext(); @@ -62,10 +62,10 @@ public class MongoJsonSchemaMapper implements JsonSchemaMapper { public Document mapSchema(Document jsonSchema, Class type) { - Assert.notNull(jsonSchema, "Schema must not be null!"); - Assert.notNull(type, "Type must not be null! Please consider Object.class."); + Assert.notNull(jsonSchema, "Schema must not be null"); + Assert.notNull(type, "Type must not be null Please consider Object.class"); Assert.isTrue(jsonSchema.containsKey($JSON_SCHEMA), - () -> String.format("Document does not contain $jsonSchema field. Found %s.", jsonSchema)); + () -> String.format("Document does not contain $jsonSchema field; Found: %s", jsonSchema)); if (Object.class.equals(type)) { return new Document(jsonSchema); diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/NoOpDbRefResolver.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/NoOpDbRefResolver.java index 4ea3bde61..599583f2a 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/NoOpDbRefResolver.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/NoOpDbRefResolver.java @@ -56,7 +56,7 @@ public enum NoOpDbRefResolver implements DbRefResolver { } private T handle() throws UnsupportedOperationException { - throw new UnsupportedOperationException("DBRef resolution is not supported!"); + throw new UnsupportedOperationException("DBRef resolution is not supported"); } @Nullable diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/ObjectPath.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/ObjectPath.java index 3da4502ff..0457e1866 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/ObjectPath.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/ObjectPath.java @@ -83,8 +83,8 @@ class ObjectPath { */ ObjectPath push(Object object, MongoPersistentEntity entity, @Nullable Object id) { - Assert.notNull(object, "Object must not be null!"); - Assert.notNull(entity, "MongoPersistentEntity must not be null!"); + Assert.notNull(object, "Object must not be null"); + Assert.notNull(entity, "MongoPersistentEntity must not be null"); return new ObjectPath(this, object, id, Lazy.of(entity::getCollection)); } @@ -102,9 +102,9 @@ class ObjectPath { @Nullable T getPathItem(Object id, String collection, Class type) { - Assert.notNull(id, "Id must not be null!"); - Assert.hasText(collection, "Collection name must not be null!"); - Assert.notNull(type, "Type must not be null!"); + Assert.notNull(id, "Id must not be null"); + Assert.hasText(collection, "Collection name must not be null"); + Assert.notNull(type, "Type must not be null"); for (ObjectPath current = this; current != null; current = current.parent) { diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/QueryMapper.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/QueryMapper.java index 2a6e7fb4a..cc154ee34 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/QueryMapper.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/QueryMapper.java @@ -97,7 +97,7 @@ public class QueryMapper { */ public QueryMapper(MongoConverter converter) { - Assert.notNull(converter, "MongoConverter must not be null!"); + Assert.notNull(converter, "MongoConverter must not be null"); this.conversionService = converter.getConversionService(); this.converter = converter; @@ -190,7 +190,7 @@ public class QueryMapper { */ public Document getMappedSort(Document sortObject, @Nullable MongoPersistentEntity entity) { - Assert.notNull(sortObject, "SortObject must not be null!"); + Assert.notNull(sortObject, "SortObject must not be null"); if (sortObject.isEmpty()) { return BsonUtils.EMPTY_DOCUMENT; @@ -211,7 +211,7 @@ public class QueryMapper { */ public Document getMappedFields(Document fieldsObject, @Nullable MongoPersistentEntity entity) { - Assert.notNull(fieldsObject, "FieldsObject must not be null!"); + Assert.notNull(fieldsObject, "FieldsObject must not be null"); Document mappedFields = mapFieldsToPropertyNames(fieldsObject, entity); return mapMetaAttributes(mappedFields, entity, MetaMapping.FORCE); @@ -516,7 +516,7 @@ public class QueryMapper { */ protected boolean isAssociationConversionNecessary(Field documentField, @Nullable Object value) { - Assert.notNull(documentField, "Document field must not be null!"); + Assert.notNull(documentField, "Document field must not be null"); if (value == null) { return false; @@ -707,7 +707,7 @@ public class QueryMapper { */ private Entry createMapEntry(String key, @Nullable Object value) { - Assert.hasText(key, "Key must not be null or empty!"); + Assert.hasText(key, "Key must not be null or empty"); return new AbstractMap.SimpleEntry<>(key, value); } @@ -853,7 +853,7 @@ public class QueryMapper { public Keyword(Bson bson) { Map map = BsonUtils.asMap(bson); - Assert.isTrue(map.size() == 1, "Can only use a single value Document!"); + Assert.isTrue(map.size() == 1, "Can only use a single value Document"); Set> entries = map.entrySet(); Entry entry = entries.iterator().next(); @@ -947,7 +947,7 @@ public class QueryMapper { */ public Field(String name) { - Assert.hasText(name, "Name must not be null!"); + Assert.hasText(name, "Name must not be null"); this.name = name; } @@ -1055,7 +1055,7 @@ public class QueryMapper { private static final Pattern POSITIONAL_PARAMETER_PATTERN = Pattern.compile("\\.\\$(\\[.*?\\])?"); private static final Pattern DOT_POSITIONAL_PATTERN = Pattern.compile("\\.\\d+(?!$)"); - private static final String INVALID_ASSOCIATION_REFERENCE = "Invalid path reference %s! Associations can only be pointed to directly or via their id property!"; + private static final String INVALID_ASSOCIATION_REFERENCE = "Invalid path reference %s; Associations can only be pointed to directly or via their id property"; private final MongoPersistentEntity entity; private final MappingContext, MongoPersistentProperty> mappingContext; @@ -1091,7 +1091,7 @@ public class QueryMapper { super(name); - Assert.notNull(entity, "MongoPersistentEntity must not be null!"); + Assert.notNull(entity, "MongoPersistentEntity must not be null"); this.entity = entity; this.mappingContext = context; @@ -1213,7 +1213,7 @@ public class QueryMapper { String types = StringUtils.collectionToDelimitedString( path.stream().map(it -> it.getType().getSimpleName()).collect(Collectors.toList()), " -> "); QueryMapper.LOGGER.info(String.format( - "Could not map '%s'. Maybe a fragment in '%s' is considered a simple type. Mapper continues with %s.", + "Could not map '%s'; Maybe a fragment in '%s' is considered a simple type; Mapper continues with %s", path, types, pathExpression)); } return null; @@ -1457,7 +1457,7 @@ public class QueryMapper { */ public AssociationConverter(String name, Association association) { - Assert.notNull(association, "Association must not be null!"); + Assert.notNull(association, "Association must not be null"); this.property = association.getInverse(); this.name = name; } diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/ReferenceResolver.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/ReferenceResolver.java index 67d13207a..31be6fccc 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/ReferenceResolver.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/ReferenceResolver.java @@ -65,7 +65,7 @@ public interface ReferenceResolver { */ public ReferenceCollection(@Nullable String database, String collection) { - Assert.hasText(collection, "Collection must not be empty or null!"); + Assert.hasText(collection, "Collection must not be empty or null"); this.database = database; this.collection = collection; diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/UpdateMapper.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/UpdateMapper.java index 9f6d12071..38852e4ff 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/UpdateMapper.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/UpdateMapper.java @@ -175,7 +175,7 @@ public class UpdateMapper extends QueryMapper { value = modificationOperations; } else { - throw new IllegalArgumentException(String.format("Unable to map value of type '%s'!", rawValue.getClass())); + throw new IllegalArgumentException(String.format("Unable to map value of type '%s'", rawValue.getClass())); } return createMapEntry(field, value); diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/geo/GeoJsonGeometryCollection.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/geo/GeoJsonGeometryCollection.java index 72c1214b4..f941a6a1b 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/geo/GeoJsonGeometryCollection.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/geo/GeoJsonGeometryCollection.java @@ -42,7 +42,7 @@ public class GeoJsonGeometryCollection implements GeoJson>> */ public GeoJsonGeometryCollection(List> geometries) { - Assert.notNull(geometries, "Geometries must not be null!"); + Assert.notNull(geometries, "Geometries must not be null"); this.geometries.addAll(geometries); } diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/geo/GeoJsonMultiLineString.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/geo/GeoJsonMultiLineString.java index 5b30580f9..2c42d3a24 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/geo/GeoJsonMultiLineString.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/geo/GeoJsonMultiLineString.java @@ -43,7 +43,7 @@ public class GeoJsonMultiLineString implements GeoJson... lines) { - Assert.notEmpty(lines, "Points for MultiLineString must not be null!"); + Assert.notEmpty(lines, "Points for MultiLineString must not be null"); for (List line : lines) { this.coordinates.add(new GeoJsonLineString(line)); @@ -57,7 +57,7 @@ public class GeoJsonMultiLineString implements GeoJson lines) { - Assert.notNull(lines, "Lines for MultiLineString must not be null!"); + Assert.notNull(lines, "Lines for MultiLineString must not be null"); this.coordinates.addAll(lines); } diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/geo/GeoJsonMultiPoint.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/geo/GeoJsonMultiPoint.java index 45a44d742..07236be11 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/geo/GeoJsonMultiPoint.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/geo/GeoJsonMultiPoint.java @@ -46,7 +46,7 @@ public class GeoJsonMultiPoint implements GeoJson> { */ public GeoJsonMultiPoint(Point point) { - Assert.notNull(point, "Point must not be null!"); + Assert.notNull(point, "Point must not be null"); this.points = new ArrayList<>(); this.points.add(point); @@ -59,8 +59,8 @@ public class GeoJsonMultiPoint implements GeoJson> { */ public GeoJsonMultiPoint(List points) { - Assert.notNull(points, "Points must not be null!"); - Assert.notEmpty(points, "Points must contain at least one point!"); + Assert.notNull(points, "Points must not be null"); + Assert.notEmpty(points, "Points must contain at least one point"); this.points = new ArrayList<>(points); } @@ -74,9 +74,9 @@ public class GeoJsonMultiPoint implements GeoJson> { */ public GeoJsonMultiPoint(Point first, Point second, Point... others) { - Assert.notNull(first, "First point must not be null!"); - Assert.notNull(second, "Second point must not be null!"); - Assert.notNull(others, "Additional points must not be null!"); + Assert.notNull(first, "First point must not be null"); + Assert.notNull(second, "Second point must not be null"); + Assert.notNull(others, "Additional points must not be null"); this.points = new ArrayList<>(); this.points.add(first); diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/geo/GeoJsonMultiPolygon.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/geo/GeoJsonMultiPolygon.java index 18f69070a..79e04c13f 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/geo/GeoJsonMultiPolygon.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/geo/GeoJsonMultiPolygon.java @@ -41,7 +41,7 @@ public class GeoJsonMultiPolygon implements GeoJson> { */ public GeoJsonMultiPolygon(List polygons) { - Assert.notNull(polygons, "Polygons for MultiPolygon must not be null!"); + Assert.notNull(polygons, "Polygons for MultiPolygon must not be null"); this.coordinates.addAll(polygons); } diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/geo/GeoJsonPolygon.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/geo/GeoJsonPolygon.java index 6a17301ec..e192fedec 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/geo/GeoJsonPolygon.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/geo/GeoJsonPolygon.java @@ -99,7 +99,7 @@ public class GeoJsonPolygon extends Polygon implements GeoJson it = this.coordinates.iterator(); GeoJsonPolygon polygon = new GeoJsonPolygon(it.next().getCoordinates()); diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/geo/Sphere.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/geo/Sphere.java index 80e7a3bf3..e0bdcd4a8 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/geo/Sphere.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/geo/Sphere.java @@ -47,9 +47,9 @@ public class Sphere implements Shape { @PersistenceConstructor public Sphere(Point center, Distance radius) { - Assert.notNull(center, "Center point must not be null!"); - Assert.notNull(radius, "Radius must not be null!"); - Assert.isTrue(radius.getValue() >= 0, "Radius must not be negative!"); + Assert.notNull(center, "Center point must not be null"); + Assert.notNull(radius, "Radius must not be null"); + Assert.isTrue(radius.getValue() >= 0, "Radius must not be negative"); this.center = center; this.radius = radius; diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/index/CompoundIndexDefinition.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/index/CompoundIndexDefinition.java index 69af7c0a6..9e5074c33 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/index/CompoundIndexDefinition.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/index/CompoundIndexDefinition.java @@ -35,7 +35,7 @@ public class CompoundIndexDefinition extends Index { */ public CompoundIndexDefinition(Document keys) { - Assert.notNull(keys, "Keys must not be null!"); + Assert.notNull(keys, "Keys must not be null"); this.keys = keys; } diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/index/GeospatialIndex.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/index/GeospatialIndex.java index d890794f6..bfaef3b8d 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/index/GeospatialIndex.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/index/GeospatialIndex.java @@ -52,7 +52,7 @@ public class GeospatialIndex implements IndexDefinition { */ public GeospatialIndex(String field) { - Assert.hasText(field, "Field must have text!"); + Assert.hasText(field, "Field must have text"); this.field = field; } @@ -100,7 +100,7 @@ public class GeospatialIndex implements IndexDefinition { */ public GeospatialIndex typed(GeoSpatialIndexType type) { - Assert.notNull(type, "Type must not be null!"); + Assert.notNull(type, "Type must not be null"); this.type = type; return this; diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/index/HashedIndex.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/index/HashedIndex.java index 45f4c4dc6..d596b2deb 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/index/HashedIndex.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/index/HashedIndex.java @@ -32,7 +32,7 @@ public class HashedIndex implements IndexDefinition { private HashedIndex(String field) { - Assert.hasText(field, "Field must not be null nor empty!"); + Assert.hasText(field, "Field must not be null nor empty"); this.field = field; } diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/index/Index.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/index/Index.java index ee0ed2cff..7e2c5f0d1 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/index/Index.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/index/Index.java @@ -119,7 +119,7 @@ public class Index implements IndexDefinition { */ public Index expire(Duration timeout) { - Assert.notNull(timeout, "Timeout must not be null!"); + Assert.notNull(timeout, "Timeout must not be null"); return expire(timeout.getSeconds()); } @@ -133,7 +133,7 @@ public class Index implements IndexDefinition { */ public Index expire(long value, TimeUnit unit) { - Assert.notNull(unit, "TimeUnit for expiration must not be null."); + Assert.notNull(unit, "TimeUnit for expiration must not be null"); this.expire = unit.toSeconds(value); return this; } diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/index/IndexField.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/index/IndexField.java index 7e132ff65..073d5c953 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/index/IndexField.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/index/IndexField.java @@ -56,7 +56,7 @@ public final class IndexField { Assert.hasText(key, "Key must not be null or empty"); if (Type.GEO.equals(type) || Type.TEXT.equals(type)) { - Assert.isNull(direction, "Geo/Text indexes must not have a direction!"); + Assert.isNull(direction, "Geo/Text indexes must not have a direction"); } else { if (!(Type.HASH.equals(type) || Type.WILDCARD.equals(type))) { Assert.notNull(direction, "Default indexes require a direction"); @@ -71,7 +71,7 @@ public final class IndexField { public static IndexField create(String key, Direction order) { - Assert.notNull(order, "Direction must not be null!"); + Assert.notNull(order, "Direction must not be null"); return new IndexField(key, order, Type.DEFAULT); } diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/index/IndexInfo.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/index/IndexInfo.java index bb591fdcb..cf8dd80f4 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/index/IndexInfo.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/index/IndexInfo.java @@ -173,7 +173,7 @@ public class IndexInfo { */ public boolean isIndexForFields(Collection keys) { - Assert.notNull(keys, "Collection of keys must not be null!"); + Assert.notNull(keys, "Collection of keys must not be null"); List indexKeys = new ArrayList(indexFields.size()); diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/index/IndexOperationsAdapter.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/index/IndexOperationsAdapter.java index 1c6e0e2e1..9ee1d6ead 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/index/IndexOperationsAdapter.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/index/IndexOperationsAdapter.java @@ -36,7 +36,7 @@ public interface IndexOperationsAdapter extends IndexOperations { */ static IndexOperationsAdapter blocking(ReactiveIndexOperations reactiveIndexOperations) { - Assert.notNull(reactiveIndexOperations, "ReactiveIndexOperations must not be null!"); + Assert.notNull(reactiveIndexOperations, "ReactiveIndexOperations must not be null"); return new IndexOperationsAdapter() { diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/index/IndexResolver.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/index/IndexResolver.java index 7403367bf..1a077cd26 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/index/IndexResolver.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/index/IndexResolver.java @@ -53,7 +53,7 @@ public interface IndexResolver { static IndexResolver create( MappingContext, MongoPersistentProperty> mappingContext) { - Assert.notNull(mappingContext, "MongoMappingContext must not be null!"); + Assert.notNull(mappingContext, "MongoMappingContext must not be null"); return new MongoPersistentEntityIndexResolver(mappingContext); } diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/index/MongoMappingEventPublisher.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/index/MongoMappingEventPublisher.java index c3bd61215..49d957a3e 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/index/MongoMappingEventPublisher.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/index/MongoMappingEventPublisher.java @@ -49,7 +49,7 @@ public class MongoMappingEventPublisher implements ApplicationEventPublisher { */ public MongoMappingEventPublisher(ApplicationListener> indexCreator) { - Assert.notNull(indexCreator, "ApplicationListener must not be null!"); + Assert.notNull(indexCreator, "ApplicationListener must not be null"); this.indexCreator = indexCreator; } @@ -61,7 +61,7 @@ public class MongoMappingEventPublisher implements ApplicationEventPublisher { */ public MongoMappingEventPublisher(MongoPersistentEntityIndexCreator indexCreator) { - Assert.notNull(indexCreator, "MongoPersistentEntityIndexCreator must not be null!"); + Assert.notNull(indexCreator, "MongoPersistentEntityIndexCreator must not be null"); this.indexCreator = indexCreator; } diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/index/MongoPersistentEntityIndexCreator.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/index/MongoPersistentEntityIndexCreator.java index 0955eef45..3737fceff 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/index/MongoPersistentEntityIndexCreator.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/index/MongoPersistentEntityIndexCreator.java @@ -84,9 +84,9 @@ public class MongoPersistentEntityIndexCreator implements ApplicationListener resolveIndexForEntity(MongoPersistentEntity root) { - Assert.notNull(root, "MongoPersistentEntity must not be null!"); + Assert.notNull(root, "MongoPersistentEntity must not be null"); Document document = root.findAnnotation(Document.class); Assert.notNull(document, () -> String - .format("Entity %s is not a collection root. Make sure to annotate it with @Document!", root.getName())); + .format("Entity %s is not a collection root; Make sure to annotate it with @Document", root.getName())); verifyWildcardIndexedProjection(root); @@ -144,7 +144,7 @@ public class MongoPersistentEntityIndexResolver implements IndexResolver { if (!ObjectUtils.isEmpty(indexed.wildcardProjection())) { throw new MappingException(String.format( - "WildcardIndexed.wildcardProjection cannot be used on nested paths. Offending property: %s.%s", + "WildcardIndexed.wildcardProjection cannot be used on nested paths; Offending property: %s.%s", entity.getName(), it.getName())); } } @@ -251,7 +251,7 @@ public class MongoPersistentEntityIndexResolver implements IndexResolver { || persistentProperty.isAnnotationPresent(HashIndexed.class) || persistentProperty.isAnnotationPresent(GeoSpatialIndexed.class))) { throw new InvalidDataAccessApiUsageException( - String.format("Index annotation not allowed on unwrapped object for path '%s'.", dotPath)); + String.format("Index annotation not allowed on unwrapped object for path '%s'", dotPath)); } if (persistentProperty.isAnnotationPresent(Indexed.class)) { @@ -384,7 +384,7 @@ public class MongoPersistentEntityIndexResolver implements IndexResolver { } catch (CyclicPropertyReferenceException e) { LOGGER.info(e.getMessage()); } catch (InvalidDataAccessApiUsageException e) { - LOGGER.info(String.format("Potentially invalid index structure discovered. Breaking operation for %s.", + LOGGER.info(String.format("Potentially invalid index structure discovered; Breaking operation for %s", entity.getName()), e); } } else if (includeOptions.isForce() || indexed != null) { @@ -486,7 +486,7 @@ public class MongoPersistentEntityIndexResolver implements IndexResolver { PersistentEntity entity) { if (!StringUtils.hasText(dotPath) && !StringUtils.hasText(keyDefinitionString)) { - throw new InvalidDataAccessApiUsageException("Cannot create index on root level for empty keys."); + throw new InvalidDataAccessApiUsageException("Cannot create index on root level for empty keys"); } if (!StringUtils.hasText(keyDefinitionString)) { @@ -557,7 +557,7 @@ public class MongoPersistentEntityIndexResolver implements IndexResolver { if (index.expireAfterSeconds() >= 0) { throw new IllegalStateException(String.format( - "@Indexed already defines an expiration timeout of %s seconds via Indexed#expireAfterSeconds. Please make to use either expireAfterSeconds or expireAfter.", + "@Indexed already defines an expiration timeout of %s seconds via Indexed#expireAfterSeconds; Please make to use either expireAfterSeconds or expireAfter", index.expireAfterSeconds())); } @@ -756,7 +756,7 @@ public class MongoPersistentEntityIndexResolver implements IndexResolver { if (property.isAnnotationPresent(GeoSpatialIndexed.class) || property.isAnnotationPresent(TextIndexed.class)) { throw new MappingException( - String.format("Cannot create geospatial-/text- index on DBRef in collection '%s' for path '%s'.", collection, + String.format("Cannot create geospatial-/text- index on DBRef in collection '%s' for path '%s'", collection, propertyDotPath)); } diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/index/PartialIndexFilter.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/index/PartialIndexFilter.java index 4e828cad4..02515b2b2 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/index/PartialIndexFilter.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/index/PartialIndexFilter.java @@ -32,7 +32,7 @@ public class PartialIndexFilter implements IndexFilter { private PartialIndexFilter(Object filterExpression) { - Assert.notNull(filterExpression, "FilterExpression must not be null!"); + Assert.notNull(filterExpression, "FilterExpression must not be null"); this.filterExpression = filterExpression; } @@ -68,6 +68,6 @@ public class PartialIndexFilter implements IndexFilter { } throw new IllegalArgumentException( - String.format("Unknown type %s used as filter expression.", filterExpression.getClass())); + String.format("Unknown type %s used as filter expression", filterExpression.getClass())); } } diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/index/ReactiveMongoPersistentEntityIndexCreator.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/index/ReactiveMongoPersistentEntityIndexCreator.java index 74f662534..112d85e5b 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/index/ReactiveMongoPersistentEntityIndexCreator.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/index/ReactiveMongoPersistentEntityIndexCreator.java @@ -78,9 +78,9 @@ public class ReactiveMongoPersistentEntityIndexCreator { public ReactiveMongoPersistentEntityIndexCreator(MongoMappingContext mappingContext, ReactiveIndexOperationsProvider operationsProvider, IndexResolver indexResolver) { - Assert.notNull(mappingContext, "MongoMappingContext must not be null!"); - Assert.notNull(operationsProvider, "ReactiveIndexOperations must not be null!"); - Assert.notNull(indexResolver, "IndexResolver must not be null!"); + Assert.notNull(mappingContext, "MongoMappingContext must not be null"); + Assert.notNull(operationsProvider, "ReactiveIndexOperations must not be null"); + Assert.notNull(indexResolver, "IndexResolver must not be null"); this.mappingContext = mappingContext; this.operationsProvider = operationsProvider; @@ -111,7 +111,7 @@ public class ReactiveMongoPersistentEntityIndexCreator { if (this.classesSeen.put(type, Boolean.TRUE) == null) { if (LOGGER.isDebugEnabled()) { - LOGGER.debug("Analyzing class " + type + " for index information."); + LOGGER.debug("Analyzing class " + type + " for index information"); } return checkForAndCreateIndexes(entity); @@ -154,14 +154,14 @@ public class ReactiveMongoPersistentEntityIndexCreator { Mono existingIndex = fetchIndexInformation(indexDefinition); Mono defaultError = Mono.error(new DataIntegrityViolationException( - String.format("Cannot create index for '%s' in collection '%s' with keys '%s' and options '%s'.", + String.format("Cannot create index for '%s' in collection '%s' with keys '%s' and options '%s'", indexDefinition.getPath(), indexDefinition.getCollection(), indexDefinition.getIndexKeys(), indexDefinition.getIndexOptions()), e.getCause())); return existingIndex.flatMap(it -> { return Mono. error(new DataIntegrityViolationException( - String.format("Index already defined as '%s'.", indexDefinition.getPath()), e.getCause())); + String.format("Index already defined as '%s'", indexDefinition.getPath()), e.getCause())); }).switchIfEmpty(defaultError); } @@ -177,7 +177,7 @@ public class ReactiveMongoPersistentEntityIndexCreator { .doOnError(e -> { if(LOGGER.isDebugEnabled()) { LOGGER.debug( - String.format("Failed to load index information for collection '%s'.", indexDefinition.getCollection()), + String.format("Failed to load index information for collection '%s'", indexDefinition.getCollection()), e); } }); diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/index/TextIndexDefinition.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/index/TextIndexDefinition.java index 5d650dab1..48f979a02 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/index/TextIndexDefinition.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/index/TextIndexDefinition.java @@ -161,7 +161,7 @@ public class TextIndexDefinition implements IndexDefinition { */ public TextIndexedFieldSpec(String fieldname, @Nullable Float weight) { - Assert.hasText(fieldname, "Text index field cannot be blank."); + Assert.hasText(fieldname, "Text index field cannot be blank"); this.fieldname = fieldname; this.weight = weight != null ? weight : 1.0F; } @@ -251,7 +251,7 @@ public class TextIndexDefinition implements IndexDefinition { public TextIndexDefinitionBuilder onAllFields() { if (!instance.fieldSpecs.isEmpty()) { - throw new InvalidDataAccessApiUsageException("Cannot add wildcard fieldspect to non empty."); + throw new InvalidDataAccessApiUsageException("Cannot add wildcard fieldspect to non empty"); } this.instance.fieldSpecs.add(ALL_FIELDS); @@ -292,7 +292,7 @@ public class TextIndexDefinition implements IndexDefinition { if (this.instance.fieldSpecs.contains(ALL_FIELDS)) { throw new InvalidDataAccessApiUsageException( - String.format("Cannot add %s to field spec for all fields.", fieldname)); + String.format("Cannot add %s to field spec for all fields", fieldname)); } this.instance.fieldSpecs.add(new TextIndexedFieldSpec(fieldname, weight)); @@ -323,7 +323,7 @@ public class TextIndexDefinition implements IndexDefinition { if (StringUtils.hasText(this.instance.languageOverride)) { throw new InvalidDataAccessApiUsageException( - String.format("Cannot set language override on %s as it is already defined on %s.", fieldname, + String.format("Cannot set language override on %s as it is already defined on %s", fieldname, this.instance.languageOverride)); } diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/index/WildcardIndex.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/index/WildcardIndex.java index 8397d7c32..ecca5ddaa 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/index/WildcardIndex.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/index/WildcardIndex.java @@ -101,7 +101,7 @@ public class WildcardIndex extends Index { */ @Override public Index unique() { - throw new UnsupportedOperationException("Wildcard Index does not support 'unique'."); + throw new UnsupportedOperationException("Wildcard Index does not support 'unique'"); } /** @@ -111,7 +111,7 @@ public class WildcardIndex extends Index { */ @Override public Index expire(long seconds) { - throw new UnsupportedOperationException("Wildcard Index does not support 'ttl'."); + throw new UnsupportedOperationException("Wildcard Index does not support 'ttl'"); } /** @@ -121,7 +121,7 @@ public class WildcardIndex extends Index { */ @Override public Index expire(long value, TimeUnit timeUnit) { - throw new UnsupportedOperationException("Wildcard Index does not support 'ttl'."); + throw new UnsupportedOperationException("Wildcard Index does not support 'ttl'"); } /** @@ -131,7 +131,7 @@ public class WildcardIndex extends Index { */ @Override public Index expire(Duration duration) { - throw new UnsupportedOperationException("Wildcard Index does not support 'ttl'."); + throw new UnsupportedOperationException("Wildcard Index does not support 'ttl'"); } /** diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/mapping/BasicMongoPersistentEntity.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/mapping/BasicMongoPersistentEntity.java index f6405402d..7492e1b32 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/mapping/BasicMongoPersistentEntity.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/mapping/BasicMongoPersistentEntity.java @@ -60,7 +60,7 @@ import org.springframework.util.StringUtils; public class BasicMongoPersistentEntity extends BasicPersistentEntity implements MongoPersistentEntity { - private static final String AMBIGUOUS_FIELD_MAPPING = "Ambiguous field mapping detected! Both %s and %s map to the same field name %s! Disambiguate using @Field annotation!"; + private static final String AMBIGUOUS_FIELD_MAPPING = "Ambiguous field mapping detected; Both %s and %s map to the same field name %s; Disambiguate using @Field annotation"; private static final SpelExpressionParser PARSER = new SpelExpressionParser(); private final String collection; @@ -247,7 +247,7 @@ public class BasicMongoPersistentEntity extends BasicPersistentEntity extends BasicPersistentEntity extends BasicPersistentEntity extends BasicPersistentEntity extends BasicPersistentEntity implements MongoPersistentEntity { return persistentProperty; } - 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())); } @Override diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/mapping/event/AfterLoadEvent.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/mapping/event/AfterLoadEvent.java index 9277b4e69..839b724e7 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/mapping/event/AfterLoadEvent.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/mapping/event/AfterLoadEvent.java @@ -44,7 +44,7 @@ public class AfterLoadEvent extends MongoMappingEvent { super(document, document, collectionName); - Assert.notNull(type, "Type must not be null!"); + Assert.notNull(type, "Type must not be null"); this.type = type; } diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/mapping/event/AuditingEntityCallback.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/mapping/event/AuditingEntityCallback.java index f90cc61d2..f33dcff30 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/mapping/event/AuditingEntityCallback.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/mapping/event/AuditingEntityCallback.java @@ -41,7 +41,7 @@ public class AuditingEntityCallback implements BeforeConvertCallback, Or */ public AuditingEntityCallback(ObjectFactory auditingHandlerFactory) { - Assert.notNull(auditingHandlerFactory, "IsNewAwareAuditingHandler must not be null!"); + Assert.notNull(auditingHandlerFactory, "IsNewAwareAuditingHandler must not be null"); this.auditingHandlerFactory = auditingHandlerFactory; } diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/mapping/event/ReactiveAuditingEntityCallback.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/mapping/event/ReactiveAuditingEntityCallback.java index bccc73760..88396345a 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/mapping/event/ReactiveAuditingEntityCallback.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/mapping/event/ReactiveAuditingEntityCallback.java @@ -43,7 +43,7 @@ public class ReactiveAuditingEntityCallback implements ReactiveBeforeConvertCall */ public ReactiveAuditingEntityCallback(ObjectFactory auditingHandlerFactory) { - Assert.notNull(auditingHandlerFactory, "IsNewAwareAuditingHandler must not be null!"); + Assert.notNull(auditingHandlerFactory, "IsNewAwareAuditingHandler must not be null"); this.auditingHandlerFactory = auditingHandlerFactory; } diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/mapping/event/ValidatingMongoEventListener.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/mapping/event/ValidatingMongoEventListener.java index 3e9455cb0..96e6d3bc9 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/mapping/event/ValidatingMongoEventListener.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/mapping/event/ValidatingMongoEventListener.java @@ -46,7 +46,7 @@ public class ValidatingMongoEventListener extends AbstractMongoEventListener implements Iterable { */ public MapReduceResults(List mappedResults, Document rawResults) { - Assert.notNull(mappedResults, "List of mapped results must not be null!"); - Assert.notNull(rawResults, "Raw results must not be null!"); + Assert.notNull(mappedResults, "List of mapped results must not be null"); + Assert.notNull(rawResults, "Raw results must not be null"); this.mappedResults = mappedResults; this.rawResults = rawResults; diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/messaging/ChangeStreamRequest.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/messaging/ChangeStreamRequest.java index 35b339d56..6b740fc13 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/messaging/ChangeStreamRequest.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/messaging/ChangeStreamRequest.java @@ -108,8 +108,8 @@ public class ChangeStreamRequest public ChangeStreamRequest(MessageListener, ? super T> messageListener, RequestOptions options) { - Assert.notNull(messageListener, "MessageListener must not be null!"); - Assert.notNull(options, "Options must not be null!"); + Assert.notNull(messageListener, "MessageListener must not be null"); + Assert.notNull(options, "Options must not be null"); this.options = options instanceof ChangeStreamRequestOptions ? (ChangeStreamRequestOptions) options : ChangeStreamRequestOptions.of(options); @@ -187,7 +187,7 @@ public class ChangeStreamRequest public ChangeStreamRequestOptions(@Nullable String databaseName, @Nullable String collectionName, @Nullable Duration maxAwaitTime, ChangeStreamOptions options) { - Assert.notNull(options, "Options must not be null!"); + Assert.notNull(options, "Options must not be null"); this.collectionName = collectionName; this.databaseName = databaseName; @@ -197,7 +197,7 @@ public class ChangeStreamRequest public static ChangeStreamRequestOptions of(RequestOptions options) { - Assert.notNull(options, "Options must not be null!"); + Assert.notNull(options, "Options must not be null"); return new ChangeStreamRequestOptions(options.getDatabaseName(), options.getCollectionName(), ChangeStreamOptions.builder().build()); @@ -253,7 +253,7 @@ public class ChangeStreamRequest */ public ChangeStreamRequestBuilder database(String databaseName) { - Assert.hasText(databaseName, "DatabaseName must not be null!"); + Assert.hasText(databaseName, "DatabaseName must not be null"); this.databaseName = databaseName; return this; @@ -267,7 +267,7 @@ public class ChangeStreamRequest */ public ChangeStreamRequestBuilder collection(String collectionName) { - Assert.hasText(collectionName, "CollectionName must not be null!"); + Assert.hasText(collectionName, "CollectionName must not be null"); this.collectionName = collectionName; return this; @@ -282,7 +282,7 @@ public class ChangeStreamRequest public ChangeStreamRequestBuilder publishTo( MessageListener, ? super T> messageListener) { - Assert.notNull(messageListener, "MessageListener must not be null!"); + Assert.notNull(messageListener, "MessageListener must not be null"); this.listener = messageListener; return this; @@ -308,7 +308,7 @@ public class ChangeStreamRequest */ public ChangeStreamRequestBuilder filter(Aggregation aggregation) { - Assert.notNull(aggregation, "Aggregation must not be null!"); + Assert.notNull(aggregation, "Aggregation must not be null"); this.delegate.filter(aggregation); return this; @@ -323,8 +323,8 @@ public class ChangeStreamRequest */ public ChangeStreamRequestBuilder filter(Document... pipeline) { - Assert.notNull(pipeline, "Aggregation pipeline must not be null!"); - Assert.noNullElements(pipeline, "Aggregation pipeline must not contain null elements!"); + Assert.notNull(pipeline, "Aggregation pipeline must not be null"); + Assert.noNullElements(pipeline, "Aggregation pipeline must not contain null elements"); this.delegate.filter(pipeline); return this; @@ -340,7 +340,7 @@ public class ChangeStreamRequest */ public ChangeStreamRequestBuilder collation(Collation collation) { - Assert.notNull(collation, "Collation must not be null!"); + Assert.notNull(collation, "Collation must not be null"); this.delegate.collation(collation); return this; @@ -357,7 +357,7 @@ public class ChangeStreamRequest */ public ChangeStreamRequestBuilder resumeToken(BsonValue resumeToken) { - Assert.notNull(resumeToken, "Resume token not be null!"); + Assert.notNull(resumeToken, "Resume token not be null"); this.delegate.resumeToken(resumeToken); return this; @@ -373,7 +373,7 @@ public class ChangeStreamRequest */ public ChangeStreamRequestBuilder resumeAt(Instant clusterTime) { - Assert.notNull(clusterTime, "ClusterTime must not be null!"); + Assert.notNull(clusterTime, "ClusterTime must not be null"); this.delegate.resumeAt(clusterTime); return this; @@ -388,7 +388,7 @@ public class ChangeStreamRequest */ public ChangeStreamRequestBuilder resumeAfter(BsonValue resumeToken) { - Assert.notNull(resumeToken, "ResumeToken must not be null!"); + Assert.notNull(resumeToken, "ResumeToken must not be null"); this.delegate.resumeAfter(resumeToken); return this; @@ -403,7 +403,7 @@ public class ChangeStreamRequest */ public ChangeStreamRequestBuilder startAfter(BsonValue resumeToken) { - Assert.notNull(resumeToken, "ResumeToken must not be null!"); + Assert.notNull(resumeToken, "ResumeToken must not be null"); this.delegate.startAfter(resumeToken); return this; @@ -419,7 +419,7 @@ public class ChangeStreamRequest */ public ChangeStreamRequestBuilder fullDocumentLookup(FullDocument lookup) { - Assert.notNull(lookup, "FullDocument not be null!"); + Assert.notNull(lookup, "FullDocument not be null"); this.delegate.fullDocumentLookup(lookup); return this; @@ -433,7 +433,7 @@ public class ChangeStreamRequest */ public ChangeStreamRequestBuilder maxAwaitTime(Duration timeout) { - Assert.notNull(timeout, "timeout not be null!"); + Assert.notNull(timeout, "timeout not be null"); this.maxAwaitTime = timeout; return this; @@ -444,7 +444,7 @@ public class ChangeStreamRequest */ public ChangeStreamRequest build() { - Assert.notNull(listener, "MessageListener must not be null!"); + Assert.notNull(listener, "MessageListener must not be null"); return new ChangeStreamRequest<>(listener, new ChangeStreamRequestOptions(databaseName, collectionName, maxAwaitTime, delegate.build())); diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/messaging/CursorReadingTask.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/messaging/CursorReadingTask.java index 687bd0913..5050a33d1 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/messaging/CursorReadingTask.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/messaging/CursorReadingTask.java @@ -190,8 +190,8 @@ abstract class CursorReadingTask implements Task { @Override public boolean awaitStart(Duration timeout) throws InterruptedException { - Assert.notNull(timeout, "Timeout must not be null!"); - Assert.isTrue(!timeout.isNegative(), "Timeout must not be negative!"); + Assert.notNull(timeout, "Timeout must not be null"); + Assert.isTrue(!timeout.isNegative(), "Timeout must not be negative"); return awaitStart.await(timeout.toNanos(), TimeUnit.NANOSECONDS); } @@ -226,7 +226,7 @@ abstract class CursorReadingTask implements Task { } } - throw new IllegalStateException(String.format("Cursor %s is not longer open.", cursor)); + throw new IllegalStateException(String.format("Cursor %s is not longer open", cursor)); } private static boolean isValidCursor(@Nullable MongoCursor cursor) { diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/messaging/DefaultMessageListenerContainer.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/messaging/DefaultMessageListenerContainer.java index e2c627eac..42682af77 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/messaging/DefaultMessageListenerContainer.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/messaging/DefaultMessageListenerContainer.java @@ -86,8 +86,8 @@ public class DefaultMessageListenerContainer implements MessageListenerContainer public DefaultMessageListenerContainer(MongoTemplate template, Executor taskExecutor, @Nullable ErrorHandler errorHandler) { - Assert.notNull(template, "Template must not be null!"); - Assert.notNull(taskExecutor, "TaskExecutor must not be null!"); + Assert.notNull(template, "Template must not be null"); + Assert.notNull(taskExecutor, "TaskExecutor must not be null"); this.taskExecutor = taskExecutor; this.taskFactory = new TaskFactory(template); @@ -279,7 +279,7 @@ public class DefaultMessageListenerContainer implements MessageListenerContainer public void handleError(Throwable t) { if (logger.isErrorEnabled()) { - logger.error("Unexpected error occurred while listening to MongoDB.", t); + logger.error("Unexpected error occurred while listening to MongoDB", t); } delegate.handleError(t); diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/messaging/Message.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/messaging/Message.java index 7d74aa034..00ca87556 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/messaging/Message.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/messaging/Message.java @@ -152,7 +152,7 @@ public interface Message { */ public MessagePropertiesBuilder databaseName(String dbName) { - Assert.notNull(dbName, "Database name must not be null!"); + Assert.notNull(dbName, "Database name must not be null"); this.databaseName = dbName; return this; @@ -164,7 +164,7 @@ public interface Message { */ public MessagePropertiesBuilder collectionName(String collectionName) { - Assert.notNull(collectionName, "Collection name must not be null!"); + Assert.notNull(collectionName, "Collection name must not be null"); this.collectionName = collectionName; return this; diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/messaging/SimpleMessage.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/messaging/SimpleMessage.java index 7606447b3..b918d5d1d 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/messaging/SimpleMessage.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/messaging/SimpleMessage.java @@ -38,7 +38,7 @@ class SimpleMessage implements Message { */ SimpleMessage(@Nullable S raw, @Nullable T body, MessageProperties properties) { - Assert.notNull(properties, "Properties must not be null! Use MessageProperties.empty() instead."); + Assert.notNull(properties, "Properties must not be null Use MessageProperties.empty() instead"); this.raw = raw; this.body = body; diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/messaging/SubscriptionRequest.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/messaging/SubscriptionRequest.java index aacd9e10b..89488cfec 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/messaging/SubscriptionRequest.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/messaging/SubscriptionRequest.java @@ -101,7 +101,7 @@ public interface SubscriptionRequest { */ static RequestOptions justDatabase(String database) { - Assert.notNull(database, "Database must not be null!"); + Assert.notNull(database, "Database must not be null"); return new RequestOptions() { @@ -125,7 +125,7 @@ public interface SubscriptionRequest { */ static RequestOptions justCollection(String collection) { - Assert.notNull(collection, "Collection must not be null!"); + Assert.notNull(collection, "Collection must not be null"); return () -> collection; } @@ -138,8 +138,8 @@ public interface SubscriptionRequest { */ static RequestOptions of(String database, String collection) { - Assert.notNull(database, "Database must not be null!"); - Assert.notNull(collection, "Collection must not be null!"); + Assert.notNull(database, "Database must not be null"); + Assert.notNull(collection, "Collection must not be null"); return new RequestOptions() { diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/messaging/TailableCursorRequest.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/messaging/TailableCursorRequest.java index 14df341c2..12a40521c 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/messaging/TailableCursorRequest.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/messaging/TailableCursorRequest.java @@ -68,8 +68,8 @@ public class TailableCursorRequest implements SubscriptionRequest messageListener, RequestOptions options) { - Assert.notNull(messageListener, "MessageListener must not be null!"); - Assert.notNull(options, "Options must not be null!"); + Assert.notNull(messageListener, "MessageListener must not be null"); + Assert.notNull(options, "Options must not be null"); this.messageListener = messageListener; this.options = options instanceof TailableCursorRequestOptions ? (TailableCursorRequestOptions) options @@ -165,7 +165,7 @@ public class TailableCursorRequest implements SubscriptionRequest implements SubscriptionRequest implements SubscriptionRequest collection(String collectionName) { - Assert.hasText(collectionName, "CollectionName must not be null!"); + Assert.hasText(collectionName, "CollectionName must not be null"); delegate.collection(collectionName); return this; @@ -236,7 +236,7 @@ public class TailableCursorRequest implements SubscriptionRequest publishTo(MessageListener messageListener) { - Assert.notNull(messageListener, "MessageListener must not be null!"); + Assert.notNull(messageListener, "MessageListener must not be null"); this.listener = messageListener; return this; @@ -250,7 +250,7 @@ public class TailableCursorRequest implements SubscriptionRequest filter(Query filter) { - Assert.notNull(filter, "Filter must not be null!"); + Assert.notNull(filter, "Filter must not be null"); delegate.filter(filter); return this; @@ -261,7 +261,7 @@ public class TailableCursorRequest implements SubscriptionRequest build() { - Assert.notNull(listener, "MessageListener must not be null!"); + Assert.notNull(listener, "MessageListener must not be null"); return new TailableCursorRequest<>(listener, delegate.build()); } diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/messaging/TaskFactory.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/messaging/TaskFactory.java index 03f9eabbe..01e775d5d 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/messaging/TaskFactory.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/messaging/TaskFactory.java @@ -35,7 +35,7 @@ class TaskFactory { */ TaskFactory(MongoTemplate template) { - Assert.notNull(template, "Template must not be null!"); + Assert.notNull(template, "Template must not be null"); this.tempate = template; } @@ -52,8 +52,8 @@ class TaskFactory { Task forRequest(SubscriptionRequest request, Class targetType, ErrorHandler errorHandler) { - Assert.notNull(request, "Request must not be null!"); - Assert.notNull(targetType, "TargetType must not be null!"); + Assert.notNull(request, "Request must not be null"); + Assert.notNull(targetType, "TargetType must not be null"); if (request instanceof ChangeStreamRequest) { return new ChangeStreamTask(tempate, (ChangeStreamRequest) request, targetType, errorHandler); @@ -62,6 +62,6 @@ class TaskFactory { } throw new IllegalArgumentException( - "oh wow - seems you're using some fancy new feature we do not support. Please be so kind and leave us a note in the issue tracker so we can get this fixed.\nThank you!"); + "oh wow - seems you're using some fancy new feature we do not support; Please be so kind and leave us a note in the issue tracker so we can get this fixed\nThank you"); } } diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/query/Collation.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/query/Collation.java index b34cc0ec1..72ed9e51b 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/query/Collation.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/query/Collation.java @@ -58,7 +58,7 @@ public class Collation { private Collation(CollationLocale locale) { - Assert.notNull(locale, "ICULocale must not be null!"); + Assert.notNull(locale, "ICULocale must not be null"); this.locale = locale; } @@ -80,7 +80,7 @@ public class Collation { */ public static Collation of(Locale locale) { - Assert.notNull(locale, "Locale must not be null!"); + Assert.notNull(locale, "Locale must not be null"); String format; @@ -124,7 +124,7 @@ public class Collation { */ public static Collation parse(String collation) { - Assert.notNull(collation, "Collation must not be null!"); + Assert.notNull(collation, "Collation must not be null"); return collation.stripLeading().startsWith("{") ? from(Document.parse(collation)) : of(collation); @@ -140,7 +140,7 @@ public class Collation { */ public static Collation from(Document source) { - Assert.notNull(source, "Source must not be null!"); + Assert.notNull(source, "Source must not be null"); Collation collation = Collation.of(source.getString("locale")); if (source.containsKey("strength")) { @@ -653,7 +653,7 @@ public class Collation { */ public ComparisonLevel caseFirst(CaseFirst caseFirst) { - Assert.notNull(caseFirst, "CaseFirst must not be null!"); + Assert.notNull(caseFirst, "CaseFirst must not be null"); return new TertiaryICUComparisonLevel(caseFirst); } } @@ -798,7 +798,7 @@ public class Collation { */ public static CollationLocale of(String language) { - Assert.notNull(language, "Code must not be null!"); + Assert.notNull(language, "Code must not be null"); return new CollationLocale(language, Optional.empty()); } @@ -810,7 +810,7 @@ public class Collation { */ public CollationLocale variant(String variant) { - Assert.notNull(variant, "Variant must not be null!"); + Assert.notNull(variant, "Variant must not be null"); return new CollationLocale(language, Optional.of(variant)); } diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/query/Criteria.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/query/Criteria.java index 3c96e77c1..e9512a32d 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/query/Criteria.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/query/Criteria.java @@ -166,11 +166,11 @@ public class Criteria implements CriteriaDefinition { if (!isValue.equals(NOT_SET)) { throw new InvalidMongoDbApiUsageException( - "Multiple 'is' values declared. You need to use 'and' with multiple criteria"); + "Multiple 'is' values declared; You need to use 'and' with multiple criteria"); } if (lastOperatorWasNot()) { - throw new InvalidMongoDbApiUsageException("Invalid query: 'not' can't be used with 'is' - use 'ne' instead."); + throw new InvalidMongoDbApiUsageException("Invalid query: 'not' can't be used with 'is' - use 'ne' instead"); } this.isValue = value; @@ -403,8 +403,8 @@ public class Criteria implements CriteriaDefinition { */ public Criteria sampleRate(double sampleRate) { - Assert.isTrue(sampleRate >= 0, "The sample rate must be greater than zero!"); - Assert.isTrue(sampleRate <= 1, "The sample rate must not be greater than one!"); + Assert.isTrue(sampleRate >= 0, "The sample rate must be greater than zero"); + Assert.isTrue(sampleRate <= 1, "The sample rate must not be greater than one"); criteria.put("$sampleRate", sampleRate); return this; @@ -432,8 +432,8 @@ public class Criteria implements CriteriaDefinition { */ public Criteria type(Type... types) { - Assert.notNull(types, "Types must not be null!"); - Assert.noNullElements(types, "Types must not contain null."); + Assert.notNull(types, "Types must not be null"); + Assert.noNullElements(types, "Types must not contain null"); return type(Arrays.asList(types)); } @@ -448,7 +448,7 @@ public class Criteria implements CriteriaDefinition { */ public Criteria type(Collection types) { - Assert.notNull(types, "Types must not be null!"); + Assert.notNull(types, "Types must not be null"); criteria.put("$type", types.stream().map(Type::value).collect(Collectors.toList())); return this; @@ -507,7 +507,7 @@ public class Criteria implements CriteriaDefinition { */ public Criteria regex(Pattern pattern) { - Assert.notNull(pattern, "Pattern must not be null!"); + Assert.notNull(pattern, "Pattern must not be null"); if (lastOperatorWasNot()) { return not(pattern); @@ -535,7 +535,7 @@ public class Criteria implements CriteriaDefinition { private Pattern toPattern(String regex, @Nullable String options) { - Assert.notNull(regex, "Regex string must not be null!"); + Assert.notNull(regex, "Regex string must not be null"); return Pattern.compile(regex, RegexFlags.toRegexFlags(options)); } @@ -553,7 +553,7 @@ public class Criteria implements CriteriaDefinition { */ public Criteria withinSphere(Circle circle) { - Assert.notNull(circle, "Circle must not be null!"); + Assert.notNull(circle, "Circle must not be null"); criteria.put("$geoWithin", new GeoCommand(new Sphere(circle))); return this; @@ -569,7 +569,7 @@ public class Criteria implements CriteriaDefinition { */ public Criteria within(Shape shape) { - Assert.notNull(shape, "Shape must not be null!"); + Assert.notNull(shape, "Shape must not be null"); criteria.put("$geoWithin", new GeoCommand(shape)); return this; @@ -584,7 +584,7 @@ public class Criteria implements CriteriaDefinition { */ public Criteria near(Point point) { - Assert.notNull(point, "Point must not be null!"); + Assert.notNull(point, "Point must not be null"); criteria.put("$near", point); return this; @@ -601,7 +601,7 @@ public class Criteria implements CriteriaDefinition { */ public Criteria nearSphere(Point point) { - Assert.notNull(point, "Point must not be null!"); + Assert.notNull(point, "Point must not be null"); criteria.put("$nearSphere", point); return this; @@ -618,7 +618,7 @@ public class Criteria implements CriteriaDefinition { @SuppressWarnings("rawtypes") public Criteria intersects(GeoJson geoJson) { - Assert.notNull(geoJson, "GeoJson must not be null!"); + Assert.notNull(geoJson, "GeoJson must not be null"); criteria.put("$geoIntersects", geoJson); return this; } @@ -710,7 +710,7 @@ public class Criteria implements CriteriaDefinition { */ public Criteria andDocumentStructureMatches(MongoJsonSchema schema) { - Assert.notNull(schema, "Schema must not be null!"); + Assert.notNull(schema, "Schema must not be null"); Criteria schemaCriteria = new Criteria(); schemaCriteria.criteria.putAll(schema.toDocument()); @@ -741,7 +741,7 @@ public class Criteria implements CriteriaDefinition { */ public Criteria orOperator(Criteria... criteria) { - Assert.notNull(criteria, "Criteria must not be null!"); + Assert.notNull(criteria, "Criteria must not be null"); return orOperator(Arrays.asList(criteria)); } @@ -758,7 +758,7 @@ public class Criteria implements CriteriaDefinition { */ public Criteria orOperator(Collection criteria) { - Assert.notNull(criteria, "Criteria must not be null!"); + Assert.notNull(criteria, "Criteria must not be null"); BasicDBList bsonList = createCriteriaList(criteria); return registerCriteriaChainElement(new Criteria("$or").is(bsonList)); @@ -775,7 +775,7 @@ public class Criteria implements CriteriaDefinition { */ public Criteria norOperator(Criteria... criteria) { - Assert.notNull(criteria, "Criteria must not be null!"); + Assert.notNull(criteria, "Criteria must not be null"); return norOperator(Arrays.asList(criteria)); } @@ -792,7 +792,7 @@ public class Criteria implements CriteriaDefinition { */ public Criteria norOperator(Collection criteria) { - Assert.notNull(criteria, "Criteria must not be null!"); + Assert.notNull(criteria, "Criteria must not be null"); BasicDBList bsonList = createCriteriaList(criteria); return registerCriteriaChainElement(new Criteria("$nor").is(bsonList)); @@ -809,7 +809,7 @@ public class Criteria implements CriteriaDefinition { */ public Criteria andOperator(Criteria... criteria) { - Assert.notNull(criteria, "Criteria must not be null!"); + Assert.notNull(criteria, "Criteria must not be null"); return andOperator(Arrays.asList(criteria)); } @@ -826,7 +826,7 @@ public class Criteria implements CriteriaDefinition { */ public Criteria andOperator(Collection criteria) { - Assert.notNull(criteria, "Criteria must not be null!"); + Assert.notNull(criteria, "Criteria must not be null"); BasicDBList bsonList = createCriteriaList(criteria); return registerCriteriaChainElement(new Criteria("$and").is(bsonList)); @@ -933,8 +933,8 @@ public class Criteria implements CriteriaDefinition { document.put(key, value); } else { throw new InvalidMongoDbApiUsageException("Due to limitations of the org.bson.Document, " - + "you can't add a second '" + key + "' expression specified as '" + key + " : " + value + "'. " - + "Criteria already contains '" + key + " : " + existing + "'."); + + "you can't add a second '" + key + "' expression specified as '" + key + " : " + value + "';" + + " Criteria already contains '" + key + " : " + existing + "'"); } } @@ -1344,8 +1344,8 @@ public class Criteria implements CriteriaDefinition { private Criteria positions(String operator, List positions) { - Assert.notNull(positions, "Positions must not be null!"); - Assert.noNullElements(positions.toArray(), "Positions must not contain null values."); + Assert.notNull(positions, "Positions must not be null"); + Assert.noNullElements(positions.toArray(), "Positions must not contain null values"); target.criteria.put(operator, positions); return target; @@ -1353,7 +1353,7 @@ public class Criteria implements CriteriaDefinition { private Criteria stringBitmask(String operator, String bitmask) { - Assert.hasText(bitmask, "Bitmask must not be null!"); + Assert.hasText(bitmask, "Bitmask must not be null"); target.criteria.put(operator, new Binary(Base64Utils.decodeFromString(bitmask))); return target; diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/query/Field.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/query/Field.java index fab1773ec..1da1e4b36 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/query/Field.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/query/Field.java @@ -52,7 +52,7 @@ public class Field { */ public Field include(String field) { - Assert.notNull(field, "Key must not be null!"); + Assert.notNull(field, "Key must not be null"); criteria.put(field, 1); @@ -124,7 +124,7 @@ public class Field { */ public Field include(String... fields) { - Assert.notNull(fields, "Keys must not be null!"); + Assert.notNull(fields, "Keys must not be null"); for (String key : fields) { criteria.put(key, 1); @@ -141,7 +141,7 @@ public class Field { */ public Field exclude(String field) { - Assert.notNull(field, "Key must not be null!"); + Assert.notNull(field, "Key must not be null"); criteria.put(field, 0); @@ -157,7 +157,7 @@ public class Field { */ public Field exclude(String... fields) { - Assert.notNull(fields, "Keys must not be null!"); + Assert.notNull(fields, "Keys must not be null"); for (String key : fields) { criteria.put(key, 0); @@ -175,7 +175,7 @@ public class Field { */ public Field slice(String field, int size) { - Assert.notNull(field, "Key must not be null!"); + Assert.notNull(field, "Key must not be null"); slices.put(field, size); @@ -213,7 +213,7 @@ public class Field { */ public Field position(String field, int value) { - Assert.hasText(field, "DocumentField must not be null or empty!"); + Assert.hasText(field, "DocumentField must not be null or empty"); positionKey = field; positionValue = value; diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/query/GeoCommand.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/query/GeoCommand.java index 2370d432d..5c3555726 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/query/GeoCommand.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/query/GeoCommand.java @@ -43,7 +43,7 @@ public final class GeoCommand { */ public GeoCommand(Shape shape) { - Assert.notNull(shape, "Shape must not be null!"); + Assert.notNull(shape, "Shape must not be null"); this.shape = shape; this.command = getCommand(shape); @@ -72,7 +72,7 @@ public final class GeoCommand { */ private String getCommand(Shape shape) { - Assert.notNull(shape, "Shape must not be null!"); + Assert.notNull(shape, "Shape must not be null"); if (shape instanceof Box) { return "$box"; diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/query/Meta.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/query/Meta.java index 7bac32b1d..3675d471e 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/query/Meta.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/query/Meta.java @@ -95,7 +95,7 @@ public class Meta { */ public void setMaxTime(Duration timeout) { - Assert.notNull(timeout, "Timeout must not be null!"); + Assert.notNull(timeout, "Timeout must not be null"); setValue(MetaKey.MAX_TIME_MS.key, timeout.toMillis()); } @@ -146,7 +146,7 @@ public class Meta { */ public boolean addFlag(CursorOption option) { - Assert.notNull(option, "CursorOption must not be null!"); + Assert.notNull(option, "CursorOption must not be null"); if (this.flags == Collections.EMPTY_SET) { this.flags = new LinkedHashSet<>(2); @@ -212,7 +212,7 @@ public class Meta { */ void setValue(String key, @Nullable Object value) { - Assert.hasText(key, "Meta key must not be 'null' or blank."); + Assert.hasText(key, "Meta key must not be 'null' or blank"); if (values == Collections.EMPTY_MAP) { values = new LinkedHashMap<>(2); diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/query/NearQuery.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/query/NearQuery.java index c46793ea5..7bb1374f8 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/query/NearQuery.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/query/NearQuery.java @@ -43,7 +43,7 @@ import org.springframework.util.ObjectUtils; *
* In other words:
* Assume you've got 5 Documents like the ones below
- * + * *
  *     
  * {
@@ -73,10 +73,10 @@ import org.springframework.util.ObjectUtils;
  * }
  *      
  * 
- * + * * Fetching all Documents within a 400 Meter radius from {@code [-73.99171, 40.738868] } would look like this using * {@literal GeoJSON}: - * + * *
  *     
  * {
@@ -92,9 +92,9 @@ import org.springframework.util.ObjectUtils;
  *
  *     
  * 
- * + * * resulting in the following 3 Documents. - * + * *
  *     
  * {
@@ -117,11 +117,11 @@ import org.springframework.util.ObjectUtils;
  * }
  *     
  * 
- * + * * Using legacy coordinate pairs one operates upon radians as discussed before. Assume we use {@link Metrics#KILOMETERS} * when constructing the geoNear command. The {@link Metric} will make sure the distance multiplier is set correctly, so * the command is rendered like - * + * *
  *     
  * {
@@ -137,12 +137,12 @@ import org.springframework.util.ObjectUtils;
  * }
  *     
  * 
- * + * * Please note the calculated distance now uses {@literal Kilometers} instead of {@literal Meters} as unit of measure, * so we need to take it times 1000 to match up to {@literal Meters} as in the {@literal GeoJSON} variant.
* Still as we've been requesting the {@link Distance} in {@link Metrics#KILOMETERS} the {@link Distance#getValue()} * reflects exactly this. - * + * *
  *     
  * {
@@ -190,8 +190,8 @@ public final class NearQuery {
 	 */
 	private NearQuery(Point point, Metric metric) {
 
-		Assert.notNull(point, "Point must not be null!");
-		Assert.notNull(metric, "Metric must not be null!");
+		Assert.notNull(point, "Point must not be null");
+		Assert.notNull(metric, "Metric must not be null");
 
 		this.point = point;
 		this.spherical = false;
@@ -295,7 +295,7 @@ public final class NearQuery {
 	 */
 	public NearQuery with(Pageable pageable) {
 
-		Assert.notNull(pageable, "Pageable must not be 'null'.");
+		Assert.notNull(pageable, "Pageable must not be 'null'");
 		if (pageable.isPaged()) {
 			this.skip = pageable.getOffset();
 			this.limit = (long) pageable.getPageSize();
@@ -330,7 +330,7 @@ public final class NearQuery {
 	 */
 	public NearQuery maxDistance(double maxDistance, Metric metric) {
 
-		Assert.notNull(metric, "Metric must not be null!");
+		Assert.notNull(metric, "Metric must not be null");
 
 		return maxDistance(new Distance(maxDistance, metric));
 	}
@@ -344,7 +344,7 @@ public final class NearQuery {
 	 */
 	public NearQuery maxDistance(Distance distance) {
 
-		Assert.notNull(distance, "Distance must not be null!");
+		Assert.notNull(distance, "Distance must not be null");
 
 		if (distance.getMetric() != Metrics.NEUTRAL) {
 			this.spherical(true);
@@ -387,7 +387,7 @@ public final class NearQuery {
 	 */
 	public NearQuery minDistance(double minDistance, Metric metric) {
 
-		Assert.notNull(metric, "Metric must not be null!");
+		Assert.notNull(metric, "Metric must not be null");
 
 		return minDistance(new Distance(minDistance, metric));
 	}
@@ -402,7 +402,7 @@ public final class NearQuery {
 	 */
 	public NearQuery minDistance(Distance distance) {
 
-		Assert.notNull(distance, "Distance must not be null!");
+		Assert.notNull(distance, "Distance must not be null");
 
 		if (distance.getMetric() != Metrics.NEUTRAL) {
 			this.spherical(true);
@@ -525,7 +525,7 @@ public final class NearQuery {
 	 */
 	public NearQuery query(Query query) {
 
-		Assert.notNull(query, "Cannot apply 'null' query on NearQuery.");
+		Assert.notNull(query, "Cannot apply 'null' query on NearQuery");
 
 		this.query = query;
 		this.skip = query.getSkip();
@@ -546,7 +546,7 @@ public final class NearQuery {
 
 	/**
 	 * Get the {@link Collation} to use along with the {@link #query(Query)}.
-	 * 
+	 *
 	 * @return the {@link Collation} if set. {@literal null} otherwise.
 	 * @since 2.2
 	 */
diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/query/Query.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/query/Query.java
index a608a59a9..27a9766c9 100644
--- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/query/Query.java
+++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/query/Query.java
@@ -96,7 +96,7 @@ public class Query {
 	 */
 	public Query addCriteria(CriteriaDefinition criteriaDefinition) {
 
-		Assert.notNull(criteriaDefinition, "CriteriaDefinition must not be null!");
+		Assert.notNull(criteriaDefinition, "CriteriaDefinition must not be null");
 
 		CriteriaDefinition existing = this.criteria.get(criteriaDefinition.getKey());
 		String key = criteriaDefinition.getKey();
@@ -105,8 +105,8 @@ public class Query {
 			this.criteria.put(key, criteriaDefinition);
 		} else {
 			throw new InvalidMongoDbApiUsageException(
-					String.format("Due to limitations of the com.mongodb.BasicDocument, you can't add a second '%s' criteria. "
-							+ "Query already contains '%s'", key, serializeToJsonSafely(existing.getCriteriaObject())));
+					String.format("Due to limitations of the com.mongodb.BasicDocument, you can't add a second '%s' criteria;"
+							+ " Query already contains '%s'", key, serializeToJsonSafely(existing.getCriteriaObject())));
 		}
 
 		return this;
@@ -155,7 +155,7 @@ public class Query {
 	 */
 	public Query withHint(String hint) {
 
-		Assert.hasText(hint, "Hint must not be empty or null!");
+		Assert.hasText(hint, "Hint must not be empty or null");
 		this.hint = hint;
 		return this;
 	}
@@ -169,7 +169,7 @@ public class Query {
 	 */
 	public Query withHint(Document hint) {
 
-		Assert.notNull(hint, "Hint must not be null!");
+		Assert.notNull(hint, "Hint must not be null");
 		this.hint = hint.toJson();
 		return this;
 	}
@@ -201,7 +201,7 @@ public class Query {
 	 */
 	public Query with(Sort sort) {
 
-		Assert.notNull(sort, "Sort must not be null!");
+		Assert.notNull(sort, "Sort must not be null");
 
 		if (sort.isUnsorted()) {
 			return this;
@@ -209,8 +209,8 @@ public class Query {
 
 		sort.stream().filter(Order::isIgnoreCase).findFirst().ifPresent(it -> {
 
-			throw new IllegalArgumentException(String.format("Given sort contained an Order for %s with ignore case! "
-					+ "MongoDB does not support sorting ignoring case currently!", it.getProperty()));
+			throw new IllegalArgumentException(String.format("Given sort contained an Order for %s with ignore case;"
+					+ " MongoDB does not support sorting ignoring case currently", it.getProperty()));
 		});
 
 		this.sort = this.sort.and(sort);
@@ -234,7 +234,7 @@ public class Query {
 	 */
 	public Query restrict(Class type, Class... additionalTypes) {
 
-		Assert.notNull(type, "Type must not be null!");
+		Assert.notNull(type, "Type must not be null");
 		Assert.notNull(additionalTypes, "AdditionalTypes must not be null");
 
 		if (restrictedTypes == Collections.EMPTY_SET) {
@@ -472,7 +472,7 @@ public class Query {
 	 */
 	public void setMeta(Meta meta) {
 
-		Assert.notNull(meta, "Query meta might be empty but must not be null.");
+		Assert.notNull(meta, "Query meta might be empty but must not be null");
 		this.meta = meta;
 	}
 
@@ -514,7 +514,7 @@ public class Query {
 	 */
 	public static Query of(Query source) {
 
-		Assert.notNull(source, "Source must not be null!");
+		Assert.notNull(source, "Source must not be null");
 
 		Document sourceFields = source.getFieldsObject();
 		Document sourceSort = source.getSortObject();
diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/query/TextCriteria.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/query/TextCriteria.java
index 300af5b61..8dc52a9df 100644
--- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/query/TextCriteria.java
+++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/query/TextCriteria.java
@@ -73,7 +73,7 @@ public class TextCriteria implements CriteriaDefinition {
 	 */
 	public static TextCriteria forLanguage(String language) {
 
-		Assert.hasText(language, "Language must not be null or empty!");
+		Assert.hasText(language, "Language must not be null or empty");
 		return new TextCriteria(language);
 	}
 
@@ -99,7 +99,7 @@ public class TextCriteria implements CriteriaDefinition {
 	 */
 	public TextCriteria matching(Term term) {
 
-		Assert.notNull(term, "Term to add must not be null.");
+		Assert.notNull(term, "Term to add must not be null");
 
 		this.terms.add(term);
 		return this;
diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/query/Update.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/query/Update.java
index 8bc0aa9b8..cc987f6f0 100644
--- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/query/Update.java
+++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/query/Update.java
@@ -320,7 +320,7 @@ public class Update implements UpdateDefinition {
 	 */
 	public Update multiply(String key, Number multiplier) {
 
-		Assert.notNull(multiplier, "Multiplier must not be null.");
+		Assert.notNull(multiplier, "Multiplier must not be null");
 		addMultiFieldOperation("$mul", key, multiplier.doubleValue());
 		return this;
 	}
@@ -337,7 +337,7 @@ public class Update implements UpdateDefinition {
 	 */
 	public Update max(String key, Object value) {
 
-		Assert.notNull(value, "Value for max operation must not be null.");
+		Assert.notNull(value, "Value for max operation must not be null");
 		addMultiFieldOperation("$max", key, value);
 		return this;
 	}
@@ -354,7 +354,7 @@ public class Update implements UpdateDefinition {
 	 */
 	public Update min(String key, Object value) {
 
-		Assert.notNull(value, "Value for min operation must not be null.");
+		Assert.notNull(value, "Value for min operation must not be null");
 		addMultiFieldOperation("$min", key, value);
 		return this;
 	}
@@ -440,7 +440,7 @@ public class Update implements UpdateDefinition {
 
 	protected void addMultiFieldOperation(String operator, String key, @Nullable Object value) {
 
-		Assert.hasText(key, "Key/Path for update must not be null or blank.");
+		Assert.hasText(key, "Key/Path for update must not be null or blank");
 		Object existingValue = this.modifierOps.get(operator);
 		Document keyValueMap;
 
@@ -742,7 +742,7 @@ public class Update implements UpdateDefinition {
 		 */
 		SortModifier(Direction direction) {
 
-			Assert.notNull(direction, "Direction must not be null!");
+			Assert.notNull(direction, "Direction must not be null");
 			this.sort = direction.isAscending() ? 1 : -1;
 		}
 
@@ -753,13 +753,13 @@ public class Update implements UpdateDefinition {
 		 */
 		SortModifier(Sort sort) {
 
-			Assert.notNull(sort, "Sort must not be null!");
+			Assert.notNull(sort, "Sort must not be null");
 
 			for (Order order : sort) {
 
 				if (order.isIgnoreCase()) {
-					throw new IllegalArgumentException(String.format("Given sort contained an Order for %s with ignore case! "
-							+ "MongoDB does not support sorting ignoring case currently!", order.getProperty()));
+					throw new IllegalArgumentException(String.format("Given sort contained an Order for %s with ignore case;"
+							+ " MongoDB does not support sorting ignoring case currently", order.getProperty()));
 				}
 			}
 
@@ -833,7 +833,7 @@ public class Update implements UpdateDefinition {
 		 */
 		public PushOperatorBuilder sort(Direction direction) {
 
-			Assert.notNull(direction, "Direction must not be null.");
+			Assert.notNull(direction, "Direction must not be null");
 			this.modifiers.addModifier(new SortModifier(direction));
 			return this;
 		}
@@ -848,7 +848,7 @@ public class Update implements UpdateDefinition {
 		 */
 		public PushOperatorBuilder sort(Sort sort) {
 
-			Assert.notNull(sort, "Sort must not be null.");
+			Assert.notNull(sort, "Sort must not be null");
 			this.modifiers.addModifier(new SortModifier(sort));
 			return this;
 		}
@@ -993,8 +993,8 @@ public class Update implements UpdateDefinition {
 		 */
 		protected BitwiseOperatorBuilder(Update reference, String key) {
 
-			Assert.notNull(reference, "Reference must not be null!");
-			Assert.notNull(key, "Key must not be null!");
+			Assert.notNull(reference, "Reference must not be null");
+			Assert.notNull(key, "Key must not be null");
 
 			this.reference = reference;
 			this.key = key;
diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/schema/DefaultMongoJsonSchema.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/schema/DefaultMongoJsonSchema.java
index 981085084..4ad1f429b 100644
--- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/schema/DefaultMongoJsonSchema.java
+++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/schema/DefaultMongoJsonSchema.java
@@ -47,7 +47,7 @@ class DefaultMongoJsonSchema implements MongoJsonSchema {
 	 */
 	DefaultMongoJsonSchema(JsonSchemaObject root, @Nullable Document encryptionMetadata) {
 
-		Assert.notNull(root, "Root schema object must not be null!");
+		Assert.notNull(root, "Root schema object must not be null");
 
 		this.root = root;
 		this.encryptionMetadata = encryptionMetadata;
diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/schema/DocumentJsonSchema.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/schema/DocumentJsonSchema.java
index 6b48c1207..9efb83aae 100644
--- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/schema/DocumentJsonSchema.java
+++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/schema/DocumentJsonSchema.java
@@ -30,7 +30,7 @@ class DocumentJsonSchema implements MongoJsonSchema {
 
 	DocumentJsonSchema(Document document) {
 
-		Assert.notNull(document, "Document must not be null!");
+		Assert.notNull(document, "Document must not be null");
 		this.document = document;
 	}
 
diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/schema/IdentifiableJsonSchemaProperty.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/schema/IdentifiableJsonSchemaProperty.java
index 99d6cde72..0e34d5ccf 100644
--- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/schema/IdentifiableJsonSchemaProperty.java
+++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/schema/IdentifiableJsonSchemaProperty.java
@@ -57,8 +57,8 @@ public class IdentifiableJsonSchemaProperty implemen
 	 */
 	IdentifiableJsonSchemaProperty(String identifier, T jsonSchemaObject) {
 
-		Assert.notNull(identifier, "Identifier must not be null!");
-		Assert.notNull(jsonSchemaObject, "JsonSchemaObject must not be null!");
+		Assert.notNull(identifier, "Identifier must not be null");
+		Assert.notNull(jsonSchemaObject, "JsonSchemaObject must not be null");
 
 		this.identifier = identifier;
 		this.jsonSchemaObjectDelegate = jsonSchemaObject;
@@ -1050,7 +1050,7 @@ public class IdentifiableJsonSchemaProperty implemen
 		private EncryptedJsonSchemaProperty(JsonSchemaProperty target, @Nullable String algorithm, @Nullable String keyId,
 				@Nullable List keyIds) {
 
-			Assert.notNull(target, "Target must not be null!");
+			Assert.notNull(target, "Target must not be null");
 			this.targetProperty = target;
 			this.algorithm = algorithm;
 			this.keyId = keyId;
diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/schema/JsonSchemaObject.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/schema/JsonSchemaObject.java
index 04e097ec7..2cd2b1274 100644
--- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/schema/JsonSchemaObject.java
+++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/schema/JsonSchemaObject.java
@@ -265,7 +265,7 @@ public interface JsonSchemaObject {
 			return of(Type.numberType());
 		}
 
-		throw new IllegalArgumentException(String.format("No JSON schema type found for %s.", type));
+		throw new IllegalArgumentException(String.format("No JSON schema type found for %s", type));
 	}
 
 	/**
diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/schema/MergedJsonSchemaProperty.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/schema/MergedJsonSchemaProperty.java
index c5b7591ed..b4b9aa335 100644
--- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/schema/MergedJsonSchemaProperty.java
+++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/schema/MergedJsonSchemaProperty.java
@@ -38,7 +38,7 @@ class MergedJsonSchemaProperty implements JsonSchemaProperty {
 	MergedJsonSchemaProperty(Iterable properties) {
 		this(properties, (k, a, b) -> {
 			throw new IllegalStateException(
-					String.format("Error resolving conflict for '%s'. No conflict resolution function defined.", k));
+					String.format("Error resolving conflict for '%s'; No conflict resolution function defined", k));
 		});
 	}
 
diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/schema/MongoJsonSchema.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/schema/MongoJsonSchema.java
index 3e888312d..32f464a29 100644
--- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/schema/MongoJsonSchema.java
+++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/schema/MongoJsonSchema.java
@@ -117,7 +117,7 @@ public interface MongoJsonSchema {
 	 */
 	static MongoJsonSchema merge(MongoJsonSchema... sources) {
 		return merge((path, left, right) -> {
-			throw new IllegalStateException(String.format("Cannot merge schema for path '%s' holding values '%s' and '%s'.",
+			throw new IllegalStateException(String.format("Cannot merge schema for path '%s' holding values '%s' and '%s'",
 					path.dotPath(), left, right));
 		}, sources);
 	}
@@ -153,7 +153,7 @@ public interface MongoJsonSchema {
 	 */
 	default MongoJsonSchema mergeWith(Collection sources) {
 		return mergeWith(sources, (path, left, right) -> {
-			throw new IllegalStateException(String.format("Cannot merge schema for path '%s' holding values '%s' and '%s'.",
+			throw new IllegalStateException(String.format("Cannot merge schema for path '%s' holding values '%s' and '%s'",
 					path.dotPath(), left, right));
 		});
 	}
@@ -231,7 +231,7 @@ public interface MongoJsonSchema {
 
 			@Override
 			default Object setValue(Object value) {
-				throw new IllegalStateException("Cannot set value result. Maybe you missed to override the method.");
+				throw new IllegalStateException("Cannot set value result; Maybe you missed to override the method");
 			}
 
 			/**
@@ -241,17 +241,17 @@ public interface MongoJsonSchema {
 
 				@Override
 				public String getKey() {
-					throw new IllegalStateException("No key for skipped result.");
+					throw new IllegalStateException("No key for skipped result");
 				}
 
 				@Override
 				public Object getValue() {
-					throw new IllegalStateException("No value for skipped result.");
+					throw new IllegalStateException("No value for skipped result");
 				}
 
 				@Override
 				public Object setValue(Object value) {
-					throw new IllegalStateException("Cannot set value on skipped result.");
+					throw new IllegalStateException("Cannot set value on skipped result");
 				}
 			};
 
diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/schema/TypedJsonSchemaObject.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/schema/TypedJsonSchemaObject.java
index d500661f9..d736b7cef 100644
--- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/schema/TypedJsonSchemaObject.java
+++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/schema/TypedJsonSchemaObject.java
@@ -70,7 +70,7 @@ public class TypedJsonSchemaObject extends UntypedJsonSchemaObject {
 
 		super(restrictions, description, generateDescription);
 
-		Assert.notNull(types, "Types must not be null! Please consider using 'Collections.emptySet()'.");
+		Assert.notNull(types, "Types must not be null Please consider using 'Collections.emptySet()'");
 
 		this.types = types;
 	}
@@ -83,8 +83,8 @@ public class TypedJsonSchemaObject extends UntypedJsonSchemaObject {
 	 */
 	public static TypedJsonSchemaObject of(Type... types) {
 
-		Assert.notNull(types, "Types must not be null!");
-		Assert.noNullElements(types, "Types must not contain null!");
+		Assert.notNull(types, "Types must not be null");
+		Assert.noNullElements(types, "Types must not contain null");
 
 		return new TypedJsonSchemaObject(new LinkedHashSet<>(Arrays.asList(types)), null, false, Restrictions.empty());
 	}
@@ -549,7 +549,7 @@ public class TypedJsonSchemaObject extends UntypedJsonSchemaObject {
 		 */
 		public NumericJsonSchemaObject multipleOf(Number value) {
 
-			Assert.notNull(value, "Value must not be null!");
+			Assert.notNull(value, "Value must not be null");
 			NumericJsonSchemaObject newInstance = newInstance(description, generateDescription, restrictions);
 			newInstance.multipleOf = value;
 
@@ -565,7 +565,7 @@ public class TypedJsonSchemaObject extends UntypedJsonSchemaObject {
 		 */
 		public NumericJsonSchemaObject within(Range range) {
 
-			Assert.notNull(range, "Range must not be null!");
+			Assert.notNull(range, "Range must not be null");
 
 			NumericJsonSchemaObject newInstance = newInstance(description, generateDescription, restrictions);
 			newInstance.range = range;
@@ -582,7 +582,7 @@ public class TypedJsonSchemaObject extends UntypedJsonSchemaObject {
 		@SuppressWarnings("unchecked")
 		public NumericJsonSchemaObject gt(Number min) {
 
-			Assert.notNull(min, "Min must not be null!");
+			Assert.notNull(min, "Min must not be null");
 
 			Bound upper = this.range != null ? this.range.getUpperBound() : Bound.unbounded();
 			return within(Range.of(createBound(min, false), upper));
@@ -597,7 +597,7 @@ public class TypedJsonSchemaObject extends UntypedJsonSchemaObject {
 		@SuppressWarnings("unchecked")
 		public NumericJsonSchemaObject gte(Number min) {
 
-			Assert.notNull(min, "Min must not be null!");
+			Assert.notNull(min, "Min must not be null");
 
 			Bound upper = this.range != null ? this.range.getUpperBound() : Bound.unbounded();
 			return within(Range.of(createBound(min, true), upper));
@@ -612,7 +612,7 @@ public class TypedJsonSchemaObject extends UntypedJsonSchemaObject {
 		@SuppressWarnings("unchecked")
 		public NumericJsonSchemaObject lt(Number max) {
 
-			Assert.notNull(max, "Max must not be null!");
+			Assert.notNull(max, "Max must not be null");
 
 			Bound lower = this.range != null ? this.range.getLowerBound() : Bound.unbounded();
 			return within(Range.of(lower, createBound(max, false)));
@@ -627,7 +627,7 @@ public class TypedJsonSchemaObject extends UntypedJsonSchemaObject {
 		@SuppressWarnings("unchecked")
 		public NumericJsonSchemaObject lte(Number max) {
 
-			Assert.notNull(max, "Max must not be null!");
+			Assert.notNull(max, "Max must not be null");
 
 			Bound lower = this.range != null ? this.range.getLowerBound() : Bound.unbounded();
 			return within(Range.of(lower, createBound(max, true)));
@@ -730,14 +730,14 @@ public class TypedJsonSchemaObject extends UntypedJsonSchemaObject {
 				return inclusive ? Bound.inclusive((BigDecimal) number) : Bound.exclusive((BigDecimal) number);
 			}
 
-			throw new IllegalArgumentException("Unsupported numeric value.");
+			throw new IllegalArgumentException("Unsupported numeric value");
 		}
 
 		private static Set validateTypes(Set types) {
 
 			types.forEach(type -> {
 				Assert.isTrue(NUMERIC_TYPES.contains(type),
-						() -> String.format("%s is not a valid numeric type. Expected one of %s.", type, NUMERIC_TYPES));
+						() -> String.format("%s is not a valid numeric type; Expected one of %s", type, NUMERIC_TYPES));
 			});
 
 			return types;
@@ -789,7 +789,7 @@ public class TypedJsonSchemaObject extends UntypedJsonSchemaObject {
 		 */
 		public StringJsonSchemaObject length(Range range) {
 
-			Assert.notNull(range, "Range must not be null!");
+			Assert.notNull(range, "Range must not be null");
 
 			StringJsonSchemaObject newInstance = newInstance(description, generateDescription, restrictions);
 			newInstance.length = range;
@@ -829,7 +829,7 @@ public class TypedJsonSchemaObject extends UntypedJsonSchemaObject {
 		 */
 		public StringJsonSchemaObject matching(String pattern) {
 
-			Assert.notNull(pattern, "Pattern must not be null!");
+			Assert.notNull(pattern, "Pattern must not be null");
 
 			StringJsonSchemaObject newInstance = newInstance(description, generateDescription, restrictions);
 			newInstance.pattern = pattern;
@@ -1185,7 +1185,7 @@ public class TypedJsonSchemaObject extends UntypedJsonSchemaObject {
 
 		@Override
 		protected String generateDescription() {
-			return "Must be a boolean.";
+			return "Must be a boolean";
 		}
 	}
 
@@ -1246,7 +1246,7 @@ public class TypedJsonSchemaObject extends UntypedJsonSchemaObject {
 
 		@Override
 		protected String generateDescription() {
-			return "Must be null.";
+			return "Must be null";
 		}
 	}
 
@@ -1306,7 +1306,7 @@ public class TypedJsonSchemaObject extends UntypedJsonSchemaObject {
 
 		@Override
 		protected String generateDescription() {
-			return "Must be a date.";
+			return "Must be a date";
 		}
 	}
 
@@ -1367,7 +1367,7 @@ public class TypedJsonSchemaObject extends UntypedJsonSchemaObject {
 
 		@Override
 		protected String generateDescription() {
-			return "Must be a timestamp.";
+			return "Must be a timestamp";
 		}
 	}
 }
diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/schema/UntypedJsonSchemaObject.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/schema/UntypedJsonSchemaObject.java
index f1ef11573..110a3eb5a 100644
--- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/schema/UntypedJsonSchemaObject.java
+++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/schema/UntypedJsonSchemaObject.java
@@ -208,7 +208,7 @@ public class UntypedJsonSchemaObject implements JsonSchemaObject {
 		 */
 		Restrictions possibleValues(Collection possibleValues) {
 
-			Assert.notNull(possibleValues, "PossibleValues must not be null!");
+			Assert.notNull(possibleValues, "PossibleValues must not be null");
 			return new Restrictions(possibleValues, allOf, anyOf, oneOf, notMatch);
 		}
 
@@ -218,7 +218,7 @@ public class UntypedJsonSchemaObject implements JsonSchemaObject {
 		 */
 		Restrictions allOf(Collection allOf) {
 
-			Assert.notNull(allOf, "AllOf must not be null!");
+			Assert.notNull(allOf, "AllOf must not be null");
 			return new Restrictions(possibleValues, allOf, anyOf, oneOf, notMatch);
 		}
 
@@ -228,7 +228,7 @@ public class UntypedJsonSchemaObject implements JsonSchemaObject {
 		 */
 		Restrictions anyOf(Collection anyOf) {
 
-			Assert.notNull(anyOf, "AnyOf must not be null!");
+			Assert.notNull(anyOf, "AnyOf must not be null");
 			return new Restrictions(possibleValues, allOf, anyOf, oneOf, notMatch);
 		}
 
@@ -238,7 +238,7 @@ public class UntypedJsonSchemaObject implements JsonSchemaObject {
 		 */
 		Restrictions oneOf(Collection oneOf) {
 
-			Assert.notNull(oneOf, "OneOf must not be null!");
+			Assert.notNull(oneOf, "OneOf must not be null");
 			return new Restrictions(possibleValues, allOf, anyOf, oneOf, notMatch);
 		}
 
@@ -248,7 +248,7 @@ public class UntypedJsonSchemaObject implements JsonSchemaObject {
 		 */
 		Restrictions notMatch(JsonSchemaObject notMatch) {
 
-			Assert.notNull(notMatch, "NotMatch must not be null!");
+			Assert.notNull(notMatch, "NotMatch must not be null");
 			return new Restrictions(possibleValues, allOf, anyOf, oneOf, notMatch);
 		}
 
diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/script/ExecutableMongoScript.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/script/ExecutableMongoScript.java
index 2c3f4501b..f09102d79 100644
--- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/script/ExecutableMongoScript.java
+++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/script/ExecutableMongoScript.java
@@ -37,7 +37,7 @@ public class ExecutableMongoScript {
 	 */
 	public ExecutableMongoScript(String code) {
 
-		Assert.hasText(code, "Code must not be null or empty!");
+		Assert.hasText(code, "Code must not be null or empty");
 		this.code = code;
 	}
 
diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/script/NamedMongoScript.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/script/NamedMongoScript.java
index 73d8b87a3..e3ec3737f 100644
--- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/script/NamedMongoScript.java
+++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/script/NamedMongoScript.java
@@ -52,8 +52,8 @@ public class NamedMongoScript {
 	 */
 	public NamedMongoScript(String name, ExecutableMongoScript script) {
 
-		Assert.hasText(name, "Name must not be null or empty!");
-		Assert.notNull(script, "ExecutableMongoScript must not be null!");
+		Assert.hasText(name, "Name must not be null or empty");
+		Assert.notNull(script, "ExecutableMongoScript must not be null");
 
 		this.name = name;
 		this.script = script;
diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/spel/ExpressionNode.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/spel/ExpressionNode.java
index a61f442c0..4cafbcb8d 100644
--- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/spel/ExpressionNode.java
+++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/spel/ExpressionNode.java
@@ -49,8 +49,8 @@ public class ExpressionNode implements Iterable {
 	 */
 	protected ExpressionNode(SpelNode node, ExpressionState state) {
 
-		Assert.notNull(node, "SpelNode must not be null!");
-		Assert.notNull(state, "ExpressionState must not be null!");
+		Assert.notNull(node, "SpelNode must not be null");
+		Assert.notNull(state, "ExpressionState must not be null");
 
 		this.node = node;
 		this.state = state;
@@ -103,7 +103,7 @@ public class ExpressionNode implements Iterable {
 	 */
 	public boolean isOfType(Class type) {
 
-		Assert.notNull(type, "Type must not be empty!");
+		Assert.notNull(type, "Type must not be empty");
 		return type.isAssignableFrom(node.getClass());
 	}
 
@@ -172,7 +172,7 @@ public class ExpressionNode implements Iterable {
 	 */
 	public ExpressionNode getChild(int index) {
 
-		Assert.isTrue(index >= 0, "Index must be greater or equal to zero!");
+		Assert.isTrue(index >= 0, "Index must be greater or equal to zero");
 		return from(node.getChild(index), state);
 	}
 
@@ -184,7 +184,7 @@ public class ExpressionNode implements Iterable {
 	 */
 	public boolean hasfirstChildNotOfType(Class type) {
 
-		Assert.notNull(type, "Type must not be null!");
+		Assert.notNull(type, "Type must not be null");
 		return hasChildren() && !node.getChild(0).getClass().equals(type);
 	}
 
diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/spel/ExpressionTransformationContextSupport.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/spel/ExpressionTransformationContextSupport.java
index 4d365ac3a..79edefc6d 100644
--- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/spel/ExpressionTransformationContextSupport.java
+++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/spel/ExpressionTransformationContextSupport.java
@@ -46,7 +46,7 @@ public class ExpressionTransformationContextSupport {
 	public ExpressionTransformationContextSupport(T currentNode, @Nullable ExpressionNode parentNode,
 			@Nullable Document previousOperationObject) {
 
-		Assert.notNull(currentNode, "currentNode must not be null!");
+		Assert.notNull(currentNode, "currentNode must not be null");
 
 		this.currentNode = currentNode;
 		this.parentNode = parentNode;
@@ -112,7 +112,7 @@ public class ExpressionTransformationContextSupport {
 	 */
 	public Document addToPreviousOperation(Object value) {
 
-		Assert.state(previousOperationObject != null, "No previous operation available!");
+		Assert.state(previousOperationObject != null, "No previous operation available");
 
 		extractArgumentListFrom(previousOperationObject).add(value);
 		return previousOperationObject;
diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/spel/MethodReferenceNode.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/spel/MethodReferenceNode.java
index 656f4fd1f..bc73ac5aa 100644
--- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/spel/MethodReferenceNode.java
+++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/spel/MethodReferenceNode.java
@@ -362,7 +362,7 @@ public class MethodReferenceNode extends ExpressionNode {
 		AggregationMethodReference mappingParametersTo(String... aggregationExpressionProperties) {
 
 			Assert.isTrue(ObjectUtils.nullSafeEquals(argumentType, ArgumentType.MAP),
-					"Parameter mapping can only be applied to AggregationMethodReference with MAPPED ArgumentType.");
+					"Parameter mapping can only be applied to AggregationMethodReference with MAPPED ArgumentType");
 			return new AggregationMethodReference(mongoOperator, argumentType, aggregationExpressionProperties);
 		}
 
diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/spel/OperatorNode.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/spel/OperatorNode.java
index 3f63714f6..cbb574483 100644
--- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/spel/OperatorNode.java
+++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/spel/OperatorNode.java
@@ -117,7 +117,7 @@ public class OperatorNode extends ExpressionNode {
 
 		if (!OPERATORS.containsKey(operator.getOperatorName())) {
 			throw new IllegalArgumentException(String.format(
-					"Unknown operator name. Cannot translate %s into its MongoDB aggregation function representation.",
+					"Unknown operator name; Cannot translate %s into its MongoDB aggregation function representation",
 					operator.getOperatorName()));
 		}
 
diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/validation/CriteriaValidator.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/validation/CriteriaValidator.java
index 5f268d966..1d451eb53 100644
--- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/validation/CriteriaValidator.java
+++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/validation/CriteriaValidator.java
@@ -49,7 +49,7 @@ class CriteriaValidator implements Validator {
 	 */
 	static CriteriaValidator of(CriteriaDefinition criteria) {
 
-		Assert.notNull(criteria, "Criteria must not be null!");
+		Assert.notNull(criteria, "Criteria must not be null");
 
 		return new CriteriaValidator(criteria);
 	}
diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/validation/DocumentValidator.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/validation/DocumentValidator.java
index 3b57935c1..9870937e4 100644
--- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/validation/DocumentValidator.java
+++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/validation/DocumentValidator.java
@@ -45,7 +45,7 @@ class DocumentValidator implements Validator {
 	 */
 	static DocumentValidator of(Document validatorObject) {
 
-		Assert.notNull(validatorObject, "ValidatorObject must not be null!");
+		Assert.notNull(validatorObject, "ValidatorObject must not be null");
 
 		return new DocumentValidator(new Document(validatorObject));
 	}
diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/validation/JsonSchemaValidator.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/validation/JsonSchemaValidator.java
index b578e6e7c..41d06309d 100644
--- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/validation/JsonSchemaValidator.java
+++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/validation/JsonSchemaValidator.java
@@ -45,7 +45,7 @@ class JsonSchemaValidator implements Validator {
 	 */
 	static JsonSchemaValidator of(MongoJsonSchema schema) {
 
-		Assert.notNull(schema, "Schema must not be null!");
+		Assert.notNull(schema, "Schema must not be null");
 
 		return new JsonSchemaValidator(schema);
 	}
diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/validation/Validator.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/validation/Validator.java
index 232799e82..d183281c4 100644
--- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/validation/Validator.java
+++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/validation/Validator.java
@@ -48,7 +48,7 @@ public interface Validator {
 	 */
 	static Validator document(Document validationRules) {
 
-		Assert.notNull(validationRules, "ValidationRules must not be null!");
+		Assert.notNull(validationRules, "ValidationRules must not be null");
 		return DocumentValidator.of(validationRules);
 	}
 
@@ -61,7 +61,7 @@ public interface Validator {
 	 */
 	static Validator schema(MongoJsonSchema schema) {
 
-		Assert.notNull(schema, "Schema must not be null!");
+		Assert.notNull(schema, "Schema must not be null");
 		return JsonSchemaValidator.of(schema);
 	}
 
@@ -75,7 +75,7 @@ public interface Validator {
 	 */
 	static Validator criteria(CriteriaDefinition criteria) {
 
-		Assert.notNull(criteria, "Criteria must not be null!");
+		Assert.notNull(criteria, "Criteria must not be null");
 		return CriteriaValidator.of(criteria);
 	}
 }
diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/gridfs/AntPath.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/gridfs/AntPath.java
index f816b4810..4a62ee05a 100644
--- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/gridfs/AntPath.java
+++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/gridfs/AntPath.java
@@ -40,7 +40,7 @@ class AntPath {
 	 */
 	public AntPath(String path) {
 
-		Assert.notNull(path, "Path must not be null!");
+		Assert.notNull(path, "Path must not be null");
 
 		this.path = path;
 	}
diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/gridfs/GridFsOperationsSupport.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/gridfs/GridFsOperationsSupport.java
index b138ae926..5cbe64460 100644
--- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/gridfs/GridFsOperationsSupport.java
+++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/gridfs/GridFsOperationsSupport.java
@@ -43,7 +43,7 @@ class GridFsOperationsSupport {
 	 */
 	GridFsOperationsSupport(MongoConverter converter) {
 
-		Assert.notNull(converter, "MongoConverter must not be null!");
+		Assert.notNull(converter, "MongoConverter must not be null");
 
 		this.converter = converter;
 		this.queryMapper = new QueryMapper(converter);
diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/gridfs/GridFsTemplate.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/gridfs/GridFsTemplate.java
index c4583b7a5..2687c48f2 100644
--- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/gridfs/GridFsTemplate.java
+++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/gridfs/GridFsTemplate.java
@@ -81,7 +81,7 @@ public class GridFsTemplate extends GridFsOperationsSupport implements GridFsOpe
 
 		super(converter);
 
-		Assert.notNull(dbFactory, "MongoDbFactory must not be null!");
+		Assert.notNull(dbFactory, "MongoDbFactory must not be null");
 
 		this.dbFactory = dbFactory;
 		this.bucket = bucket;
@@ -112,7 +112,7 @@ public class GridFsTemplate extends GridFsOperationsSupport implements GridFsOpe
 
 	public GridFSFindIterable find(Query query) {
 
-		Assert.notNull(query, "Query must not be null!");
+		Assert.notNull(query, "Query must not be null");
 
 		Document queryObject = getMappedQuery(query.getQueryObject());
 		Document sortObject = getMappedQuery(query.getSortObject());
@@ -154,7 +154,7 @@ public class GridFsTemplate extends GridFsOperationsSupport implements GridFsOpe
 
 	public GridFsResource getResource(GridFSFile file) {
 
-		Assert.notNull(file, "GridFSFile must not be null!");
+		Assert.notNull(file, "GridFSFile must not be null");
 
 		return new GridFsResource(file, getGridFs().openDownloadStream(file.getId()));
 	}
diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/gridfs/ReactiveGridFsTemplate.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/gridfs/ReactiveGridFsTemplate.java
index 2efd25cfa..2d3a6cb99 100644
--- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/gridfs/ReactiveGridFsTemplate.java
+++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/gridfs/ReactiveGridFsTemplate.java
@@ -103,8 +103,8 @@ public class ReactiveGridFsTemplate extends GridFsOperationsSupport implements R
 
 		super(converter);
 
-		Assert.notNull(dataBufferFactory, "DataBufferFactory must not be null!");
-		Assert.notNull(dbFactory, "ReactiveMongoDatabaseFactory must not be null!");
+		Assert.notNull(dataBufferFactory, "DataBufferFactory must not be null");
+		Assert.notNull(dbFactory, "ReactiveMongoDatabaseFactory must not be null");
 
 		this.dataBufferFactory = dataBufferFactory;
 		this.dbFactory = dbFactory;
@@ -186,7 +186,7 @@ public class ReactiveGridFsTemplate extends GridFsOperationsSupport implements R
 	@Override
 	public Mono getResource(String location) {
 
-		Assert.notNull(location, "Filename must not be null!");
+		Assert.notNull(location, "Filename must not be null");
 
 		return findOne(query(whereFilename().is(location))).flatMap(this::getResource)
 				.defaultIfEmpty(ReactiveGridFsResource.absent(location));
@@ -195,7 +195,7 @@ public class ReactiveGridFsTemplate extends GridFsOperationsSupport implements R
 	@Override
 	public Mono getResource(GridFSFile file) {
 
-		Assert.notNull(file, "GridFSFile must not be null!");
+		Assert.notNull(file, "GridFSFile must not be null");
 
 		return doGetBucket()
 				.map(it -> new ReactiveGridFsResource(file, it.downloadToPublisher(file.getId()), dataBufferFactory));
@@ -228,7 +228,7 @@ public class ReactiveGridFsTemplate extends GridFsOperationsSupport implements R
 	 */
 	public  Mono createMono(ReactiveBucketCallback callback) {
 
-		Assert.notNull(callback, "ReactiveBucketCallback must not be null!");
+		Assert.notNull(callback, "ReactiveBucketCallback must not be null");
 
 		return doGetBucket().flatMap(bucket -> Mono.from(callback.doInBucket(bucket)));
 	}
@@ -242,7 +242,7 @@ public class ReactiveGridFsTemplate extends GridFsOperationsSupport implements R
 	 */
 	public  Flux createFlux(ReactiveBucketCallback callback) {
 
-		Assert.notNull(callback, "ReactiveBucketCallback must not be null!");
+		Assert.notNull(callback, "ReactiveBucketCallback must not be null");
 
 		return doGetBucket().flatMapMany(callback::doInBucket);
 	}
diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/cdi/MongoRepositoryBean.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/cdi/MongoRepositoryBean.java
index 4c4cdeeea..e70b7a6e5 100644
--- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/cdi/MongoRepositoryBean.java
+++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/cdi/MongoRepositoryBean.java
@@ -54,7 +54,7 @@ public class MongoRepositoryBean extends CdiRepositoryBean {
 
 		super(qualifiers, repositoryType, beanManager, detector);
 
-		Assert.notNull(operations, "MongoOperations bean must not be null!");
+		Assert.notNull(operations, "MongoOperations bean must not be null");
 		this.operations = operations;
 	}
 
diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/AbstractMongoQuery.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/AbstractMongoQuery.java
index 20bf6520d..910ae7514 100644
--- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/AbstractMongoQuery.java
+++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/AbstractMongoQuery.java
@@ -86,10 +86,10 @@ public abstract class AbstractMongoQuery implements RepositoryQuery {
 	public AbstractMongoQuery(MongoQueryMethod method, MongoOperations operations, ExpressionParser expressionParser,
 			QueryMethodEvaluationContextProvider evaluationContextProvider) {
 
-		Assert.notNull(operations, "MongoOperations must not be null!");
-		Assert.notNull(method, "MongoQueryMethod must not be null!");
-		Assert.notNull(expressionParser, "SpelExpressionParser must not be null!");
-		Assert.notNull(evaluationContextProvider, "QueryMethodEvaluationContextProvider must not be null!");
+		Assert.notNull(operations, "MongoOperations must not be null");
+		Assert.notNull(method, "MongoQueryMethod must not be null");
+		Assert.notNull(expressionParser, "SpelExpressionParser must not be null");
+		Assert.notNull(evaluationContextProvider, "QueryMethodEvaluationContextProvider must not be null");
 
 		this.method = method;
 		this.operations = operations;
@@ -153,7 +153,7 @@ public abstract class AbstractMongoQuery implements RepositoryQuery {
 		if (method.isModifyingQuery()) {
 			if (isLimiting()) {
 				throw new IllegalStateException(
-						String.format("Update method must not be limiting. Offending method: %s", method));
+						String.format("Update method must not be limiting; Offending method: %s", method));
 			}
 			return new UpdateExecution(executableUpdate, method, () -> createUpdate(accessor), accessor);
 		}
diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/AbstractReactiveMongoQuery.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/AbstractReactiveMongoQuery.java
index 4b8d02ec4..08e61c902 100644
--- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/AbstractReactiveMongoQuery.java
+++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/AbstractReactiveMongoQuery.java
@@ -90,10 +90,10 @@ public abstract class AbstractReactiveMongoQuery implements RepositoryQuery {
 	public AbstractReactiveMongoQuery(ReactiveMongoQueryMethod method, ReactiveMongoOperations operations,
 			ExpressionParser expressionParser, ReactiveQueryMethodEvaluationContextProvider evaluationContextProvider) {
 
-		Assert.notNull(method, "MongoQueryMethod must not be null!");
-		Assert.notNull(operations, "ReactiveMongoOperations must not be null!");
-		Assert.notNull(expressionParser, "SpelExpressionParser must not be null!");
-		Assert.notNull(evaluationContextProvider, "ReactiveEvaluationContextExtension must not be null!");
+		Assert.notNull(method, "MongoQueryMethod must not be null");
+		Assert.notNull(operations, "ReactiveMongoOperations must not be null");
+		Assert.notNull(expressionParser, "SpelExpressionParser must not be null");
+		Assert.notNull(evaluationContextProvider, "ReactiveEvaluationContextExtension must not be null");
 
 		this.method = method;
 		this.operations = operations;
@@ -193,7 +193,7 @@ public abstract class AbstractReactiveMongoQuery implements RepositoryQuery {
 
 			if (isLimiting()) {
 				throw new IllegalStateException(
-						String.format("Update method must not be limiting. Offending method: %s", method));
+						String.format("Update method must not be limiting; Offending method: %s", method));
 			}
 
 			return new UpdateExecution(updateOps, method, accessor, createUpdate(accessor));
diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/ConvertingParameterAccessor.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/ConvertingParameterAccessor.java
index b9ace445e..f246973ee 100644
--- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/ConvertingParameterAccessor.java
+++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/ConvertingParameterAccessor.java
@@ -61,8 +61,8 @@ public class ConvertingParameterAccessor implements MongoParameterAccessor {
 	 */
 	public ConvertingParameterAccessor(MongoWriter writer, MongoParameterAccessor delegate) {
 
-		Assert.notNull(writer, "MongoWriter must not be null!");
-		Assert.notNull(delegate, "MongoParameterAccessor must not be null!");
+		Assert.notNull(writer, "MongoWriter must not be null");
+		Assert.notNull(delegate, "MongoParameterAccessor must not be null");
 
 		this.writer = writer;
 		this.delegate = delegate;
diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/MongoParameters.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/MongoParameters.java
index 7d2814e43..dffd4a82a 100644
--- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/MongoParameters.java
+++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/MongoParameters.java
@@ -106,7 +106,7 @@ public class MongoParameters extends Parameters
 			if (nearIndex == parameterTypes.lastIndexOf(reference)) {
 				return nearIndex;
 			} else {
-				throw new IllegalStateException("Multiple Point parameters found but none annotated with @Near!");
+				throw new IllegalStateException("Multiple Point parameters found but none annotated with @Near");
 			}
 		}
 
@@ -124,7 +124,7 @@ public class MongoParameters extends Parameters
 					index = param.getIndex();
 				} else {
 					throw new IllegalStateException(
-							String.format("Found multiple @Near annotations ond method %s! Only one allowed!", method.toString()));
+							String.format("Found multiple @Near annotations ond method %s; Only one allowed", method.toString()));
 				}
 
 			}
@@ -249,7 +249,7 @@ public class MongoParameters extends Parameters
 			this.parameter = parameter;
 
 			if (!isPoint() && hasNearAnnotation()) {
-				throw new IllegalArgumentException("Near annotation is only allowed at Point parameter!");
+				throw new IllegalArgumentException("Near annotation is only allowed at Point parameter");
 			}
 		}
 
diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/MongoParametersParameterAccessor.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/MongoParametersParameterAccessor.java
index 028e7b6fc..5d46866be 100644
--- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/MongoParametersParameterAccessor.java
+++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/MongoParametersParameterAccessor.java
@@ -87,7 +87,7 @@ public class MongoParametersParameterAccessor extends ParametersParameterAccesso
 		if (value instanceof double[]) {
 			double[] typedValue = (double[]) value;
 			if (typedValue.length != 2) {
-				throw new IllegalArgumentException("The given double[] must have exactly 2 elements!");
+				throw new IllegalArgumentException("The given double[] must have exactly 2 elements");
 			} else {
 				return new Point(typedValue[0], typedValue[1]);
 			}
diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/MongoQueryCreator.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/MongoQueryCreator.java
index 976d19e7a..9a486c499 100644
--- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/MongoQueryCreator.java
+++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/MongoQueryCreator.java
@@ -99,7 +99,7 @@ class MongoQueryCreator extends AbstractQueryCreator {
 
 		super(tree, accessor);
 
-		Assert.notNull(context, "MappingContext must not be null!");
+		Assert.notNull(context, "MappingContext must not be null");
 
 		this.accessor = accessor;
 		this.isGeoNearQuery = isGeoNearQuery;
@@ -250,7 +250,7 @@ class MongoQueryCreator extends AbstractQueryCreator {
 				return isSimpleComparisionPossible(part) ? criteria.ne(parameters.next())
 						: createLikeRegexCriteriaOrThrow(part, property, criteria, parameters, true);
 			default:
-				throw new IllegalArgumentException("Unsupported keyword!");
+				throw new IllegalArgumentException("Unsupported keyword");
 		}
 	}
 
@@ -342,7 +342,7 @@ class MongoQueryCreator extends AbstractQueryCreator {
 		if (value == null) {
 
 			throw new IllegalArgumentException(String.format(
-					"Argument for creating $regex pattern for property '%s' must not be null!", part.getProperty().getSegment()));
+					"Argument for creating $regex pattern for property '%s' must not be null", part.getProperty().getSegment()));
 		}
 
 		return criteria.regex(toLikeRegex(value.toString(), part), toRegexOptions(part));
@@ -383,7 +383,7 @@ class MongoQueryCreator extends AbstractQueryCreator {
 		}
 
 		throw new IllegalArgumentException(
-				String.format("Expected parameter type of %s but got %s!", type, parameter.getClass()));
+				String.format("Expected parameter type of %s but got %s", type, parameter.getClass()));
 	}
 
 	private java.util.List nextAsList(Iterator iterator, Part part) {
diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/MongoQueryExecution.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/MongoQueryExecution.java
index 4dcef0f9f..84370ff13 100644
--- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/MongoQueryExecution.java
+++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/MongoQueryExecution.java
@@ -71,8 +71,8 @@ interface MongoQueryExecution {
 
 		public SlicedExecution(ExecutableFindOperation.FindWithQuery find, Pageable pageable) {
 
-			Assert.notNull(find, "Find must not be null!");
-			Assert.notNull(pageable, "Pageable must not be null!");
+			Assert.notNull(find, "Find must not be null");
+			Assert.notNull(pageable, "Pageable must not be null");
 
 			this.find = find;
 			this.pageable = pageable;
@@ -108,8 +108,8 @@ interface MongoQueryExecution {
 
 		public PagedExecution(ExecutableFindOperation.FindWithQuery operation, Pageable pageable) {
 
-			Assert.notNull(operation, "Operation must not be null!");
-			Assert.notNull(pageable, "Pageable must not be null!");
+			Assert.notNull(operation, "Operation must not be null");
+			Assert.notNull(pageable, "Pageable must not be null");
 
 			this.operation = operation;
 			this.pageable = pageable;
@@ -152,9 +152,9 @@ interface MongoQueryExecution {
 		public GeoNearExecution(ExecutableFindOperation.FindWithQuery operation, MongoQueryMethod method,
 				MongoParameterAccessor accessor) {
 
-			Assert.notNull(operation, "Operation must not be null!");
-			Assert.notNull(method, "Method must not be null!");
-			Assert.notNull(accessor, "Accessor must not be null!");
+			Assert.notNull(operation, "Operation must not be null");
+			Assert.notNull(method, "Method must not be null");
+			Assert.notNull(accessor, "Accessor must not be null");
 
 			this.operation = operation;
 			this.method = method;
@@ -256,8 +256,8 @@ interface MongoQueryExecution {
 
 		public DeleteExecution(MongoOperations operations, MongoQueryMethod method) {
 
-			Assert.notNull(operations, "Operations must not be null!");
-			Assert.notNull(method, "Method must not be null!");
+			Assert.notNull(operations, "Operations must not be null");
+			Assert.notNull(method, "Method must not be null");
 
 			this.operations = operations;
 			this.method = method;
diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/MongoQueryMethod.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/MongoQueryMethod.java
index acc62f39e..ebc2d6cdf 100644
--- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/MongoQueryMethod.java
+++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/MongoQueryMethod.java
@@ -82,7 +82,7 @@ public class MongoQueryMethod extends QueryMethod {
 
 		super(method, metadata, projectionFactory);
 
-		Assert.notNull(mappingContext, "MappingContext must not be null!");
+		Assert.notNull(mappingContext, "MappingContext must not be null");
 
 		this.method = method;
 		this.mappingContext = mappingContext;
@@ -310,7 +310,7 @@ public class MongoQueryMethod extends QueryMethod {
 	public String getAnnotatedSort() {
 
 		return lookupQueryAnnotation().map(Query::sort).orElseThrow(() -> new IllegalStateException(
-				"Expected to find @Query annotation but did not. Make sure to check hasAnnotatedSort() before."));
+				"Expected to find @Query annotation but did not; Make sure to check hasAnnotatedSort() before."));
 	}
 
 	/**
@@ -344,7 +344,7 @@ public class MongoQueryMethod extends QueryMethod {
 		return lookupQueryAnnotation().map(Query::collation)
 				.orElseGet(() -> lookupAggregationAnnotation().map(Aggregation::collation) //
 						.orElseThrow(() -> new IllegalStateException(
-								"Expected to find @Query annotation but did not. Make sure to check hasAnnotatedCollation() before.")));
+								"Expected to find @Query annotation but did not; Make sure to check hasAnnotatedCollation() before.")));
 	}
 
 	/**
@@ -367,7 +367,7 @@ public class MongoQueryMethod extends QueryMethod {
 	 */
 	public String[] getAnnotatedAggregation() {
 		return findAnnotatedAggregation().orElseThrow(() -> new IllegalStateException(
-				"Expected to find @Aggregation annotation but did not. Make sure to check hasAnnotatedAggregation() before."));
+				"Expected to find @Aggregation annotation but did not; Make sure to check hasAnnotatedAggregation() before."));
 	}
 
 	private Optional findAnnotatedAggregation() {
@@ -437,8 +437,8 @@ public class MongoQueryMethod extends QueryMethod {
 			if (hasAnnotatedUpdate()) { // must define either an update or an update pipeline
 				if (!StringUtils.hasText(getUpdateSource().update()) && ObjectUtils.isEmpty(getUpdateSource().pipeline())) {
 					throw new IllegalStateException(
-							String.format("Update method must define either 'Update#update' or 'Update#pipeline' attribute. "
-									+ "Offending method: %s", method));
+							String.format("Update method must define either 'Update#update' or 'Update#pipeline' attribute;"
+									+ " Offending method: %s", method));
 				}
 			}
 		}
diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/PartTreeMongoQuery.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/PartTreeMongoQuery.java
index ec50c60f3..835a39af2 100644
--- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/PartTreeMongoQuery.java
+++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/PartTreeMongoQuery.java
@@ -119,7 +119,7 @@ public class PartTreeMongoQuery extends AbstractMongoQuery {
 			return result;
 
 		} catch (JsonParseException o_O) {
-			throw new IllegalStateException(String.format("Invalid query or field specification in %s!", getQueryMethod()),
+			throw new IllegalStateException(String.format("Invalid query or field specification in %s", getQueryMethod()),
 					o_O);
 		}
 	}
diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/ReactiveMongoQueryExecution.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/ReactiveMongoQueryExecution.java
index 818ef79af..5c22fb85a 100644
--- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/ReactiveMongoQueryExecution.java
+++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/ReactiveMongoQueryExecution.java
@@ -189,8 +189,8 @@ interface ReactiveMongoQueryExecution {
 
 		public ResultProcessingExecution(ReactiveMongoQueryExecution delegate, Converter converter) {
 
-			Assert.notNull(delegate, "Delegate must not be null!");
-			Assert.notNull(converter, "Converter must not be null!");
+			Assert.notNull(delegate, "Delegate must not be null");
+			Assert.notNull(converter, "Converter must not be null");
 
 			this.delegate = delegate;
 			this.converter = converter;
@@ -216,9 +216,9 @@ interface ReactiveMongoQueryExecution {
 		public ResultProcessingConverter(ResultProcessor processor, ReactiveMongoOperations operations,
 				EntityInstantiators instantiators) {
 
-			Assert.notNull(processor, "Processor must not be null!");
-			Assert.notNull(operations, "Operations must not be null!");
-			Assert.notNull(instantiators, "Instantiators must not be null!");
+			Assert.notNull(processor, "Processor must not be null");
+			Assert.notNull(operations, "Operations must not be null");
+			Assert.notNull(instantiators, "Instantiators must not be null");
 
 			this.processor = processor;
 			this.operations = operations;
diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/ReactiveMongoQueryMethod.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/ReactiveMongoQueryMethod.java
index 366d46332..53ab91ae0 100644
--- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/ReactiveMongoQueryMethod.java
+++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/ReactiveMongoQueryMethod.java
@@ -141,19 +141,19 @@ public class ReactiveMongoQueryMethod extends MongoQueryMethod {
 
 			if (singleWrapperWithWrappedPageableResult) {
 				throw new InvalidDataAccessApiUsageException(
-						String.format("'%s.%s' must not use sliced or paged execution. Please use Flux.buffer(size, skip).",
+						String.format("'%s.%s' must not use sliced or paged execution; Please use Flux.buffer(size, skip).",
 								ClassUtils.getShortName(method.getDeclaringClass()), method.getName()));
 			}
 
 			if (!multiWrapper) {
 				throw new IllegalStateException(String.format(
-						"Method has to use a either multi-item reactive wrapper return type or a wrapped Page/Slice type. Offending method: %s",
+						"Method has to use a either multi-item reactive wrapper return type or a wrapped Page/Slice type; Offending method: %s",
 						method.toString()));
 			}
 
 			if (hasParameterOfType(method, Sort.class)) {
-				throw new IllegalStateException(String.format("Method must not have Pageable *and* Sort parameter. "
-						+ "Use sorting capabilities on Pageable instead! Offending method: %s", method.toString()));
+				throw new IllegalStateException(String.format("Method must not have Pageable *and* Sort parameter;"
+						+ " Use sorting capabilities on Pageable instead; Offending method: %s", method));
 			}
 		}
 
diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/ReactivePartTreeMongoQuery.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/ReactivePartTreeMongoQuery.java
index b47564cf5..b3048db7a 100644
--- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/ReactivePartTreeMongoQuery.java
+++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/ReactivePartTreeMongoQuery.java
@@ -125,7 +125,7 @@ public class ReactivePartTreeMongoQuery extends AbstractReactiveMongoQuery {
 
 			return result;
 		} catch (JsonParseException o_O) {
-			throw new IllegalStateException(String.format("Invalid query or field specification in %s!", getQueryMethod()),
+			throw new IllegalStateException(String.format("Invalid query or field specification in %s", getQueryMethod()),
 					o_O);
 		}
 	}
diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/ReactiveStringBasedMongoQuery.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/ReactiveStringBasedMongoQuery.java
index d62ef9fe2..80bea5c4b 100644
--- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/ReactiveStringBasedMongoQuery.java
+++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/ReactiveStringBasedMongoQuery.java
@@ -43,7 +43,7 @@ import org.springframework.util.Assert;
  */
 public class ReactiveStringBasedMongoQuery extends AbstractReactiveMongoQuery {
 
-	private static final String COUNT_EXISTS_AND_DELETE = "Manually defined query for %s cannot be a count and exists or delete query at the same time!";
+	private static final String COUNT_EXISTS_AND_DELETE = "Manually defined query for %s cannot be a count and exists or delete query at the same time";
 	private static final Log LOG = LogFactory.getLog(ReactiveStringBasedMongoQuery.class);
 
 	private final String query;
@@ -85,8 +85,8 @@ public class ReactiveStringBasedMongoQuery extends AbstractReactiveMongoQuery {
 
 		super(method, mongoOperations, expressionParser, evaluationContextProvider);
 
-		Assert.notNull(query, "Query must not be null!");
-		Assert.notNull(expressionParser, "SpelExpressionParser must not be null!");
+		Assert.notNull(query, "Query must not be null");
+		Assert.notNull(expressionParser, "SpelExpressionParser must not be null");
 
 		this.query = query;
 		this.expressionParser = expressionParser;
diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/SimpleMongoEntityMetadata.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/SimpleMongoEntityMetadata.java
index d7a229ec0..4121b4667 100644
--- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/SimpleMongoEntityMetadata.java
+++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/SimpleMongoEntityMetadata.java
@@ -37,8 +37,8 @@ class SimpleMongoEntityMetadata implements MongoEntityMetadata {
 	 */
 	public SimpleMongoEntityMetadata(Class type, MongoPersistentEntity collectionEntity) {
 
-		Assert.notNull(type, "Type must not be null!");
-		Assert.notNull(collectionEntity, "Collection entity must not be null or empty!");
+		Assert.notNull(type, "Type must not be null");
+		Assert.notNull(collectionEntity, "Collection entity must not be null or empty");
 
 		this.type = type;
 		this.collectionEntity = collectionEntity;
diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/StringBasedAggregation.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/StringBasedAggregation.java
index 3df9adfd0..56186bbca 100644
--- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/StringBasedAggregation.java
+++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/StringBasedAggregation.java
@@ -69,7 +69,7 @@ public class StringBasedAggregation extends AbstractMongoQuery {
 
 		if (method.isPageQuery()) {
 			throw new InvalidMongoDbApiUsageException(String.format(
-					"Repository aggregation method '%s' does not support '%s' return type. Please use 'Slice' or 'List' instead.",
+					"Repository aggregation method '%s' does not support '%s' return type; Please use 'Slice' or 'List' instead",
 					method.getName(), method.getReturnType().getType().getSimpleName()));
 		}
 
diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/StringBasedMongoQuery.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/StringBasedMongoQuery.java
index f6b800d7e..0509f052e 100644
--- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/StringBasedMongoQuery.java
+++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/StringBasedMongoQuery.java
@@ -41,7 +41,7 @@ import org.springframework.util.Assert;
  */
 public class StringBasedMongoQuery extends AbstractMongoQuery {
 
-	private static final String COUNT_EXISTS_AND_DELETE = "Manually defined query for %s cannot be a count and exists or delete query at the same time!";
+	private static final String COUNT_EXISTS_AND_DELETE = "Manually defined query for %s cannot be a count and exists or delete query at the same time";
 	private static final Log LOG = LogFactory.getLog(StringBasedMongoQuery.class);
 
 	private final String query;
@@ -79,8 +79,8 @@ public class StringBasedMongoQuery extends AbstractMongoQuery {
 
 		super(method, mongoOperations, expressionParser, evaluationContextProvider);
 
-		Assert.notNull(query, "Query must not be null!");
-		Assert.notNull(expressionParser, "SpelExpressionParser must not be null!");
+		Assert.notNull(query, "Query must not be null");
+		Assert.notNull(expressionParser, "SpelExpressionParser must not be null");
 
 		this.query = query;
 		this.fieldSpec = method.getFieldSpecification();
diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/support/FetchableFluentQuerySupport.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/support/FetchableFluentQuerySupport.java
index 64d4d78d1..38570fec8 100644
--- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/support/FetchableFluentQuerySupport.java
+++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/support/FetchableFluentQuerySupport.java
@@ -50,7 +50,7 @@ abstract class FetchableFluentQuerySupport implements FluentQuery.Fetchabl
 	@Override
 	public FluentQuery.FetchableFluentQuery sortBy(Sort sort) {
 
-		Assert.notNull(sort, "Sort must not be null!");
+		Assert.notNull(sort, "Sort must not be null");
 
 		return create(predicate, sort, resultType, fieldsToInclude);
 	}
@@ -62,7 +62,7 @@ abstract class FetchableFluentQuerySupport implements FluentQuery.Fetchabl
 	@Override
 	public  FluentQuery.FetchableFluentQuery as(Class projection) {
 
-		Assert.notNull(projection, "Projection target type must not be null!");
+		Assert.notNull(projection, "Projection target type must not be null");
 
 		return create(predicate, sort, projection, fieldsToInclude);
 	}
@@ -74,7 +74,7 @@ abstract class FetchableFluentQuerySupport implements FluentQuery.Fetchabl
 	@Override
 	public FluentQuery.FetchableFluentQuery project(Collection properties) {
 
-		Assert.notNull(properties, "Projection properties must not be null!");
+		Assert.notNull(properties, "Projection properties must not be null");
 
 		return create(predicate, sort, resultType, new ArrayList<>(properties));
 	}
diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/support/IndexEnsuringQueryCreationListener.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/support/IndexEnsuringQueryCreationListener.java
index ac3becd44..84cc75fc6 100644
--- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/support/IndexEnsuringQueryCreationListener.java
+++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/support/IndexEnsuringQueryCreationListener.java
@@ -66,7 +66,7 @@ class IndexEnsuringQueryCreationListener implements QueryCreationListener MongoEntityInformation entityInformationFor(MongoPersistentEntity entity,
 			@Nullable Class idType) {
 
-		Assert.notNull(entity, "Entity must not be null!");
+		Assert.notNull(entity, "Entity must not be null");
 
 		return new MappingMongoEntityInformation<>((MongoPersistentEntity) entity, (Class) idType);
 	}
diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/support/MongoRepositoryFactory.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/support/MongoRepositoryFactory.java
index cd6344c85..936b3cc71 100644
--- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/support/MongoRepositoryFactory.java
+++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/support/MongoRepositoryFactory.java
@@ -71,7 +71,7 @@ public class MongoRepositoryFactory extends RepositoryFactorySupport {
 	 */
 	public MongoRepositoryFactory(MongoOperations mongoOperations) {
 
-		Assert.notNull(mongoOperations, "MongoOperations must not be null!");
+		Assert.notNull(mongoOperations, "MongoOperations must not be null");
 
 		this.operations = mongoOperations;
 		this.mappingContext = mongoOperations.getConverter().getMappingContext();
diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/support/MongoRepositoryFactoryBean.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/support/MongoRepositoryFactoryBean.java
index dafff6e7e..552ad6722 100644
--- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/support/MongoRepositoryFactoryBean.java
+++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/support/MongoRepositoryFactoryBean.java
@@ -99,7 +99,7 @@ public class MongoRepositoryFactoryBean, S, ID exten
 	public void afterPropertiesSet() {
 
 		super.afterPropertiesSet();
-		Assert.state(operations != null, "MongoTemplate must not be null!");
+		Assert.state(operations != null, "MongoTemplate must not be null");
 
 		if (!mappingContextConfigured) {
 			setMappingContext(operations.getConverter().getMappingContext());
diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/support/QuerydslMongoPredicateExecutor.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/support/QuerydslMongoPredicateExecutor.java
index 8d4b97bbf..cc35d0777 100644
--- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/support/QuerydslMongoPredicateExecutor.java
+++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/support/QuerydslMongoPredicateExecutor.java
@@ -88,7 +88,7 @@ public class QuerydslMongoPredicateExecutor extends QuerydslPredicateExecutor
 	@Override
 	public Optional findOne(Predicate predicate) {
 
-		Assert.notNull(predicate, "Predicate must not be null!");
+		Assert.notNull(predicate, "Predicate must not be null");
 
 		try {
 			return Optional.ofNullable(createQueryFor(predicate).fetchOne());
@@ -100,7 +100,7 @@ public class QuerydslMongoPredicateExecutor extends QuerydslPredicateExecutor
 	@Override
 	public List findAll(Predicate predicate) {
 
-		Assert.notNull(predicate, "Predicate must not be null!");
+		Assert.notNull(predicate, "Predicate must not be null");
 
 		return createQueryFor(predicate).fetch();
 	}
@@ -108,8 +108,8 @@ public class QuerydslMongoPredicateExecutor extends QuerydslPredicateExecutor
 	@Override
 	public List findAll(Predicate predicate, OrderSpecifier... orders) {
 
-		Assert.notNull(predicate, "Predicate must not be null!");
-		Assert.notNull(orders, "Order specifiers must not be null!");
+		Assert.notNull(predicate, "Predicate must not be null");
+		Assert.notNull(orders, "Order specifiers must not be null");
 
 		return createQueryFor(predicate).orderBy(orders).fetch();
 	}
@@ -117,8 +117,8 @@ public class QuerydslMongoPredicateExecutor extends QuerydslPredicateExecutor
 	@Override
 	public List findAll(Predicate predicate, Sort sort) {
 
-		Assert.notNull(predicate, "Predicate must not be null!");
-		Assert.notNull(sort, "Sort must not be null!");
+		Assert.notNull(predicate, "Predicate must not be null");
+		Assert.notNull(sort, "Sort must not be null");
 
 		return applySorting(createQueryFor(predicate), sort).fetch();
 	}
@@ -126,7 +126,7 @@ public class QuerydslMongoPredicateExecutor extends QuerydslPredicateExecutor
 	@Override
 	public Iterable findAll(OrderSpecifier... orders) {
 
-		Assert.notNull(orders, "Order specifiers must not be null!");
+		Assert.notNull(orders, "Order specifiers must not be null");
 
 		return createQuery().orderBy(orders).fetch();
 	}
@@ -134,8 +134,8 @@ public class QuerydslMongoPredicateExecutor extends QuerydslPredicateExecutor
 	@Override
 	public Page findAll(Predicate predicate, Pageable pageable) {
 
-		Assert.notNull(predicate, "Predicate must not be null!");
-		Assert.notNull(pageable, "Pageable must not be null!");
+		Assert.notNull(predicate, "Predicate must not be null");
+		Assert.notNull(pageable, "Pageable must not be null");
 
 		SpringDataMongodbQuery query = createQueryFor(predicate);
 
@@ -145,7 +145,7 @@ public class QuerydslMongoPredicateExecutor extends QuerydslPredicateExecutor
 	@Override
 	public long count(Predicate predicate) {
 
-		Assert.notNull(predicate, "Predicate must not be null!");
+		Assert.notNull(predicate, "Predicate must not be null");
 
 		return createQueryFor(predicate).fetchCount();
 	}
@@ -153,7 +153,7 @@ public class QuerydslMongoPredicateExecutor extends QuerydslPredicateExecutor
 	@Override
 	public boolean exists(Predicate predicate) {
 
-		Assert.notNull(predicate, "Predicate must not be null!");
+		Assert.notNull(predicate, "Predicate must not be null");
 
 		return createQueryFor(predicate).fetchCount() > 0;
 	}
@@ -163,8 +163,8 @@ public class QuerydslMongoPredicateExecutor extends QuerydslPredicateExecutor
 	public  R findBy(Predicate predicate,
 			Function, R> queryFunction) {
 
-		Assert.notNull(predicate, "Predicate must not be null!");
-		Assert.notNull(queryFunction, "Query function must not be null!");
+		Assert.notNull(predicate, "Predicate must not be null");
+		Assert.notNull(queryFunction, "Query function must not be null");
 
 		return queryFunction.apply(new FluentQuerydsl<>(predicate, (Class) typeInformation().getJavaType()));
 	}
@@ -259,7 +259,7 @@ public class QuerydslMongoPredicateExecutor extends QuerydslPredicateExecutor
 		@Override
 		public Page page(Pageable pageable) {
 
-			Assert.notNull(pageable, "Pageable must not be null!");
+			Assert.notNull(pageable, "Pageable must not be null");
 
 			return createQuery().fetchPage(pageable);
 		}
diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/support/QuerydslRepositorySupport.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/support/QuerydslRepositorySupport.java
index f1ffb59b2..e7bd2c04a 100644
--- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/support/QuerydslRepositorySupport.java
+++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/support/QuerydslRepositorySupport.java
@@ -40,7 +40,7 @@ public abstract class QuerydslRepositorySupport {
 	 */
 	public QuerydslRepositorySupport(MongoOperations operations) {
 
-		Assert.notNull(operations, "MongoOperations must not be null!");
+		Assert.notNull(operations, "MongoOperations must not be null");
 
 		this.template = operations;
 		this.context = operations.getConverter().getMappingContext();
@@ -55,7 +55,7 @@ public abstract class QuerydslRepositorySupport {
 	 */
 	protected  SpringDataMongodbQuery from(final EntityPath path) {
 
-		Assert.notNull(path, "EntityPath must not be null!");
+		Assert.notNull(path, "EntityPath must not be null");
 		MongoPersistentEntity entity = context.getRequiredPersistentEntity(path.getType());
 		return from(path, entity.getCollection());
 	}
@@ -69,8 +69,8 @@ public abstract class QuerydslRepositorySupport {
 	 */
 	protected  SpringDataMongodbQuery from(final EntityPath path, String collection) {
 
-		Assert.notNull(path, "EntityPath must not be null!");
-		Assert.hasText(collection, "Collection name must not be null or empty!");
+		Assert.notNull(path, "EntityPath must not be null");
+		Assert.hasText(collection, "Collection name must not be null or empty");
 
 		return new SpringDataMongodbQuery(template, path.getType(), collection);
 	}
diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/support/ReactiveFluentQuerySupport.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/support/ReactiveFluentQuerySupport.java
index 7125a74fb..914965447 100644
--- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/support/ReactiveFluentQuerySupport.java
+++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/support/ReactiveFluentQuerySupport.java
@@ -43,38 +43,38 @@ abstract class ReactiveFluentQuerySupport implements FluentQuery.ReactiveF
 		this.fieldsToInclude = fieldsToInclude;
 	}
 
-	/* 
+	/*
 	 * (non-Javadoc)
 	 * @see org.springframework.data.repository.query.FluentQuery.ReactiveFluentQuery#sortBy(org.springframework.data.domain.Sort)
 	 */
 	@Override
 	public ReactiveFluentQuery sortBy(Sort sort) {
 
-		Assert.notNull(sort, "Sort must not be null!");
+		Assert.notNull(sort, "Sort must not be null");
 
 		return create(predicate, sort, resultType, fieldsToInclude);
 	}
 
-	/* 
+	/*
 	 * (non-Javadoc)
 	 * @see org.springframework.data.repository.query.FluentQuery.ReactiveFluentQuery#as(java.lang.Class)
 	 */
 	@Override
 	public  ReactiveFluentQuery as(Class projection) {
 
-		Assert.notNull(projection, "Projection target type must not be null!");
+		Assert.notNull(projection, "Projection target type must not be null");
 
 		return create(predicate, sort, projection, fieldsToInclude);
 	}
 
-	/* 
+	/*
 	 * (non-Javadoc)
 	 * @see org.springframework.data.repository.query.FluentQuery.ReactiveFluentQuery#project(java.util.Collection)
 	 */
 	@Override
 	public ReactiveFluentQuery project(Collection properties) {
 
-		Assert.notNull(properties, "Projection properties must not be null!");
+		Assert.notNull(properties, "Projection properties must not be null");
 
 		return create(predicate, sort, resultType, new ArrayList<>(properties));
 	}
diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/support/ReactiveMongoRepositoryFactory.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/support/ReactiveMongoRepositoryFactory.java
index 6c47408d5..a04005e77 100644
--- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/support/ReactiveMongoRepositoryFactory.java
+++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/support/ReactiveMongoRepositoryFactory.java
@@ -72,7 +72,7 @@ public class ReactiveMongoRepositoryFactory extends ReactiveRepositoryFactorySup
 	 */
 	public ReactiveMongoRepositoryFactory(ReactiveMongoOperations mongoOperations) {
 
-		Assert.notNull(mongoOperations, "ReactiveMongoOperations must not be null!");
+		Assert.notNull(mongoOperations, "ReactiveMongoOperations must not be null");
 
 		this.operations = mongoOperations;
 		this.mappingContext = mongoOperations.getConverter().getMappingContext();
diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/support/ReactiveMongoRepositoryFactoryBean.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/support/ReactiveMongoRepositoryFactoryBean.java
index f7587cae4..5442c8cd2 100644
--- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/support/ReactiveMongoRepositoryFactoryBean.java
+++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/support/ReactiveMongoRepositoryFactoryBean.java
@@ -114,7 +114,7 @@ public class ReactiveMongoRepositoryFactoryBean, S,
 	public void afterPropertiesSet() {
 
 		super.afterPropertiesSet();
-		Assert.state(operations != null, "ReactiveMongoOperations must not be null!");
+		Assert.state(operations != null, "ReactiveMongoOperations must not be null");
 
 		if (!mappingContextConfigured) {
 			setMappingContext(operations.getConverter().getMappingContext());
diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/support/ReactivePageableExecutionUtils.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/support/ReactivePageableExecutionUtils.java
index 0218bbaac..b8ae20c26 100644
--- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/support/ReactivePageableExecutionUtils.java
+++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/support/ReactivePageableExecutionUtils.java
@@ -47,9 +47,9 @@ abstract class ReactivePageableExecutionUtils {
 	 */
 	public static  Mono> getPage(List content, Pageable pageable, Mono totalSupplier) {
 
-		Assert.notNull(content, "Content must not be null!");
-		Assert.notNull(pageable, "Pageable must not be null!");
-		Assert.notNull(totalSupplier, "TotalSupplier must not be null!");
+		Assert.notNull(content, "Content must not be null");
+		Assert.notNull(pageable, "Pageable must not be null");
+		Assert.notNull(totalSupplier, "TotalSupplier must not be null");
 
 		if (pageable.isUnpaged() || pageable.getOffset() == 0) {
 
diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/support/ReactiveQuerydslMongoPredicateExecutor.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/support/ReactiveQuerydslMongoPredicateExecutor.java
index 791543d4c..35a40fbae 100644
--- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/support/ReactiveQuerydslMongoPredicateExecutor.java
+++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/support/ReactiveQuerydslMongoPredicateExecutor.java
@@ -86,7 +86,7 @@ public class ReactiveQuerydslMongoPredicateExecutor extends QuerydslPredicate
 	@Override
 	public Mono findOne(Predicate predicate) {
 
-		Assert.notNull(predicate, "Predicate must not be null!");
+		Assert.notNull(predicate, "Predicate must not be null");
 
 		return createQueryFor(predicate).fetchOne();
 	}
@@ -94,7 +94,7 @@ public class ReactiveQuerydslMongoPredicateExecutor extends QuerydslPredicate
 	@Override
 	public Flux findAll(Predicate predicate) {
 
-		Assert.notNull(predicate, "Predicate must not be null!");
+		Assert.notNull(predicate, "Predicate must not be null");
 
 		return createQueryFor(predicate).fetch();
 	}
@@ -102,8 +102,8 @@ public class ReactiveQuerydslMongoPredicateExecutor extends QuerydslPredicate
 	@Override
 	public Flux findAll(Predicate predicate, OrderSpecifier... orders) {
 
-		Assert.notNull(predicate, "Predicate must not be null!");
-		Assert.notNull(orders, "Order specifiers must not be null!");
+		Assert.notNull(predicate, "Predicate must not be null");
+		Assert.notNull(orders, "Order specifiers must not be null");
 
 		return createQueryFor(predicate).orderBy(orders).fetch();
 	}
@@ -111,8 +111,8 @@ public class ReactiveQuerydslMongoPredicateExecutor extends QuerydslPredicate
 	@Override
 	public Flux findAll(Predicate predicate, Sort sort) {
 
-		Assert.notNull(predicate, "Predicate must not be null!");
-		Assert.notNull(sort, "Sort must not be null!");
+		Assert.notNull(predicate, "Predicate must not be null");
+		Assert.notNull(sort, "Sort must not be null");
 
 		return applySorting(createQueryFor(predicate), sort).fetch();
 	}
@@ -120,7 +120,7 @@ public class ReactiveQuerydslMongoPredicateExecutor extends QuerydslPredicate
 	@Override
 	public Flux findAll(OrderSpecifier... orders) {
 
-		Assert.notNull(orders, "Order specifiers must not be null!");
+		Assert.notNull(orders, "Order specifiers must not be null");
 
 		return createQuery().orderBy(orders).fetch();
 	}
@@ -128,7 +128,7 @@ public class ReactiveQuerydslMongoPredicateExecutor extends QuerydslPredicate
 	@Override
 	public Mono count(Predicate predicate) {
 
-		Assert.notNull(predicate, "Predicate must not be null!");
+		Assert.notNull(predicate, "Predicate must not be null");
 
 		return createQueryFor(predicate).fetchCount();
 	}
@@ -136,7 +136,7 @@ public class ReactiveQuerydslMongoPredicateExecutor extends QuerydslPredicate
 	@Override
 	public Mono exists(Predicate predicate) {
 
-		Assert.notNull(predicate, "Predicate must not be null!");
+		Assert.notNull(predicate, "Predicate must not be null");
 
 		return createQueryFor(predicate).fetchCount().map(it -> it != 0);
 	}
@@ -145,8 +145,8 @@ public class ReactiveQuerydslMongoPredicateExecutor extends QuerydslPredicate
 	public > P findBy(Predicate predicate,
 			Function, P> queryFunction) {
 
-		Assert.notNull(predicate, "Predicate must not be null!");
-		Assert.notNull(queryFunction, "Query function must not be null!");
+		Assert.notNull(predicate, "Predicate must not be null");
+		Assert.notNull(queryFunction, "Query function must not be null");
 
 		return queryFunction.apply(new ReactiveFluentQuerydsl(predicate, (Class) typeInformation().getJavaType()));
 	}
@@ -226,7 +226,7 @@ public class ReactiveQuerydslMongoPredicateExecutor extends QuerydslPredicate
 		@Override
 		public Mono> page(Pageable pageable) {
 
-			Assert.notNull(pageable, "Pageable must not be null!");
+			Assert.notNull(pageable, "Pageable must not be null");
 
 			return createQuery().fetchPage(pageable);
 		}
diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/support/SimpleMongoRepository.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/support/SimpleMongoRepository.java
index 9016dedb0..f9c4ec17d 100644
--- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/support/SimpleMongoRepository.java
+++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/support/SimpleMongoRepository.java
@@ -71,8 +71,8 @@ public class SimpleMongoRepository implements MongoRepository {
 	 */
 	public SimpleMongoRepository(MongoEntityInformation metadata, MongoOperations mongoOperations) {
 
-		Assert.notNull(metadata, "MongoEntityInformation must not be null!");
-		Assert.notNull(mongoOperations, "MongoOperations must not be null!");
+		Assert.notNull(metadata, "MongoEntityInformation must not be null");
+		Assert.notNull(mongoOperations, "MongoOperations must not be null");
 
 		this.entityInformation = metadata;
 		this.mongoOperations = mongoOperations;
@@ -85,7 +85,7 @@ public class SimpleMongoRepository implements MongoRepository {
 	@Override
 	public  S save(S entity) {
 
-		Assert.notNull(entity, "Entity must not be null!");
+		Assert.notNull(entity, "Entity must not be null");
 
 		if (entityInformation.isNew(entity)) {
 			return mongoOperations.insert(entity, entityInformation.getCollectionName());
@@ -97,7 +97,7 @@ public class SimpleMongoRepository implements MongoRepository {
 	@Override
 	public  List saveAll(Iterable entities) {
 
-		Assert.notNull(entities, "The given Iterable of entities not be null!");
+		Assert.notNull(entities, "The given Iterable of entities not be null");
 
 		Streamable source = Streamable.of(entities);
 		boolean allNew = source.stream().allMatch(entityInformation::isNew);
@@ -114,7 +114,7 @@ public class SimpleMongoRepository implements MongoRepository {
 	@Override
 	public Optional findById(ID id) {
 
-		Assert.notNull(id, "The given id must not be null!");
+		Assert.notNull(id, "The given id must not be null");
 
 		return Optional.ofNullable(
 				mongoOperations.findById(id, entityInformation.getJavaType(), entityInformation.getCollectionName()));
@@ -123,7 +123,7 @@ public class SimpleMongoRepository implements MongoRepository {
 	@Override
 	public boolean existsById(ID id) {
 
-		Assert.notNull(id, "The given id must not be null!");
+		Assert.notNull(id, "The given id must not be null");
 
 		return mongoOperations.exists(getIdQuery(id), entityInformation.getJavaType(),
 				entityInformation.getCollectionName());
@@ -137,7 +137,7 @@ public class SimpleMongoRepository implements MongoRepository {
 	@Override
 	public List findAllById(Iterable ids) {
 
-		Assert.notNull(ids, "The given Ids of entities not be null!");
+		Assert.notNull(ids, "The given Ids of entities not be null");
 
 		return findAll(getIdQuery(ids));
 	}
@@ -150,7 +150,7 @@ public class SimpleMongoRepository implements MongoRepository {
 	@Override
 	public void deleteById(ID id) {
 
-		Assert.notNull(id, "The given id must not be null!");
+		Assert.notNull(id, "The given id must not be null");
 
 		mongoOperations.remove(getIdQuery(id), entityInformation.getJavaType(), entityInformation.getCollectionName());
 	}
@@ -158,13 +158,13 @@ public class SimpleMongoRepository implements MongoRepository {
 	@Override
 	public void delete(T entity) {
 
-		Assert.notNull(entity, "The given entity must not be null!");
+		Assert.notNull(entity, "The given entity must not be null");
 
 		DeleteResult deleteResult = mongoOperations.remove(entity, entityInformation.getCollectionName());
 
 		if (entityInformation.isVersioned() && deleteResult.wasAcknowledged() && deleteResult.getDeletedCount() == 0) {
 			throw new OptimisticLockingFailureException(String.format(
-					"The entity with id %s with version %s in %s cannot be deleted! Was it modified or deleted in the meantime?",
+					"The entity with id %s with version %s in %s cannot be deleted; Was it modified or deleted in the meantime",
 					entityInformation.getId(entity), entityInformation.getVersion(entity),
 					entityInformation.getCollectionName()));
 		}
@@ -173,7 +173,7 @@ public class SimpleMongoRepository implements MongoRepository {
 	@Override
 	public void deleteAllById(Iterable ids) {
 
-		Assert.notNull(ids, "The given Iterable of ids must not be null!");
+		Assert.notNull(ids, "The given Iterable of ids must not be null");
 
 		mongoOperations.remove(getIdQuery(ids), entityInformation.getJavaType(), entityInformation.getCollectionName());
 	}
@@ -181,7 +181,7 @@ public class SimpleMongoRepository implements MongoRepository {
 	@Override
 	public void deleteAll(Iterable entities) {
 
-		Assert.notNull(entities, "The given Iterable of entities must not be null!");
+		Assert.notNull(entities, "The given Iterable of entities must not be null");
 
 		entities.forEach(this::delete);
 	}
@@ -198,7 +198,7 @@ public class SimpleMongoRepository implements MongoRepository {
 	@Override
 	public Page findAll(Pageable pageable) {
 
-		Assert.notNull(pageable, "Pageable must not be null!");
+		Assert.notNull(pageable, "Pageable must not be null");
 
 		long count = count();
 		List list = findAll(new Query().with(pageable));
@@ -209,7 +209,7 @@ public class SimpleMongoRepository implements MongoRepository {
 	@Override
 	public List findAll(Sort sort) {
 
-		Assert.notNull(sort, "Sort must not be null!");
+		Assert.notNull(sort, "Sort must not be null");
 
 		return findAll(new Query().with(sort));
 	}
@@ -221,7 +221,7 @@ public class SimpleMongoRepository implements MongoRepository {
 	@Override
 	public  S insert(S entity) {
 
-		Assert.notNull(entity, "Entity must not be null!");
+		Assert.notNull(entity, "Entity must not be null");
 
 		return mongoOperations.insert(entity, entityInformation.getCollectionName());
 	}
@@ -229,7 +229,7 @@ public class SimpleMongoRepository implements MongoRepository {
 	@Override
 	public  List insert(Iterable entities) {
 
-		Assert.notNull(entities, "The given Iterable of entities not be null!");
+		Assert.notNull(entities, "The given Iterable of entities not be null");
 
 		Collection list = toCollection(entities);
 
@@ -247,7 +247,7 @@ public class SimpleMongoRepository implements MongoRepository {
 	@Override
 	public  Optional findOne(Example example) {
 
-		Assert.notNull(example, "Sample must not be null!");
+		Assert.notNull(example, "Sample must not be null");
 
 		Query query = new Query(new Criteria().alike(example)) //
 				.collation(entityInformation.getCollation());
@@ -264,8 +264,8 @@ public class SimpleMongoRepository implements MongoRepository {
 	@Override
 	public  List findAll(Example example, Sort sort) {
 
-		Assert.notNull(example, "Sample must not be null!");
-		Assert.notNull(sort, "Sort must not be null!");
+		Assert.notNull(example, "Sample must not be null");
+		Assert.notNull(sort, "Sort must not be null");
 
 		Query query = new Query(new Criteria().alike(example)) //
 				.collation(entityInformation.getCollation()) //
@@ -277,8 +277,8 @@ public class SimpleMongoRepository implements MongoRepository {
 	@Override
 	public  Page findAll(Example example, Pageable pageable) {
 
-		Assert.notNull(example, "Sample must not be null!");
-		Assert.notNull(pageable, "Pageable must not be null!");
+		Assert.notNull(example, "Sample must not be null");
+		Assert.notNull(pageable, "Pageable must not be null");
 
 		Query query = new Query(new Criteria().alike(example)) //
 				.collation(entityInformation.getCollation()).with(pageable); //
@@ -292,7 +292,7 @@ public class SimpleMongoRepository implements MongoRepository {
 	@Override
 	public  long count(Example example) {
 
-		Assert.notNull(example, "Sample must not be null!");
+		Assert.notNull(example, "Sample must not be null");
 
 		Query query = new Query(new Criteria().alike(example)) //
 				.collation(entityInformation.getCollation());
@@ -303,7 +303,7 @@ public class SimpleMongoRepository implements MongoRepository {
 	@Override
 	public  boolean exists(Example example) {
 
-		Assert.notNull(example, "Sample must not be null!");
+		Assert.notNull(example, "Sample must not be null");
 
 		Query query = new Query(new Criteria().alike(example)) //
 				.collation(entityInformation.getCollation());
@@ -315,8 +315,8 @@ public class SimpleMongoRepository implements MongoRepository {
 	public  R findBy(Example example,
 			Function, R> queryFunction) {
 
-		Assert.notNull(example, "Sample must not be null!");
-		Assert.notNull(queryFunction, "Query function must not be null!");
+		Assert.notNull(example, "Sample must not be null");
+		Assert.notNull(queryFunction, "Query function must not be null");
 
 		return queryFunction.apply(new FluentQueryByExample<>(example, example.getProbeType()));
 	}
@@ -392,7 +392,7 @@ public class SimpleMongoRepository implements MongoRepository {
 		@Override
 		public Page page(Pageable pageable) {
 
-			Assert.notNull(pageable, "Pageable must not be null!");
+			Assert.notNull(pageable, "Pageable must not be null");
 
 			List list = createQuery(q -> q.with(pageable)).all();
 
diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/support/SimpleReactiveMongoRepository.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/support/SimpleReactiveMongoRepository.java
index 97205603b..728392ee5 100644
--- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/support/SimpleReactiveMongoRepository.java
+++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/support/SimpleReactiveMongoRepository.java
@@ -67,8 +67,8 @@ public class SimpleReactiveMongoRepository implement
 	public SimpleReactiveMongoRepository(MongoEntityInformation entityInformation,
 			ReactiveMongoOperations mongoOperations) {
 
-		Assert.notNull(entityInformation, "EntityInformation must not be null!");
-		Assert.notNull(mongoOperations, "MongoOperations must not be null!");
+		Assert.notNull(entityInformation, "EntityInformation must not be null");
+		Assert.notNull(mongoOperations, "MongoOperations must not be null");
 
 		this.entityInformation = entityInformation;
 		this.mongoOperations = mongoOperations;
@@ -81,7 +81,7 @@ public class SimpleReactiveMongoRepository implement
 	@Override
 	public  Mono save(S entity) {
 
-		Assert.notNull(entity, "Entity must not be null!");
+		Assert.notNull(entity, "Entity must not be null");
 
 		if (entityInformation.isNew(entity)) {
 			return mongoOperations.insert(entity, entityInformation.getCollectionName());
@@ -93,7 +93,7 @@ public class SimpleReactiveMongoRepository implement
 	@Override
 	public  Flux saveAll(Iterable entities) {
 
-		Assert.notNull(entities, "The given Iterable of entities must not be null!");
+		Assert.notNull(entities, "The given Iterable of entities must not be null");
 
 		Streamable source = Streamable.of(entities);
 
@@ -105,7 +105,7 @@ public class SimpleReactiveMongoRepository implement
 	@Override
 	public  Flux saveAll(Publisher entityStream) {
 
-		Assert.notNull(entityStream, "The given Publisher of entities must not be null!");
+		Assert.notNull(entityStream, "The given Publisher of entities must not be null");
 
 		return Flux.from(entityStream).flatMap(entity -> entityInformation.isNew(entity) ? //
 				mongoOperations.insert(entity, entityInformation.getCollectionName()) : //
@@ -115,7 +115,7 @@ public class SimpleReactiveMongoRepository implement
 	@Override
 	public Mono findById(ID id) {
 
-		Assert.notNull(id, "The given id must not be null!");
+		Assert.notNull(id, "The given id must not be null");
 
 		return mongoOperations.findById(id, entityInformation.getJavaType(), entityInformation.getCollectionName());
 	}
@@ -123,7 +123,7 @@ public class SimpleReactiveMongoRepository implement
 	@Override
 	public Mono findById(Publisher publisher) {
 
-		Assert.notNull(publisher, "The given id must not be null!");
+		Assert.notNull(publisher, "The given id must not be null");
 
 		return Mono.from(publisher).flatMap(
 				id -> mongoOperations.findById(id, entityInformation.getJavaType(), entityInformation.getCollectionName()));
@@ -132,7 +132,7 @@ public class SimpleReactiveMongoRepository implement
 	@Override
 	public Mono existsById(ID id) {
 
-		Assert.notNull(id, "The given id must not be null!");
+		Assert.notNull(id, "The given id must not be null");
 
 		return mongoOperations.exists(getIdQuery(id), entityInformation.getJavaType(),
 				entityInformation.getCollectionName());
@@ -141,7 +141,7 @@ public class SimpleReactiveMongoRepository implement
 	@Override
 	public Mono existsById(Publisher publisher) {
 
-		Assert.notNull(publisher, "The given id must not be null!");
+		Assert.notNull(publisher, "The given id must not be null");
 
 		return Mono.from(publisher).flatMap(id -> mongoOperations.exists(getIdQuery(id), entityInformation.getJavaType(),
 				entityInformation.getCollectionName()));
@@ -155,7 +155,7 @@ public class SimpleReactiveMongoRepository implement
 	@Override
 	public Flux findAllById(Iterable ids) {
 
-		Assert.notNull(ids, "The given Iterable of Id's must not be null!");
+		Assert.notNull(ids, "The given Iterable of Id's must not be null");
 
 		return findAll(getIdQuery(ids));
 	}
@@ -163,7 +163,7 @@ public class SimpleReactiveMongoRepository implement
 	@Override
 	public Flux findAllById(Publisher ids) {
 
-		Assert.notNull(ids, "The given Publisher of Id's must not be null!");
+		Assert.notNull(ids, "The given Publisher of Id's must not be null");
 
 		return Flux.from(ids).buffer().flatMap(this::findAllById);
 	}
@@ -176,7 +176,7 @@ public class SimpleReactiveMongoRepository implement
 	@Override
 	public Mono deleteById(ID id) {
 
-		Assert.notNull(id, "The given id must not be null!");
+		Assert.notNull(id, "The given id must not be null");
 
 		return mongoOperations
 				.remove(getIdQuery(id), entityInformation.getJavaType(), entityInformation.getCollectionName()).then();
@@ -185,7 +185,7 @@ public class SimpleReactiveMongoRepository implement
 	@Override
 	public Mono deleteById(Publisher publisher) {
 
-		Assert.notNull(publisher, "Id must not be null!");
+		Assert.notNull(publisher, "Id must not be null");
 
 		return Mono.from(publisher).flatMap(id -> mongoOperations.remove(getIdQuery(id), entityInformation.getJavaType(),
 				entityInformation.getCollectionName())).then();
@@ -194,7 +194,7 @@ public class SimpleReactiveMongoRepository implement
 	@Override
 	public Mono delete(T entity) {
 
-		Assert.notNull(entity, "The given entity must not be null!");
+		Assert.notNull(entity, "The given entity must not be null");
 
 		Mono remove = mongoOperations.remove(entity, entityInformation.getCollectionName());
 
@@ -204,7 +204,7 @@ public class SimpleReactiveMongoRepository implement
 
 				if (deleteResult.wasAcknowledged() && deleteResult.getDeletedCount() == 0) {
 					sink.error(new OptimisticLockingFailureException(String.format(
-							"The entity with id %s with version %s in %s cannot be deleted! Was it modified or deleted in the meantime?",
+							"The entity with id %s with version %s in %s cannot be deleted; Was it modified or deleted in the meantime",
 							entityInformation.getId(entity), entityInformation.getVersion(entity),
 							entityInformation.getCollectionName())));
 				} else {
@@ -219,7 +219,7 @@ public class SimpleReactiveMongoRepository implement
 	@Override
 	public Mono deleteAllById(Iterable ids) {
 
-		Assert.notNull(ids, "The given Iterable of Id's must not be null!");
+		Assert.notNull(ids, "The given Iterable of Id's must not be null");
 
 		return mongoOperations
 				.remove(getIdQuery(ids), entityInformation.getJavaType(), entityInformation.getCollectionName()).then();
@@ -228,7 +228,7 @@ public class SimpleReactiveMongoRepository implement
 	@Override
 	public Mono deleteAll(Iterable entities) {
 
-		Assert.notNull(entities, "The given Iterable of entities must not be null!");
+		Assert.notNull(entities, "The given Iterable of entities must not be null");
 
 		Collection idCollection = StreamUtils.createStreamFromIterator(entities.iterator()).map(entityInformation::getId)
 				.collect(Collectors.toList());
@@ -243,7 +243,7 @@ public class SimpleReactiveMongoRepository implement
 	@Override
 	public Mono deleteAll(Publisher entityStream) {
 
-		Assert.notNull(entityStream, "The given Publisher of entities must not be null!");
+		Assert.notNull(entityStream, "The given Publisher of entities must not be null");
 
 		return Flux.from(entityStream)//
 				.map(entityInformation::getRequiredId)//
@@ -263,7 +263,7 @@ public class SimpleReactiveMongoRepository implement
 	@Override
 	public Flux findAll(Sort sort) {
 
-		Assert.notNull(sort, "Sort must not be null!");
+		Assert.notNull(sort, "Sort must not be null");
 
 		return findAll(new Query().with(sort));
 	}
@@ -275,7 +275,7 @@ public class SimpleReactiveMongoRepository implement
 	@Override
 	public  Mono insert(S entity) {
 
-		Assert.notNull(entity, "Entity must not be null!");
+		Assert.notNull(entity, "Entity must not be null");
 
 		return mongoOperations.insert(entity, entityInformation.getCollectionName());
 	}
@@ -283,7 +283,7 @@ public class SimpleReactiveMongoRepository implement
 	@Override
 	public  Flux insert(Iterable entities) {
 
-		Assert.notNull(entities, "The given Iterable of entities must not be null!");
+		Assert.notNull(entities, "The given Iterable of entities must not be null");
 
 		Collection source = toCollection(entities);
 
@@ -293,7 +293,7 @@ public class SimpleReactiveMongoRepository implement
 	@Override
 	public  Flux insert(Publisher entities) {
 
-		Assert.notNull(entities, "The given Publisher of entities must not be null!");
+		Assert.notNull(entities, "The given Publisher of entities must not be null");
 
 		return Flux.from(entities).flatMap(entity -> mongoOperations.insert(entity, entityInformation.getCollectionName()));
 	}
@@ -305,7 +305,7 @@ public class SimpleReactiveMongoRepository implement
 	@Override
 	public  Mono findOne(Example example) {
 
-		Assert.notNull(example, "Sample must not be null!");
+		Assert.notNull(example, "Sample must not be null");
 
 		Query query = new Query(new Criteria().alike(example)) //
 				.collation(entityInformation.getCollation()) //
@@ -324,7 +324,7 @@ public class SimpleReactiveMongoRepository implement
 	@Override
 	public  Flux findAll(Example example) {
 
-		Assert.notNull(example, "Example must not be null!");
+		Assert.notNull(example, "Example must not be null");
 
 		return findAll(example, Sort.unsorted());
 	}
@@ -332,8 +332,8 @@ public class SimpleReactiveMongoRepository implement
 	@Override
 	public  Flux findAll(Example example, Sort sort) {
 
-		Assert.notNull(example, "Sample must not be null!");
-		Assert.notNull(sort, "Sort must not be null!");
+		Assert.notNull(example, "Sample must not be null");
+		Assert.notNull(sort, "Sort must not be null");
 
 		Query query = new Query(new Criteria().alike(example)) //
 				.collation(entityInformation.getCollation()) //
@@ -345,7 +345,7 @@ public class SimpleReactiveMongoRepository implement
 	@Override
 	public  Mono count(Example example) {
 
-		Assert.notNull(example, "Sample must not be null!");
+		Assert.notNull(example, "Sample must not be null");
 
 		Query query = new Query(new Criteria().alike(example)) //
 				.collation(entityInformation.getCollation());
@@ -356,7 +356,7 @@ public class SimpleReactiveMongoRepository implement
 	@Override
 	public  Mono exists(Example example) {
 
-		Assert.notNull(example, "Sample must not be null!");
+		Assert.notNull(example, "Sample must not be null");
 
 		Query query = new Query(new Criteria().alike(example)) //
 				.collation(entityInformation.getCollation());
@@ -368,8 +368,8 @@ public class SimpleReactiveMongoRepository implement
 	public > P findBy(Example example,
 			Function, P> queryFunction) {
 
-		Assert.notNull(example, "Sample must not be null!");
-		Assert.notNull(queryFunction, "Query function must not be null!");
+		Assert.notNull(example, "Sample must not be null");
+		Assert.notNull(queryFunction, "Query function must not be null");
 
 		return queryFunction.apply(new ReactiveFluentQueryByExample<>(example, example.getProbeType()));
 	}
@@ -435,7 +435,7 @@ public class SimpleReactiveMongoRepository implement
 		@Override
 		public Mono> page(Pageable pageable) {
 
-			Assert.notNull(pageable, "Pageable must not be null!");
+			Assert.notNull(pageable, "Pageable must not be null");
 
 			Mono> items = createQuery(q -> q.with(pageable)).all().collectList();
 
diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/support/SpringDataMongodbSerializer.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/support/SpringDataMongodbSerializer.java
index 377a98539..eebd5e952 100644
--- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/support/SpringDataMongodbSerializer.java
+++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/support/SpringDataMongodbSerializer.java
@@ -74,7 +74,7 @@ class SpringDataMongodbSerializer extends MongodbDocumentSerializer {
 	 */
 	public SpringDataMongodbSerializer(MongoConverter converter) {
 
-		Assert.notNull(converter, "MongoConverter must not be null!");
+		Assert.notNull(converter, "MongoConverter must not be null");
 
 		this.mappingContext = converter.getMappingContext();
 		this.converter = converter;
diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/util/BsonUtils.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/util/BsonUtils.java
index a6f7b4d5f..a9ccd7d40 100644
--- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/util/BsonUtils.java
+++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/util/BsonUtils.java
@@ -158,7 +158,7 @@ public class BsonUtils {
 		}
 
 		throw new IllegalArgumentException(String.format(
-				"Cannot add key/value pair to %s. as map. Given Bson must be a Document or BSONObject!", bson.getClass()));
+				"Cannot add key/value pair to %s; as map given Bson must be a Document or BSONObject", bson.getClass()));
 	}
 
 	/**
@@ -183,7 +183,7 @@ public class BsonUtils {
 		}
 
 		throw new IllegalArgumentException(
-				String.format("Cannot add all to %s. Given Bson must be a Document or BSONObject.", target.getClass()));
+				String.format("Cannot add all to %s; Given Bson must be a Document or BSONObject.", target.getClass()));
 	}
 
 	/**
@@ -250,7 +250,7 @@ public class BsonUtils {
 		}
 
 		throw new IllegalArgumentException(
-				String.format("Cannot remove from %s. Given Bson must be a Document or BSONObject.", bson.getClass()));
+				String.format("Cannot remove from %s given Bson must be a Document or BSONObject.", bson.getClass()));
 	}
 
 	/**
@@ -444,7 +444,7 @@ public class BsonUtils {
 	 */
 	public static Document parse(String json, @Nullable CodecRegistryProvider codecRegistryProvider) {
 
-		Assert.notNull(json, "Json must not be null!");
+		Assert.notNull(json, "Json must not be null");
 
 		if (codecRegistryProvider == null) {
 			return Document.parse(json);
diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/util/encryption/EncryptionUtils.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/util/encryption/EncryptionUtils.java
index b13188167..8a2c1c208 100644
--- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/util/encryption/EncryptionUtils.java
+++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/util/encryption/EncryptionUtils.java
@@ -51,7 +51,7 @@ public final class EncryptionUtils {
 	@Nullable
 	public static Object resolveKeyId(String value, Supplier evaluationContext) {
 
-		Assert.notNull(value, "Value must not be null!");
+		Assert.notNull(value, "Value must not be null");
 
 		Object potentialKeyId = value;
 		Expression expression = ExpressionUtils.detectExpression(value);
diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/util/json/JsonScanner.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/util/json/JsonScanner.java
index e648efdee..d62301348 100644
--- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/util/json/JsonScanner.java
+++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/util/json/JsonScanner.java
@@ -115,7 +115,7 @@ class JsonScanner {
 				} else {
 					int position = buffer.getPosition();
 					buffer.unread(c);
-					throw new JsonParseException("Invalid JSON input. Position: %d. Character: '%c'.", position, c);
+					throw new JsonParseException("Invalid JSON input; Position: %d; Character: '%c'.", position, c);
 				}
 		}
 	}
@@ -199,7 +199,7 @@ class JsonScanner {
 							buffer.substring(options, end));
 					return new JsonToken(JsonTokenType.REGULAR_EXPRESSION, regex);
 				case INVALID:
-					throw new JsonParseException("Invalid JSON regular expression. Position: %d.", buffer.getPosition());
+					throw new JsonParseException("Invalid JSON regular expression; Position: %d.", buffer.getPosition());
 				default:
 			}
 		}
diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/util/json/ParameterBindingDocumentCodec.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/util/json/ParameterBindingDocumentCodec.java
index de035374b..25084c0eb 100644
--- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/util/json/ParameterBindingDocumentCodec.java
+++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/util/json/ParameterBindingDocumentCodec.java
@@ -221,7 +221,7 @@ public class ParameterBindingDocumentCodec implements CollectibleCodec
 				try {
 					return decode((String) bindingReader.currentValue, new Object[0]);
 				} catch (JsonParseException jsonParseException) {
-					throw new IllegalArgumentException("Expression result is not a valid json document!", jsonParseException);
+					throw new IllegalArgumentException("Expression result is not a valid json document", jsonParseException);
 				}
 			} else if (bindingReader.currentValue instanceof Map) {
 				return new Document((Map) bindingReader.currentValue);
diff --git a/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/ReactiveTransactionIntegrationTests.java b/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/ReactiveTransactionIntegrationTests.java
index 5e1cb98a2..9f69df3aa 100644
--- a/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/ReactiveTransactionIntegrationTests.java
+++ b/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/ReactiveTransactionIntegrationTests.java
@@ -259,7 +259,7 @@ public class ReactiveTransactionIntegrationTests {
 					new DefaultTransactionDefinition());
 
 			return operations.save(person) //
-					. flatMap(it -> Mono.error(new RuntimeException("poof!"))) //
+					. flatMap(it -> Mono.error(new RuntimeException("poof"))) //
 					.as(transactionalOperator::transactional);
 		}
 
@@ -307,7 +307,7 @@ public class ReactiveTransactionIntegrationTests {
 					operations.save(new EventLog(new ObjectId(), "beforeInsert")), //
 					operations.save(person), //
 					operations.save(new EventLog(new ObjectId(), "afterInsert"))) //
-					. flatMap(it -> Mono.error(new RuntimeException("poof!"))) //
+					. flatMap(it -> Mono.error(new RuntimeException("poof"))) //
 					.as(transactionalOperator::transactional);
 		}
 
@@ -331,7 +331,7 @@ public class ReactiveTransactionIntegrationTests {
 			return transactionalOperator.execute(reactiveTransaction -> {
 
 				return operations.save(person) //
-						. flatMap(it -> Mono.error(new RuntimeException("poof!")));
+						. flatMap(it -> Mono.error(new RuntimeException("poof")));
 			});
 		}
 	}
diff --git a/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/DefaultBulkOperationsUnitTests.java b/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/DefaultBulkOperationsUnitTests.java
index cf62232b4..59d14f7be 100644
--- a/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/DefaultBulkOperationsUnitTests.java
+++ b/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/DefaultBulkOperationsUnitTests.java
@@ -295,7 +295,7 @@ class DefaultBulkOperationsUnitTests {
 
 		ApplicationEventPublisher eventPublisher = mock(ApplicationEventPublisher.class);
 		when(collection.bulkWrite(anyList(), any(BulkWriteOptions.class))).thenThrow(new MongoWriteException(
-				new WriteError(89, "NetworkTimeout", new BsonDocument("hi", new BsonString("there!"))), null));
+				new WriteError(89, "NetworkTimeout", new BsonDocument("hi", new BsonString("there"))), null));
 
 		ops = new DefaultBulkOperations(template, "collection-1",
 				new BulkOperationContext(BulkMode.ORDERED, Optional.of(mappingContext.getPersistentEntity(Person.class)),
diff --git a/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/MongoExceptionTranslatorUnitTests.java b/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/MongoExceptionTranslatorUnitTests.java
index d56c84826..e771bf40f 100644
--- a/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/MongoExceptionTranslatorUnitTests.java
+++ b/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/MongoExceptionTranslatorUnitTests.java
@@ -175,7 +175,7 @@ class MongoExceptionTranslatorUnitTests {
 
 		DataAccessException translated = translator.translateExceptionIfPossible(new MongoException(code, ""));
 
-		assertThat(translated).as("Expected exception of type " + clazz.getName() + "!").isNotNull();
+		assertThat(translated).as("Expected exception of type " + clazz.getName()).isNotNull();
 
 		Throwable cause = translated.getRootCause();
 		assertThat(cause).isInstanceOf(MongoException.class);
diff --git a/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/MongoTemplateTests.java b/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/MongoTemplateTests.java
index 8c20be176..90f5619a5 100644
--- a/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/MongoTemplateTests.java
+++ b/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/MongoTemplateTests.java
@@ -230,7 +230,7 @@ public class MongoTemplateTests {
 
 		try {
 			template.insert(person);
-			fail("Expected DataIntegrityViolationException!");
+			fail("Expected DataIntegrityViolationException");
 		} catch (DataIntegrityViolationException e) {
 			assertThat(e.getMessage()).contains("E11000 duplicate key error");
 		}
@@ -273,7 +273,7 @@ public class MongoTemplateTests {
 
 		try {
 			template.save(person);
-			fail("Expected DataIntegrityViolationException!");
+			fail("Expected DataIntegrityViolationException");
 		} catch (DataIntegrityViolationException e) {
 			assertThat(e.getMessage()).contains("E11000 duplicate key error");
 		}
@@ -1120,7 +1120,7 @@ public class MongoTemplateTests {
 		assertThat(p2).isNotNull();
 		assertThat(p2.getWishList().size()).isEqualTo(0);
 
-		p2.addToWishList("please work!");
+		p2.addToWishList("please work");
 
 		template.save(p2);
 
@@ -1581,7 +1581,7 @@ public class MongoTemplateTests {
 
 	@Test // DATAMONGO-551
 	public void rejectsNonJsonStringForSave() {
-		assertThatExceptionOfType(MappingException.class).isThrownBy(() -> template.save("Foobar!", "collection"));
+		assertThatExceptionOfType(MappingException.class).isThrownBy(() -> template.save("Foobar", "collection"));
 	}
 
 	@Test // DATAMONGO-588
@@ -3606,13 +3606,13 @@ public class MongoTemplateTests {
 		ImmutableAudited source = new ImmutableAudited(null, null);
 		ImmutableAudited result = template.save(source);
 
-		assertThat(result).isNotSameAs(source).describedAs("Expected a different instances to be returned!");
-		assertThat(result.modified).isNotNull().describedAs("Auditing field must not be null!");
+		assertThat(result).isNotSameAs(source).describedAs("Expected a different instances to be returned");
+		assertThat(result.modified).isNotNull().describedAs("Auditing field must not be null");
 
 		ImmutableAudited read = template.findOne(query(where("id").is(result.getId())), ImmutableAudited.class);
 
 		assertThat(read.modified).isEqualTo(result.modified.truncatedTo(ChronoUnit.MILLIS))
-				.describedAs("Expected auditing information to be read!");
+				.describedAs("Expected auditing information to be read");
 	}
 
 	@Test // DATAMONGO-1798
diff --git a/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/MongoTemplateUnitTests.java b/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/MongoTemplateUnitTests.java
index 7cd09fa8a..169832f8f 100644
--- a/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/MongoTemplateUnitTests.java
+++ b/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/MongoTemplateUnitTests.java
@@ -2459,7 +2459,7 @@ public class MongoTemplateUnitTests extends MongoOperationsUnitTests {
 	@Override
 	protected MongoOperations getOperationsForExceptionHandling() {
 		MongoTemplate template = spy(this.template);
-		lenient().when(template.getDb()).thenThrow(new MongoException("Error!"));
+		lenient().when(template.getDb()).thenThrow(new MongoException("Error"));
 		return template;
 	}
 
diff --git a/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/ReactiveMongoTemplateTests.java b/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/ReactiveMongoTemplateTests.java
index ae52c56f7..6e2ddb15d 100644
--- a/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/ReactiveMongoTemplateTests.java
+++ b/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/ReactiveMongoTemplateTests.java
@@ -296,7 +296,7 @@ public class ReactiveMongoTemplateTests {
 					assertThat(actual.getWishList()).isEmpty();
 				}).verifyComplete();
 
-		person.addToWishList("please work!");
+		person.addToWishList("please work");
 
 		template.save(person).as(StepVerifier::create).expectNextCount(1).verifyComplete();
 
@@ -1029,7 +1029,7 @@ public class ReactiveMongoTemplateTests {
 
 	@Test // DATAMONGO-1444, DATAMONGO-2150
 	void rejectsNonJsonStringForSave() {
-		assertThatExceptionOfType(MappingException.class).isThrownBy(() -> template.save("Foobar!", "collection"));
+		assertThatExceptionOfType(MappingException.class).isThrownBy(() -> template.save("Foobar", "collection"));
 	}
 
 	@Test // DATAMONGO-1444
@@ -1368,7 +1368,7 @@ public class ReactiveMongoTemplateTests {
 	}
 
 	@Test // DATAMONGO-1803
-	@Disabled("Heavily relying on timing assumptions. Cannot test message resumption properly. Too much race for too little time in between.")
+	@Disabled("Heavily relying on timing assumptions; Cannot test message resumption properly; Too much race for too little time in between.")
 	@EnableIfReplicaSetAvailable
 	void changeStreamEventsShouldBeEmittedCorrectly() throws InterruptedException {
 
@@ -1400,7 +1400,7 @@ public class ReactiveMongoTemplateTests {
 	}
 
 	@Test // DATAMONGO-1803
-	@Disabled("Heavily relying on timing assumptions. Cannot test message resumption properly. Too much race for too little time in between.")
+	@Disabled("Heavily relying on timing assumptions; Cannot test message resumption properly; Too much race for too little time in between.")
 	@EnableIfReplicaSetAvailable
 	void changeStreamEventsShouldBeConvertedCorrectly() throws InterruptedException {
 
@@ -1432,7 +1432,7 @@ public class ReactiveMongoTemplateTests {
 	}
 
 	@Test // DATAMONGO-1803
-	@Disabled("Heavily relying on timing assumptions. Cannot test message resumption properly. Too much race for too little time in between.")
+	@Disabled("Heavily relying on timing assumptions; Cannot test message resumption properly; Too much race for too little time in between.")
 	@EnableIfReplicaSetAvailable
 	void changeStreamEventsShouldBeFilteredCorrectly() throws InterruptedException {
 
@@ -1508,7 +1508,7 @@ public class ReactiveMongoTemplateTests {
 	}
 
 	@Test // DATAMONGO-1803
-	@Disabled("Heavily relying on timing assumptions. Cannot test message resumption properly. Too much race for too little time in between.")
+	@Disabled("Heavily relying on timing assumptions; Cannot test message resumption properly; Too much race for too little time in between.")
 	@EnableIfReplicaSetAvailable
 	void changeStreamEventsShouldBeResumedCorrectly() throws InterruptedException {
 
diff --git a/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/aggregation/AggregationOptionsTests.java b/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/aggregation/AggregationOptionsTests.java
index c24adae79..a38962fa7 100644
--- a/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/aggregation/AggregationOptionsTests.java
+++ b/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/aggregation/AggregationOptionsTests.java
@@ -41,7 +41,7 @@ class AggregationOptionsTests {
 		aggregationOptions = newAggregationOptions().explain(true) //
 				.cursorBatchSize(1) //
 				.allowDiskUse(true) //
-				.comment("hola!") //
+				.comment("hola") //
 				.hint(dummyHint) //
 				.build();
 	}
@@ -62,7 +62,7 @@ class AggregationOptionsTests {
 		document.put("cursor", new Document("batchSize", 1));
 		document.put("explain", true);
 		document.put("allowDiskUse", true);
-		document.put("comment", "hola!");
+		document.put("comment", "hola");
 		document.put("hint", dummyHint);
 
 		aggregationOptions = AggregationOptions.fromDocument(document);
@@ -71,7 +71,7 @@ class AggregationOptionsTests {
 		assertThat(aggregationOptions.isExplain()).isTrue();
 		assertThat(aggregationOptions.getCursor()).contains(new Document("batchSize", 1));
 		assertThat(aggregationOptions.getCursorBatchSize()).isEqualTo(1);
-		assertThat(aggregationOptions.getComment()).contains("hola!");
+		assertThat(aggregationOptions.getComment()).contains("hola");
 		assertThat(aggregationOptions.getHint()).contains(dummyHint);
 	}
 
@@ -80,6 +80,6 @@ class AggregationOptionsTests {
 
 		assertThat(aggregationOptions.toDocument()).isEqualTo(Document
 				.parse("{ " + "\"allowDiskUse\" : true , " + "\"explain\" : true , " + "\"cursor\" : { \"batchSize\" : 1}, "
-						+ "\"comment\": \"hola!\", " + "\"hint\" : { \"dummyField\" : 1}" + "}"));
+						+ "\"comment\": \"hola\", " + "\"hint\" : { \"dummyField\" : 1}" + "}"));
 	}
 }
diff --git a/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/aggregation/AggregationTests.java b/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/aggregation/AggregationTests.java
index 456b95817..94aaa6fc3 100644
--- a/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/aggregation/AggregationTests.java
+++ b/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/aggregation/AggregationTests.java
@@ -157,7 +157,7 @@ public class AggregationTests {
 						if (scanner != null) {
 							scanner.close();
 						}
-						throw new RuntimeException("Could not load mongodb sample dataset!", e);
+						throw new RuntimeException("Could not load mongodb sample dataset", e);
 					}
 
 					collection.bulkWrite(docs);
diff --git a/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/aggregation/ProjectionOperationUnitTests.java b/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/aggregation/ProjectionOperationUnitTests.java
index a299bdc52..75c10b8e9 100755
--- a/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/aggregation/ProjectionOperationUnitTests.java
+++ b/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/aggregation/ProjectionOperationUnitTests.java
@@ -1954,7 +1954,7 @@ public class ProjectionOperationUnitTests {
 				"     branches: [\n" + //
 				"       {\n" + //
 				"         case: { $gte : [ { $avg : \"$scores\" }, 90 ] },\n" + //
-				"         then: \"Doing great!\"\n" + //
+				"         then: \"Doing great\"\n" + //
 				"       },\n" + //
 				"       {\n" + //
 				"         case: { $and : [ { $gte : [ { $avg : \"$scores\" }, 80 ] },\n" + //
@@ -1972,7 +1972,7 @@ public class ProjectionOperationUnitTests {
 
 		CaseOperator cond1 = CaseOperator
 				.when(ComparisonOperators.Gte.valueOf(AccumulatorOperators.Avg.avgOf("scores")).greaterThanEqualToValue(90))
-				.then("Doing great!");
+				.then("Doing great");
 		CaseOperator cond2 = CaseOperator
 				.when(BooleanOperators.And.and(
 						ComparisonOperators.Gte.valueOf(AccumulatorOperators.Avg.avgOf("scores")).greaterThanEqualToValue(80),
diff --git a/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/convert/DbRefMappingMongoConverterUnitTests.java b/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/convert/DbRefMappingMongoConverterUnitTests.java
index a5cdf9e96..914e0cc2b 100644
--- a/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/convert/DbRefMappingMongoConverterUnitTests.java
+++ b/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/convert/DbRefMappingMongoConverterUnitTests.java
@@ -183,7 +183,7 @@ class DbRefMappingMongoConverterUnitTests {
 	}
 
 	@Test // DATAMONGO-348
-	@DisabledForJreRange(min = JRE.JAVA_16, disabledReason = "Class Proxies for eg. ArrayList require to open java.util.")
+	@DisabledForJreRange(min = JRE.JAVA_16, disabledReason = "Class Proxies for eg; ArrayList require to open java.util.")
 	void lazyLoadingProxyForLazyDbRefOnConcreteCollection() {
 
 		String id = "42";
@@ -511,7 +511,7 @@ class DbRefMappingMongoConverterUnitTests {
 	}
 
 	@Test // DATAMONGO-1076
-	@DisabledForJreRange(min = JRE.JAVA_16, disabledReason = "Class Proxies for eg. ArrayList require to open java.util.")
+	@DisabledForJreRange(min = JRE.JAVA_16, disabledReason = "Class Proxies for eg; ArrayList require to open java.util.")
 	void shouldNotTriggerResolvingOfLazyLoadedProxyWhenFinalizeMethodIsInvoked() throws Exception {
 
 		MongoPersistentEntity entity = mappingContext
@@ -530,7 +530,7 @@ class DbRefMappingMongoConverterUnitTests {
 	}
 
 	@Test // DATAMONGO-1194
-	@DisabledForJreRange(min = JRE.JAVA_16, disabledReason = "Class Proxies for eg. ArrayList require to open java.util.")
+	@DisabledForJreRange(min = JRE.JAVA_16, disabledReason = "Class Proxies for eg; ArrayList require to open java.util.")
 	void shouldBulkFetchListOfReferences() {
 
 		String id1 = "1";
@@ -581,7 +581,7 @@ class DbRefMappingMongoConverterUnitTests {
 	}
 
 	@Test // DATAMONGO-1194
-	@DisabledForJreRange(min = JRE.JAVA_16, disabledReason = "Class Proxies for eg. ArrayList require to open java.util.")
+	@DisabledForJreRange(min = JRE.JAVA_16, disabledReason = "Class Proxies for eg; ArrayList require to open java.util.")
 	void shouldFallbackToOneByOneFetchingWhenElementsInListOfReferencesPointToDifferentCollections() {
 
 		String id1 = "1";
diff --git a/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/convert/MappingMongoConverterUnitTests.java b/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/convert/MappingMongoConverterUnitTests.java
index 0e7d8fd79..e6b5c8db7 100644
--- a/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/convert/MappingMongoConverterUnitTests.java
+++ b/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/convert/MappingMongoConverterUnitTests.java
@@ -1099,7 +1099,7 @@ class MappingMongoConverterUnitTests {
 			}
 		}
 
-		fail(String.format("Didn't find synthetic field on %s!", target));
+		fail(String.format("Didn't find synthetic field on %s", target));
 	}
 
 	@Test // DATAMGONGO-508
diff --git a/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/mapping/GenericMappingTests.java b/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/mapping/GenericMappingTests.java
index 0bc6569b2..68e09e70b 100644
--- a/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/mapping/GenericMappingTests.java
+++ b/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/mapping/GenericMappingTests.java
@@ -57,8 +57,8 @@ class GenericMappingTests {
 	void writesGenericTypeCorrectly() {
 
 		StringWrapper wrapper = new StringWrapper();
-		wrapper.container = new Container();
-		wrapper.container.content = "Foo!";
+		wrapper.container = new Container<>();
+		wrapper.container.content = "Foo";
 
 		Document document = new Document();
 		converter.write(wrapper, document);
@@ -69,18 +69,18 @@ class GenericMappingTests {
 
 		Object content = ((Document) container).get("content");
 		assertThat(content instanceof String).isTrue();
-		assertThat((String) content).isEqualTo("Foo!");
+		assertThat((String) content).isEqualTo("Foo");
 	}
 
 	@Test
 	void readsGenericTypeCorrectly() {
 
-		Document content = new Document("content", "Foo!");
+		Document content = new Document("content", "Foo");
 		Document container = new Document("container", content);
 
 		StringWrapper result = converter.read(StringWrapper.class, container);
 		assertThat(result.container).isNotNull();
-		assertThat(result.container.content).isEqualTo("Foo!");
+		assertThat(result.container.content).isEqualTo("Foo");
 	}
 
 	private static class StringWrapper extends Wrapper {
diff --git a/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/messaging/DefaultMessageListenerContainerTests.java b/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/messaging/DefaultMessageListenerContainerTests.java
index 06f596f6c..9a9c14ac6 100644
--- a/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/messaging/DefaultMessageListenerContainerTests.java
+++ b/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/messaging/DefaultMessageListenerContainerTests.java
@@ -122,7 +122,7 @@ public class DefaultMessageListenerContainerTests {
 
 			try {
 				if (thrownException.compareAndSet(false, true)) {
-					throw new IllegalStateException("Boom!");
+					throw new IllegalStateException("Boom");
 				}
 			} finally {
 				messageListener.onMessage(message);
diff --git a/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/query/QueryTests.java b/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/query/QueryTests.java
index e3a68b077..66bf9d89a 100644
--- a/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/query/QueryTests.java
+++ b/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/query/QueryTests.java
@@ -225,7 +225,7 @@ class QueryTests {
 	void queryOfShouldCreateNewQueryWithEqualBehaviour() {
 
 		Query source = new Query();
-		source.addCriteria(where("This you must ken!").is(EnumType.VAL_1));
+		source.addCriteria(where("This you must ken").is(EnumType.VAL_1));
 
 		compareQueries(Query.of(source), source);
 	}
@@ -245,14 +245,14 @@ class QueryTests {
 	void clonedQueryShouldAppendCriteria() {
 
 		Query source = new Query();
-		source.addCriteria(where("Skip o'er the four!").is("From five and six"));
+		source.addCriteria(where("Skip o'er the four").is("From five and six"));
 		Query target = Query.of(source);
 
 		compareQueries(target, source);
 		target.addCriteria(where("the Witch's tricks").is("make seven and eight"));
 
 		assertThat(target.getQueryObject()).isEqualTo(
-				new Document("Skip o'er the four!", "From five and six").append("the Witch's tricks", "make seven and eight"));
+				new Document("Skip o'er the four", "From five and six").append("the Witch's tricks", "make seven and eight"));
 	}
 
 	@Test // DATAMONGO-1783
@@ -284,13 +284,13 @@ class QueryTests {
 	void clonedQueryShouldNotDependOnFieldsFromSource() {
 
 		Query source = new Query();
-		source.fields().include("That is the witch's one-time-one!");
+		source.fields().include("That is the witch's one-time-one");
 		Query target = Query.of(source);
 
 		compareQueries(target, source);
 		source.fields().exclude("Goethe");
 
-		assertThat(target.getFieldsObject()).isEqualTo(new Document("That is the witch's one-time-one!", 1))
+		assertThat(target.getFieldsObject()).isEqualTo(new Document("That is the witch's one-time-one", 1))
 				.isNotEqualTo(source.getFieldsObject());
 	}
 
diff --git a/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/schema/JsonSchemaObjectUnitTests.java b/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/schema/JsonSchemaObjectUnitTests.java
index 6af8429f4..2ae3543ab 100644
--- a/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/schema/JsonSchemaObjectUnitTests.java
+++ b/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/schema/JsonSchemaObjectUnitTests.java
@@ -316,7 +316,7 @@ class JsonSchemaObjectUnitTests {
 	void booleanShouldRenderCorrectly() {
 
 		assertThat(bool().generatedDescription().toDocument())
-				.isEqualTo(new Document("type", "boolean").append("description", "Must be a boolean."));
+				.isEqualTo(new Document("type", "boolean").append("description", "Must be a boolean"));
 	}
 
 	// -----------------
@@ -327,7 +327,7 @@ class JsonSchemaObjectUnitTests {
 	void nullShouldRenderCorrectly() {
 
 		assertThat(nil().generatedDescription().toDocument())
-				.isEqualTo(new Document("type", "null").append("description", "Must be null."));
+				.isEqualTo(new Document("type", "null").append("description", "Must be null"));
 	}
 
 	// -----------------
@@ -338,7 +338,7 @@ class JsonSchemaObjectUnitTests {
 	void dateShouldRenderCorrectly() {
 
 		assertThat(date().generatedDescription().toDocument())
-				.isEqualTo(new Document("bsonType", "date").append("description", "Must be a date."));
+				.isEqualTo(new Document("bsonType", "date").append("description", "Must be a date"));
 	}
 
 	// -----------------
@@ -349,7 +349,7 @@ class JsonSchemaObjectUnitTests {
 	void timestampShouldRenderCorrectly() {
 
 		assertThat(timestamp().generatedDescription().toDocument())
-				.isEqualTo(new Document("bsonType", "timestamp").append("description", "Must be a timestamp."));
+				.isEqualTo(new Document("bsonType", "timestamp").append("description", "Must be a timestamp"));
 	}
 
 	// -----------------
diff --git a/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/performance/PerformanceTests.java b/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/performance/PerformanceTests.java
index 550fa3321..976abaab7 100644
--- a/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/performance/PerformanceTests.java
+++ b/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/performance/PerformanceTests.java
@@ -584,7 +584,7 @@ public class PerformanceTests {
 
 	private static  List pickRandomNumerOfItemsFrom(List source) {
 
-		Assert.isTrue(!source.isEmpty(), "Source must not be empty!");
+		Assert.isTrue(!source.isEmpty(), "Source must not be empty");
 
 		Random random = new Random();
 		int numberOfItems = random.nextInt(source.size());
diff --git a/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/performance/ReactivePerformanceTests.java b/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/performance/ReactivePerformanceTests.java
index 61565d9cc..09c490a8a 100644
--- a/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/performance/ReactivePerformanceTests.java
+++ b/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/performance/ReactivePerformanceTests.java
@@ -642,7 +642,7 @@ public class ReactivePerformanceTests {
 
 	private static  List pickRandomNumerOfItemsFrom(List source) {
 
-		Assert.isTrue(!source.isEmpty(), "Source must not be empty!");
+		Assert.isTrue(!source.isEmpty(), "Source must not be empty");
 
 		Random random = new Random();
 		int numberOfItems = random.nextInt(source.size());
diff --git a/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/repository/PersonRepositoryLazyLoadingIntegrationTests.java b/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/repository/PersonRepositoryLazyLoadingIntegrationTests.java
index b326bfff2..36ee9e4cc 100644
--- a/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/repository/PersonRepositoryLazyLoadingIntegrationTests.java
+++ b/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/repository/PersonRepositoryLazyLoadingIntegrationTests.java
@@ -75,7 +75,7 @@ public class PersonRepositoryLazyLoadingIntegrationTests {
 	}
 
 	@Test // DATAMONGO-348
-	@DisabledForJreRange(min = JRE.JAVA_16, disabledReason = "Class Proxies for eg. ArrayList require to open java.util.")
+	@DisabledForJreRange(min = JRE.JAVA_16, disabledReason = "Class Proxies for eg; ArrayList require to open java.util.")
 	public void shouldLoadAssociationWithDbRefOnConcreteCollectionAndLazyLoadingEnabled() {
 
 		User thomas = new User();
diff --git a/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/repository/RepositoryIndexCreationIntegrationTests.java b/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/repository/RepositoryIndexCreationIntegrationTests.java
index ebc1fa470..8ebb0884b 100644
--- a/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/repository/RepositoryIndexCreationIntegrationTests.java
+++ b/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/repository/RepositoryIndexCreationIntegrationTests.java
@@ -89,6 +89,6 @@ public class RepositoryIndexCreationIntegrationTests {
 			}
 		}
 
-		fail(String.format("Did not find index for field(s) %s in %s!", fields, indexInfo));
+		fail(String.format("Did not find index for field(s) %s in %s", fields, indexInfo));
 	}
 }
diff --git a/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/test/util/CleanMongoDB.java b/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/test/util/CleanMongoDB.java
index 9b30e925d..1f0c49fff 100644
--- a/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/test/util/CleanMongoDB.java
+++ b/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/test/util/CleanMongoDB.java
@@ -286,7 +286,7 @@ public class CleanMongoDB implements TestRule {
 
 		client.getDatabase(dbName).drop();
 		if(LOGGER.isDebugEnabled()) {
-			LOGGER.debug(String.format("Dropping DB '%s'. ", dbName));
+			LOGGER.debug(String.format("Dropping DB '%s'; ", dbName));
 		}
 		return true;
 	}
@@ -305,13 +305,13 @@ public class CleanMongoDB implements TestRule {
 					if (types.contains(Struct.COLLECTION)) {
 						collection.drop();
 						if(LOGGER.isDebugEnabled()) {
-							LOGGER.debug(String.format("Dropping collection '%s' for DB '%s'. ", collectionName, db.getName()));
+							LOGGER.debug(String.format("Dropping collection '%s' for DB '%s'; ", collectionName, db.getName()));
 						}
 					} else if (types.contains(Struct.INDEX)) {
 						collection.dropIndexes();
 						if(LOGGER.isDebugEnabled()) {
 							LOGGER.debug(
-									String.format("Dropping indexes in collection '%s' for DB '%s'. ", collectionName, db.getName()));
+									String.format("Dropping indexes in collection '%s' for DB '%s'; ", collectionName, db.getName()));
 						}
 					}
 				}
diff --git a/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/test/util/DocumentAssert.java b/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/test/util/DocumentAssert.java
index b2e51c3ca..0248fb78b 100644
--- a/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/test/util/DocumentAssert.java
+++ b/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/test/util/DocumentAssert.java
@@ -70,7 +70,7 @@ public class DocumentAssert extends AbstractMapAssert lookup = lookup(key);
 
@@ -106,7 +106,7 @@ public class DocumentAssert extends AbstractMapAssert lookup = lookup(key);
 
diff --git a/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/test/util/MongoServerCondition.java b/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/test/util/MongoServerCondition.java
index c4317db62..6b20bbd78 100644
--- a/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/test/util/MongoServerCondition.java
+++ b/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/test/util/MongoServerCondition.java
@@ -55,7 +55,7 @@ public class MongoServerCondition implements ExecutionCondition {
 				if (!expectedMinVersion.equals(ANY) && !expectedMinVersion.equals(DEFAULT_LOW)) {
 					if (serverVersion.isLessThan(expectedMinVersion)) {
 						return ConditionEvaluationResult.disabled(String
-								.format("Disabled for server version %s. Requires at least %s.", serverVersion, expectedMinVersion));
+								.format("Disabled for server version %s; Requires at least %s.", serverVersion, expectedMinVersion));
 					}
 				}
 
@@ -63,7 +63,7 @@ public class MongoServerCondition implements ExecutionCondition {
 				if (!expectedMaxVersion.equals(ANY) && !expectedMaxVersion.equals(DEFAULT_HIGH)) {
 					if (serverVersion.isGreaterThanOrEqualTo(expectedMaxVersion)) {
 						return ConditionEvaluationResult.disabled(String
-								.format("Disabled for server version %s. Only supported until %s.", serverVersion, expectedMaxVersion));
+								.format("Disabled for server version %s; Only supported until %s.", serverVersion, expectedMaxVersion));
 					}
 				}
 			}