Remove punctuation in Exception messages.

Closes #2152.
This commit is contained in:
John Blum
2022-06-08 16:01:48 -07:00
parent 93d0d7426e
commit 29b7305d71
121 changed files with 478 additions and 478 deletions

View File

@@ -37,7 +37,7 @@ public enum StringToLdapNameConverter implements Converter<String, Name> {
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);
}
}
}

View File

@@ -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<ConvertiblePair> convertiblePairs = new HashSet<ConvertiblePair>();
@@ -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);

View File

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

View File

@@ -92,7 +92,7 @@ class EntityLookupConfiguration implements EntityLookupRegistrar {
*/
public MappingBuilder(Class<R> 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<R> repositoryType, Converter<T, ID> 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<EntityLookup<?>> 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<Object, Object, Repository<? extends T, ?>> 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<? extends T, ?>) //
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<R> repositoryType, Converter<T, ID> identifierMapping,
Lookup<R, ID> 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;

View File

@@ -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<Class<?>, Pattern> entry : this.patterns.entrySet()) {
if (entry.getKey().isAssignableFrom(type)) {

View File

@@ -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<ProjectionDefinition> 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<String, Class<?>> 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<String, ProjectionDefinition> byName = new HashMap<String, ProjectionDefinition>();
@@ -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);
}

View File

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

View File

@@ -48,7 +48,7 @@ import org.springframework.util.ReflectionUtils;
public class AnnotatedEventHandlerInvoker implements ApplicationListener<RepositoryEvent>, 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<Class<? extends RepositoryEvent>, EventHandlerMethod> handlerMethods = new LinkedMultiValueMap<Class<? extends RepositoryEvent>, EventHandlerMethod>();
@@ -77,7 +77,7 @@ public class AnnotatedEventHandlerInvoker implements ApplicationListener<Reposit
}
if (LOG.isDebugEnabled()) {
LOG.debug("Invoking {} handler for {}.", event.getClass().getSimpleName(), event.getSource());
LOG.debug("Invoking {} handler for {}", event.getClass().getSimpleName(), event.getSource());
}
ReflectionUtils.invokeMethod(handlerMethod.method, handlerMethod.handler, parameters.toArray());
@@ -169,9 +169,9 @@ public class AnnotatedEventHandlerInvoker implements ApplicationListener<Reposit
public EventHandlerMethod(Class<?> 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;

View File

@@ -54,7 +54,7 @@ public class ValidatingRepositoryEventListener extends AbstractRepositoryEventLi
*/
public ValidatingRepositoryEventListener(ObjectFactory<PersistentEntities> persistentEntitiesFactory) {
Assert.notNull(persistentEntitiesFactory, "PersistentEntities must not be null!");
Assert.notNull(persistentEntitiesFactory, "PersistentEntities must not be null");
this.persistentEntitiesFactory = persistentEntitiesFactory;
this.validators = new LinkedMultiValueMap<String, Validator>();

View File

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

View File

@@ -40,7 +40,7 @@ public class ConfigurableHttpMethods implements HttpMethods {
private ConfigurableHttpMethods(Collection<HttpMethod> 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<HttpMethod> 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<HttpMethod> 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);
}

View File

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

View File

@@ -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<HttpMethod> methods = new HashSet<HttpMethod>();
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());

View File

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

View File

@@ -46,7 +46,7 @@ public interface HttpMethods extends Streamable<HttpMethod> {
*/
public static HttpMethods of(Collection<HttpMethod> methods) {
Assert.notNull(methods, "HTTP methods must not be null!");
Assert.notNull(methods, "HTTP methods must not be null");
return ConfigurableHttpMethods.of(methods);
}

View File

@@ -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<PersistentProperty<?>, 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)) {

View File

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

View File

@@ -37,7 +37,7 @@ public class ParametersMetadata implements Iterable<ParameterMetadata> {
*/
ParametersMetadata(List<ParameterMetadata> parameterMetadata) {
Assert.notNull(parameterMetadata, "Parameter metadata must not be null!");
Assert.notNull(parameterMetadata, "Parameter metadata must not be null");
this.parameterMetadata = parameterMetadata;
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -34,8 +34,8 @@ import org.springframework.util.Assert;
*/
public class SearchResourceMappings implements Iterable<MethodResourceMapping>, 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<MethodResourceMapping>,
*/
public SearchResourceMappings(List<MethodResourceMapping> mappings) {
Assert.notNull(mappings, "MethodResourceMappings must not be null!");
Assert.notNull(mappings, "MethodResourceMappings must not be null");
this.mappings = new HashMap<Path, MethodResourceMapping>(mappings.size());
@@ -74,7 +74,7 @@ public class SearchResourceMappings implements Iterable<MethodResourceMapping>,
*/
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<MethodResourceMapping>,
*/
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<MethodResourceMapping>,
*/
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) {

View File

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

View File

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

View File

@@ -53,9 +53,9 @@ public class DefaultSelfLinkProvider implements SelfLinkProvider {
public DefaultSelfLinkProvider(PersistentEntities entities, EntityLinks entityLinks,
List<? extends EntityLookup<?>> 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);
}

View File

@@ -40,7 +40,7 @@ public class RepositoryRelProvider implements LinkRelationProvider {
*/
public RepositoryRelProvider(ObjectFactory<ResourceMappings> mappings) {
Assert.notNull(mappings, "ResourceMappings must not be null!");
Assert.notNull(mappings, "ResourceMappings must not be null");
this.mappings = mappings;
}

View File

@@ -47,8 +47,8 @@ public class UnwrappingRepositoryInvokerFactory implements RepositoryInvokerFact
public UnwrappingRepositoryInvokerFactory(RepositoryInvokerFactory delegate,
List<? extends EntityLookup<?>> 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<EntityLookup<?>> 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;

View File

@@ -39,7 +39,7 @@ public interface MapUtils {
*/
public static <K, V> Map<K, Collection<V>> toMap(MultiValueMap<K, V> map) {
Assert.notNull(map, "Given map must not be null!");
Assert.notNull(map, "Given map must not be null");
Map<K, Collection<V>> result = new LinkedHashMap<K, Collection<V>>(map.size());
for (Entry<K, List<V>> entry : map.entrySet()) {

View File

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

View File

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

View File

@@ -169,7 +169,7 @@ public abstract class AbstractWebIntegrationTests {
String href = JsonPath.<JSONArray> 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> 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();
};
}

View File

@@ -36,8 +36,8 @@ public class RequestParameters {
private RequestParameters(Map<String, String[]> 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<String, String[]>(parameters);
this.parameters.put(key, values);

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -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<Object>(HttpStatus.I_AM_A_TEAPOT);
}
}

View File

@@ -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()).//

View File

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

View File

@@ -54,7 +54,7 @@ class AbstractRepositoryRestController {
*/
public AbstractRepositoryRestController(PagedResourcesAssembler<Object> pagedResourcesAssembler) {
Assert.notNull(pagedResourcesAssembler, "PagedResourcesAssembler must not be null!");
Assert.notNull(pagedResourcesAssembler, "PagedResourcesAssembler must not be null");
this.pagedResourcesAssembler = pagedResourcesAssembler;
}

View File

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

View File

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

View File

@@ -53,9 +53,9 @@ public class ControllerUtils {
public static <R extends RepresentationModel<?>> ResponseEntity<RepresentationModel<?>> 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));
}

View File

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

View File

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

View File

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

View File

@@ -64,7 +64,7 @@ public class PersistentEntityResource extends EntityModel<Object> {
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<Object> {
*/
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<Object> {
*/
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<Object> {
public Builder withLinks(List<Link> links) {
Assert.notNull(links, "Links must not be null!");
Assert.notNull(links, "Links must not be null");
this.links.addAll(links);
return this;

View File

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

View File

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

View File

@@ -41,7 +41,7 @@ public class ProfileResourceProcessor implements RepresentationModelProcessor<Re
*/
public ProfileResourceProcessor(RepositoryRestConfiguration configuration) {
Assert.notNull(configuration, "RepositoryRestConfiguration must not be null!");
Assert.notNull(configuration, "RepositoryRestConfiguration must not be null");
this.configuration = configuration;
}

View File

@@ -60,9 +60,9 @@ public class RepositoryController extends AbstractRepositoryRestController {
super(assembler);
Assert.notNull(repositories, "Repositories must not be null!");
Assert.notNull(entityLinks, "EntityLinks must not be null!");
Assert.notNull(mappings, "ResourceMappings must not be null!");
Assert.notNull(repositories, "Repositories must not be null");
Assert.notNull(entityLinks, "EntityLinks must not be null");
Assert.notNull(mappings, "ResourceMappings must not be null");
this.repositories = repositories;
this.entityLinks = entityLinks;

View File

@@ -225,7 +225,7 @@ class RepositoryPropertyReferenceController extends AbstractRepositoryRestContro
return new RepresentationModel<>(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;

View File

@@ -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 <T> ResponseEntity<T> 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<T>(body, headers, status);
}

View File

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

View File

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

View File

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

View File

@@ -38,7 +38,7 @@ public class RepositorySearchesResource extends RepresentationModel<RepositorySe
*/
RepositorySearchesResource(Class<?> domainType) {
Assert.notNull(domainType, "Domain type must not be null!");
Assert.notNull(domainType, "Domain type must not be null");
this.domainType = domainType;
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -53,7 +53,7 @@ class DelegatingHandlerMapping implements MatchableHandlerMapping, Iterable<Hand
*/
public DelegatingHandlerMapping(List<HandlerMapping> 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<Hand
public HandlerSelectionResult(HttpServletRequest request, HandlerMapping mapping, HandlerExecutionChain result,
Exception ignoredException) {
Assert.notNull(request, "HttpServletRequest must not be null!");
Assert.notNull(request, "HttpServletRequest must not be null");
this.request = request;
this.mapping = mapping;

View File

@@ -45,7 +45,7 @@ class HalFormsAdaptingResponseBodyAdvice<T extends RepresentationModel<T>>
implements ResponseBodyAdvice<RepresentationModel<T>> {
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<MediaType> SUPPORTED_MEDIA_TYPES = Arrays.asList(MediaTypes.HAL_JSON,
MediaType.APPLICATION_JSON);

View File

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

View File

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

View File

@@ -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<HttpMessageConverter<?>> messageConverters;
private final RootResourceInformationHandlerMethodArgumentResolver resourceInformationResolver;
@@ -79,11 +79,11 @@ public class PersistentEntityResourceHandlerMethodArgumentResolver implements Ha
BackendIdHandlerMethodArgumentResolver idResolver, DomainObjectReader reader,
PluginRegistry<EntityLookup<?>, 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;

View File

@@ -50,7 +50,7 @@ public class ProjectionDefinitionRegistar implements SmartInstantiationAwareBean
*/
public ProjectionDefinitionRegistar(ObjectFactory<RepositoryRestConfiguration> config) {
Assert.notNull(config, "RepositoryRestConfiguration must not be null!");
Assert.notNull(config, "RepositoryRestConfiguration must not be null");
this.config = config;
}

View File

@@ -50,7 +50,7 @@ public interface RepositoryRestConfigurer {
*/
static RepositoryRestConfigurer withConfig(Consumer<RepositoryRestConfiguration> 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<RepositoryRestConfiguration, CorsRegistry> consumer) {
Assert.notNull(consumer, "Consumer must not be null!");
Assert.notNull(consumer, "Consumer must not be null");
return new RepositoryRestConfigurer() {

View File

@@ -47,7 +47,7 @@ class RepositoryRestConfigurerDelegate implements RepositoryRestConfigurer {
*/
public RepositoryRestConfigurerDelegate(Iterable<RepositoryRestConfigurer> delegates) {
Assert.notNull(delegates, "RepositoryRestConfigurers must not be null!");
Assert.notNull(delegates, "RepositoryRestConfigurers must not be null");
this.delegates = delegates;
}

View File

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

View File

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

View File

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

View File

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

View File

@@ -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> 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> 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> 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> 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<PersistentEntity<?, ? extends PersistentProperty<?>>> candidate = entities
.getPersistentEntity(target.getClass());
@@ -338,9 +338,9 @@ public class DomainObjectReader {
private boolean handleArrayNode(ArrayNode array, Collection<Object> 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<Object> 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<Object>) 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),

View File

@@ -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<String> getValues(Class<? extends Enum<?>> 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);

View File

@@ -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<Order> filteredOrders = new ArrayList<Order>();
@@ -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()));
}

View File

@@ -59,8 +59,8 @@ public class JacksonMetadata implements Iterable<BeanPropertyDefinition> {
*/
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<BeanPropertyDefinition> {
*/
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<BeanPropertyDefinition> {
*/
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<BeanPropertyDefinition> {
*/
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<BeanPropertyDefinition> {
*/
public JsonSerializer<?> getTypeSerializer(Class<?> type) {
Assert.notNull(type, "Type must not be null!");
Assert.notNull(type, "Type must not be null");
try {

View File

@@ -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<? extends Enum<?>>) getActualType(property.getType()).getRawClass(),

View File

@@ -70,9 +70,9 @@ public class JsonSchema {
public JsonSchema(String title, String description, Collection<AbstractJsonSchemaProperty<?>> 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<AbstractJsonSchemaProperty<?>> properties) {
Assert.notNull(properties, "JsonSchemaPropertys must not be null!");
Assert.notNull(properties, "JsonSchemaPropertys must not be null");
this.properties = new HashMap<String, JsonSchema.AbstractJsonSchemaProperty<?>>();
this.requiredProperties = new ArrayList<String>();
@@ -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<String> values) {
Assert.notNull(values, "Values must not be null!");
Assert.notNull(values, "Values must not be null");
this.values = Collections.unmodifiableList(values);
return this;

View File

@@ -70,8 +70,8 @@ class MappedProperties {
*/
private MappedProperties(PersistentEntity<?, ? extends PersistentProperty<?>> 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;

View File

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

View File

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

View File

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

View File

@@ -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<Object> {
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<EntityLookup<?>, Class<?>> lookups) {
Assert.notNull(lookups, "EntityLookups must not be null!");
Assert.notNull(lookups, "EntityLookups must not be null");
this.lookups = lookups;
}

View File

@@ -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<AbstractJsonSchemaProperty<?>>();
}
@@ -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<? extends PersistentProperty<?>> 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;

View File

@@ -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<PersistentProperty<?>> 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<String, List<PersistentProperty<?>>> 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);
}

View File

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

View File

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

View File

@@ -39,7 +39,7 @@ public class JsonPatchPatchConverter implements PatchConverter<JsonNode> {
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<JsonNode> {
}
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));
}
}

View File

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

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