Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 0032561

Browse files
christophstroblmp911de
authored andcommitted
Polishing.
Fix nullability warnings and update copyright header. Original Pull Request: #3282
1 parent 5f5e33c commit 0032561

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

Lines changed: 3 additions & 1 deletion
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, @NullableString 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

Lines changed: 5 additions & 0 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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)

AltStyle によって変換されたページ (->オリジナル) /