Polishing.
Fix nullability warnings and update copyright header. Original Pull Request: #3282
This commit is contained in:
committed by
Mark Paluch
parent
5f5e33c5e7
commit
00325610e8
@@ -17,13 +17,15 @@ package org.springframework.data.repository.aot.generate;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.jspecify.annotations.Nullable;
|
||||
|
||||
/**
|
||||
* Value object capturing metadata about a repository.
|
||||
*
|
||||
* @author Mark Paluch
|
||||
* @since 4.0
|
||||
*/
|
||||
record AotRepositoryMetadata(String name, String module,
|
||||
record AotRepositoryMetadata(String name, @Nullable String module,
|
||||
org.springframework.data.repository.aot.generate.AotRepositoryMetadata.RepositoryType type,
|
||||
List<AotRepositoryMethod> methods) {
|
||||
|
||||
|
||||
@@ -39,6 +39,7 @@ import org.springframework.data.repository.core.support.AbstractRepositoryMetada
|
||||
import org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport;
|
||||
import org.springframework.data.repository.core.support.RepositoryFragment;
|
||||
import org.springframework.data.repository.core.support.RepositoryFragmentsContributor;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.ClassUtils;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
|
||||
@@ -82,6 +83,8 @@ class RepositoryBeanDefinitionReader {
|
||||
*/
|
||||
public RepositoryInformation getRepositoryInformation() {
|
||||
|
||||
Assert.notNull(configuration, "Configuration must not be null");
|
||||
|
||||
RepositoryMetadata metadata = AbstractRepositoryMetadata
|
||||
.getMetadata(forName(configuration.getRepositoryInterface()));
|
||||
Class<?> repositoryBaseClass = getRepositoryBaseClass();
|
||||
@@ -178,6 +181,8 @@ class RepositoryBeanDefinitionReader {
|
||||
return (RepositoryFragmentsContributor) BeanUtils.instantiateClass(getClass(bd));
|
||||
}
|
||||
|
||||
Assert.state(beanDefinition.getBeanClassName() != null, "No Repository BeanFactory set");
|
||||
|
||||
Class<?> repositoryFactoryBean = forName(beanDefinition.getBeanClassName());
|
||||
Constructor<?> constructor = ClassUtils.getConstructorIfAvailable(repositoryFactoryBean, Class.class);
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2022-2025 the original author or authors.
|
||||
* Copyright 2025 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2025 the original author or authors.
|
||||
* Copyright 2025 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
Reference in New Issue
Block a user