Skip to content

Commit e19bea7

Browse files
Polishing.
Fix nullability warnings and update copyright header. Original Pull Request: #3282
1 parent 85df71e commit e19bea7

File tree

4 files changed

+10
-3
lines changed

4 files changed

+10
-3
lines changed

src/main/java/org/springframework/data/repository/aot/generate/AotRepositoryMetadata.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,15 @@
1717

1818
import java.util.List;
1919

20+
import org.jspecify.annotations.Nullable;
21+
2022
/**
2123
* Value object capturing metadata about a repository.
2224
*
2325
* @author Mark Paluch
2426
* @since 4.0
2527
*/
26-
record AotRepositoryMetadata(String name, String module,
28+
record AotRepositoryMetadata(String name, @Nullable String module,
2729
org.springframework.data.repository.aot.generate.AotRepositoryMetadata.RepositoryType type,
2830
List<AotRepositoryMethod> methods) {
2931

src/main/java/org/springframework/data/repository/config/RepositoryBeanDefinitionReader.java

+5
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
import org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport;
4040
import org.springframework.data.repository.core.support.RepositoryFragment;
4141
import org.springframework.data.repository.core.support.RepositoryFragmentsContributor;
42+
import org.springframework.util.Assert;
4243
import org.springframework.util.ClassUtils;
4344
import org.springframework.util.ObjectUtils;
4445

@@ -82,6 +83,8 @@ public RepositoryBeanDefinitionReader(RegisteredBean bean) {
8283
*/
8384
public RepositoryInformation getRepositoryInformation() {
8485

86+
Assert.notNull(configuration, "Configuration must not be null");
87+
8588
RepositoryMetadata metadata = AbstractRepositoryMetadata
8689
.getMetadata(forName(configuration.getRepositoryInterface()));
8790
Class<?> repositoryBaseClass = getRepositoryBaseClass();
@@ -178,6 +181,8 @@ private RepositoryFragmentsContributor getFragmentsContributor(Class<?> reposito
178181
return (RepositoryFragmentsContributor) BeanUtils.instantiateClass(getClass(bd));
179182
}
180183

184+
Assert.state(beanDefinition.getBeanClassName() != null, "No Repository BeanFactory set");
185+
181186
Class<?> repositoryFactoryBean = forName(beanDefinition.getBeanClassName());
182187
Constructor<?> constructor = ClassUtils.getConstructorIfAvailable(repositoryFactoryBean, Class.class);
183188

src/test/java/org/springframework/data/repository/config/DummyRegistrarWithContributor.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2022-2025 the original author or authors.
2+
* Copyright 2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

src/test/java/org/springframework/data/repository/config/EnableRepositoriesWithContributor.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2025 the original author or authors.
2+
* Copyright 2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

0 commit comments

Comments
 (0)