Polishing.

Fix nullability warnings and update copyright header.

Original Pull Request: #3282
This commit is contained in:
Christoph Strobl
2025-05-08 15:08:48 +02:00
committed by Mark Paluch
parent 5f5e33c5e7
commit 00325610e8
4 changed files with 10 additions and 3 deletions

View File

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

View File

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

View File

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

View File

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