From 29b7305d712085c65b7402118f254606b8b40649 Mon Sep 17 00:00:00 2001 From: John Blum Date: Wed, 8 Jun 2022 16:01:48 -0700 Subject: [PATCH] Remove punctuation in Exception messages. Closes #2152. --- .../rest/core/StringToLdapNameConverter.java | 2 +- .../data/rest/core/UriToEntityConverter.java | 8 ++-- .../data/rest/core/ValidationErrors.java | 4 +- .../config/EntityLookupConfiguration.java | 20 ++++---- .../core/config/MetadataConfiguration.java | 8 ++-- .../ProjectionDefinitionConfiguration.java | 22 ++++----- .../config/RepositoryRestConfiguration.java | 22 ++++----- .../event/AnnotatedEventHandlerInvoker.java | 10 ++-- .../ValidatingRepositoryEventListener.java | 2 +- .../AnnotationBasedResourceDescription.java | 4 +- .../core/mapping/ConfigurableHttpMethods.java | 12 ++--- ...onApplyingSupportedHttpMethodsAdapter.java | 6 +-- .../CrudMethodsSupportedHttpMethods.java | 8 ++-- .../core/mapping/ExposureConfiguration.java | 8 ++-- .../data/rest/core/mapping/HttpMethods.java | 2 +- .../core/mapping/MappingResourceMetadata.java | 6 +-- .../rest/core/mapping/ParameterMetadata.java | 6 +-- .../rest/core/mapping/ParametersMetadata.java | 2 +- .../PersistentEntitiesResourceMappings.java | 6 +-- .../PersistentPropertyResourceMapping.java | 2 +- .../RepositoryAwareResourceMetadata.java | 8 ++-- .../RepositoryCollectionResourceMapping.java | 10 ++-- .../RepositoryMethodResourceMapping.java | 4 +- .../mapping/RepositoryResourceMappings.java | 6 +-- .../core/mapping/SearchResourceMappings.java | 12 ++--- .../mapping/SimpleResourceDescription.java | 4 +- .../TypeBasedCollectionResourceMapping.java | 4 +- .../core/support/DefaultSelfLinkProvider.java | 8 ++-- .../core/support/RepositoryRelProvider.java | 2 +- .../UnwrappingRepositoryInvokerFactory.java | 8 ++-- .../data/rest/core/util/MapUtils.java | 2 +- .../rest/core/ValidationErrorsUnitTests.java | 2 +- .../AbstractControllerIntegrationTests.java | 2 +- .../tests/AbstractWebIntegrationTests.java | 10 ++-- .../data/rest/tests/RequestParameters.java | 4 +- .../data/rest/tests/ResourceTester.java | 4 +- .../data/rest/tests/TestMvcClient.java | 6 +-- .../data/rest/tests/geode/Address.java | 6 +-- .../data/rest/tests/geode/Customer.java | 8 ++-- .../data/rest/tests/geode/EmailAddress.java | 2 +- .../data/rest/tests/geode/LineItem.java | 4 +- .../data/rest/tests/geode/Order.java | 4 +- .../data/rest/tests/geode/Product.java | 6 +-- .../rest/webmvc/jpa/AuthorsController.java | 2 +- .../rest/tests/mongodb/MongoWebTests.java | 2 +- .../data/rest/tests/mongodb/TestUtils.java | 2 +- .../AbstractRepositoryRestController.java | 2 +- .../webmvc/BasePathAwareHandlerMapping.java | 6 +-- .../data/rest/webmvc/BaseUri.java | 6 +-- .../data/rest/webmvc/ControllerUtils.java | 6 +-- .../webmvc/EmbeddedResourcesAssembler.java | 8 ++-- .../data/rest/webmvc/HttpHeadersPreparer.java | 12 ++--- .../data/rest/webmvc/IncomingRequest.java | 2 +- .../rest/webmvc/PersistentEntityResource.java | 10 ++-- .../PersistentEntityResourceAssembler.java | 12 ++--- .../data/rest/webmvc/ProfileController.java | 6 +-- .../rest/webmvc/ProfileResourceProcessor.java | 2 +- .../rest/webmvc/RepositoryController.java | 6 +-- ...RepositoryPropertyReferenceController.java | 6 +-- .../RepositoryRestExceptionHandler.java | 6 +-- .../webmvc/RepositoryRestHandlerMapping.java | 12 ++--- .../webmvc/RepositorySchemaController.java | 2 +- .../webmvc/RepositorySearchController.java | 4 +- .../webmvc/RepositorySearchesResource.java | 2 +- .../webmvc/ResourceNotFoundException.java | 2 +- .../data/rest/webmvc/ResourceStatus.java | 12 ++--- .../rest/webmvc/RootResourceInformation.java | 8 ++-- .../data/rest/webmvc/alps/AlpsController.java | 2 +- .../alps/AlpsJsonHttpMessageConverter.java | 2 +- ...eInformationToAlpsDescriptorConverter.java | 16 +++---- ...lverPagingAndSortingTemplateVariables.java | 4 +- .../config/DelegatingHandlerMapping.java | 4 +- .../HalFormsAdaptingResponseBodyAdvice.java | 2 +- .../rest/webmvc/config/JsonPatchHandler.java | 12 ++--- ...tityResourceAssemblerArgumentResolver.java | 10 ++-- ...ResourceHandlerMethodArgumentResolver.java | 14 +++--- .../config/ProjectionDefinitionRegistar.java | 2 +- .../config/RepositoryRestConfigurer.java | 4 +- .../RepositoryRestConfigurerDelegate.java | 2 +- ...MetadataHandlerMethodArgumentResolver.java | 6 +-- ...ormationHandlerMethodArgumentResolver.java | 6 +-- .../WebMvcRepositoryRestConfiguration.java | 2 +- .../AggregateReferenceResolvingModule.java | 4 +- .../rest/webmvc/json/DomainObjectReader.java | 48 +++++++++---------- .../data/rest/webmvc/json/EnumTranslator.java | 8 ++-- .../JacksonMappingAwareSortTranslator.java | 30 ++++++------ .../rest/webmvc/json/JacksonMetadata.java | 14 +++--- .../rest/webmvc/json/JacksonSerializers.java | 8 ++-- .../data/rest/webmvc/json/JsonSchema.java | 20 ++++---- .../rest/webmvc/json/MappedProperties.java | 14 +++--- ...wareDefaultedPageableArgumentResolver.java | 4 +- .../MappingAwarePageableArgumentResolver.java | 4 +- .../MappingAwareSortArgumentResolver.java | 4 +- .../json/PersistentEntityJackson2Module.java | 38 +++++++-------- ...PersistentEntityToJsonSchemaConverter.java | 30 ++++++------ .../rest/webmvc/json/WrappedProperties.java | 12 ++--- .../rest/webmvc/json/patch/CopyOperation.java | 2 +- .../json/patch/JsonLateObjectEvaluator.java | 6 +-- .../json/patch/JsonPatchPatchConverter.java | 4 +- .../rest/webmvc/json/patch/MoveOperation.java | 2 +- .../webmvc/json/patch/PatchOperation.java | 4 +- .../data/rest/webmvc/json/patch/SpelPath.java | 46 +++++++++--------- .../rest/webmvc/json/patch/TestOperation.java | 4 +- .../rest/webmvc/mapping/Associations.java | 16 +++---- .../webmvc/mapping/DefaultLinkCollector.java | 22 ++++----- ...ackendIdHandlerMethodArgumentResolver.java | 8 ++-- .../support/DefaultExcerptProjector.java | 6 +-- .../webmvc/support/DefaultedPageable.java | 2 +- ...PageableHandlerMethodArgumentResolver.java | 2 +- .../webmvc/support/DomainClassResolver.java | 10 ++-- .../data/rest/webmvc/support/ETag.java | 8 ++-- .../support/ETagDoesntMatchException.java | 4 +- .../support/PersistentEntityProjector.java | 8 ++-- ...ryConstraintViolationExceptionMessage.java | 10 ++-- .../webmvc/support/RepositoryEntityLinks.java | 18 +++---- .../webmvc/support/RepositoryLinkBuilder.java | 2 +- .../util/InputStreamHttpInputMessage.java | 2 +- .../data/rest/webmvc/util/UriUtils.java | 6 +-- ...positoryRestExceptionHandlerUnitTests.java | 6 +-- .../webmvc/json/patch/JsonPatchUnitTests.java | 4 +- .../json/patch/MoveOperationUnitTests.java | 4 +- 121 files changed, 478 insertions(+), 478 deletions(-) diff --git a/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/StringToLdapNameConverter.java b/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/StringToLdapNameConverter.java index b4f0da44f..6dbfb92fe 100644 --- a/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/StringToLdapNameConverter.java +++ b/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/StringToLdapNameConverter.java @@ -37,7 +37,7 @@ public enum StringToLdapNameConverter implements Converter { try { return new LdapName(source); } catch (InvalidNameException e) { - throw new IllegalArgumentException(String.format("Cannot create LdapName for '%s'!", source), e); + throw new IllegalArgumentException(String.format("Cannot create LdapName for '%s'", source), e); } } } diff --git a/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/UriToEntityConverter.java b/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/UriToEntityConverter.java index 556dbeffe..8e60f912f 100644 --- a/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/UriToEntityConverter.java +++ b/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/UriToEntityConverter.java @@ -59,9 +59,9 @@ public class UriToEntityConverter implements ConditionalGenericConverter { public UriToEntityConverter(PersistentEntities entities, RepositoryInvokerFactory invokerFactory, Repositories repositories) { - Assert.notNull(entities, "PersistentEntities must not be null!"); - Assert.notNull(invokerFactory, "RepositoryInvokerFactory must not be null!"); - Assert.notNull(repositories, "Repositories must not be null!"); + Assert.notNull(entities, "PersistentEntities must not be null"); + Assert.notNull(invokerFactory, "RepositoryInvokerFactory must not be null"); + Assert.notNull(repositories, "Repositories must not be null"); Set convertiblePairs = new HashSet(); @@ -108,7 +108,7 @@ public class UriToEntityConverter implements ConditionalGenericConverter { if (parts.length < 2) { throw new ConversionFailedException(sourceType, targetType, source, new IllegalArgumentException( - "Cannot resolve URI " + uri + ". Is it local or remote? Only local URIs are resolvable.")); + "Cannot resolve URI " + uri + "; Is it local or remote; Only local URIs are resolvable")); } return invokerFactory.getInvokerFor(targetType.getType()).invokeFindById(parts[parts.length - 1]).orElse(null); diff --git a/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/ValidationErrors.java b/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/ValidationErrors.java index 492341661..92f33b4a1 100644 --- a/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/ValidationErrors.java +++ b/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/ValidationErrors.java @@ -57,8 +57,8 @@ public class ValidationErrors extends AbstractPropertyBindingResult { super(source.getClass().getSimpleName()); - Assert.notNull(source, "Entity must not be null!"); - Assert.notNull(entities, "PersistentEntities must not be null!"); + Assert.notNull(source, "Entity must not be null"); + Assert.notNull(entities, "PersistentEntities must not be null"); this.entities = entities; this.source = source; diff --git a/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/config/EntityLookupConfiguration.java b/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/config/EntityLookupConfiguration.java index 82a2c130f..a743a219c 100644 --- a/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/config/EntityLookupConfiguration.java +++ b/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/config/EntityLookupConfiguration.java @@ -92,7 +92,7 @@ class EntityLookupConfiguration implements EntityLookupRegistrar { */ public MappingBuilder(Class type) { - Assert.notNull(type, "Repository type must not be null!"); + Assert.notNull(type, "Repository type must not be null"); this.repositoryType = type; } @@ -105,7 +105,7 @@ class EntityLookupConfiguration implements EntityLookupRegistrar { */ private MappingBuilder(Class repositoryType, Converter mapping) { this(repositoryType); - Assert.notNull(mapping, "Converter must not be null!"); + Assert.notNull(mapping, "Converter must not be null"); this.idMapping = mapping; } @@ -134,7 +134,7 @@ class EntityLookupConfiguration implements EntityLookupRegistrar { */ public List> getEntityLookups(Repositories repositories) { - Assert.notNull(repositories, "Repositories must not be null!"); + Assert.notNull(repositories, "Repositories must not be null"); return lookupInformation.stream() // .map(it -> new RepositoriesEntityLookup<>(repositories, it)) // @@ -166,17 +166,17 @@ class EntityLookupConfiguration implements EntityLookupRegistrar { @SuppressWarnings("unchecked") public RepositoriesEntityLookup(Repositories repositories, LookupInformation> lookupInformation) { - Assert.notNull(repositories, "Repositories must not be null!"); - Assert.notNull(lookupInformation, "LookupInformation must not be null!"); + Assert.notNull(repositories, "Repositories must not be null"); + Assert.notNull(lookupInformation, "LookupInformation must not be null"); RepositoryInformation information = // repositories.getRepositoryInformation(lookupInformation.repositoryType) .orElseThrow(() -> new IllegalStateException( - "No repository found for type " + lookupInformation.repositoryType.getName() + "!")); + "No repository found for type " + lookupInformation.repositoryType.getName())); this.domainType = information.getDomainType(); this.lookupInfo = lookupInformation; this.repository = (Repository) // repositories.getRepositoryFor(information.getDomainType()).orElseThrow(() -> new IllegalStateException( - "No repository found for type " + information.getDomainType().getName() + "!")); + "No repository found for type " + information.getDomainType().getName())); this.lookupProperty = // Optional.of(domainType).flatMap(it -> // // @@ -216,9 +216,9 @@ class EntityLookupConfiguration implements EntityLookupRegistrar { public LookupInformation(Class repositoryType, Converter identifierMapping, Lookup lookup) { - Assert.notNull(repositoryType, "Repository type must not be null!"); - Assert.notNull(identifierMapping, "Identifier mapping must not be null!"); - Assert.notNull(lookup, "Lookup must not be null!"); + Assert.notNull(repositoryType, "Repository type must not be null"); + Assert.notNull(identifierMapping, "Identifier mapping must not be null"); + Assert.notNull(lookup, "Lookup must not be null"); this.repositoryType = repositoryType; this.identifierMapping = identifierMapping; diff --git a/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/config/MetadataConfiguration.java b/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/config/MetadataConfiguration.java index b7b7e4e4e..b6199aaf5 100644 --- a/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/config/MetadataConfiguration.java +++ b/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/config/MetadataConfiguration.java @@ -75,7 +75,7 @@ public class MetadataConfiguration { public void registerJsonSchemaFormat(JsonSchemaFormat format, Class... types) { - Assert.notNull(format, "JsonSchemaFormat must not be null!"); + Assert.notNull(format, "JsonSchemaFormat must not be null"); for (Class type : types) { schemaFormats.put(type, format); @@ -100,8 +100,8 @@ public class MetadataConfiguration { */ public void registerFormattingPatternFor(String pattern, Class type) { - Assert.hasText(pattern, "Pattern must not be null or empty!"); - Assert.notNull(type, "Type must not be null!"); + Assert.hasText(pattern, "Pattern must not be null or empty"); + Assert.notNull(type, "Type must not be null"); this.patterns.put(type, Pattern.compile(pattern)); } @@ -114,7 +114,7 @@ public class MetadataConfiguration { */ public Pattern getPatternFor(Class type) { - Assert.notNull(type, "Type must not be null!"); + Assert.notNull(type, "Type must not be null"); for (Entry, Pattern> entry : this.patterns.entrySet()) { if (entry.getKey().isAssignableFrom(type)) { diff --git a/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/config/ProjectionDefinitionConfiguration.java b/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/config/ProjectionDefinitionConfiguration.java index 1d56f2d3a..488658a5a 100644 --- a/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/config/ProjectionDefinitionConfiguration.java +++ b/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/config/ProjectionDefinitionConfiguration.java @@ -34,7 +34,7 @@ import org.springframework.util.StringUtils; */ public class ProjectionDefinitionConfiguration implements ProjectionDefinitions { - private static final String PROJECTION_ANNOTATION_NOT_FOUND = "Projection annotation not found on %s! Either add the annotation or hand source type to the registration manually!"; + private static final String PROJECTION_ANNOTATION_NOT_FOUND = "Projection annotation not found on %s; Either add the annotation or hand source type to the registration manually"; private static final String DEFAULT_PROJECTION_PARAMETER_NAME = "projection"; private final Set projectionDefinitions; @@ -71,7 +71,7 @@ public class ProjectionDefinitionConfiguration implements ProjectionDefinitions */ public ProjectionDefinitionConfiguration addProjection(Class projectionType) { - Assert.notNull(projectionType, "Projection type must not be null!"); + Assert.notNull(projectionType, "Projection type must not be null"); Projection annotation = AnnotationUtils.findAnnotation(projectionType, Projection.class); @@ -97,7 +97,7 @@ public class ProjectionDefinitionConfiguration implements ProjectionDefinitions */ public ProjectionDefinitionConfiguration addProjection(Class projectionType, Class... sourceTypes) { - Assert.notNull(projectionType, "Projection type must not be null!"); + Assert.notNull(projectionType, "Projection type must not be null"); return addProjection(projectionType, StringUtils.uncapitalize(projectionType.getSimpleName()), sourceTypes); } @@ -113,9 +113,9 @@ public class ProjectionDefinitionConfiguration implements ProjectionDefinitions public ProjectionDefinitionConfiguration addProjection(Class projectionType, String name, Class... sourceTypes) { - Assert.notNull(projectionType, "Projection type must not be null!"); - Assert.hasText(name, "Name must not be null or empty!"); - Assert.notEmpty(sourceTypes, "Source types must not be null!"); + Assert.notNull(projectionType, "Projection type must not be null"); + Assert.hasText(name, "Name must not be null or empty"); + Assert.notEmpty(sourceTypes, "Source types must not be null"); for (Class sourceType : sourceTypes) { this.projectionDefinitions.add(ProjectionDefinition.of(sourceType, projectionType, name)); @@ -150,7 +150,7 @@ public class ProjectionDefinitionConfiguration implements ProjectionDefinitions */ public Map> getProjectionsFor(Class sourceType) { - Assert.notNull(sourceType, "Source type must not be null!"); + Assert.notNull(sourceType, "Source type must not be null"); Class userType = ProxyUtils.getUserClass(sourceType); Map byName = new HashMap(); @@ -189,9 +189,9 @@ public class ProjectionDefinitionConfiguration implements ProjectionDefinitions private ProjectionDefinition(Class sourceType, Class targetType, String name) { - Assert.notNull(sourceType, "Source type must not be null!"); - Assert.notNull(targetType, "Target type must not be null!"); - Assert.notNull(name, "Name must not be null!"); + Assert.notNull(sourceType, "Source type must not be null"); + Assert.notNull(targetType, "Target type must not be null"); + Assert.notNull(name, "Name must not be null"); this.sourceType = sourceType; this.targetType = targetType; @@ -207,7 +207,7 @@ public class ProjectionDefinitionConfiguration implements ProjectionDefinitions */ static ProjectionDefinition of(Class sourceType, Class targetType, String name) { - Assert.hasText(name, "Name must not be null or empty!"); + Assert.hasText(name, "Name must not be null or empty"); return new ProjectionDefinition(sourceType, targetType, name); } diff --git a/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/config/RepositoryRestConfiguration.java b/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/config/RepositoryRestConfiguration.java index b06411f90..e26729773 100644 --- a/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/config/RepositoryRestConfiguration.java +++ b/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/config/RepositoryRestConfiguration.java @@ -87,9 +87,9 @@ public class RepositoryRestConfiguration { public RepositoryRestConfiguration(ProjectionDefinitionConfiguration projectionConfiguration, MetadataConfiguration metadataConfiguration, EnumTranslationConfiguration enumTranslationConfiguration) { - Assert.notNull(projectionConfiguration, "ProjectionDefinitionConfiguration must not be null!"); - Assert.notNull(metadataConfiguration, "MetadataConfiguration must not be null!"); - Assert.notNull(enumTranslationConfiguration, "EnumTranslationConfiguration must not be null!"); + Assert.notNull(projectionConfiguration, "ProjectionDefinitionConfiguration must not be null"); + Assert.notNull(metadataConfiguration, "MetadataConfiguration must not be null"); + Assert.notNull(enumTranslationConfiguration, "EnumTranslationConfiguration must not be null"); this.projectionConfiguration = projectionConfiguration; this.metadataConfiguration = metadataConfiguration; @@ -133,7 +133,7 @@ public class RepositoryRestConfiguration { basePath = StringUtils.trimTrailingCharacter(basePath, '/'); this.basePath = URI.create(basePath.startsWith("/") ? basePath : "/".concat(basePath)); - Assert.isTrue(!this.basePath.isAbsolute(), "Absolute URIs are not supported as base path!"); + Assert.isTrue(!this.basePath.isAbsolute(), "Absolute URIs are not supported as base path"); return this; } @@ -154,7 +154,7 @@ public class RepositoryRestConfiguration { * @return {@literal this} */ public RepositoryRestConfiguration setDefaultPageSize(int defaultPageSize) { - Assert.isTrue(defaultPageSize > 0, "Page size must be greater than 0."); + Assert.isTrue(defaultPageSize > 0, "Page size must be greater than 0"); this.defaultPageSize = defaultPageSize; return this; } @@ -175,7 +175,7 @@ public class RepositoryRestConfiguration { * @return {@literal this} */ public RepositoryRestConfiguration setMaxPageSize(int maxPageSize) { - Assert.isTrue(defaultPageSize > 0, "Maximum page size must be greater than 0."); + Assert.isTrue(defaultPageSize > 0, "Maximum page size must be greater than 0"); this.maxPageSize = maxPageSize; return this; } @@ -196,7 +196,7 @@ public class RepositoryRestConfiguration { * @return {@literal this} */ public RepositoryRestConfiguration setPageParamName(String pageParamName) { - Assert.notNull(pageParamName, "Page param name cannot be null."); + Assert.notNull(pageParamName, "Page param name cannot be null"); this.pageParamName = pageParamName; return this; } @@ -219,7 +219,7 @@ public class RepositoryRestConfiguration { * @return {@literal this} */ public RepositoryRestConfiguration setLimitParamName(String limitParamName) { - Assert.notNull(limitParamName, "Limit param name cannot be null."); + Assert.notNull(limitParamName, "Limit param name cannot be null"); this.limitParamName = limitParamName; return this; } @@ -240,7 +240,7 @@ public class RepositoryRestConfiguration { * @return {@literal this} */ public RepositoryRestConfiguration setSortParamName(String sortParamName) { - Assert.notNull(sortParamName, "Sort param name cannot be null."); + Assert.notNull(sortParamName, "Sort param name cannot be null"); this.sortParamName = sortParamName; return this; } @@ -654,7 +654,7 @@ public class RepositoryRestConfiguration { */ public List> getEntityLookups(Repositories repositories) { - Assert.notNull(repositories, "Repositories must not be null!"); + Assert.notNull(repositories, "Repositories must not be null"); return entityLookupConfiguration.getEntityLookups(repositories); } @@ -709,7 +709,7 @@ public class RepositoryRestConfiguration { */ public RepositoryRestConfiguration setLinkRelationProvider(LinkRelationProvider provider) { - Assert.notNull(provider, "LinkRelationProvider must not be null!"); + Assert.notNull(provider, "LinkRelationProvider must not be null"); this.linkRelationProvider = provider; diff --git a/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/event/AnnotatedEventHandlerInvoker.java b/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/event/AnnotatedEventHandlerInvoker.java index 52018734a..e48409db5 100644 --- a/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/event/AnnotatedEventHandlerInvoker.java +++ b/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/event/AnnotatedEventHandlerInvoker.java @@ -48,7 +48,7 @@ import org.springframework.util.ReflectionUtils; public class AnnotatedEventHandlerInvoker implements ApplicationListener, BeanPostProcessor { private static final Logger LOG = LoggerFactory.getLogger(AnnotatedEventHandlerInvoker.class); - private static final String PARAMETER_MISSING = "Invalid event handler method %s! At least a single argument is required to determine the domain type for which you are interested in events."; + private static final String PARAMETER_MISSING = "Invalid event handler method %s; At least a single argument is required to determine the domain type for which you are interested in events"; private final MultiValueMap, EventHandlerMethod> handlerMethods = new LinkedMultiValueMap, EventHandlerMethod>(); @@ -77,7 +77,7 @@ public class AnnotatedEventHandlerInvoker implements ApplicationListener targetType, Method method, Object handler) { - Assert.notNull(targetType, "Target type must not be null!"); - Assert.notNull(method, "Method must not be null!"); - Assert.notNull(handler, "Handler must not be null!"); + Assert.notNull(targetType, "Target type must not be null"); + Assert.notNull(method, "Method must not be null"); + Assert.notNull(handler, "Handler must not be null"); this.targetType = targetType; this.method = method; diff --git a/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/event/ValidatingRepositoryEventListener.java b/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/event/ValidatingRepositoryEventListener.java index 63d5ac5ae..227c706a8 100644 --- a/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/event/ValidatingRepositoryEventListener.java +++ b/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/event/ValidatingRepositoryEventListener.java @@ -54,7 +54,7 @@ public class ValidatingRepositoryEventListener extends AbstractRepositoryEventLi */ public ValidatingRepositoryEventListener(ObjectFactory persistentEntitiesFactory) { - Assert.notNull(persistentEntitiesFactory, "PersistentEntities must not be null!"); + Assert.notNull(persistentEntitiesFactory, "PersistentEntities must not be null"); this.persistentEntitiesFactory = persistentEntitiesFactory; this.validators = new LinkedMultiValueMap(); diff --git a/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/mapping/AnnotationBasedResourceDescription.java b/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/mapping/AnnotationBasedResourceDescription.java index 092978a83..26aa06a81 100644 --- a/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/mapping/AnnotationBasedResourceDescription.java +++ b/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/mapping/AnnotationBasedResourceDescription.java @@ -40,8 +40,8 @@ public class AnnotationBasedResourceDescription extends ResolvableResourceDescri */ public AnnotationBasedResourceDescription(Description description, ResourceDescription fallback) { - Assert.notNull(description, "Description must not be null!"); - Assert.notNull(fallback, "Fallback resource description must not be null!"); + Assert.notNull(description, "Description must not be null"); + Assert.notNull(fallback, "Fallback resource description must not be null"); this.message = description.value(); this.fallback = fallback; diff --git a/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/mapping/ConfigurableHttpMethods.java b/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/mapping/ConfigurableHttpMethods.java index 57b691383..020653c0c 100644 --- a/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/mapping/ConfigurableHttpMethods.java +++ b/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/mapping/ConfigurableHttpMethods.java @@ -40,7 +40,7 @@ public class ConfigurableHttpMethods implements HttpMethods { private ConfigurableHttpMethods(Collection methods) { - Assert.notNull(methods, "HttpMethods must not be null!"); + Assert.notNull(methods, "HttpMethods must not be null"); this.methods = methods; } @@ -57,7 +57,7 @@ public class ConfigurableHttpMethods implements HttpMethods { */ static ConfigurableHttpMethods of(HttpMethod... methods) { - Assert.notNull(methods, "HttpMethods must not be null!"); + Assert.notNull(methods, "HttpMethods must not be null"); return new ConfigurableHttpMethods(Arrays.stream(methods).collect(Collectors.toSet())); } @@ -70,7 +70,7 @@ public class ConfigurableHttpMethods implements HttpMethods { */ static ConfigurableHttpMethods of(HttpMethods methods) { - Assert.notNull(methods, "HttpMethods must not be null!"); + Assert.notNull(methods, "HttpMethods must not be null"); if (ConfigurableHttpMethods.class.isInstance(methods)) { return ConfigurableHttpMethods.class.cast(methods); @@ -87,7 +87,7 @@ public class ConfigurableHttpMethods implements HttpMethods { */ public ConfigurableHttpMethods disable(HttpMethod... methods) { - Assert.notNull(methods, "HttpMethods must not be null!"); + Assert.notNull(methods, "HttpMethods must not be null"); List toRemove = Arrays.asList(methods); @@ -104,7 +104,7 @@ public class ConfigurableHttpMethods implements HttpMethods { */ public ConfigurableHttpMethods enable(HttpMethod... methods) { - Assert.notNull(methods, "HttpMethods must not be null!"); + Assert.notNull(methods, "HttpMethods must not be null"); List toAdd = Arrays.asList(methods); @@ -118,7 +118,7 @@ public class ConfigurableHttpMethods implements HttpMethods { @Override public boolean contains(HttpMethod method) { - Assert.notNull(method, "HTTP method must not be null!"); + Assert.notNull(method, "HTTP method must not be null"); return methods.contains(method); } diff --git a/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/mapping/ConfigurationApplyingSupportedHttpMethodsAdapter.java b/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/mapping/ConfigurationApplyingSupportedHttpMethodsAdapter.java index 9d127c7b4..5a5b937e1 100644 --- a/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/mapping/ConfigurationApplyingSupportedHttpMethodsAdapter.java +++ b/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/mapping/ConfigurationApplyingSupportedHttpMethodsAdapter.java @@ -36,9 +36,9 @@ class ConfigurationApplyingSupportedHttpMethodsAdapter implements SupportedHttpM ConfigurationApplyingSupportedHttpMethodsAdapter(ExposureConfiguration configuration, ResourceMetadata resourceMetadata, SupportedHttpMethods delegate) { - Assert.notNull(configuration, "Configuration must not be null!"); - Assert.notNull(resourceMetadata, "ResourceMetadata must not be null!"); - Assert.notNull(delegate, "SupportedHttpMethods must not be null!"); + Assert.notNull(configuration, "Configuration must not be null"); + Assert.notNull(resourceMetadata, "ResourceMetadata must not be null"); + Assert.notNull(delegate, "SupportedHttpMethods must not be null"); this.configuration = configuration; this.resourceMetadata = resourceMetadata; diff --git a/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/mapping/CrudMethodsSupportedHttpMethods.java b/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/mapping/CrudMethodsSupportedHttpMethods.java index b4121e6e5..29c865c70 100644 --- a/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/mapping/CrudMethodsSupportedHttpMethods.java +++ b/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/mapping/CrudMethodsSupportedHttpMethods.java @@ -50,7 +50,7 @@ public class CrudMethodsSupportedHttpMethods implements SupportedHttpMethods { */ public CrudMethodsSupportedHttpMethods(CrudMethods crudMethods, boolean methodsExposedByDefault) { - Assert.notNull(crudMethods, "CrudMethods must not be null!"); + Assert.notNull(crudMethods, "CrudMethods must not be null"); this.exposedMethods = new DefaultExposureAwareCrudMethods(crudMethods, methodsExposedByDefault); } @@ -58,7 +58,7 @@ public class CrudMethodsSupportedHttpMethods implements SupportedHttpMethods { @Override public HttpMethods getMethodsFor(ResourceType resourceType) { - Assert.notNull(resourceType, "EntityRepresentationModel type must not be null!"); + Assert.notNull(resourceType, "EntityRepresentationModel type must not be null"); Set methods = new HashSet(); methods.add(OPTIONS); @@ -97,7 +97,7 @@ public class CrudMethodsSupportedHttpMethods implements SupportedHttpMethods { break; default: - throw new IllegalArgumentException(String.format("Unsupported resource type %s!", resourceType)); + throw new IllegalArgumentException(String.format("Unsupported resource type %s", resourceType)); } return HttpMethods.of(methods); @@ -141,7 +141,7 @@ public class CrudMethodsSupportedHttpMethods implements SupportedHttpMethods { DefaultExposureAwareCrudMethods(CrudMethods crudMethods, boolean exportedDefault) { - Assert.notNull(crudMethods, "CrudMethods must not be null!"); + Assert.notNull(crudMethods, "CrudMethods must not be null"); this.exposesSave = Lazy.of(() -> exposes(crudMethods.getSaveMethod())); this.exposesDelete = Lazy.of(() -> exposes(crudMethods.getDeleteMethod()) && crudMethods.hasFindOneMethod()); diff --git a/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/mapping/ExposureConfiguration.java b/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/mapping/ExposureConfiguration.java index a27026662..b6a6d1708 100644 --- a/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/mapping/ExposureConfiguration.java +++ b/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/mapping/ExposureConfiguration.java @@ -80,7 +80,7 @@ public class ExposureConfiguration implements ExposureConfigurer { */ public ExposureConfigurer forDomainType(Class type) { - Assert.notNull(type, "Type must not be null!"); + Assert.notNull(type, "Type must not be null"); return new TypeBasedExposureConfigurer(type); } @@ -115,7 +115,7 @@ public class ExposureConfiguration implements ExposureConfigurer { */ public boolean allowsPutForCreation(ResourceMetadata metadata) { - Assert.notNull(metadata, "ResourceMetadata must not be null!"); + Assert.notNull(metadata, "ResourceMetadata must not be null"); return allowsPutForCreation(metadata.getDomainType()); } @@ -128,7 +128,7 @@ public class ExposureConfiguration implements ExposureConfigurer { */ public boolean allowsPutForCreation(Class domainType) { - Assert.notNull(domainType, "Domain type must not be null!"); + Assert.notNull(domainType, "Domain type must not be null"); return creationViaPut.apply(domainType); } @@ -170,7 +170,7 @@ public class ExposureConfiguration implements ExposureConfigurer { public TypeBasedExposureConfigurer(Class type) { - Assert.notNull(type, " must not be null!"); + Assert.notNull(type, " must not be null"); this.type = type; } diff --git a/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/mapping/HttpMethods.java b/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/mapping/HttpMethods.java index b8f806ca0..874766f44 100644 --- a/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/mapping/HttpMethods.java +++ b/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/mapping/HttpMethods.java @@ -46,7 +46,7 @@ public interface HttpMethods extends Streamable { */ public static HttpMethods of(Collection methods) { - Assert.notNull(methods, "HTTP methods must not be null!"); + Assert.notNull(methods, "HTTP methods must not be null"); return ConfigurableHttpMethods.of(methods); } diff --git a/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/mapping/MappingResourceMetadata.java b/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/mapping/MappingResourceMetadata.java index b616f2c1e..9f5678e19 100644 --- a/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/mapping/MappingResourceMetadata.java +++ b/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/mapping/MappingResourceMetadata.java @@ -114,7 +114,7 @@ class MappingResourceMetadata extends TypeBasedCollectionResourceMapping impleme */ public PropertyMappings(ResourceMappings resourceMappings) { - Assert.notNull(resourceMappings, "ResourceMappings must not be null!"); + Assert.notNull(resourceMappings, "ResourceMappings must not be null"); this.resourceMappings = resourceMappings; this.propertyMappings = new HashMap, PropertyAwareResourceMapping>(); @@ -128,7 +128,7 @@ class MappingResourceMetadata extends TypeBasedCollectionResourceMapping impleme @Override public void doWithPersistentProperty(PersistentProperty property) { - Assert.notNull(property, "PersistentProperty must not be null!"); + Assert.notNull(property, "PersistentProperty must not be null"); this.propertyMappings.put(property, new PersistentPropertyResourceMapping(property, resourceMappings)); @@ -142,7 +142,7 @@ class MappingResourceMetadata extends TypeBasedCollectionResourceMapping impleme */ public PropertyAwareResourceMapping getMappingFor(String mappedPath) { - Assert.hasText(mappedPath, "Mapped path must not be null or empty!"); + Assert.hasText(mappedPath, "Mapped path must not be null or empty"); for (PropertyAwareResourceMapping mapping : propertyMappings.values()) { if (mapping.getPath().matches(mappedPath)) { diff --git a/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/mapping/ParameterMetadata.java b/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/mapping/ParameterMetadata.java index 871dee1b7..1af7609e5 100644 --- a/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/mapping/ParameterMetadata.java +++ b/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/mapping/ParameterMetadata.java @@ -38,12 +38,12 @@ public final class ParameterMetadata { */ public ParameterMetadata(MethodParameter parameter, String baseRel) { - Assert.notNull(parameter, "MethodParameter must not be null!"); + Assert.notNull(parameter, "MethodParameter must not be null"); this.name = parameter.getParameterName(); - Assert.hasText(name, "Parameter name must not be null or empty!"); - Assert.hasText(baseRel, "Method rel must not be null!"); + Assert.hasText(name, "Parameter name must not be null or empty"); + Assert.hasText(baseRel, "Method rel must not be null"); ResourceDescription fallback = TypedResourceDescription .defaultFor(LinkRelation.of(baseRel.concat(".").concat(name)), parameter.getParameterType()); diff --git a/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/mapping/ParametersMetadata.java b/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/mapping/ParametersMetadata.java index 214cc24f7..35dcd3c9d 100644 --- a/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/mapping/ParametersMetadata.java +++ b/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/mapping/ParametersMetadata.java @@ -37,7 +37,7 @@ public class ParametersMetadata implements Iterable { */ ParametersMetadata(List parameterMetadata) { - Assert.notNull(parameterMetadata, "Parameter metadata must not be null!"); + Assert.notNull(parameterMetadata, "Parameter metadata must not be null"); this.parameterMetadata = parameterMetadata; } diff --git a/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/mapping/PersistentEntitiesResourceMappings.java b/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/mapping/PersistentEntitiesResourceMappings.java index 778a38602..845eb411d 100644 --- a/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/mapping/PersistentEntitiesResourceMappings.java +++ b/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/mapping/PersistentEntitiesResourceMappings.java @@ -56,7 +56,7 @@ public class PersistentEntitiesResourceMappings implements ResourceMappings { @Override public ResourceMetadata getMetadataFor(Class type) { - Assert.notNull(type, "Type must not be null!"); + Assert.notNull(type, "Type must not be null"); return cache.computeIfAbsent(ProxyUtils.getUserClass(type), it -> getMappingMetadataFor(it)); } @@ -70,7 +70,7 @@ public class PersistentEntitiesResourceMappings implements ResourceMappings { */ MappingResourceMetadata getMappingMetadataFor(Class type) { - Assert.notNull(type, "Type must not be null!"); + Assert.notNull(type, "Type must not be null"); Class userType = ProxyUtils.getUserClass(type); return mappingCache.computeIfAbsent(ProxyUtils.getUserClass(type), it -> { @@ -100,7 +100,7 @@ public class PersistentEntitiesResourceMappings implements ResourceMappings { @Override public boolean exportsTopLevelResourceFor(String path) { - Assert.hasText(path, "Path must not be null or empty!"); + Assert.hasText(path, "Path must not be null or empty"); for (ResourceMetadata metadata : this) { if (metadata.getPath().matches(path)) { diff --git a/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/mapping/PersistentPropertyResourceMapping.java b/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/mapping/PersistentPropertyResourceMapping.java index a0363deb1..8936980e8 100644 --- a/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/mapping/PersistentPropertyResourceMapping.java +++ b/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/mapping/PersistentPropertyResourceMapping.java @@ -46,7 +46,7 @@ class PersistentPropertyResourceMapping implements PropertyAwareResourceMapping */ public PersistentPropertyResourceMapping(PersistentProperty property, ResourceMappings mappings) { - Assert.notNull(property, "PersistentProperty must not be null!"); + Assert.notNull(property, "PersistentProperty must not be null"); this.property = property; this.mappings = mappings; diff --git a/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/mapping/RepositoryAwareResourceMetadata.java b/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/mapping/RepositoryAwareResourceMetadata.java index 9c652f4df..fa5ad494d 100644 --- a/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/mapping/RepositoryAwareResourceMetadata.java +++ b/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/mapping/RepositoryAwareResourceMetadata.java @@ -52,10 +52,10 @@ class RepositoryAwareResourceMetadata implements ResourceMetadata { public RepositoryAwareResourceMetadata(PersistentEntity entity, CollectionResourceMapping mapping, RepositoryResourceMappings provider, RepositoryMetadata repositoryMetadata) { - Assert.notNull(entity, "PersistentEntity must not be null!"); - Assert.notNull(mapping, "CollectionResourceMapping must not be null!"); - Assert.notNull(provider, "ResourceMetadataProvider must not be null!"); - Assert.notNull(repositoryMetadata, "RepositoryMetadata must not be null!"); + Assert.notNull(entity, "PersistentEntity must not be null"); + Assert.notNull(mapping, "CollectionResourceMapping must not be null"); + Assert.notNull(provider, "ResourceMetadataProvider must not be null"); + Assert.notNull(repositoryMetadata, "RepositoryMetadata must not be null"); this.mapping = mapping; this.provider = provider; diff --git a/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/mapping/RepositoryCollectionResourceMapping.java b/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/mapping/RepositoryCollectionResourceMapping.java index be545741d..648e910c7 100644 --- a/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/mapping/RepositoryCollectionResourceMapping.java +++ b/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/mapping/RepositoryCollectionResourceMapping.java @@ -68,9 +68,9 @@ class RepositoryCollectionResourceMapping implements CollectionResourceMapping { RepositoryCollectionResourceMapping(RepositoryMetadata metadata, RepositoryDetectionStrategy strategy, LinkRelationProvider relProvider) { - Assert.notNull(metadata, "Repository metadata must not be null!"); - Assert.notNull(relProvider, "LinkRelationProvider must not be null!"); - Assert.notNull(strategy, "RepositoryDetectionStrategy must not be null!"); + Assert.notNull(metadata, "Repository metadata must not be null"); + Assert.notNull(relProvider, "LinkRelationProvider must not be null"); + Assert.notNull(strategy, "RepositoryDetectionStrategy must not be null"); Class repositoryType = metadata.getRepositoryInterface(); @@ -105,7 +105,7 @@ class RepositoryCollectionResourceMapping implements CollectionResourceMapping { if (it.contains("/")) { throw new IllegalStateException( - String.format("Path %s configured for %s must only contain a single path segment!", it, + String.format("Path %s configured for %s must only contain a single path segment", it, metadata.getRepositoryInterface().getName())); } @@ -140,7 +140,7 @@ class RepositoryCollectionResourceMapping implements CollectionResourceMapping { if (annotation.isPresent()) { LOGGER.warn( - "@RestResource detected to customize the repository resource for {}! Use @RepositoryRestResource instead!", + "@RestResource detected to customize the repository resource for {}; Use @RepositoryRestResource instead", metadata.getRepositoryInterface().getName()); } } diff --git a/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/mapping/RepositoryMethodResourceMapping.java b/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/mapping/RepositoryMethodResourceMapping.java index 9b188fa58..92b06d7de 100644 --- a/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/mapping/RepositoryMethodResourceMapping.java +++ b/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/mapping/RepositoryMethodResourceMapping.java @@ -67,8 +67,8 @@ class RepositoryMethodResourceMapping implements MethodResourceMapping { public RepositoryMethodResourceMapping(Method method, ResourceMapping resourceMapping, RepositoryMetadata metadata, boolean exposeMethodsByDefault) { - Assert.notNull(method, "Method must not be null!"); - Assert.notNull(resourceMapping, "ResourceMapping must not be null!"); + Assert.notNull(method, "Method must not be null"); + Assert.notNull(resourceMapping, "ResourceMapping must not be null"); RestResource annotation = AnnotationUtils.findAnnotation(method, RestResource.class); LinkRelation resourceRel = resourceMapping.getRel(); diff --git a/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/mapping/RepositoryResourceMappings.java b/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/mapping/RepositoryResourceMappings.java index 96cc0fcd5..90c9f8879 100644 --- a/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/mapping/RepositoryResourceMappings.java +++ b/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/mapping/RepositoryResourceMappings.java @@ -56,8 +56,8 @@ public class RepositoryResourceMappings extends PersistentEntitiesResourceMappin super(entities); - Assert.notNull(repositories, "Repositories must not be null!"); - Assert.notNull(configuration, "RepositoryRestConfiguration must not be null!"); + Assert.notNull(repositories, "Repositories must not be null"); + Assert.notNull(configuration, "RepositoryRestConfiguration must not be null"); this.repositories = repositories; this.configuration = configuration; @@ -96,7 +96,7 @@ public class RepositoryResourceMappings extends PersistentEntitiesResourceMappin @Override public SearchResourceMappings getSearchResourceMappings(Class domainType) { - Assert.notNull(domainType, "Type must not be null!"); + Assert.notNull(domainType, "Type must not be null"); if (searchCache.containsKey(domainType)) { return searchCache.get(domainType); diff --git a/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/mapping/SearchResourceMappings.java b/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/mapping/SearchResourceMappings.java index 890f523c8..42eb35822 100644 --- a/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/mapping/SearchResourceMappings.java +++ b/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/mapping/SearchResourceMappings.java @@ -34,8 +34,8 @@ import org.springframework.util.Assert; */ public class SearchResourceMappings implements Iterable, ResourceMapping { - private static final String AMBIGUOUS_MAPPING = "Ambiguous search mapping detected. Both %s and " - + "%s are mapped to %s! Tweak configuration to get to unambiguous paths!"; + private static final String AMBIGUOUS_MAPPING = "Ambiguous search mapping detected; Both %s and " + + "%s are mapped to %s; Tweak configuration to get to unambiguous paths"; private static final Path PATH = new Path("/search"); private static final LinkRelation REL = IanaLinkRelations.SEARCH; @@ -49,7 +49,7 @@ public class SearchResourceMappings implements Iterable, */ public SearchResourceMappings(List mappings) { - Assert.notNull(mappings, "MethodResourceMappings must not be null!"); + Assert.notNull(mappings, "MethodResourceMappings must not be null"); this.mappings = new HashMap(mappings.size()); @@ -74,7 +74,7 @@ public class SearchResourceMappings implements Iterable, */ public Method getMappedMethod(String path) { - Assert.hasText(path, "Path must not be null or empty!"); + Assert.hasText(path, "Path must not be null or empty"); MethodResourceMapping mapping = mappings.get(new Path(path)); return mapping == null ? null : mapping.getMethod(); @@ -101,7 +101,7 @@ public class SearchResourceMappings implements Iterable, */ public MethodResourceMapping getExportedMethodMappingForRel(LinkRelation rel) { - Assert.notNull(rel, "Rel must not be null!"); + Assert.notNull(rel, "Rel must not be null"); return mappings.values().stream() // .filter(MethodResourceMapping::isExported) // @@ -118,7 +118,7 @@ public class SearchResourceMappings implements Iterable, */ public MethodResourceMapping getExportedMethodMappingForPath(String path) { - Assert.hasText(path, "Path must not be null or empty!"); + Assert.hasText(path, "Path must not be null or empty"); for (MethodResourceMapping mapping : this) { diff --git a/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/mapping/SimpleResourceDescription.java b/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/mapping/SimpleResourceDescription.java index 4981dca19..68176a347 100644 --- a/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/mapping/SimpleResourceDescription.java +++ b/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/mapping/SimpleResourceDescription.java @@ -39,8 +39,8 @@ public class SimpleResourceDescription extends ResolvableResourceDescriptionSupp */ protected SimpleResourceDescription(String message, MediaType mediaType) { - Assert.hasText(message, "Message must not be null or empty!"); - Assert.notNull(mediaType, "MediaType must not be null!"); + Assert.hasText(message, "Message must not be null or empty"); + Assert.notNull(mediaType, "MediaType must not be null"); this.message = message; this.mediaType = mediaType; diff --git a/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/mapping/TypeBasedCollectionResourceMapping.java b/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/mapping/TypeBasedCollectionResourceMapping.java index 196b8b340..4699afd55 100644 --- a/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/mapping/TypeBasedCollectionResourceMapping.java +++ b/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/mapping/TypeBasedCollectionResourceMapping.java @@ -63,8 +63,8 @@ class TypeBasedCollectionResourceMapping implements CollectionResourceMapping { */ public TypeBasedCollectionResourceMapping(Class type, LinkRelationProvider relProvider) { - Assert.notNull(type, "Type must not be null!"); - Assert.notNull(relProvider, "LinkRelationProvider must not be null!"); + Assert.notNull(type, "Type must not be null"); + Assert.notNull(relProvider, "LinkRelationProvider must not be null"); this.type = type; this.relProvider = relProvider; diff --git a/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/support/DefaultSelfLinkProvider.java b/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/support/DefaultSelfLinkProvider.java index 5ea8b9729..815b47b2c 100644 --- a/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/support/DefaultSelfLinkProvider.java +++ b/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/support/DefaultSelfLinkProvider.java @@ -53,9 +53,9 @@ public class DefaultSelfLinkProvider implements SelfLinkProvider { public DefaultSelfLinkProvider(PersistentEntities entities, EntityLinks entityLinks, List> lookups, ConversionService conversionService) { - Assert.notNull(entities, "PersistentEntities must not be null!"); - Assert.notNull(entityLinks, "EntityLinks must not be null!"); - Assert.notNull(lookups, "EntityLookups must not be null!"); + Assert.notNull(entities, "PersistentEntities must not be null"); + Assert.notNull(entityLinks, "EntityLinks must not be null"); + Assert.notNull(lookups, "EntityLookups must not be null"); this.entities = entities; this.entityLinks = entityLinks; @@ -65,7 +65,7 @@ public class DefaultSelfLinkProvider implements SelfLinkProvider { public Link createSelfLinkFor(Object instance) { - Assert.notNull(instance, "Domain object must not be null!"); + Assert.notNull(instance, "Domain object must not be null"); return createSelfLinkFor(instance.getClass(), instance); } diff --git a/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/support/RepositoryRelProvider.java b/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/support/RepositoryRelProvider.java index ff8f80642..22c9504cd 100644 --- a/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/support/RepositoryRelProvider.java +++ b/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/support/RepositoryRelProvider.java @@ -40,7 +40,7 @@ public class RepositoryRelProvider implements LinkRelationProvider { */ public RepositoryRelProvider(ObjectFactory mappings) { - Assert.notNull(mappings, "ResourceMappings must not be null!"); + Assert.notNull(mappings, "ResourceMappings must not be null"); this.mappings = mappings; } diff --git a/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/support/UnwrappingRepositoryInvokerFactory.java b/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/support/UnwrappingRepositoryInvokerFactory.java index 4fdd85a2f..c8d0664aa 100644 --- a/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/support/UnwrappingRepositoryInvokerFactory.java +++ b/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/support/UnwrappingRepositoryInvokerFactory.java @@ -47,8 +47,8 @@ public class UnwrappingRepositoryInvokerFactory implements RepositoryInvokerFact public UnwrappingRepositoryInvokerFactory(RepositoryInvokerFactory delegate, List> lookups) { - Assert.notNull(delegate, "Delegate RepositoryInvokerFactory must not be null!"); - Assert.notNull(lookups, "EntityLookups must not be null!"); + Assert.notNull(delegate, "Delegate RepositoryInvokerFactory must not be null"); + Assert.notNull(lookups, "EntityLookups must not be null"); this.delegate = delegate; this.lookups = PluginRegistry.of(lookups); @@ -75,8 +75,8 @@ public class UnwrappingRepositoryInvokerFactory implements RepositoryInvokerFact public UnwrappingRepositoryInvoker(RepositoryInvoker delegate, Optional> lookup) { - Assert.notNull(delegate, "Delegate RepositoryInvoker must not be null!"); - Assert.notNull(lookup, "EntityLookup must not be null!"); + Assert.notNull(delegate, "Delegate RepositoryInvoker must not be null"); + Assert.notNull(lookup, "EntityLookup must not be null"); this.delegate = delegate; this.lookup = lookup; diff --git a/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/util/MapUtils.java b/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/util/MapUtils.java index 65b76279d..3595ed189 100644 --- a/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/util/MapUtils.java +++ b/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/util/MapUtils.java @@ -39,7 +39,7 @@ public interface MapUtils { */ public static Map> toMap(MultiValueMap map) { - Assert.notNull(map, "Given map must not be null!"); + Assert.notNull(map, "Given map must not be null"); Map> result = new LinkedHashMap>(map.size()); for (Entry> entry : map.entrySet()) { diff --git a/spring-data-rest-core/src/test/java/org/springframework/data/rest/core/ValidationErrorsUnitTests.java b/spring-data-rest-core/src/test/java/org/springframework/data/rest/core/ValidationErrorsUnitTests.java index 5a38e5962..1dfb356c0 100755 --- a/spring-data-rest-core/src/test/java/org/springframework/data/rest/core/ValidationErrorsUnitTests.java +++ b/spring-data-rest-core/src/test/java/org/springframework/data/rest/core/ValidationErrorsUnitTests.java @@ -79,7 +79,7 @@ class ValidationErrorsUnitTests { try { errors.getFieldValue("bars"); - fail("Expected NotReadablePropertyException!"); + fail("Expected NotReadablePropertyException"); } catch (NotReadablePropertyException e) {} assertThat(errors.getFieldValue("field")).isEqualTo((Object) "Hello"); diff --git a/spring-data-rest-tests/spring-data-rest-tests-core/src/test/java/org/springframework/data/rest/tests/AbstractControllerIntegrationTests.java b/spring-data-rest-tests/spring-data-rest-tests-core/src/test/java/org/springframework/data/rest/tests/AbstractControllerIntegrationTests.java index 3091e9645..f6356d90d 100755 --- a/spring-data-rest-tests/spring-data-rest-tests-core/src/test/java/org/springframework/data/rest/tests/AbstractControllerIntegrationTests.java +++ b/spring-data-rest-tests/spring-data-rest-tests-core/src/test/java/org/springframework/data/rest/tests/AbstractControllerIntegrationTests.java @@ -92,7 +92,7 @@ public abstract class AbstractControllerIntegrationTests { */ protected RootResourceInformation getResourceInformation(Class domainType) { - Assert.notNull(domainType, "Domain type must not be null!"); + Assert.notNull(domainType, "Domain type must not be null"); PersistentEntity entity = repositories.getPersistentEntity(domainType); diff --git a/spring-data-rest-tests/spring-data-rest-tests-core/src/test/java/org/springframework/data/rest/tests/AbstractWebIntegrationTests.java b/spring-data-rest-tests/spring-data-rest-tests-core/src/test/java/org/springframework/data/rest/tests/AbstractWebIntegrationTests.java index 8f8a7bd68..8a422f7cd 100755 --- a/spring-data-rest-tests/spring-data-rest-tests-core/src/test/java/org/springframework/data/rest/tests/AbstractWebIntegrationTests.java +++ b/spring-data-rest-tests/spring-data-rest-tests-core/src/test/java/org/springframework/data/rest/tests/AbstractWebIntegrationTests.java @@ -169,7 +169,7 @@ public abstract class AbstractWebIntegrationTests { String href = JsonPath. read(content, String.format(CONTENT_LINK_JSONPATH, rel)).get(0).toString(); - String message = "Expected to%s find a link with rel %s in the content section of the response!"; + String message = "Expected to%s find a link with rel %s in the content section of the response"; if (expected) { assertThat(href).as(message, "", rel).isNotNull(); @@ -182,7 +182,7 @@ public abstract class AbstractWebIntegrationTests { } catch (InvalidPathException o_O) { if (expected) { - fail("Didn't find any content in the given response!", o_O); + fail("Didn't find any content in the given response", o_O); } return null; @@ -194,7 +194,7 @@ public abstract class AbstractWebIntegrationTests { String content = response.getContentAsString(); Optional link = client.getDiscoverer(response).findLinkWithRel(rel, content); - assertThat(link).as("Expected not to find link with rel %s but found %s!", rel, link).isEmpty(); + assertThat(link).as("Expected not to find link with rel %s but found %s", rel, link).isEmpty(); } @SuppressWarnings("unchecked") @@ -203,7 +203,7 @@ public abstract class AbstractWebIntegrationTests { String content = response.getContentAsString(); Object jsonPathResult = JsonPath.read(content, path); - assertThat(jsonPathResult).as("JSONPath lookup for %s did return null in %s.", path, content).isNotNull(); + assertThat(jsonPathResult).as("JSONPath lookup for %s did return null in %s", path, content).isNotNull(); if (jsonPathResult instanceof JSONArray) { JSONArray array = (JSONArray) jsonPathResult; @@ -251,7 +251,7 @@ public abstract class AbstractWebIntegrationTests { String s = response.getContentAsString(); assertThat(client.getDiscoverer(response).findLinkWithRel(relation, s))// - .as("Expected not to find link with rel %s but found one in %s!", relation, s)// + .as("Expected not to find link with rel %s but found one in %s", relation, s)// .isEmpty(); }; } diff --git a/spring-data-rest-tests/spring-data-rest-tests-core/src/test/java/org/springframework/data/rest/tests/RequestParameters.java b/spring-data-rest-tests/spring-data-rest-tests-core/src/test/java/org/springframework/data/rest/tests/RequestParameters.java index d20eebc3e..c657c4706 100644 --- a/spring-data-rest-tests/spring-data-rest-tests-core/src/test/java/org/springframework/data/rest/tests/RequestParameters.java +++ b/spring-data-rest-tests/spring-data-rest-tests-core/src/test/java/org/springframework/data/rest/tests/RequestParameters.java @@ -36,8 +36,8 @@ public class RequestParameters { private RequestParameters(Map parameters, String key, String... values) { - Assert.notNull(parameters, "Parameters must not be null!"); - Assert.hasText(key, "Key must not be null or empty!"); + Assert.notNull(parameters, "Parameters must not be null"); + Assert.hasText(key, "Key must not be null or empty"); this.parameters = new HashMap(parameters); this.parameters.put(key, values); diff --git a/spring-data-rest-tests/spring-data-rest-tests-core/src/test/java/org/springframework/data/rest/tests/ResourceTester.java b/spring-data-rest-tests/spring-data-rest-tests-core/src/test/java/org/springframework/data/rest/tests/ResourceTester.java index 93e36ecc2..bfd25aa14 100644 --- a/spring-data-rest-tests/spring-data-rest-tests-core/src/test/java/org/springframework/data/rest/tests/ResourceTester.java +++ b/spring-data-rest-tests/spring-data-rest-tests-core/src/test/java/org/springframework/data/rest/tests/ResourceTester.java @@ -47,7 +47,7 @@ public class ResourceTester { * @param resource must not be {@literal null}. */ private ResourceTester(RepresentationModel resource) { - Assert.notNull(resource, "EntityRepresentationModel must not be null!"); + Assert.notNull(resource, "EntityRepresentationModel must not be null"); this.resource = resource; } @@ -148,7 +148,7 @@ public class ResourceTester { String href = content.assertHasLink("self", null).getHref(); UriTemplate uriTemplate = new UriTemplate(template.toString()); - assertThat(uriTemplate.matches(href)).as(String.format("Expected %s to match %s!", href, uriTemplate.toString())) + assertThat(uriTemplate.matches(href)).as(String.format("Expected %s to match %s", href, uriTemplate.toString())) .isTrue(); } } diff --git a/spring-data-rest-tests/spring-data-rest-tests-core/src/test/java/org/springframework/data/rest/tests/TestMvcClient.java b/spring-data-rest-tests/spring-data-rest-tests-core/src/test/java/org/springframework/data/rest/tests/TestMvcClient.java index 8861d6b54..7b47faa6d 100644 --- a/spring-data-rest-tests/spring-data-rest-tests-core/src/test/java/org/springframework/data/rest/tests/TestMvcClient.java +++ b/spring-data-rest-tests/spring-data-rest-tests-core/src/test/java/org/springframework/data/rest/tests/TestMvcClient.java @@ -62,8 +62,8 @@ public class TestMvcClient { */ public TestMvcClient(MockMvc mvc, LinkDiscoverers discoverers) { - Assert.notNull(mvc, "MockMvc must not be null!"); - Assert.notNull(discoverers, "LinkDiscoverers must not be null!"); + Assert.notNull(mvc, "MockMvc must not be null"); + Assert.notNull(discoverers, "LinkDiscoverers must not be null"); this.mvc = mvc; this.discoverers = discoverers; @@ -334,7 +334,7 @@ public class TestMvcClient { Optional link = getDiscoverer(response).findLinkWithRel(relation, content); return link.orElseThrow(() -> new IllegalStateException( - "Expected to find link with rel " + relation + " but found none in " + content + "!")); + "Expected to find link with rel " + relation + " but found none in " + content)); } public ResultMatcher hasLinkWithRel(String rel) { diff --git a/spring-data-rest-tests/spring-data-rest-tests-geode/src/main/java/org/springframework/data/rest/tests/geode/Address.java b/spring-data-rest-tests/spring-data-rest-tests-geode/src/main/java/org/springframework/data/rest/tests/geode/Address.java index 1dc226b84..24b3b811b 100644 --- a/spring-data-rest-tests/spring-data-rest-tests-geode/src/main/java/org/springframework/data/rest/tests/geode/Address.java +++ b/spring-data-rest-tests/spring-data-rest-tests-geode/src/main/java/org/springframework/data/rest/tests/geode/Address.java @@ -35,9 +35,9 @@ public class Address { */ public Address(String street, String city, String country) { - Assert.hasText(street, "Street must not be null or empty!"); - Assert.hasText(city, "City must not be null or empty!"); - Assert.hasText(country, "Country must not be null or empty!"); + Assert.hasText(street, "Street must not be null or empty"); + Assert.hasText(city, "City must not be null or empty"); + Assert.hasText(country, "Country must not be null or empty"); this.street = street; this.city = city; diff --git a/spring-data-rest-tests/spring-data-rest-tests-geode/src/main/java/org/springframework/data/rest/tests/geode/Customer.java b/spring-data-rest-tests/spring-data-rest-tests-geode/src/main/java/org/springframework/data/rest/tests/geode/Customer.java index 2593e1113..dd7949b05 100644 --- a/spring-data-rest-tests/spring-data-rest-tests-geode/src/main/java/org/springframework/data/rest/tests/geode/Customer.java +++ b/spring-data-rest-tests/spring-data-rest-tests-geode/src/main/java/org/springframework/data/rest/tests/geode/Customer.java @@ -45,9 +45,9 @@ public class Customer extends AbstractPersistentEntity { */ public Customer(Long id, EmailAddress emailAddress, String firstname, String lastname) { super(id); - Assert.hasText(firstname, "Firstname must not be null or empty!"); - Assert.hasText(lastname, "Lastname must not be null or empty!"); - Assert.notNull(emailAddress, "EmailAddress must not be null!"); + Assert.hasText(firstname, "Firstname must not be null or empty"); + Assert.hasText(lastname, "Lastname must not be null or empty"); + Assert.notNull(emailAddress, "EmailAddress must not be null"); this.firstname = firstname; this.lastname = lastname; @@ -63,7 +63,7 @@ public class Customer extends AbstractPersistentEntity { */ public void add(Address address) { - Assert.notNull(address, "Address must not be null!"); + Assert.notNull(address, "Address must not be null"); this.addresses.add(address); } diff --git a/spring-data-rest-tests/spring-data-rest-tests-geode/src/main/java/org/springframework/data/rest/tests/geode/EmailAddress.java b/spring-data-rest-tests/spring-data-rest-tests-geode/src/main/java/org/springframework/data/rest/tests/geode/EmailAddress.java index f86c8a276..ce41b19dd 100644 --- a/spring-data-rest-tests/spring-data-rest-tests-geode/src/main/java/org/springframework/data/rest/tests/geode/EmailAddress.java +++ b/spring-data-rest-tests/spring-data-rest-tests-geode/src/main/java/org/springframework/data/rest/tests/geode/EmailAddress.java @@ -45,7 +45,7 @@ public final class EmailAddress { */ @JsonCreator public EmailAddress(String emailAddress) { - Assert.isTrue(isValid(emailAddress), "Invalid email address!"); + Assert.isTrue(isValid(emailAddress), "Invalid email address"); this.value = emailAddress; } diff --git a/spring-data-rest-tests/spring-data-rest-tests-geode/src/main/java/org/springframework/data/rest/tests/geode/LineItem.java b/spring-data-rest-tests/spring-data-rest-tests-geode/src/main/java/org/springframework/data/rest/tests/geode/LineItem.java index 77605103a..39c90da26 100644 --- a/spring-data-rest-tests/spring-data-rest-tests-geode/src/main/java/org/springframework/data/rest/tests/geode/LineItem.java +++ b/spring-data-rest-tests/spring-data-rest-tests-geode/src/main/java/org/springframework/data/rest/tests/geode/LineItem.java @@ -44,8 +44,8 @@ public class LineItem { * @param amount */ public LineItem(Product product, int amount) { - Assert.notNull(product, "The given Product must not be null!"); - Assert.isTrue(amount > 0, "The amount of Products to be bought must be greater than 0!"); + Assert.notNull(product, "The given Product must not be null"); + Assert.isTrue(amount > 0, "The amount of Products to be bought must be greater than 0"); this.productId = product.getId(); this.amount = amount; diff --git a/spring-data-rest-tests/spring-data-rest-tests-geode/src/main/java/org/springframework/data/rest/tests/geode/Order.java b/spring-data-rest-tests/spring-data-rest-tests-geode/src/main/java/org/springframework/data/rest/tests/geode/Order.java index 12522d87d..cf9dee1fc 100644 --- a/spring-data-rest-tests/spring-data-rest-tests-geode/src/main/java/org/springframework/data/rest/tests/geode/Order.java +++ b/spring-data-rest-tests/spring-data-rest-tests-geode/src/main/java/org/springframework/data/rest/tests/geode/Order.java @@ -45,8 +45,8 @@ public class Order extends AbstractPersistentEntity { */ public Order(Long id, Long customerId, Address shippingAddress) { super(id); - Assert.notNull(customerId, "CustomerId must not be null!"); - Assert.notNull(shippingAddress, "ShippingAddress must not be null!"); + Assert.notNull(customerId, "CustomerId must not be null"); + Assert.notNull(shippingAddress, "ShippingAddress must not be null"); this.customerId = customerId; this.shippingAddress = shippingAddress; diff --git a/spring-data-rest-tests/spring-data-rest-tests-geode/src/main/java/org/springframework/data/rest/tests/geode/Product.java b/spring-data-rest-tests/spring-data-rest-tests-geode/src/main/java/org/springframework/data/rest/tests/geode/Product.java index 762f6e58d..fd9750f89 100644 --- a/spring-data-rest-tests/spring-data-rest-tests-geode/src/main/java/org/springframework/data/rest/tests/geode/Product.java +++ b/spring-data-rest-tests/spring-data-rest-tests-geode/src/main/java/org/springframework/data/rest/tests/geode/Product.java @@ -60,8 +60,8 @@ public class Product extends AbstractPersistentEntity { @PersistenceConstructor public Product(Long id, String name, BigDecimal price, String description) { super(id); - Assert.hasText(name, "Name must not be null or empty!"); - Assert.isTrue(BigDecimal.ZERO.compareTo(price) < 0, "Price must be greater than zero!"); + Assert.hasText(name, "Name must not be null or empty"); + Assert.isTrue(BigDecimal.ZERO.compareTo(price) < 0, "Price must be greater than zero"); this.name = name; this.price = price; @@ -78,7 +78,7 @@ public class Product extends AbstractPersistentEntity { */ public void setAttribute(String name, String value) { - Assert.hasText(name, "Name must not be null or empty!"); + Assert.hasText(name, "Name must not be null or empty"); if (value == null) { this.attributes.remove(value); diff --git a/spring-data-rest-tests/spring-data-rest-tests-jpa/src/main/java/org/springframework/data/rest/webmvc/jpa/AuthorsController.java b/spring-data-rest-tests/spring-data-rest-tests-jpa/src/main/java/org/springframework/data/rest/webmvc/jpa/AuthorsController.java index 1debdb59c..4c8383166 100644 --- a/spring-data-rest-tests/spring-data-rest-tests-jpa/src/main/java/org/springframework/data/rest/webmvc/jpa/AuthorsController.java +++ b/spring-data-rest-tests/spring-data-rest-tests-jpa/src/main/java/org/springframework/data/rest/webmvc/jpa/AuthorsController.java @@ -35,7 +35,7 @@ public class AuthorsController { @RequestMapping(value = "/authors/{author}", method = RequestMethod.DELETE) HttpEntity deleteAuthor(@PathVariable Author author) { - Assert.notNull(author, "Author must not be null!"); + Assert.notNull(author, "Author must not be null"); return new ResponseEntity(HttpStatus.I_AM_A_TEAPOT); } } diff --git a/spring-data-rest-tests/spring-data-rest-tests-mongodb/src/test/java/org/springframework/data/rest/tests/mongodb/MongoWebTests.java b/spring-data-rest-tests/spring-data-rest-tests-mongodb/src/test/java/org/springframework/data/rest/tests/mongodb/MongoWebTests.java index fd91ca8fc..bc49eeb1d 100755 --- a/spring-data-rest-tests/spring-data-rest-tests-mongodb/src/test/java/org/springframework/data/rest/tests/mongodb/MongoWebTests.java +++ b/spring-data-rest-tests/spring-data-rest-tests-mongodb/src/test/java/org/springframework/data/rest/tests/mongodb/MongoWebTests.java @@ -297,7 +297,7 @@ class MongoWebTests extends CommonWebTests { Link receiptLink = client.getDiscoverer(response) // .findLinkWithRel(IanaLinkRelations.SELF, response.getContentAsString()) // - .orElseThrow(() -> new IllegalStateException("Did not find self link!")); + .orElseThrow(() -> new IllegalStateException("Did not find self link")); mvc.perform(get(receiptLink.getHref()).header(IF_MODIFIED_SINCE, response.getHeader(LAST_MODIFIED))).// andExpect(status().isNotModified()).// diff --git a/spring-data-rest-tests/spring-data-rest-tests-mongodb/src/test/java/org/springframework/data/rest/tests/mongodb/TestUtils.java b/spring-data-rest-tests/spring-data-rest-tests-mongodb/src/test/java/org/springframework/data/rest/tests/mongodb/TestUtils.java index 2172d4470..64eb2c2d9 100644 --- a/spring-data-rest-tests/spring-data-rest-tests-mongodb/src/test/java/org/springframework/data/rest/tests/mongodb/TestUtils.java +++ b/spring-data-rest-tests/spring-data-rest-tests-mongodb/src/test/java/org/springframework/data/rest/tests/mongodb/TestUtils.java @@ -38,7 +38,7 @@ public class TestUtils { * @return */ public static InputStream asStream(String source) { - Assert.notNull(source, "Source string must not be null!"); + Assert.notNull(source, "Source string must not be null"); return new ByteArrayInputStream(source.getBytes(UTF8)); } } diff --git a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/AbstractRepositoryRestController.java b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/AbstractRepositoryRestController.java index 330f6a7c1..4be871e69 100644 --- a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/AbstractRepositoryRestController.java +++ b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/AbstractRepositoryRestController.java @@ -54,7 +54,7 @@ class AbstractRepositoryRestController { */ public AbstractRepositoryRestController(PagedResourcesAssembler pagedResourcesAssembler) { - Assert.notNull(pagedResourcesAssembler, "PagedResourcesAssembler must not be null!"); + Assert.notNull(pagedResourcesAssembler, "PagedResourcesAssembler must not be null"); this.pagedResourcesAssembler = pagedResourcesAssembler; } diff --git a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/BasePathAwareHandlerMapping.java b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/BasePathAwareHandlerMapping.java index 317a57bf3..bb28bce48 100644 --- a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/BasePathAwareHandlerMapping.java +++ b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/BasePathAwareHandlerMapping.java @@ -51,7 +51,7 @@ import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandl */ public class BasePathAwareHandlerMapping extends RequestMappingHandlerMapping { - private static final String AT_REQUEST_MAPPING_ON_TYPE = "Spring Data REST controller %s must not use @RequestMapping on class level as this would cause double registration with Spring MVC!"; + private static final String AT_REQUEST_MAPPING_ON_TYPE = "Spring Data REST controller %s must not use @RequestMapping on class level as this would cause double registration with Spring MVC"; private final RepositoryRestConfiguration configuration; /** @@ -61,7 +61,7 @@ public class BasePathAwareHandlerMapping extends RequestMappingHandlerMapping { */ public BasePathAwareHandlerMapping(RepositoryRestConfiguration configuration) { - Assert.notNull(configuration, "RepositoryRestConfiguration must not be null!"); + Assert.notNull(configuration, "RepositoryRestConfiguration must not be null"); this.configuration = configuration; @@ -190,7 +190,7 @@ public class BasePathAwareHandlerMapping extends RequestMappingHandlerMapping { super(request); - Assert.notEmpty(acceptMediaTypes, "MediaTypes must not be empty!"); + Assert.notEmpty(acceptMediaTypes, "MediaTypes must not be empty"); this.acceptMediaTypes = acceptMediaTypes; diff --git a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/BaseUri.java b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/BaseUri.java index f59837be2..62311f00a 100644 --- a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/BaseUri.java +++ b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/BaseUri.java @@ -51,7 +51,7 @@ public class BaseUri { */ public BaseUri(URI uri) { - Assert.notNull(uri, "Base URI must not be null!"); + Assert.notNull(uri, "Base URI must not be null"); String uriString = uri.toString(); this.baseUri = URI.create(trimTrailingCharacter(trimTrailingCharacter(uriString, '/'), '/')); @@ -111,7 +111,7 @@ public class BaseUri { */ public String getRepositoryLookupPath(String lookupPath) { - Assert.notNull(lookupPath, "Lookup path must not be null!"); + Assert.notNull(lookupPath, "Lookup path must not be null"); // Temporary fix for SPR-13455 lookupPath = lookupPath.replaceAll("//", "/"); @@ -167,7 +167,7 @@ public class BaseUri { */ public UriComponents appendPath(Path path) { - Assert.notNull(path, "Path must not be null!"); + Assert.notNull(path, "Path must not be null"); return getUriComponentsBuilder().path(path.toString()).build(); } diff --git a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/ControllerUtils.java b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/ControllerUtils.java index f05e553f1..abfee236d 100644 --- a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/ControllerUtils.java +++ b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/ControllerUtils.java @@ -53,9 +53,9 @@ public class ControllerUtils { public static > ResponseEntity> toResponseEntity( HttpStatus status, HttpHeaders headers, R resource) { - Assert.notNull(status, "Http status must not be null!"); - Assert.notNull(headers, "Http headers must not be null!"); - Assert.notNull(resource, "Payload must not be null!"); + Assert.notNull(status, "Http status must not be null"); + Assert.notNull(headers, "Http headers must not be null"); + Assert.notNull(resource, "Payload must not be null"); return toResponseEntity(status, headers, Optional.of(resource)); } diff --git a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/EmbeddedResourcesAssembler.java b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/EmbeddedResourcesAssembler.java index 636fa7d53..bc671eed4 100644 --- a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/EmbeddedResourcesAssembler.java +++ b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/EmbeddedResourcesAssembler.java @@ -45,9 +45,9 @@ public class EmbeddedResourcesAssembler { public EmbeddedResourcesAssembler(PersistentEntities entities, Associations associations, ExcerptProjector projector) { - Assert.notNull(entities, "PersistentEntities must not be null!"); - Assert.notNull(associations, "Associations must not be null!"); - Assert.notNull(projector, "ExcerptProjector must not be null!"); + Assert.notNull(entities, "PersistentEntities must not be null"); + Assert.notNull(associations, "Associations must not be null"); + Assert.notNull(projector, "ExcerptProjector must not be null"); this.entities = entities; this.associations = associations; @@ -63,7 +63,7 @@ public class EmbeddedResourcesAssembler { */ public Iterable getEmbeddedResources(Object instance) { - Assert.notNull(instance, "Entity instance must not be null!"); + Assert.notNull(instance, "Entity instance must not be null"); PersistentEntity entity = entities.getRequiredPersistentEntity(instance.getClass()); diff --git a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/HttpHeadersPreparer.java b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/HttpHeadersPreparer.java index 12be7e05b..f80cd93bb 100644 --- a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/HttpHeadersPreparer.java +++ b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/HttpHeadersPreparer.java @@ -44,7 +44,7 @@ public class HttpHeadersPreparer { public HttpHeadersPreparer(AuditableBeanWrapperFactory auditableBeanWrapperFactory) { - Assert.notNull(auditableBeanWrapperFactory, "AuditableBeanWrapperFactory must not be null!"); + Assert.notNull(auditableBeanWrapperFactory, "AuditableBeanWrapperFactory must not be null"); Jsr310Converters.getConvertersToRegister().forEach(conversionService::addConverter); @@ -75,10 +75,10 @@ public class HttpHeadersPreparer { */ public HttpHeaders prepareHeaders(PersistentEntity entity, Object value) { - Assert.notNull(entity, "PersistentEntity must not be null!"); - Assert.notNull(value, "Entity value must not be null!"); + Assert.notNull(entity, "PersistentEntity must not be null"); + Assert.notNull(value, "Entity value must not be null"); Assert.isInstanceOf(entity.getType(), value, () -> - String.format("Target bean of type %s is not of type of the persistent entity (%s)!", value.getClass().getName(), entity.getType().getName())); + String.format("Target bean of type %s is not of type of the persistent entity (%s)", value.getClass().getName(), entity.getType().getName())); // Add ETag HttpHeaders headers = ETag.from(entity, value).addTo(new HttpHeaders()); @@ -98,8 +98,8 @@ public class HttpHeadersPreparer { */ public boolean isObjectStillValid(Object source, HttpHeaders headers) { - Assert.notNull(source, "Source object must not be null!"); - Assert.notNull(headers, "HttpHeaders must not be null!"); + Assert.notNull(source, "Source object must not be null"); + Assert.notNull(headers, "HttpHeaders must not be null"); if (headers.getIfModifiedSince() == -1) { return false; diff --git a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/IncomingRequest.java b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/IncomingRequest.java index 82a11bdd4..c6f9c2249 100644 --- a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/IncomingRequest.java +++ b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/IncomingRequest.java @@ -41,7 +41,7 @@ public class IncomingRequest { */ public IncomingRequest(ServerHttpRequest request) { - Assert.notNull(request, "ServerHttpRequest must not be null!"); + Assert.notNull(request, "ServerHttpRequest must not be null"); this.request = request; this.contentType = request.getHeaders().getContentType(); diff --git a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/PersistentEntityResource.java b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/PersistentEntityResource.java index e2f45d9f9..903c32c74 100644 --- a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/PersistentEntityResource.java +++ b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/PersistentEntityResource.java @@ -64,7 +64,7 @@ public class PersistentEntityResource extends EntityModel { super(content, links); - Assert.notNull(entity, "PersistentEntity must not be null!"); + Assert.notNull(entity, "PersistentEntity must not be null"); this.entity = entity; this.embeddeds = embeddeds == null ? NO_EMBEDDEDS : embeddeds; @@ -161,8 +161,8 @@ public class PersistentEntityResource extends EntityModel { */ private Builder(Object content, PersistentEntity entity) { - Assert.notNull(content, "Content must not be null!"); - Assert.notNull(entity, "PersistentEntity must not be null!"); + Assert.notNull(content, "Content must not be null"); + Assert.notNull(entity, "PersistentEntity must not be null"); this.content = content; this.entity = entity; @@ -190,7 +190,7 @@ public class PersistentEntityResource extends EntityModel { */ public Builder withLink(Link link) { - Assert.notNull(link, "Link must not be null!"); + Assert.notNull(link, "Link must not be null"); this.links.add(link); return this; @@ -198,7 +198,7 @@ public class PersistentEntityResource extends EntityModel { public Builder withLinks(List links) { - Assert.notNull(links, "Links must not be null!"); + Assert.notNull(links, "Links must not be null"); this.links.addAll(links); return this; diff --git a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/PersistentEntityResourceAssembler.java b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/PersistentEntityResourceAssembler.java index ec4059d5c..6db032499 100644 --- a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/PersistentEntityResourceAssembler.java +++ b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/PersistentEntityResourceAssembler.java @@ -51,10 +51,10 @@ public class PersistentEntityResourceAssembler public PersistentEntityResourceAssembler(PersistentEntities entities, Projector projector, Associations associations, SelfLinkProvider linkProvider) { - Assert.notNull(entities, "PersistentEntities must not be null!"); - Assert.notNull(projector, "Projector must not be null!"); - Assert.notNull(associations, "Associations must not be null!"); - Assert.notNull(linkProvider, "SelfLinkProvider must not be null!"); + Assert.notNull(entities, "PersistentEntities must not be null"); + Assert.notNull(projector, "Projector must not be null"); + Assert.notNull(associations, "Associations must not be null"); + Assert.notNull(linkProvider, "SelfLinkProvider must not be null"); this.entities = entities; this.projector = projector; @@ -65,7 +65,7 @@ public class PersistentEntityResourceAssembler @Override public PersistentEntityResource toModel(Object instance) { - Assert.notNull(instance, "Entity instance must not be null!"); + Assert.notNull(instance, "Entity instance must not be null"); return wrap(projector.projectExcerpt(instance), instance).build(); } @@ -77,7 +77,7 @@ public class PersistentEntityResourceAssembler */ public PersistentEntityResource toFullResource(Object instance) { - Assert.notNull(instance, "Entity instance must not be null!"); + Assert.notNull(instance, "Entity instance must not be null"); return wrap(projector.project(instance), instance).build(); } diff --git a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/ProfileController.java b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/ProfileController.java index e0f47e33f..8c24b2477 100644 --- a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/ProfileController.java +++ b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/ProfileController.java @@ -63,9 +63,9 @@ public class ProfileController { public ProfileController(RepositoryRestConfiguration configuration, RepositoryResourceMappings mappings, Repositories repositories) { - Assert.notNull(configuration, "RepositoryRestConfiguration must not be null!"); - Assert.notNull(mappings, "RepositoryResourceMappings must not be null!"); - Assert.notNull(repositories, "Repositories must not be null!"); + Assert.notNull(configuration, "RepositoryRestConfiguration must not be null"); + Assert.notNull(mappings, "RepositoryResourceMappings must not be null"); + Assert.notNull(repositories, "Repositories must not be null"); this.configuration = configuration; this.mappings = mappings; diff --git a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/ProfileResourceProcessor.java b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/ProfileResourceProcessor.java index d7debb43e..8e3e155b9 100644 --- a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/ProfileResourceProcessor.java +++ b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/ProfileResourceProcessor.java @@ -41,7 +41,7 @@ public class ProfileResourceProcessor implements RepresentationModelProcessor(links.toList()); } else if (prop.property.isMap()) { - throw new UnsupportedMediaTypeStatusException("Cannot produce compact representation of map property!"); + throw new UnsupportedMediaTypeStatusException("Cannot produce compact representation of map property"); } return new RepresentationModel<>(assembler.getExpandedSelfLink(it)); @@ -466,8 +466,8 @@ class RepositoryPropertyReferenceController extends AbstractRepositoryRestContro private HttpRequestMethodNotSupportedException(HttpMethod rejectedMethod, HttpMethod[] allowedMethods, @Nullable String message) { - Assert.notNull(rejectedMethod, "Rejected HttpMethod must not be null!"); - Assert.notNull(allowedMethods, "Allowed HttpMethod must not be null!"); + Assert.notNull(rejectedMethod, "Rejected HttpMethod must not be null"); + Assert.notNull(allowedMethods, "Allowed HttpMethod must not be null"); this.rejectedMethod = rejectedMethod; this.allowedMethods = allowedMethods; diff --git a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/RepositoryRestExceptionHandler.java b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/RepositoryRestExceptionHandler.java index dd4c610e1..761b1e246 100644 --- a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/RepositoryRestExceptionHandler.java +++ b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/RepositoryRestExceptionHandler.java @@ -59,7 +59,7 @@ public class RepositoryRestExceptionHandler { */ public RepositoryRestExceptionHandler(MessageSource messageSource) { - Assert.notNull(messageSource, "MessageSource must not be null!"); + Assert.notNull(messageSource, "MessageSource must not be null"); this.messageSourceAccessor = new MessageSourceAccessor(messageSource); } @@ -182,8 +182,8 @@ public class RepositoryRestExceptionHandler { private static ResponseEntity response(HttpStatus status, HttpHeaders headers, T body) { - Assert.notNull(headers, "Headers must not be null!"); - Assert.notNull(status, "HttpStatus must not be null!"); + Assert.notNull(headers, "Headers must not be null"); + Assert.notNull(status, "HttpStatus must not be null"); return new ResponseEntity(body, headers, status); } diff --git a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/RepositoryRestHandlerMapping.java b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/RepositoryRestHandlerMapping.java index 7da5fecda..281e115f2 100644 --- a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/RepositoryRestHandlerMapping.java +++ b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/RepositoryRestHandlerMapping.java @@ -106,9 +106,9 @@ public class RepositoryRestHandlerMapping extends BasePathAwareHandlerMapping { super(config); - Assert.notNull(mappings, "ResourceMappings must not be null!"); - Assert.notNull(config, "RepositoryRestConfiguration must not be null!"); - Assert.notNull(repositories, "Repositories must not be null!"); + Assert.notNull(mappings, "ResourceMappings must not be null"); + Assert.notNull(config, "RepositoryRestConfiguration must not be null"); + Assert.notNull(repositories, "Repositories must not be null"); this.mappings = mappings; this.configuration = config; @@ -296,9 +296,9 @@ public class RepositoryRestHandlerMapping extends BasePathAwareHandlerMapping { public RepositoryCorsConfigurationAccessor(ResourceMappings mappings, StringValueResolver embeddedValueResolver, Optional repositories) { - Assert.notNull(mappings, "ResourceMappings must not be null!"); - Assert.notNull(embeddedValueResolver, "StringValueResolver must not be null!"); - Assert.notNull(repositories, "Repositories must not be null!"); + Assert.notNull(mappings, "ResourceMappings must not be null"); + Assert.notNull(embeddedValueResolver, "StringValueResolver must not be null"); + Assert.notNull(repositories, "Repositories must not be null"); this.mappings = mappings; this.embeddedValueResolver = embeddedValueResolver; diff --git a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/RepositorySchemaController.java b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/RepositorySchemaController.java index a2a7f226a..4178ad9a6 100644 --- a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/RepositorySchemaController.java +++ b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/RepositorySchemaController.java @@ -47,7 +47,7 @@ class RepositorySchemaController { @Autowired public RepositorySchemaController(PersistentEntityToJsonSchemaConverter jsonSchemaConverter) { - Assert.notNull(jsonSchemaConverter, "PersistentEntityToJsonSchemaConverter must not be null!"); + Assert.notNull(jsonSchemaConverter, "PersistentEntityToJsonSchemaConverter must not be null"); this.jsonSchemaConverter = jsonSchemaConverter; } diff --git a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/RepositorySearchController.java b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/RepositorySearchController.java index 74cd1a1a7..1fc299116 100644 --- a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/RepositorySearchController.java +++ b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/RepositorySearchController.java @@ -92,8 +92,8 @@ class RepositorySearchController extends AbstractRepositoryRestController { super(assembler); - Assert.notNull(entityLinks, "EntityLinks must not be null!"); - Assert.notNull(mappings, "ResourceMappings must not be null!"); + Assert.notNull(entityLinks, "EntityLinks must not be null"); + Assert.notNull(mappings, "ResourceMappings must not be null"); this.entityLinks = entityLinks; this.mappings = mappings; diff --git a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/RepositorySearchesResource.java b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/RepositorySearchesResource.java index 4206c2a39..311082846 100644 --- a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/RepositorySearchesResource.java +++ b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/RepositorySearchesResource.java @@ -38,7 +38,7 @@ public class RepositorySearchesResource extends RepresentationModel domainType) { - Assert.notNull(domainType, "Domain type must not be null!"); + Assert.notNull(domainType, "Domain type must not be null"); this.domainType = domainType; } diff --git a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/ResourceNotFoundException.java b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/ResourceNotFoundException.java index d0863d1f1..c962ddbb2 100644 --- a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/ResourceNotFoundException.java +++ b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/ResourceNotFoundException.java @@ -30,7 +30,7 @@ public class ResourceNotFoundException extends RuntimeException { private static final long serialVersionUID = 7992904489502842099L; public ResourceNotFoundException() { - this("EntityRepresentationModel not found!"); + this("EntityRepresentationModel not found"); } public ResourceNotFoundException(String message) { diff --git a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/ResourceStatus.java b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/ResourceStatus.java index 55ce1c920..2ad41c88c 100644 --- a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/ResourceStatus.java +++ b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/ResourceStatus.java @@ -36,13 +36,13 @@ import org.springframework.util.Assert; */ class ResourceStatus { - private static final String INVALID_DOMAIN_OBJECT = "Domain object %s is not an instance of the given PersistentEntity of type %s!"; + private static final String INVALID_DOMAIN_OBJECT = "Domain object %s is not an instance of the given PersistentEntity of type %s"; private final HttpHeadersPreparer preparer; private ResourceStatus(HttpHeadersPreparer preparer) { - Assert.notNull(preparer, "HttpHeadersPreparer must not be null!"); + Assert.notNull(preparer, "HttpHeadersPreparer must not be null"); this.preparer = preparer; } @@ -63,9 +63,9 @@ class ResourceStatus { public StatusAndHeaders getStatusAndHeaders(HttpHeaders requestHeaders, Object domainObject, PersistentEntity entity) { - Assert.notNull(requestHeaders, "Request headers must not be null!"); - Assert.notNull(domainObject, "Domain object must not be null!"); - Assert.notNull(entity, "PersistentEntity must not be null!"); + Assert.notNull(requestHeaders, "Request headers must not be null"); + Assert.notNull(domainObject, "Domain object must not be null"); + Assert.notNull(entity, "PersistentEntity must not be null"); Assert.isTrue(entity.getType().isInstance(domainObject), () -> String.format(INVALID_DOMAIN_OBJECT, domainObject, entity.getType())); @@ -89,7 +89,7 @@ class ResourceStatus { private StatusAndHeaders(HttpHeaders headers, boolean modified) { - Assert.notNull(headers, "HttpHeaders must not be null!"); + Assert.notNull(headers, "HttpHeaders must not be null"); this.headers = headers; this.modified = modified; diff --git a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/RootResourceInformation.java b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/RootResourceInformation.java index 1b8f0b8a3..5b3dd7ca8 100644 --- a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/RootResourceInformation.java +++ b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/RootResourceInformation.java @@ -93,8 +93,8 @@ public class RootResourceInformation { public void verifySupportedMethod(HttpMethod httpMethod, ResourceType resourceType) throws HttpRequestMethodNotSupportedException, ResourceNotFoundException { - Assert.notNull(httpMethod, "HTTP method must not be null!"); - Assert.notNull(resourceType, "EntityRepresentationModel type must not be null!"); + Assert.notNull(httpMethod, "HTTP method must not be null"); + Assert.notNull(resourceType, "EntityRepresentationModel type must not be null"); if (!resourceMetadata.isExported()) { throw new ResourceNotFoundException(); @@ -120,8 +120,8 @@ public class RootResourceInformation { public void verifySupportedMethod(HttpMethod httpMethod, PersistentProperty property) throws HttpRequestMethodNotSupportedException { - Assert.notNull(httpMethod, "HTTP method must not be null!"); - Assert.notNull(property, "EntityRepresentationModel type must not be null!"); + Assert.notNull(httpMethod, "HTTP method must not be null"); + Assert.notNull(property, "EntityRepresentationModel type must not be null"); if (!resourceMetadata.isExported()) { throw new ResourceNotFoundException(); diff --git a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/alps/AlpsController.java b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/alps/AlpsController.java index 0a27c94f1..d16ad3934 100644 --- a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/alps/AlpsController.java +++ b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/alps/AlpsController.java @@ -57,7 +57,7 @@ public class AlpsController { @Autowired public AlpsController(RepositoryRestConfiguration configuration) { - Assert.notNull(configuration, "MetadataConfiguration must not be null!"); + Assert.notNull(configuration, "MetadataConfiguration must not be null"); this.configuration = configuration; } diff --git a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/alps/AlpsJsonHttpMessageConverter.java b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/alps/AlpsJsonHttpMessageConverter.java index 50cf42b54..ae95abe1a 100644 --- a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/alps/AlpsJsonHttpMessageConverter.java +++ b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/alps/AlpsJsonHttpMessageConverter.java @@ -54,7 +54,7 @@ public class AlpsJsonHttpMessageConverter extends MappingJackson2HttpMessageConv */ public AlpsJsonHttpMessageConverter(RootResourceInformationToAlpsDescriptorConverter converter) { - Assert.notNull(converter, "Converter must not be null!"); + Assert.notNull(converter, "Converter must not be null"); this.converter = converter; diff --git a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/alps/RootResourceInformationToAlpsDescriptorConverter.java b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/alps/RootResourceInformationToAlpsDescriptorConverter.java index b822695c3..8c9b65076 100644 --- a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/alps/RootResourceInformationToAlpsDescriptorConverter.java +++ b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/alps/RootResourceInformationToAlpsDescriptorConverter.java @@ -93,14 +93,14 @@ public class RootResourceInformationToAlpsDescriptorConverter { PersistentEntities persistentEntities, EntityLinks entityLinks, MessageResolver resolver, RepositoryRestConfiguration configuration, ObjectMapper mapper, EnumTranslator translator) { - Assert.notNull(associations, "Associations must not be null!"); - Assert.notNull(repositories, "Repositories must not be null!"); - Assert.notNull(persistentEntities, "PersistentEntities must not be null!"); - Assert.notNull(entityLinks, "EntityLinks must not be null!"); - Assert.notNull(resolver, "MessageResolver must not be null!"); - Assert.notNull(configuration, "RepositoryRestConfiguration must not be null!"); - Assert.notNull(mapper, "ObjectMapper must not be null!"); - Assert.notNull(translator, "EnumTranslator must not be null!"); + Assert.notNull(associations, "Associations must not be null"); + Assert.notNull(repositories, "Repositories must not be null"); + Assert.notNull(persistentEntities, "PersistentEntities must not be null"); + Assert.notNull(entityLinks, "EntityLinks must not be null"); + Assert.notNull(resolver, "MessageResolver must not be null"); + Assert.notNull(configuration, "RepositoryRestConfiguration must not be null"); + Assert.notNull(mapper, "ObjectMapper must not be null"); + Assert.notNull(translator, "EnumTranslator must not be null"); this.associations = associations; this.repositories = repositories; diff --git a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/config/ArgumentResolverPagingAndSortingTemplateVariables.java b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/config/ArgumentResolverPagingAndSortingTemplateVariables.java index 9e83c1d03..d0cf0d205 100644 --- a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/config/ArgumentResolverPagingAndSortingTemplateVariables.java +++ b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/config/ArgumentResolverPagingAndSortingTemplateVariables.java @@ -57,8 +57,8 @@ class ArgumentResolverPagingAndSortingTemplateVariables implements PagingAndSort public ArgumentResolverPagingAndSortingTemplateVariables(HateoasPageableHandlerMethodArgumentResolver pagingResolver, HateoasSortHandlerMethodArgumentResolver sortResolver) { - Assert.notNull(pagingResolver, "HateoasPageableHandlerMethodArgumentResolver must not be null!"); - Assert.notNull(sortResolver, "HateoasSortHandlerMethodArgumentResolver must not be null!"); + Assert.notNull(pagingResolver, "HateoasPageableHandlerMethodArgumentResolver must not be null"); + Assert.notNull(sortResolver, "HateoasSortHandlerMethodArgumentResolver must not be null"); this.pagingResolver = pagingResolver; this.sortResolver = sortResolver; diff --git a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/config/DelegatingHandlerMapping.java b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/config/DelegatingHandlerMapping.java index fb426b295..bc81bb0a7 100644 --- a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/config/DelegatingHandlerMapping.java +++ b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/config/DelegatingHandlerMapping.java @@ -53,7 +53,7 @@ class DelegatingHandlerMapping implements MatchableHandlerMapping, Iterable delegates, @Nullable PathPatternParser parser) { - Assert.notNull(delegates, "Delegates must not be null!"); + Assert.notNull(delegates, "Delegates must not be null"); this.delegates = delegates; this.parser = parser; @@ -164,7 +164,7 @@ class DelegatingHandlerMapping implements MatchableHandlerMapping, Iterable> implements ResponseBodyAdvice> { private static final Logger logger = LoggerFactory.getLogger(RequestResponseBodyMethodProcessor.class); - private static final String MESSAGE = "HalFormsRejectingResponseBodyAdvice - Changing content type to '%s' as no affordances were registered on the representation model to be rendered!"; + private static final String MESSAGE = "HalFormsRejectingResponseBodyAdvice - Changing content type to '%s' as no affordances were registered on the representation model to be rendered"; private static final List SUPPORTED_MEDIA_TYPES = Arrays.asList(MediaTypes.HAL_JSON, MediaType.APPLICATION_JSON); diff --git a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/config/JsonPatchHandler.java b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/config/JsonPatchHandler.java index f873d624a..ee473b458 100644 --- a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/config/JsonPatchHandler.java +++ b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/config/JsonPatchHandler.java @@ -56,8 +56,8 @@ class JsonPatchHandler { */ public JsonPatchHandler(ObjectMapper mapper, DomainObjectReader reader) { - Assert.notNull(mapper, "ObjectMapper must not be null!"); - Assert.notNull(reader, "DomainObjectReader must not be null!"); + Assert.notNull(mapper, "ObjectMapper must not be null"); + Assert.notNull(reader, "DomainObjectReader must not be null"); this.mapper = mapper; this.reader = reader; @@ -76,9 +76,9 @@ class JsonPatchHandler { */ public T apply(IncomingRequest request, T target) throws Exception { - Assert.notNull(request, "Request must not be null!"); - Assert.isTrue(request.isPatchRequest(), "Cannot handle non-PATCH request!"); - Assert.notNull(target, "Target must not be null!"); + Assert.notNull(request, "Request must not be null"); + Assert.isTrue(request.isPatchRequest(), "Cannot handle non-PATCH request"); + Assert.notNull(target, "Target must not be null"); if (request.isJsonPatchRequest()) { return applyPatch(request.getBody(), target); @@ -113,7 +113,7 @@ class JsonPatchHandler { return new JsonPatchPatchConverter(mapper).convert(mapper.readTree(source)); } catch (Exception o_O) { throw new HttpMessageNotReadableException( - String.format("Could not read PATCH operations! Expected %s!", RestMediaTypes.JSON_PATCH_JSON), o_O, + String.format("Could not read PATCH operations; Expected %s", RestMediaTypes.JSON_PATCH_JSON), o_O, InputStreamHttpInputMessage.of(source)); } } diff --git a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/config/PersistentEntityResourceAssemblerArgumentResolver.java b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/config/PersistentEntityResourceAssemblerArgumentResolver.java index 41ddaf492..1d0d639a0 100644 --- a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/config/PersistentEntityResourceAssemblerArgumentResolver.java +++ b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/config/PersistentEntityResourceAssemblerArgumentResolver.java @@ -46,11 +46,11 @@ public class PersistentEntityResourceAssemblerArgumentResolver implements Handle ProjectionDefinitions projectionDefinitions, ProjectionFactory projectionFactory, Associations associations) { - Assert.notNull(entities, "PersistentEntities must not be null!"); - Assert.notNull(linkProvider, "SelfLinkProvider must not be null!"); - Assert.notNull(projectionDefinitions, "ProjectionDefinitions must not be null!"); - Assert.notNull(projectionFactory, "ProjectionFactory must not be null!"); - Assert.notNull(associations, "Associations must not be null!"); + Assert.notNull(entities, "PersistentEntities must not be null"); + Assert.notNull(linkProvider, "SelfLinkProvider must not be null"); + Assert.notNull(projectionDefinitions, "ProjectionDefinitions must not be null"); + Assert.notNull(projectionFactory, "ProjectionFactory must not be null"); + Assert.notNull(associations, "Associations must not be null"); this.entities = entities; this.linkProvider = linkProvider; diff --git a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/config/PersistentEntityResourceHandlerMethodArgumentResolver.java b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/config/PersistentEntityResourceHandlerMethodArgumentResolver.java index 3366aa0ce..3cd266882 100644 --- a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/config/PersistentEntityResourceHandlerMethodArgumentResolver.java +++ b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/config/PersistentEntityResourceHandlerMethodArgumentResolver.java @@ -63,8 +63,8 @@ import com.fasterxml.jackson.databind.node.ObjectNode; */ public class PersistentEntityResourceHandlerMethodArgumentResolver implements HandlerMethodArgumentResolver { - private static final String ERROR_MESSAGE = "Could not read an object of type %s from the request!"; - private static final String NO_CONVERTER_FOUND = "No suitable HttpMessageConverter found to read request body into object of type %s from request with content type of %s!"; + private static final String ERROR_MESSAGE = "Could not read an object of type %s from the request"; + private static final String NO_CONVERTER_FOUND = "No suitable HttpMessageConverter found to read request body into object of type %s from request with content type of %s"; private final List> messageConverters; private final RootResourceInformationHandlerMethodArgumentResolver resourceInformationResolver; @@ -79,11 +79,11 @@ public class PersistentEntityResourceHandlerMethodArgumentResolver implements Ha BackendIdHandlerMethodArgumentResolver idResolver, DomainObjectReader reader, PluginRegistry, Class> lookups) { - Assert.notNull(messageConverters, "HttpMessageConverters must not be null!"); - Assert.notNull(resourceInformationResolver, "RootResourceInformation resolver must not be null!"); - Assert.notNull(idResolver, "IdResolver must not be null!"); - Assert.notNull(reader, "DomainObjectReader must not be null!"); - Assert.notNull(lookups, "EntityLookups must not be null!"); + Assert.notNull(messageConverters, "HttpMessageConverters must not be null"); + Assert.notNull(resourceInformationResolver, "RootResourceInformation resolver must not be null"); + Assert.notNull(idResolver, "IdResolver must not be null"); + Assert.notNull(reader, "DomainObjectReader must not be null"); + Assert.notNull(lookups, "EntityLookups must not be null"); this.messageConverters = messageConverters; this.resourceInformationResolver = resourceInformationResolver; diff --git a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/config/ProjectionDefinitionRegistar.java b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/config/ProjectionDefinitionRegistar.java index 5870b726a..2b99381db 100644 --- a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/config/ProjectionDefinitionRegistar.java +++ b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/config/ProjectionDefinitionRegistar.java @@ -50,7 +50,7 @@ public class ProjectionDefinitionRegistar implements SmartInstantiationAwareBean */ public ProjectionDefinitionRegistar(ObjectFactory config) { - Assert.notNull(config, "RepositoryRestConfiguration must not be null!"); + Assert.notNull(config, "RepositoryRestConfiguration must not be null"); this.config = config; } diff --git a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/config/RepositoryRestConfigurer.java b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/config/RepositoryRestConfigurer.java index f7535f16a..45a1f01cc 100644 --- a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/config/RepositoryRestConfigurer.java +++ b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/config/RepositoryRestConfigurer.java @@ -50,7 +50,7 @@ public interface RepositoryRestConfigurer { */ static RepositoryRestConfigurer withConfig(Consumer consumer) { - Assert.notNull(consumer, "Consumer must not be null!"); + Assert.notNull(consumer, "Consumer must not be null"); return new RepositoryRestConfigurer() { @@ -71,7 +71,7 @@ public interface RepositoryRestConfigurer { */ static RepositoryRestConfigurer withConfig(BiConsumer consumer) { - Assert.notNull(consumer, "Consumer must not be null!"); + Assert.notNull(consumer, "Consumer must not be null"); return new RepositoryRestConfigurer() { diff --git a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/config/RepositoryRestConfigurerDelegate.java b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/config/RepositoryRestConfigurerDelegate.java index 90e58e4fb..5188b4495 100644 --- a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/config/RepositoryRestConfigurerDelegate.java +++ b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/config/RepositoryRestConfigurerDelegate.java @@ -47,7 +47,7 @@ class RepositoryRestConfigurerDelegate implements RepositoryRestConfigurer { */ public RepositoryRestConfigurerDelegate(Iterable delegates) { - Assert.notNull(delegates, "RepositoryRestConfigurers must not be null!"); + Assert.notNull(delegates, "RepositoryRestConfigurers must not be null"); this.delegates = delegates; } diff --git a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/config/ResourceMetadataHandlerMethodArgumentResolver.java b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/config/ResourceMetadataHandlerMethodArgumentResolver.java index f2c1151c9..ccd7b3c99 100644 --- a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/config/ResourceMetadataHandlerMethodArgumentResolver.java +++ b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/config/ResourceMetadataHandlerMethodArgumentResolver.java @@ -54,9 +54,9 @@ public class ResourceMetadataHandlerMethodArgumentResolver implements HandlerMet public ResourceMetadataHandlerMethodArgumentResolver(Repositories repositories, ResourceMappings mappings, BaseUri baseUri) { - Assert.notNull(repositories, "Repositories must not be null!"); - Assert.notNull(mappings, "ResourceMappings must not be null!"); - Assert.notNull(baseUri, "BaseUri must not be null!"); + Assert.notNull(repositories, "Repositories must not be null"); + Assert.notNull(mappings, "ResourceMappings must not be null"); + Assert.notNull(baseUri, "BaseUri must not be null"); this.repositories = repositories; this.mappings = mappings; diff --git a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/config/RootResourceInformationHandlerMethodArgumentResolver.java b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/config/RootResourceInformationHandlerMethodArgumentResolver.java index f4d3c96cc..ca3130725 100644 --- a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/config/RootResourceInformationHandlerMethodArgumentResolver.java +++ b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/config/RootResourceInformationHandlerMethodArgumentResolver.java @@ -54,9 +54,9 @@ public class RootResourceInformationHandlerMethodArgumentResolver implements Han public RootResourceInformationHandlerMethodArgumentResolver(Repositories repositories, RepositoryInvokerFactory invokerFactory, ResourceMetadataHandlerMethodArgumentResolver resourceMetadataResolver) { - Assert.notNull(repositories, "Repositories must not be null!"); - Assert.notNull(invokerFactory, "invokerFactory must not be null!"); - Assert.notNull(resourceMetadataResolver, "ResourceMetadataHandlerMethodArgumentResolver must not be null!"); + Assert.notNull(repositories, "Repositories must not be null"); + Assert.notNull(invokerFactory, "invokerFactory must not be null"); + Assert.notNull(resourceMetadataResolver, "ResourceMetadataHandlerMethodArgumentResolver must not be null"); this.repositories = repositories; this.invokerFactory = invokerFactory; diff --git a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/config/WebMvcRepositoryRestConfiguration.java b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/config/WebMvcRepositoryRestConfiguration.java index b778ea753..27e34415e 100644 --- a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/config/WebMvcRepositoryRestConfiguration.java +++ b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/config/WebMvcRepositoryRestConfiguration.java @@ -50,7 +50,7 @@ class WebMvcRepositoryRestConfiguration extends RepositoryRestConfiguration impl super(projectionConfiguration, metadataConfiguration, enumTranslationConfiguration); - Assert.notNull(registry, "CorsRegistry must not be null!"); + Assert.notNull(registry, "CorsRegistry must not be null"); this.registry = registry; } diff --git a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/json/AggregateReferenceResolvingModule.java b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/json/AggregateReferenceResolvingModule.java index 68ed162e9..33852d28e 100644 --- a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/json/AggregateReferenceResolvingModule.java +++ b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/json/AggregateReferenceResolvingModule.java @@ -78,8 +78,8 @@ public class AggregateReferenceResolvingModule extends SimpleModule { */ public AggregateReferenceDeserializerModifier(UriToEntityConverter converter, ResourceMappings mappings) { - Assert.notNull(converter, "UriToEntityConverter must not be null!"); - Assert.notNull(mappings, "ResourceMappings must not be null!"); + Assert.notNull(converter, "UriToEntityConverter must not be null"); + Assert.notNull(mappings, "ResourceMappings must not be null"); this.converter = converter; this.mappings = mappings; diff --git a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/json/DomainObjectReader.java b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/json/DomainObjectReader.java index 3ac6c3f21..e82c43d28 100644 --- a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/json/DomainObjectReader.java +++ b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/json/DomainObjectReader.java @@ -70,8 +70,8 @@ public class DomainObjectReader { public DomainObjectReader(PersistentEntities entities, Associations associationLinks) { - Assert.notNull(entities, "PersistentEntities must not be null!"); - Assert.notNull(associationLinks, "Associations must not be null!"); + Assert.notNull(entities, "PersistentEntities must not be null"); + Assert.notNull(associationLinks, "Associations must not be null"); this.entities = entities; this.associationLinks = associationLinks; @@ -87,14 +87,14 @@ public class DomainObjectReader { */ public T read(InputStream source, T target, ObjectMapper mapper) { - Assert.notNull(target, "Target object must not be null!"); - Assert.notNull(source, "InputStream must not be null!"); - Assert.notNull(mapper, "ObjectMapper must not be null!"); + Assert.notNull(target, "Target object must not be null"); + Assert.notNull(source, "InputStream must not be null"); + Assert.notNull(mapper, "ObjectMapper must not be null"); try { return doMerge((ObjectNode) mapper.readTree(source), target, mapper); } catch (Exception o_O) { - throw new HttpMessageNotReadableException("Could not read payload!", o_O, InputStreamHttpInputMessage.of(source)); + throw new HttpMessageNotReadableException("Could not read payload", o_O, InputStreamHttpInputMessage.of(source)); } } @@ -109,9 +109,9 @@ public class DomainObjectReader { @SuppressWarnings("unchecked") public T readPut(final ObjectNode source, T target, final ObjectMapper mapper) throws Exception { - Assert.notNull(source, "ObjectNode must not be null!"); - Assert.notNull(target, "Existing object instance must not be null!"); - Assert.notNull(mapper, "ObjectMapper must not be null!"); + Assert.notNull(source, "ObjectNode must not be null"); + Assert.notNull(target, "Existing object instance must not be null"); + Assert.notNull(mapper, "ObjectMapper must not be null"); Object intermediate = mapper.readerFor(target.getClass()).readValue(source); return (T) mergeForPut(intermediate, target, mapper); @@ -128,7 +128,7 @@ public class DomainObjectReader { @Nullable T mergeForPut(T source, T target, final ObjectMapper mapper) { - Assert.notNull(mapper, "ObjectMapper must not be null!"); + Assert.notNull(mapper, "ObjectMapper must not be null"); if (target == null || source == null) { return source; @@ -209,7 +209,7 @@ public class DomainObjectReader { try { return doMerge(source, target, mapper); } catch (Exception o_O) { - throw new HttpMessageNotReadableException("Could not read payload!", o_O); + throw new HttpMessageNotReadableException("Could not read payload", o_O); } } @@ -225,9 +225,9 @@ public class DomainObjectReader { @SuppressWarnings("unchecked") T doMerge(ObjectNode root, T target, ObjectMapper mapper) throws Exception { - Assert.notNull(root, "Root ObjectNode must not be null!"); - Assert.notNull(target, "Target object instance must not be null!"); - Assert.notNull(mapper, "ObjectMapper must not be null!"); + Assert.notNull(root, "Root ObjectNode must not be null"); + Assert.notNull(target, "Target object instance must not be null"); + Assert.notNull(mapper, "ObjectMapper must not be null"); Optional>> candidate = entities .getPersistentEntity(target.getClass()); @@ -338,9 +338,9 @@ public class DomainObjectReader { private boolean handleArrayNode(ArrayNode array, Collection collection, ObjectMapper mapper, TypeInformation componentType) throws Exception { - Assert.notNull(array, "ArrayNode must not be null!"); - Assert.notNull(collection, "Source collection must not be null!"); - Assert.notNull(mapper, "ObjectMapper must not be null!"); + Assert.notNull(array, "ArrayNode must not be null"); + Assert.notNull(collection, "Source collection must not be null"); + Assert.notNull(mapper, "ObjectMapper must not be null"); // We need an iterator for the original collection. // We might modify it but we want to keep iterating over the original collection. @@ -522,7 +522,7 @@ public class DomainObjectReader { @SuppressWarnings("unchecked") private static Collection ifCollection(Object source) { - Assert.notNull(source, "Source instance must not be null!"); + Assert.notNull(source, "Source instance must not be null"); if (source instanceof Collection) { return (Collection) source; @@ -595,8 +595,8 @@ public class DomainObjectReader { public LinkedAssociationSkippingAssociationHandler(Associations associations, SimplePropertyHandler delegate) { - Assert.notNull(associations, "Associations must not be null!"); - Assert.notNull(delegate, "Delegate SimplePropertyHandler must not be null!"); + Assert.notNull(associations, "Associations must not be null"); + Assert.notNull(delegate, "Delegate SimplePropertyHandler must not be null"); this.associations = associations; this.delegate = delegate; @@ -636,10 +636,10 @@ public class DomainObjectReader { */ public MergingPropertyHandler(Object source, Object target, PersistentEntity entity, ObjectMapper mapper) { - Assert.notNull(source, "Source instance must not be null!"); - Assert.notNull(target, "Target instance must not be null!"); - Assert.notNull(entity, "PersistentEntity must not be null!"); - Assert.notNull(mapper, "ObjectMapper must not be null!"); + Assert.notNull(source, "Source instance must not be null"); + Assert.notNull(target, "Target instance must not be null"); + Assert.notNull(entity, "PersistentEntity must not be null"); + Assert.notNull(mapper, "ObjectMapper must not be null"); this.properties = MappedProperties.forDeserialization(entity, mapper); this.targetAccessor = new ConvertingPropertyAccessor<>(entity.getPropertyAccessor(target), diff --git a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/json/EnumTranslator.java b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/json/EnumTranslator.java index 8b743e461..33aa65caf 100644 --- a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/json/EnumTranslator.java +++ b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/json/EnumTranslator.java @@ -46,7 +46,7 @@ public class EnumTranslator implements EnumTranslationConfiguration { */ public EnumTranslator(MessageResolver resolver) { - Assert.notNull(resolver, "MessageResolver must not be null!"); + Assert.notNull(resolver, "MessageResolver must not be null"); this.resolver = resolver; this.enableDefaultTranslation = true; @@ -73,7 +73,7 @@ public class EnumTranslator implements EnumTranslationConfiguration { */ public String asText(Enum value) { - Assert.notNull(value, "Enum value must not be null!"); + Assert.notNull(value, "Enum value must not be null"); return resolver.resolve(TranslatedEnum.of(value, enableDefaultTranslation)); } @@ -86,7 +86,7 @@ public class EnumTranslator implements EnumTranslationConfiguration { */ public List getValues(Class> type) { - Assert.notNull(type, "Enum type must not be null!"); + Assert.notNull(type, "Enum type must not be null"); return Arrays.stream(type.getEnumConstants()) // .map(this::asText) // @@ -107,7 +107,7 @@ public class EnumTranslator implements EnumTranslationConfiguration { return null; } - Assert.notNull(type, "Enum type must not be null!"); + Assert.notNull(type, "Enum type must not be null"); T value = resolveEnum(type, text, true); diff --git a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/json/JacksonMappingAwareSortTranslator.java b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/json/JacksonMappingAwareSortTranslator.java index 01213c0d5..94d6e3180 100644 --- a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/json/JacksonMappingAwareSortTranslator.java +++ b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/json/JacksonMappingAwareSortTranslator.java @@ -65,9 +65,9 @@ public class JacksonMappingAwareSortTranslator { public JacksonMappingAwareSortTranslator(ObjectMapper objectMapper, Repositories repositories, DomainClassResolver domainClassResolver, PersistentEntities persistentEntities, Associations associations) { - Assert.notNull(repositories, "Repositories must not be null!"); - Assert.notNull(domainClassResolver, "DomainClassResolver must not be null!"); - Assert.notNull(associations, "Associations must not be null!"); + Assert.notNull(repositories, "Repositories must not be null"); + Assert.notNull(domainClassResolver, "DomainClassResolver must not be null"); + Assert.notNull(associations, "Associations must not be null"); this.repositories = repositories; this.domainClassResolver = domainClassResolver; @@ -85,9 +85,9 @@ public class JacksonMappingAwareSortTranslator { */ protected Sort translateSort(Sort input, MethodParameter parameter, NativeWebRequest webRequest) { - Assert.notNull(input, "Sort must not be null!"); - Assert.notNull(parameter, "MethodParameter must not be null!"); - Assert.notNull(webRequest, "NativeWebRequest must not be null!"); + Assert.notNull(input, "Sort must not be null"); + Assert.notNull(parameter, "MethodParameter must not be null"); + Assert.notNull(webRequest, "NativeWebRequest must not be null"); Class domainClass = domainClassResolver.resolve(parameter.getMethod(), webRequest); @@ -120,9 +120,9 @@ public class JacksonMappingAwareSortTranslator { public SortTranslator(PersistentEntities entities, ObjectMapper objectMapper, Associations associations) { - Assert.notNull(entities, "PersistentEntities must not be null!"); - Assert.notNull(objectMapper, "ObjectMapper must not be null!"); - Assert.notNull(associations, "Associations must not be null!"); + Assert.notNull(entities, "PersistentEntities must not be null"); + Assert.notNull(objectMapper, "ObjectMapper must not be null"); + Assert.notNull(associations, "Associations must not be null"); this.entities = entities; this.objectMapper = objectMapper; @@ -139,8 +139,8 @@ public class JacksonMappingAwareSortTranslator { */ public Sort translateSort(Sort input, PersistentEntity rootEntity) { - Assert.notNull(input, "Sort must not be null!"); - Assert.notNull(rootEntity, "PersistentEntity must not be null!"); + Assert.notNull(input, "Sort must not be null"); + Assert.notNull(rootEntity, "PersistentEntity must not be null"); List filteredOrders = new ArrayList(); @@ -252,9 +252,9 @@ public class JacksonMappingAwareSortTranslator { public static TypedSegment create(PersistentEntities persistentEntities, ObjectMapper objectMapper, PersistentEntity rootEntity) { - Assert.notNull(persistentEntities, "PersistentEntities must not be null!"); - Assert.notNull(objectMapper, "ObjectMapper must not be null!"); - Assert.notNull(rootEntity, "PersistentEntity must not be null!"); + Assert.notNull(persistentEntities, "PersistentEntities must not be null"); + Assert.notNull(objectMapper, "ObjectMapper must not be null"); + Assert.notNull(rootEntity, "PersistentEntity must not be null"); return new TypedSegment(persistentEntities, objectMapper, Optional.of(rootEntity)); } @@ -267,7 +267,7 @@ public class JacksonMappingAwareSortTranslator { */ public TypedSegment next(PersistentProperty persistentProperty) { - Assert.notNull(persistentProperty, "PersistentProperty must not be null!"); + Assert.notNull(persistentProperty, "PersistentProperty must not be null"); return new TypedSegment(this, persistentEntities.getPersistentEntity(persistentProperty.getType())); } diff --git a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/json/JacksonMetadata.java b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/json/JacksonMetadata.java index 6f130a578..d9f76d00b 100644 --- a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/json/JacksonMetadata.java +++ b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/json/JacksonMetadata.java @@ -59,8 +59,8 @@ public class JacksonMetadata implements Iterable { */ public JacksonMetadata(ObjectMapper mapper, Class type) { - Assert.notNull(mapper, "ObjectMapper must not be null!"); - Assert.notNull(type, "Type must not be null!"); + Assert.notNull(mapper, "ObjectMapper must not be null"); + Assert.notNull(type, "Type must not be null"); this.mapper = mapper; @@ -86,7 +86,7 @@ public class JacksonMetadata implements Iterable { */ public BeanPropertyDefinition getDefinitionFor(PersistentProperty property) { - Assert.notNull(property, "PersistentProperty must not be null!"); + Assert.notNull(property, "PersistentProperty must not be null"); return getDefinitionFor(property, definitions); } @@ -100,8 +100,8 @@ public class JacksonMetadata implements Iterable { */ public ResourceDescription getFallbackDescription(ResourceMetadata ownerMetadata, BeanPropertyDefinition definition) { - Assert.notNull(ownerMetadata, "Owner's resource metadata must not be null!"); - Assert.notNull(definition, "BeanPropertyDefinition must not be null!"); + Assert.notNull(ownerMetadata, "Owner's resource metadata must not be null"); + Assert.notNull(definition, "BeanPropertyDefinition must not be null"); AnnotatedMember member = definition.getPrimaryMember(); Description description = member.getAnnotation(Description.class); @@ -119,7 +119,7 @@ public class JacksonMetadata implements Iterable { */ public boolean isExported(PersistentProperty property) { - Assert.notNull(property, "PersistentProperty must not be null!"); + Assert.notNull(property, "PersistentProperty must not be null"); return getDefinitionFor(property) != null; } @@ -153,7 +153,7 @@ public class JacksonMetadata implements Iterable { */ public JsonSerializer getTypeSerializer(Class type) { - Assert.notNull(type, "Type must not be null!"); + Assert.notNull(type, "Type must not be null"); try { diff --git a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/json/JacksonSerializers.java b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/json/JacksonSerializers.java index 42595e81a..a1f6da801 100644 --- a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/json/JacksonSerializers.java +++ b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/json/JacksonSerializers.java @@ -58,7 +58,7 @@ public class JacksonSerializers extends SimpleModule { */ public JacksonSerializers(EnumTranslator translator) { - Assert.notNull(translator, "EnumTranslator must not be null!"); + Assert.notNull(translator, "EnumTranslator must not be null"); SimpleSerializers serializers = new SimpleSerializers(); serializers.addSerializer(Enum.class, new EnumTranslatingSerializer(translator)); @@ -90,7 +90,7 @@ public class JacksonSerializers extends SimpleModule { super(Enum.class); - Assert.notNull(translator, "EnumTranslator must not be null!"); + Assert.notNull(translator, "EnumTranslator must not be null"); this.translator = translator; } @@ -146,7 +146,7 @@ public class JacksonSerializers extends SimpleModule { super(Enum.class); - Assert.notNull(translator, "EnumTranslator must not be null!"); + Assert.notNull(translator, "EnumTranslator must not be null"); this.translator = translator; this.property = property; @@ -163,7 +163,7 @@ public class JacksonSerializers extends SimpleModule { public Enum deserialize(JsonParser p, DeserializationContext ctxt) throws IOException, JsonProcessingException { if (property == null) { - throw new IllegalStateException("Can only translate enum with property information!"); + throw new IllegalStateException("Can only translate enum with property information"); } return translator.fromText((Class>) getActualType(property.getType()).getRawClass(), diff --git a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/json/JsonSchema.java b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/json/JsonSchema.java index 70d857259..ec608116d 100644 --- a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/json/JsonSchema.java +++ b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/json/JsonSchema.java @@ -70,9 +70,9 @@ public class JsonSchema { public JsonSchema(String title, String description, Collection> properties, Definitions definitions) { - Assert.hasText(title, "Title must not be null or empty!"); - Assert.notNull(properties, "JsonSchemaProperties must not be null!"); - Assert.notNull(definitions, "Definitions must not be null!"); + Assert.hasText(title, "Title must not be null or empty"); + Assert.notNull(properties, "JsonSchemaProperties must not be null"); + Assert.notNull(definitions, "Definitions must not be null"); this.title = title; this.description = description; @@ -210,7 +210,7 @@ public class JsonSchema { */ public PropertiesContainer(Collection> properties) { - Assert.notNull(properties, "JsonSchemaPropertys must not be null!"); + Assert.notNull(properties, "JsonSchemaPropertys must not be null"); this.properties = new HashMap>(); this.requiredProperties = new ArrayList(); @@ -350,7 +350,7 @@ public class JsonSchema { */ public JsonSchemaProperty withType(Class type) { - Assert.notNull(type, "Type must not be null!"); + Assert.notNull(type, "Type must not be null"); return with(ClassTypeInformation.from(type)); } @@ -362,7 +362,7 @@ public class JsonSchema { */ public JsonSchemaProperty with(TypeInformation type) { - Assert.notNull(type, "Type must not be null!"); + Assert.notNull(type, "Type must not be null"); this.type = toJsonSchemaType(type); if (isDate(type)) { @@ -389,7 +389,7 @@ public class JsonSchema { */ public JsonSchemaProperty withFormat(JsonSchemaFormat format) { - Assert.notNull(format, "Format must not be null!"); + Assert.notNull(format, "Format must not be null"); this.format = format; return with(STRING_TYPE_INFORMATION); @@ -403,7 +403,7 @@ public class JsonSchema { */ public JsonSchemaProperty withRegex(String regex) { - Assert.hasText(regex, "Regular expression must not be null or empty!"); + Assert.hasText(regex, "Regular expression must not be null or empty"); return withPattern(Pattern.compile(regex)); } @@ -415,7 +415,7 @@ public class JsonSchema { */ public JsonSchemaProperty withPattern(Pattern pattern) { - Assert.notNull(pattern, "Pattern must not be null!"); + Assert.notNull(pattern, "Pattern must not be null"); this.pattern = pattern.toString(); return with(STRING_TYPE_INFORMATION); @@ -490,7 +490,7 @@ public class JsonSchema { */ public EnumProperty withValues(List values) { - Assert.notNull(values, "Values must not be null!"); + Assert.notNull(values, "Values must not be null"); this.values = Collections.unmodifiableList(values); return this; diff --git a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/json/MappedProperties.java b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/json/MappedProperties.java index f8c3f582a..3289e9a1c 100644 --- a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/json/MappedProperties.java +++ b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/json/MappedProperties.java @@ -70,8 +70,8 @@ class MappedProperties { */ private MappedProperties(PersistentEntity> entity, BeanDescription description) { - Assert.notNull(entity, "Entity must not be null!"); - Assert.notNull(description, "BeanDescription must not be null!"); + Assert.notNull(entity, "Entity must not be null"); + Assert.notNull(description, "BeanDescription must not be null"); this.propertyToFieldName = new HashMap<>(); this.fieldNameToProperty = new HashMap<>(); @@ -152,7 +152,7 @@ class MappedProperties { */ public String getMappedName(PersistentProperty property) { - Assert.notNull(property, "PersistentProperty must not be null!"); + Assert.notNull(property, "PersistentProperty must not be null"); return propertyToFieldName.get(property).getName(); } @@ -163,7 +163,7 @@ class MappedProperties { */ public boolean hasPersistentPropertyForField(String fieldName) { - Assert.hasText(fieldName, "Field name must not be null or empty!"); + Assert.hasText(fieldName, "Field name must not be null or empty"); return fieldNameToProperty.containsKey(fieldName); } @@ -174,7 +174,7 @@ class MappedProperties { */ public PersistentProperty getPersistentProperty(String fieldName) { - Assert.hasText(fieldName, "Field name must not be null or empty!"); + Assert.hasText(fieldName, "Field name must not be null or empty"); return fieldNameToProperty.get(fieldName); } @@ -217,7 +217,7 @@ class MappedProperties { */ public boolean isMappedProperty(PersistentProperty property) { - Assert.notNull(property, "PersistentProperty must not be null!"); + Assert.notNull(property, "PersistentProperty must not be null"); return propertyToFieldName.containsKey(property); } @@ -231,7 +231,7 @@ class MappedProperties { */ public boolean isWritableProperty(String name) { - Assert.hasText(name, "Property name must not be null or empty!"); + Assert.hasText(name, "Property name must not be null or empty"); if (ignoredPropertyNames.contains(name)) { return false; diff --git a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/json/MappingAwareDefaultedPageableArgumentResolver.java b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/json/MappingAwareDefaultedPageableArgumentResolver.java index 002733ad9..5e2a09a5c 100644 --- a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/json/MappingAwareDefaultedPageableArgumentResolver.java +++ b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/json/MappingAwareDefaultedPageableArgumentResolver.java @@ -47,8 +47,8 @@ public class MappingAwareDefaultedPageableArgumentResolver implements HandlerMet public MappingAwareDefaultedPageableArgumentResolver(JacksonMappingAwareSortTranslator translator, PageableHandlerMethodArgumentResolver delegate) { - Assert.notNull(translator, "JacksonMappingAwareSortTranslator must not be null!"); - Assert.notNull(delegate, "Delegate PageableHandlerMethodArgumentResolver must not be null!"); + Assert.notNull(translator, "JacksonMappingAwareSortTranslator must not be null"); + Assert.notNull(delegate, "Delegate PageableHandlerMethodArgumentResolver must not be null"); this.translator = translator; this.delegate = delegate; diff --git a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/json/MappingAwarePageableArgumentResolver.java b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/json/MappingAwarePageableArgumentResolver.java index 31e279b48..d09965b70 100644 --- a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/json/MappingAwarePageableArgumentResolver.java +++ b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/json/MappingAwarePageableArgumentResolver.java @@ -46,8 +46,8 @@ public class MappingAwarePageableArgumentResolver implements HandlerMethodArgume public MappingAwarePageableArgumentResolver(JacksonMappingAwareSortTranslator translator, PageableArgumentResolver delegate) { - Assert.notNull(translator, "JacksonMappingAwareSortTranslator must not be null!"); - Assert.notNull(delegate, "Delegate PageableArgumentResolver must not be null!"); + Assert.notNull(translator, "JacksonMappingAwareSortTranslator must not be null"); + Assert.notNull(delegate, "Delegate PageableArgumentResolver must not be null"); this.translator = translator; this.delegate = delegate; diff --git a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/json/MappingAwareSortArgumentResolver.java b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/json/MappingAwareSortArgumentResolver.java index e76f976d7..76e347e43 100644 --- a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/json/MappingAwareSortArgumentResolver.java +++ b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/json/MappingAwareSortArgumentResolver.java @@ -43,8 +43,8 @@ public class MappingAwareSortArgumentResolver implements HandlerMethodArgumentRe public MappingAwareSortArgumentResolver(JacksonMappingAwareSortTranslator translator, SortArgumentResolver delegate) { - Assert.notNull(translator, "JacksonMappingAwareSortTranslator must not be null!"); - Assert.notNull(delegate, "Delegate SortArgumentResolver must not be null!"); + Assert.notNull(translator, "JacksonMappingAwareSortTranslator must not be null"); + Assert.notNull(delegate, "Delegate SortArgumentResolver must not be null"); this.translator = translator; this.delegate = delegate; diff --git a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/json/PersistentEntityJackson2Module.java b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/json/PersistentEntityJackson2Module.java index 18bcffbb4..314aab395 100644 --- a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/json/PersistentEntityJackson2Module.java +++ b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/json/PersistentEntityJackson2Module.java @@ -128,10 +128,10 @@ public class PersistentEntityJackson2Module extends SimpleModule { super("persistent-entity-resource", new Version(2, 0, 0, null, "org.springframework.data.rest", "jackson-module")); - Assert.notNull(associations, "AssociationLinks must not be null!"); - Assert.notNull(entities, "Repositories must not be null!"); - Assert.notNull(converter, "UriToEntityConverter must not be null!"); - Assert.notNull(collector, "LinkCollector must not be null!"); + Assert.notNull(associations, "AssociationLinks must not be null"); + Assert.notNull(entities, "Repositories must not be null"); + Assert.notNull(converter, "UriToEntityConverter must not be null"); + Assert.notNull(collector, "LinkCollector must not be null"); NestedEntitySerializer serializer = new NestedEntitySerializer(entities, assembler, invoker); addSerializer(new PersistentEntityResourceSerializer(collector)); @@ -172,7 +172,7 @@ public class PersistentEntityJackson2Module extends SimpleModule { public void serialize(final PersistentEntityResource resource, final JsonGenerator jgen, final SerializerProvider provider) throws IOException, JsonGenerationException { - LOG.debug("Serializing PersistentEntity {}.", resource.getPersistentEntity()); + LOG.debug("Serializing PersistentEntity {}", resource.getPersistentEntity()); Object content = resource.getContent(); @@ -236,10 +236,10 @@ public class PersistentEntityJackson2Module extends SimpleModule { public AssociationOmittingSerializerModifier(PersistentEntities entities, Associations associations, NestedEntitySerializer nestedEntitySerializer, LookupObjectSerializer lookupObjectSerializer) { - Assert.notNull(entities, "PersistentEntities must not be null!"); - Assert.notNull(associations, "Associations must not be null!"); - Assert.notNull(nestedEntitySerializer, "NestedEntitySerializer must not be null!"); - Assert.notNull(lookupObjectSerializer, "LookupObjectSerializer must not be null!"); + Assert.notNull(entities, "PersistentEntities must not be null"); + Assert.notNull(associations, "Associations must not be null"); + Assert.notNull(nestedEntitySerializer, "NestedEntitySerializer must not be null"); + Assert.notNull(lookupObjectSerializer, "LookupObjectSerializer must not be null"); this.entities = entities; this.associations = associations; @@ -268,7 +268,7 @@ public class PersistentEntityJackson2Module extends SimpleModule { if (associations.isLookupType(it)) { - LOG.debug("Assigning lookup object serializer for {}.", it); + LOG.debug("Assigning lookup object serializer for {}", it); writer.assignSerializer(lookupObjectSerializer); return Optional.of(writer); @@ -290,7 +290,7 @@ public class PersistentEntityJackson2Module extends SimpleModule { } if (it.isEntity() && !writer.isUnwrapping()) { - LOG.debug("Assigning nested entity serializer for {}.", it); + LOG.debug("Assigning nested entity serializer for {}", it); writer.assignSerializer(nestedEntitySerializer); } @@ -421,10 +421,10 @@ public class PersistentEntityJackson2Module extends SimpleModule { public AssociationUriResolvingDeserializerModifier(PersistentEntities entities, Associations associations, UriToEntityConverter converter, RepositoryInvokerFactory factory) { - Assert.notNull(entities, "PersistentEntities must not be null!"); - Assert.notNull(associations, "Associations must not be null!"); - Assert.notNull(converter, "UriToEntityConverter must not be null!"); - Assert.notNull(factory, "RepositoryInvokerFactory must not be null!"); + Assert.notNull(entities, "PersistentEntities must not be null"); + Assert.notNull(associations, "Associations must not be null"); + Assert.notNull(converter, "UriToEntityConverter must not be null"); + Assert.notNull(factory, "RepositoryInvokerFactory must not be null"); this.entities = entities; this.associationLinks = associations; @@ -569,7 +569,7 @@ public class PersistentEntityJackson2Module extends SimpleModule { public static class UriStringDeserializer extends StdDeserializer { private static final long serialVersionUID = -2175900204153350125L; - private static final String UNEXPECTED_VALUE = "Expected URI cause property %s points to the managed domain type!"; + private static final String UNEXPECTED_VALUE = "Expected URI cause property %s points to the managed domain type"; private final Class type; private final UriToEntityConverter converter; @@ -782,8 +782,8 @@ public class PersistentEntityJackson2Module extends SimpleModule { */ public CollectionValueInstantiator(TypeInformation property) { - Assert.notNull(property, "Property must not be null!"); - Assert.isTrue(property.isCollectionLike() || property.isMap(), "Property must be a collection or map property!"); + Assert.notNull(property, "Property must not be null"); + Assert.isTrue(property.isCollectionLike() || property.isMap(), "Property must be a collection or map property"); this.property = property; } @@ -831,7 +831,7 @@ public class PersistentEntityJackson2Module extends SimpleModule { public LookupObjectSerializer(PluginRegistry, Class> lookups) { - Assert.notNull(lookups, "EntityLookups must not be null!"); + Assert.notNull(lookups, "EntityLookups must not be null"); this.lookups = lookups; } diff --git a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/json/PersistentEntityToJsonSchemaConverter.java b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/json/PersistentEntityToJsonSchemaConverter.java index 87ae2dac4..f20ea5132 100644 --- a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/json/PersistentEntityToJsonSchemaConverter.java +++ b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/json/PersistentEntityToJsonSchemaConverter.java @@ -97,12 +97,12 @@ public class PersistentEntityToJsonSchemaConverter implements ConditionalGeneric MessageResolver resolver, ObjectMapper objectMapper, RepositoryRestConfiguration configuration, ValueTypeSchemaPropertyCustomizerFactory customizerFactory) { - Assert.notNull(entities, "PersistentEntities must not be null!"); - Assert.notNull(associations, "AssociationLinks must not be null!"); - Assert.notNull(resolver, "MessageResolver must not be null!"); - Assert.notNull(objectMapper, "ObjectMapper must not be null!"); - Assert.notNull(configuration, "RepositoryRestConfiguration must not be null!"); - Assert.notNull(customizerFactory, "ValueTypeSchemaPropertyCustomizerFactory must not be null!"); + Assert.notNull(entities, "PersistentEntities must not be null"); + Assert.notNull(associations, "AssociationLinks must not be null"); + Assert.notNull(resolver, "MessageResolver must not be null"); + Assert.notNull(objectMapper, "ObjectMapper must not be null"); + Assert.notNull(configuration, "RepositoryRestConfiguration must not be null"); + Assert.notNull(customizerFactory, "ValueTypeSchemaPropertyCustomizerFactory must not be null"); this.entities = entities; this.associations = associations; @@ -284,7 +284,7 @@ public class PersistentEntityToJsonSchemaConverter implements ConditionalGeneric * @param metadata must not be {@literal null}. */ public JsonSchemaPropertyRegistrar(JacksonMetadata metadata) { - Assert.notNull(metadata, "Metadata must not be null!"); + Assert.notNull(metadata, "Metadata must not be null"); this.metadata = metadata; this.properties = new ArrayList>(); } @@ -317,7 +317,7 @@ public class PersistentEntityToJsonSchemaConverter implements ConditionalGeneric public ValueTypeSchemaPropertyCustomizerFactory(RepositoryInvokerFactory factory) { - Assert.notNull(factory, "RepositoryInvokerFactory must not be null!"); + Assert.notNull(factory, "RepositoryInvokerFactory must not be null"); this.factory = factory; } @@ -364,7 +364,7 @@ public class PersistentEntityToJsonSchemaConverter implements ConditionalGeneric private static String[] getCodes(BeanPropertyDefinition property) { - Assert.notNull(property, "BeanPropertyDefinition must not be null!"); + Assert.notNull(property, "BeanPropertyDefinition must not be null"); Class owner = property.getPrimaryMember().getDeclaringClass(); @@ -397,7 +397,7 @@ public class PersistentEntityToJsonSchemaConverter implements ConditionalGeneric private static String[] getTitleCodes(Class type) { - Assert.notNull(type, "Type must not be null!"); + Assert.notNull(type, "Type must not be null"); return new String[] { type.getName().concat("._title"), type.getSimpleName().concat("._title") }; } @@ -412,9 +412,9 @@ public class PersistentEntityToJsonSchemaConverter implements ConditionalGeneric public JacksonProperty(JacksonMetadata metadata, Optional> property, BeanPropertyDefinition definition) { - Assert.notNull(metadata, "JacksonMetadata must not be null!"); - Assert.notNull(property, "PersistentProperty must not be null!"); - Assert.notNull(definition, "BeanPropertyDefinition must not be null!"); + Assert.notNull(metadata, "JacksonMetadata must not be null"); + Assert.notNull(property, "PersistentProperty must not be null"); + Assert.notNull(definition, "BeanPropertyDefinition must not be null"); this.metadata = metadata; this.property = property; @@ -478,8 +478,8 @@ public class PersistentEntityToJsonSchemaConverter implements ConditionalGeneric public DefaultMessageResolver(MessageResolver resolver, RepositoryRestConfiguration configuration) { - Assert.notNull(resolver, "MessageResolver must not be null!"); - Assert.notNull(configuration, "RepositoryRestConfiguration must not be null!"); + Assert.notNull(resolver, "MessageResolver must not be null"); + Assert.notNull(configuration, "RepositoryRestConfiguration must not be null"); this.resolver = resolver; this.configuration = configuration; diff --git a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/json/WrappedProperties.java b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/json/WrappedProperties.java index 3d09edab0..131cf5e6b 100644 --- a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/json/WrappedProperties.java +++ b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/json/WrappedProperties.java @@ -75,7 +75,7 @@ class WrappedProperties { public static WrappedProperties fromJacksonProperties(PersistentEntities persistentEntities, PersistentEntity entity, ObjectMapper mapper) { - Assert.notNull(entity, "PersistentEntity must not be null!"); + Assert.notNull(entity, "PersistentEntity must not be null"); JacksonUnwrappedPropertiesResolver resolver = new JacksonUnwrappedPropertiesResolver(persistentEntities, mapper); return new WrappedProperties(resolver.findUnwrappedPropertyPaths(entity.getType())); @@ -91,7 +91,7 @@ class WrappedProperties { */ public boolean hasPersistentPropertiesForField(String fieldName) { - Assert.hasText(fieldName, "Field name must not be null or empty!"); + Assert.hasText(fieldName, "Field name must not be null or empty"); return fieldNameToProperties.containsKey(fieldName); } @@ -102,7 +102,7 @@ class WrappedProperties { */ public List> getPersistentProperties(String fieldName) { - Assert.hasText(fieldName, "Field name must not be null or empty!"); + Assert.hasText(fieldName, "Field name must not be null or empty"); return hasPersistentPropertiesForField(fieldName) ? Collections.unmodifiableList(fieldNameToProperties.get(fieldName)) @@ -121,8 +121,8 @@ class WrappedProperties { public JacksonUnwrappedPropertiesResolver(PersistentEntities entities, ObjectMapper mapper) { - Assert.notNull(entities, "PersistentEntities must not be null!"); - Assert.notNull(mapper, "ObjectMapper must not be null!"); + Assert.notNull(entities, "PersistentEntities must not be null"); + Assert.notNull(mapper, "ObjectMapper must not be null"); this.entities = entities; this.mapper = mapper; @@ -136,7 +136,7 @@ class WrappedProperties { */ public Map>> findUnwrappedPropertyPaths(Class type) { - Assert.notNull(type, "Type must not be null!"); + Assert.notNull(type, "Type must not be null"); return findUnwrappedPropertyPaths(type, NameTransformer.NOP, false); } diff --git a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/json/patch/CopyOperation.java b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/json/patch/CopyOperation.java index 625273ffb..577508869 100644 --- a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/json/patch/CopyOperation.java +++ b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/json/patch/CopyOperation.java @@ -67,7 +67,7 @@ class CopyOperation extends PatchOperation { public CopyOperationBuilder(String from) { - Assert.hasText(from, "From must not be null!"); + Assert.hasText(from, "From must not be null"); this.from = from; } diff --git a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/json/patch/JsonLateObjectEvaluator.java b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/json/patch/JsonLateObjectEvaluator.java index 2e6b0f81a..d2a2393a4 100644 --- a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/json/patch/JsonLateObjectEvaluator.java +++ b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/json/patch/JsonLateObjectEvaluator.java @@ -35,8 +35,8 @@ class JsonLateObjectEvaluator implements LateObjectEvaluator { public JsonLateObjectEvaluator(ObjectMapper mapper, JsonNode node) { - Assert.notNull(mapper, "ObjectMapper must not be null!"); - Assert.notNull(node, "JsonNode must not be null!"); + Assert.notNull(mapper, "ObjectMapper must not be null"); + Assert.notNull(node, "JsonNode must not be null"); this.mapper = mapper; this.node = node; @@ -48,7 +48,7 @@ class JsonLateObjectEvaluator implements LateObjectEvaluator { try { return mapper.readValue(node.traverse(mapper.getFactory().getCodec()), type); } catch (Exception o_O) { - throw new PatchException(String.format("Could not read %s into %s!", node, type), o_O); + throw new PatchException(String.format("Could not read %s into %s", node, type), o_O); } } } diff --git a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/json/patch/JsonPatchPatchConverter.java b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/json/patch/JsonPatchPatchConverter.java index 7d4378b38..6e16091c9 100644 --- a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/json/patch/JsonPatchPatchConverter.java +++ b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/json/patch/JsonPatchPatchConverter.java @@ -39,7 +39,7 @@ public class JsonPatchPatchConverter implements PatchConverter { public JsonPatchPatchConverter(ObjectMapper mapper) { - Assert.notNull(mapper, "ObjectMapper must not be null!"); + Assert.notNull(mapper, "ObjectMapper must not be null"); this.mapper = mapper; } @@ -109,6 +109,6 @@ public class JsonPatchPatchConverter implements PatchConverter { } throw new PatchException( - String.format("Unrecognized valueNode type at path %s and value node %s.", path, valueNode)); + String.format("Unrecognized valueNode type at path %s and value node %s", path, valueNode)); } } diff --git a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/json/patch/MoveOperation.java b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/json/patch/MoveOperation.java index c98757697..c2b692004 100644 --- a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/json/patch/MoveOperation.java +++ b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/json/patch/MoveOperation.java @@ -60,7 +60,7 @@ class MoveOperation extends PatchOperation { private MoveOperationBuilder(String from) { - Assert.hasText(from, "From must not be null or empty!"); + Assert.hasText(from, "From must not be null or empty"); this.from = from; } diff --git a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/json/patch/PatchOperation.java b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/json/patch/PatchOperation.java index 57c4dc795..8e8264ac1 100644 --- a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/json/patch/PatchOperation.java +++ b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/json/patch/PatchOperation.java @@ -43,8 +43,8 @@ public abstract class PatchOperation { protected PatchOperation(String op, UntypedSpelPath path, Object value) { - Assert.hasText(op, "Operation must not be null or empty!"); - Assert.notNull(path, "UntypedSpelPath must not be null!"); + Assert.hasText(op, "Operation must not be null or empty"); + Assert.notNull(path, "UntypedSpelPath must not be null"); this.op = op; this.path = path; diff --git a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/json/patch/SpelPath.java b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/json/patch/SpelPath.java index 8c6474768..fc5e5a3e7 100644 --- a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/json/patch/SpelPath.java +++ b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/json/patch/SpelPath.java @@ -57,7 +57,7 @@ class SpelPath { private SpelPath(String path) { - Assert.notNull(path, "Path must not be null!"); + Assert.notNull(path, "Path must not be null"); this.path = path; } @@ -135,7 +135,7 @@ class SpelPath { */ public TypedSpelPath bindTo(Class type) { - Assert.notNull(type, "Type must not be null!"); + Assert.notNull(type, "Type must not be null"); return TypedSpelPath.of(this, type); } @@ -148,8 +148,8 @@ class SpelPath { */ static class TypedSpelPath extends SpelPath { - private static final String INVALID_PATH_REFERENCE = "Invalid path reference %s on type %s!"; - private static final String INVALID_COLLECTION_INDEX = "Invalid collection index %s for collection of size %s. Use '…/-' or the collection's actual size as index to append to it!"; + private static final String INVALID_PATH_REFERENCE = "Invalid path reference %s on type %s"; + private static final String INVALID_COLLECTION_INDEX = "Invalid collection index %s for collection of size %s; Use '…/-' or the collection's actual size as index to append to it"; private static final Map TYPED_PATHS = new ConcurrentReferenceHashMap<>(32); private static final EvaluationContext CONTEXT = SimpleEvaluationContext.forReadWriteDataBinding().build(); @@ -163,8 +163,8 @@ class SpelPath { private CacheKey(Class type, UntypedSpelPath path) { - Assert.notNull(type, "Type must not be null!"); - Assert.notNull(path, "UntypedSpelPath must not be null!"); + Assert.notNull(type, "Type must not be null"); + Assert.notNull(path, "UntypedSpelPath must not be null"); this.type = type; this.path = path; @@ -219,8 +219,8 @@ class SpelPath { */ public static TypedSpelPath of(UntypedSpelPath path, Class type) { - Assert.notNull(path, "Path must not be null!"); - Assert.notNull(type, "Type must not be null!"); + Assert.notNull(path, "Path must not be null"); + Assert.notNull(type, "Type must not be null"); return TYPED_PATHS.computeIfAbsent(CacheKey.of(type, path), key -> new TypedSpelPath(key.path, key.type)); } @@ -234,7 +234,7 @@ class SpelPath { @SuppressWarnings("unchecked") public T getValue(Object target) { - Assert.notNull(target, "Target must not be null!"); + Assert.notNull(target, "Target must not be null"); try { return (T) expression.getValue(CONTEXT, target); @@ -251,7 +251,7 @@ class SpelPath { */ public void setValue(Object target, @Nullable Object value) { - Assert.notNull(target, "Target must not be null!"); + Assert.notNull(target, "Target must not be null"); expression.setValue(CONTEXT, target, value); } @@ -281,7 +281,7 @@ class SpelPath { */ public Class getType(Object root) { - Assert.notNull(root, "Root object must not be null!"); + Assert.notNull(root, "Root object must not be null"); try { @@ -300,7 +300,7 @@ class SpelPath { } } - throw new IllegalArgumentException(String.format("Cannot obtain type for path %s on %s!", path, root)); + throw new IllegalArgumentException(String.format("Cannot obtain type for path %s on %s", path, root)); } /** @@ -312,8 +312,8 @@ class SpelPath { */ public void copyFrom(UntypedSpelPath path, Object source) { - Assert.notNull(path, "Source path must not be null!"); - Assert.notNull(source, "Source value must not be null!"); + Assert.notNull(path, "Source path must not be null"); + Assert.notNull(source, "Source value must not be null"); addValue(source, path.bindTo(type).getValue(source)); } @@ -328,8 +328,8 @@ class SpelPath { */ public void moveFrom(UntypedSpelPath path, Object source) { - Assert.notNull(path, "Source path must not be null!"); - Assert.notNull(source, "Source value must not be null!"); + Assert.notNull(path, "Source path must not be null"); + Assert.notNull(source, "Source value must not be null"); addValue(source, path.bindTo(type).removeFrom(source)); } @@ -342,7 +342,7 @@ class SpelPath { */ public Object removeFrom(Object target) { - Assert.notNull(target, "Target must not be null!"); + Assert.notNull(target, "Target must not be null"); Integer listIndex = getTargetListIndex(); Object value = getValue(target); @@ -353,7 +353,7 @@ class SpelPath { setValue(target, null); return value; } catch (SpelEvaluationException o_O) { - throw new PatchException("Path '" + path + "' is not nullable.", o_O); + throw new PatchException("Path '" + path + "' is not nullable", o_O); } } else { @@ -447,8 +447,8 @@ class SpelPath { */ private static Optional verifyPath(String path, Class type) { - Assert.notNull(path, "Path must not be null!"); - Assert.notNull(type, "Type must not be null!"); + Assert.notNull(path, "Path must not be null"); + Assert.notNull(type, "Type must not be null"); // Remove leading digits String segmentSource = path.replaceAll("^/\\d+", ""); @@ -476,7 +476,7 @@ class SpelPath { private SkippedPropertyPath(PropertyPath path, boolean skipped) { - Assert.notNull(path, "PropertyPath must not be null!"); + Assert.notNull(path, "PropertyPath must not be null"); this.path = path; this.skipped = skipped; @@ -574,8 +574,8 @@ class SpelPath { public SpelExpressionBuilder(@Nullable PropertyPath basePath, Class type, String spelSegment, boolean skipped) { - Assert.notNull(type, "Type must not be null!"); - Assert.notNull(spelSegment, "SpEL segment must not be null!"); + Assert.notNull(type, "Type must not be null"); + Assert.notNull(spelSegment, "SpEL segment must not be null"); this.basePath = basePath; this.type = type; diff --git a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/json/patch/TestOperation.java b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/json/patch/TestOperation.java index 0145568fa..deebb7079 100644 --- a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/json/patch/TestOperation.java +++ b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/json/patch/TestOperation.java @@ -56,7 +56,7 @@ class TestOperation extends PatchOperation { private TestOperationBuilder(String path) { - Assert.hasText(path, "Path must not be null or empty!"); + Assert.hasText(path, "Path must not be null or empty"); this.path = path; } @@ -73,7 +73,7 @@ class TestOperation extends PatchOperation { Object actual = normalizeIfNumber(path.bindTo(type).getValue(target)); if (!ObjectUtils.nullSafeEquals(expected, actual)) { - throw new PatchException("Test against path '" + path + "' failed."); + throw new PatchException("Test against path '" + path + "' failed"); } } diff --git a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/mapping/Associations.java b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/mapping/Associations.java index 03e64f02b..68f05105d 100644 --- a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/mapping/Associations.java +++ b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/mapping/Associations.java @@ -50,8 +50,8 @@ public class Associations { public Associations(ResourceMappings mappings, RepositoryRestConfiguration config) { - Assert.notNull(mappings, "ResourceMappings must not be null!"); - Assert.notNull(config, "RepositoryRestConfiguration must not be null!"); + Assert.notNull(mappings, "ResourceMappings must not be null"); + Assert.notNull(config, "RepositoryRestConfiguration must not be null"); this.mappings = mappings; this.config = config; @@ -70,8 +70,8 @@ public class Associations { */ public List getLinksFor(Association> association, Path path) { - Assert.notNull(association, "Association must not be null!"); - Assert.notNull(path, "Base path must not be null!"); + Assert.notNull(association, "Association must not be null"); + Assert.notNull(path, "Base path must not be null"); if (isLinkableAssociation(association)) { @@ -96,7 +96,7 @@ public class Associations { */ public ResourceMetadata getMetadataFor(Class type) { - Assert.notNull(type, "Type must not be null!"); + Assert.notNull(type, "Type must not be null"); return mappings.getMetadataFor(type); } @@ -109,7 +109,7 @@ public class Associations { */ public boolean isLookupType(PersistentProperty property) { - Assert.notNull(property, "Persistent property must not be null!"); + Assert.notNull(property, "Persistent property must not be null"); return config.isLookupType(property.getActualType()); } @@ -126,7 +126,7 @@ public class Associations { */ public boolean isLinkableAssociation(Association> association) { - Assert.notNull(association, "Association must not be null!"); + Assert.notNull(association, "Association must not be null"); return isLinkableAssociation(association.getInverse()); } @@ -139,7 +139,7 @@ public class Associations { */ public boolean isLinkableAssociation(PersistentProperty property) { - Assert.notNull(property, "PersistentProperty must not be null!"); + Assert.notNull(property, "PersistentProperty must not be null"); if (!property.isAssociation() || config.isLookupType(property.getActualType())) { return false; diff --git a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/mapping/DefaultLinkCollector.java b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/mapping/DefaultLinkCollector.java index 73554374d..919cc1f4c 100644 --- a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/mapping/DefaultLinkCollector.java +++ b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/mapping/DefaultLinkCollector.java @@ -59,9 +59,9 @@ public class DefaultLinkCollector implements LinkCollector { public DefaultLinkCollector(PersistentEntities entities, SelfLinkProvider linkProvider, Associations associationLinks) { - Assert.notNull(entities, "PersistentEntities must not be null!"); - Assert.notNull(linkProvider, "SelfLinkProvider must not be null!"); - Assert.notNull(associationLinks, "AssociationLinks must not be null!"); + Assert.notNull(entities, "PersistentEntities must not be null"); + Assert.notNull(linkProvider, "SelfLinkProvider must not be null"); + Assert.notNull(associationLinks, "AssociationLinks must not be null"); this.links = linkProvider; this.entities = entities; @@ -89,8 +89,8 @@ public class DefaultLinkCollector implements LinkCollector { @Override public Links getLinksFor(Object object, Links existingLinks) { - Assert.notNull(object, "Object must not be null!"); - Assert.notNull(existingLinks, "Existing links must not be null!"); + Assert.notNull(object, "Object must not be null"); + Assert.notNull(existingLinks, "Existing links must not be null"); Link selfLink = createSelfLink(object, existingLinks); @@ -137,7 +137,7 @@ public class DefaultLinkCollector implements LinkCollector { */ private static class LinkCollectingAssociationHandler implements SimpleAssociationHandler { - private static final String AMBIGUOUS_ASSOCIATIONS = "Detected multiple association links with same relation type! Disambiguate association %s using @RestResource!"; + private static final String AMBIGUOUS_ASSOCIATIONS = "Detected multiple association links with same relation type; Disambiguate association %s using @RestResource"; private final Path basePath; private final Associations associationLinks; @@ -145,8 +145,8 @@ public class DefaultLinkCollector implements LinkCollector { public LinkCollectingAssociationHandler(Path basePath, Associations associationLinks) { - Assert.notNull(basePath, "Base Path must not be null!"); - Assert.notNull(associationLinks, "Associations must not be null!"); + Assert.notNull(basePath, "Base Path must not be null"); + Assert.notNull(associationLinks, "Associations must not be null"); this.basePath = basePath; this.associationLinks = associationLinks; @@ -190,9 +190,9 @@ public class DefaultLinkCollector implements LinkCollector { public NestedLinkCollectingAssociationHandler(SelfLinkProvider selfLinks, PersistentPropertyAccessor accessor, Associations associations) { - Assert.notNull(selfLinks, "SelfLinkProvider must not be null!"); - Assert.notNull(accessor, "PersistentPropertyAccessor must not be null!"); - Assert.notNull(associations, "Associations must not be null!"); + Assert.notNull(selfLinks, "SelfLinkProvider must not be null"); + Assert.notNull(accessor, "PersistentPropertyAccessor must not be null"); + Assert.notNull(associations, "Associations must not be null"); this.selfLinks = selfLinks; this.accessor = accessor; diff --git a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/support/BackendIdHandlerMethodArgumentResolver.java b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/support/BackendIdHandlerMethodArgumentResolver.java index d23e1d81a..279d765c9 100644 --- a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/support/BackendIdHandlerMethodArgumentResolver.java +++ b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/support/BackendIdHandlerMethodArgumentResolver.java @@ -55,9 +55,9 @@ public class BackendIdHandlerMethodArgumentResolver implements HandlerMethodArgu public BackendIdHandlerMethodArgumentResolver(PluginRegistry> idConverters, ResourceMetadataHandlerMethodArgumentResolver resourceMetadataResolver, BaseUri baseUri) { - Assert.notNull(idConverters, "Id converters must not be null!"); - Assert.notNull(resourceMetadataResolver, "ResourceMetadata resolver must not be null!"); - Assert.notNull(baseUri, "BaseUri must not be null!"); + Assert.notNull(idConverters, "Id converters must not be null"); + Assert.notNull(resourceMetadataResolver, "ResourceMetadata resolver must not be null"); + Assert.notNull(baseUri, "BaseUri must not be null"); this.idConverters = idConverters; this.resourceMetadataResolver = resourceMetadataResolver; @@ -77,7 +77,7 @@ public class BackendIdHandlerMethodArgumentResolver implements HandlerMethodArgu if (parameter.getMethodAnnotation(BackendId.class) != null && !parameterType.equals(Serializable.class)) { throw new IllegalArgumentException(String.format( - "Method parameter for @%s must be of type %s! Got %s for method %s.", BackendId.class.getSimpleName(), + "Method parameter for @%s must be of type %s; Got %s for method %s", BackendId.class.getSimpleName(), Serializable.class.getSimpleName(), parameterType.getSimpleName(), parameter.getMethod())); } diff --git a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/support/DefaultExcerptProjector.java b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/support/DefaultExcerptProjector.java index c6f6c0cce..3a7f8cf70 100644 --- a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/support/DefaultExcerptProjector.java +++ b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/support/DefaultExcerptProjector.java @@ -36,8 +36,8 @@ public class DefaultExcerptProjector implements ExcerptProjector { public DefaultExcerptProjector(ProjectionFactory factory, ResourceMappings mappings) { - Assert.notNull(factory, "ProjectionFactory must not be null!"); - Assert.notNull(mappings, "ResourceMappings must not be null!"); + Assert.notNull(factory, "ProjectionFactory must not be null"); + Assert.notNull(mappings, "ResourceMappings must not be null"); this.factory = factory; this.mappings = mappings; @@ -46,7 +46,7 @@ public class DefaultExcerptProjector implements ExcerptProjector { @Override public Object projectExcerpt(Object source) { - Assert.notNull(source, "Projection source must not be null!"); + Assert.notNull(source, "Projection source must not be null"); ResourceMetadata metadata = mappings.getMetadataFor(source.getClass()); diff --git a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/support/DefaultedPageable.java b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/support/DefaultedPageable.java index 4d6c13ed9..266c62f81 100644 --- a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/support/DefaultedPageable.java +++ b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/support/DefaultedPageable.java @@ -32,7 +32,7 @@ public final class DefaultedPageable { public DefaultedPageable(Pageable pageable, boolean isDefault) { - Assert.notNull(pageable, "Pageable must not be null!"); + Assert.notNull(pageable, "Pageable must not be null"); this.pageable = pageable; this.isDefault = isDefault; diff --git a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/support/DefaultedPageableHandlerMethodArgumentResolver.java b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/support/DefaultedPageableHandlerMethodArgumentResolver.java index a486b9657..cf629f34f 100644 --- a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/support/DefaultedPageableHandlerMethodArgumentResolver.java +++ b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/support/DefaultedPageableHandlerMethodArgumentResolver.java @@ -43,7 +43,7 @@ public class DefaultedPageableHandlerMethodArgumentResolver implements HandlerMe */ public DefaultedPageableHandlerMethodArgumentResolver(PageableHandlerMethodArgumentResolver resolver) { - Assert.notNull(resolver, "PageableHandlerMethodArgumentResolver must not be null!"); + Assert.notNull(resolver, "PageableHandlerMethodArgumentResolver must not be null"); this.resolver = resolver; } diff --git a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/support/DomainClassResolver.java b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/support/DomainClassResolver.java index 0bc88627c..67e1c10ae 100644 --- a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/support/DomainClassResolver.java +++ b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/support/DomainClassResolver.java @@ -44,9 +44,9 @@ public class DomainClassResolver { private DomainClassResolver(Repositories repositories, ResourceMappings mappings, BaseUri baseUri) { - Assert.notNull(repositories, "Repositories must not be null!"); - Assert.notNull(mappings, "ResourceMappings must not be null!"); - Assert.notNull(baseUri, "BaseUri must not be null!"); + Assert.notNull(repositories, "Repositories must not be null"); + Assert.notNull(mappings, "ResourceMappings must not be null"); + Assert.notNull(baseUri, "BaseUri must not be null"); this.repositories = repositories; this.mappings = mappings; @@ -67,8 +67,8 @@ public class DomainClassResolver { */ public Class resolve(Method method, NativeWebRequest webRequest) { - Assert.notNull(method, "Method must not be null!"); - Assert.notNull(webRequest, "NativeWebRequest must not be null!"); + Assert.notNull(method, "Method must not be null"); + Assert.notNull(webRequest, "NativeWebRequest must not be null"); String lookupPath = baseUri.getRepositoryLookupPath(webRequest); String repositoryKey = UriUtils.findMappingVariable("repository", method, lookupPath); diff --git a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/support/ETag.java b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/support/ETag.java index bed888cc2..df25e1079 100644 --- a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/support/ETag.java +++ b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/support/ETag.java @@ -71,7 +71,7 @@ public final class ETag { */ public static ETag from(PersistentEntityResource resource) { - Assert.notNull(resource, "PersistentEntityResource must not be null!"); + Assert.notNull(resource, "PersistentEntityResource must not be null"); return from(resource.getPersistentEntity(), resource.getTarget()); } @@ -133,7 +133,7 @@ public final class ETag { */ public HttpHeaders addTo(HttpHeaders headers) { - Assert.notNull(headers, "HttpHeaders must not be null!"); + Assert.notNull(headers, "HttpHeaders must not be null"); String stringValue = toString(); if (stringValue == null) { @@ -159,8 +159,8 @@ public final class ETag { private static Optional getVersionInformation(PersistentEntity> entity, Object bean) { - Assert.notNull(entity, "PersistentEntity must not be null!"); - Assert.notNull(bean, "Target bean must not be null!"); + Assert.notNull(entity, "PersistentEntity must not be null"); + Assert.notNull(bean, "Target bean must not be null"); PersistentPropertyAccessor accessor = entity.getPropertyAccessor(bean); diff --git a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/support/ETagDoesntMatchException.java b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/support/ETagDoesntMatchException.java index a0a7a590d..0cf9cdd40 100644 --- a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/support/ETagDoesntMatchException.java +++ b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/support/ETagDoesntMatchException.java @@ -39,8 +39,8 @@ public class ETagDoesntMatchException extends RuntimeException { */ public ETagDoesntMatchException(Object bean, ETag expected) { - Assert.notNull(bean, "Target bean must not be null!"); - Assert.notNull(expected, "Expected ETag must not be null!"); + Assert.notNull(bean, "Target bean must not be null"); + Assert.notNull(expected, "Expected ETag must not be null"); this.expected = expected; this.bean = bean; diff --git a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/support/PersistentEntityProjector.java b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/support/PersistentEntityProjector.java index 1f101dc9c..5eb2344f0 100644 --- a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/support/PersistentEntityProjector.java +++ b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/support/PersistentEntityProjector.java @@ -47,8 +47,8 @@ public class PersistentEntityProjector extends DefaultExcerptProjector implement super(factory, mappings); - Assert.notNull(projectionDefinitions, "ProjectionDefinitions must not be null!"); - Assert.notNull(factory, "ProjectionFactory must not be null!"); + Assert.notNull(projectionDefinitions, "ProjectionDefinitions must not be null"); + Assert.notNull(factory, "ProjectionFactory must not be null"); this.factory = factory; this.definitions = projectionDefinitions; @@ -74,8 +74,8 @@ public class PersistentEntityProjector extends DefaultExcerptProjector implement */ private Object projectWithDefault(Object source, Function converter) { - Assert.notNull(source, "Projection source must not be null!"); - Assert.notNull(converter, "Converter must not be null!"); + Assert.notNull(source, "Projection source must not be null"); + Assert.notNull(converter, "Converter must not be null"); if (!StringUtils.hasText(projection)) { return converter.apply(source); diff --git a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/support/RepositoryConstraintViolationExceptionMessage.java b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/support/RepositoryConstraintViolationExceptionMessage.java index 607dce279..648ec2830 100644 --- a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/support/RepositoryConstraintViolationExceptionMessage.java +++ b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/support/RepositoryConstraintViolationExceptionMessage.java @@ -45,8 +45,8 @@ public class RepositoryConstraintViolationExceptionMessage { public RepositoryConstraintViolationExceptionMessage(RepositoryConstraintViolationException exception, MessageSourceAccessor accessor) { - Assert.notNull(exception, "RepositoryConstraintViolationException must not be null!"); - Assert.notNull(accessor, "MessageSourceAccessor must not be null!"); + Assert.notNull(exception, "RepositoryConstraintViolationException must not be null"); + Assert.notNull(accessor, "MessageSourceAccessor must not be null"); for (FieldError fieldError : exception.getErrors().getFieldErrors()) { this.errors.add(ValidationError.of(fieldError.getObjectName(), fieldError.getField(), @@ -68,9 +68,9 @@ public class RepositoryConstraintViolationExceptionMessage { private ValidationError(String entity, String property, Object invalidValue, String message) { - Assert.hasText(entity, "Entity must not be null or empty!"); - Assert.hasText(property, "Property must not be null or empty!"); - Assert.hasText(message, "Message must not be null or empty!"); + Assert.hasText(entity, "Entity must not be null or empty"); + Assert.hasText(property, "Property must not be null or empty"); + Assert.hasText(message, "Message must not be null or empty"); this.entity = entity; this.property = property; diff --git a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/support/RepositoryEntityLinks.java b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/support/RepositoryEntityLinks.java index 93acc152d..22f37fc9b 100644 --- a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/support/RepositoryEntityLinks.java +++ b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/support/RepositoryEntityLinks.java @@ -76,11 +76,11 @@ public class RepositoryEntityLinks extends AbstractEntityLinks { Lazy templateVariables, PluginRegistry> idConverters) { - Assert.notNull(repositories, "Repositories must not be null!"); - Assert.notNull(mappings, "ResourceMappings must not be null!"); - Assert.notNull(config, "RepositoryRestConfiguration must not be null!"); - Assert.notNull(templateVariables, "PagingAndSortingTemplateVariables must not be null!"); - Assert.notNull(idConverters, "BackendIdConverters must not be null!"); + Assert.notNull(repositories, "Repositories must not be null"); + Assert.notNull(mappings, "ResourceMappings must not be null"); + Assert.notNull(config, "RepositoryRestConfiguration must not be null"); + Assert.notNull(templateVariables, "PagingAndSortingTemplateVariables must not be null"); + Assert.notNull(idConverters, "BackendIdConverters must not be null"); this.repositories = repositories; this.mappings = mappings; @@ -133,7 +133,7 @@ public class RepositoryEntityLinks extends AbstractEntityLinks { @Override public Link linkToItemResource(Class type, Object id) { - Assert.isInstanceOf(Serializable.class, id, "Id must be assignable to Serializable!"); + Assert.isInstanceOf(Serializable.class, id, "Id must be assignable to Serializable"); ResourceMetadata metadata = mappings.getMetadataFor(type); Link link = linkForItemResource(type, id).withRel(metadata.getItemResourceRel()); @@ -145,7 +145,7 @@ public class RepositoryEntityLinks extends AbstractEntityLinks { @Override public LinkBuilder linkForItemResource(Class type, Object id) { - Assert.isInstanceOf(Serializable.class, id, "Id must be assignable to Serializable!"); + Assert.isInstanceOf(Serializable.class, id, "Id must be assignable to Serializable"); String mappedId = idConverters.getPluginFor(type)// .orElse(DefaultIdConverter.INSTANCE)// @@ -259,8 +259,8 @@ public class RepositoryEntityLinks extends AbstractEntityLinks { */ private Link getSearchResourceLinkFor(Class type, LinkRelation rel, Pageable pageable, Sort sort) { - Assert.notNull(type, "Domain type must not be null!"); - Assert.notNull(rel, "Relation name must not be null!"); + Assert.notNull(type, "Domain type must not be null"); + Assert.notNull(rel, "Relation name must not be null"); SearchResourceMappings searchMappings = mappings.getSearchResourceMappings(type); MethodResourceMapping mapping = searchMappings.getExportedMethodMappingForRel(rel); diff --git a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/support/RepositoryLinkBuilder.java b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/support/RepositoryLinkBuilder.java index 6d5f5e766..ff6955958 100644 --- a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/support/RepositoryLinkBuilder.java +++ b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/support/RepositoryLinkBuilder.java @@ -58,7 +58,7 @@ public class RepositoryLinkBuilder extends LinkBuilderSupport getPathSegments(Method method) { - Assert.notNull(method, "Method must not be null!"); + Assert.notNull(method, "Method must not be null"); String mapping = DISCOVERER.getMapping(method.getDeclaringClass(), method); diff --git a/spring-data-rest-webmvc/src/test/java/org/springframework/data/rest/webmvc/RepositoryRestExceptionHandlerUnitTests.java b/spring-data-rest-webmvc/src/test/java/org/springframework/data/rest/webmvc/RepositoryRestExceptionHandlerUnitTests.java index 16fb81a0e..b453ccd1b 100755 --- a/spring-data-rest-webmvc/src/test/java/org/springframework/data/rest/webmvc/RepositoryRestExceptionHandlerUnitTests.java +++ b/spring-data-rest-webmvc/src/test/java/org/springframework/data/rest/webmvc/RepositoryRestExceptionHandlerUnitTests.java @@ -61,7 +61,7 @@ class RepositoryRestExceptionHandlerUnitTests { void handlesHttpMessageNotReadableException() { ResponseEntity result = HANDLER - .handleNotReadable(new HttpMessageNotReadableException("Message!", new MockHttpInputMessage(new byte[0]))); + .handleNotReadable(new HttpMessageNotReadableException("Message", new MockHttpInputMessage(new byte[0]))); assertThat(result.getStatusCode()).isEqualTo(HttpStatus.BAD_REQUEST); } @@ -69,7 +69,7 @@ class RepositoryRestExceptionHandlerUnitTests { @Test // DATAREST-507 void handlesConflictCorrectly() { - ResponseEntity result = HANDLER.handleConflict(new DataIntegrityViolationException("Message!")); + ResponseEntity result = HANDLER.handleConflict(new DataIntegrityViolationException("Message")); assertThat(result.getStatusCode()).isEqualTo(HttpStatus.CONFLICT); } @@ -77,7 +77,7 @@ class RepositoryRestExceptionHandlerUnitTests { @Test // DATAREST-706 void forwardsExceptionForMiscellaneousFailure() { - String message = "My Message!"; + String message = "My Message"; ResponseEntity result = HANDLER.handleMiscFailures(new Exception(message)); diff --git a/spring-data-rest-webmvc/src/test/java/org/springframework/data/rest/webmvc/json/patch/JsonPatchUnitTests.java b/spring-data-rest-webmvc/src/test/java/org/springframework/data/rest/webmvc/json/patch/JsonPatchUnitTests.java index b20ce4207..7614a9c36 100755 --- a/spring-data-rest-webmvc/src/test/java/org/springframework/data/rest/webmvc/json/patch/JsonPatchUnitTests.java +++ b/spring-data-rest-webmvc/src/test/java/org/springframework/data/rest/webmvc/json/patch/JsonPatchUnitTests.java @@ -77,7 +77,7 @@ class JsonPatchUnitTests { assertThatExceptionOfType(PatchException.class) .isThrownBy(() -> patch.apply(todos, Todo.class)) - .withMessage("Test against path '/5/description' failed."); + .withMessage("Test against path '/5/description' failed"); assertThat(todos.size()).isEqualTo(6); assertThat(todos.get(1).isComplete()).isFalse(); @@ -101,7 +101,7 @@ class JsonPatchUnitTests { assertThatExceptionOfType(PatchException.class) .isThrownBy(() -> patch.apply(todos, Todo.class)) - .withMessage("Test against path '/5/description' failed."); + .withMessage("Test against path '/5/description' failed"); assertThat(todos.size()).isEqualTo(6); assertThat(todos.get(1).isComplete()).isFalse(); diff --git a/spring-data-rest-webmvc/src/test/java/org/springframework/data/rest/webmvc/json/patch/MoveOperationUnitTests.java b/spring-data-rest-webmvc/src/test/java/org/springframework/data/rest/webmvc/json/patch/MoveOperationUnitTests.java index d53501e8e..a0bb1a77a 100755 --- a/spring-data-rest-webmvc/src/test/java/org/springframework/data/rest/webmvc/json/patch/MoveOperationUnitTests.java +++ b/spring-data-rest-webmvc/src/test/java/org/springframework/data/rest/webmvc/json/patch/MoveOperationUnitTests.java @@ -36,7 +36,7 @@ class MoveOperationUnitTests { assertThatExceptionOfType(PatchException.class) .isThrownBy(() -> move.perform(todos, Todo.class)) - .withMessage("Path '/0/complete' is not nullable."); + .withMessage("Path '/0/complete' is not nullable"); assertThat(todos.get(1).isComplete()).isFalse(); } @@ -67,7 +67,7 @@ class MoveOperationUnitTests { assertThatExceptionOfType(PatchException.class) .isThrownBy(() -> move.perform(todos, Todo.class)) - .withMessage("Path '/0/complete' is not nullable."); + .withMessage("Path '/0/complete' is not nullable"); assertThat(todos.get(1).getDescription()).isEqualTo("B"); }