Skip to content

Commit 3dff7ea

Browse files
committed
DATACMNS-1263 - Polishing.
Fixed nullability constraints on method RepositoryConfigurationExtensionSupport.loadRepositoryInterface(…). Tweaked method declaration order to have public methods first, protected methods after that. Fixed a tiny typo. Original pull request: #276.
1 parent f827ec7 commit 3dff7ea

File tree

1 file changed

+17
-16
lines changed

1 file changed

+17
-16
lines changed

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

+17-16
Original file line numberDiff line numberDiff line change
@@ -114,19 +114,6 @@ public <T extends RepositoryConfigurationSource> Collection<RepositoryConfigurat
114114
return result;
115115
}
116116

117-
/**
118-
* Returns the {@link ClassLoader} to load repository interfaces for configuration inspection. Subclasses may override
119-
* this method to provide a customized class loader.
120-
*
121-
* @param loader must not be {@literal null}.
122-
* @return the {@link ClassLoader} for repository interfaces configuration inspection.
123-
* @since 2.1
124-
*/
125-
@Nullable
126-
protected ClassLoader getConfigurationInspectionClassLoader(ResourceLoader loader) {
127-
return loader.getClassLoader();
128-
}
129-
130117
/*
131118
* (non-Javadoc)
132119
* @see org.springframework.data.repository.config.RepositoryConfigurationExtension#getDefaultNamedQueryLocation()
@@ -188,9 +175,22 @@ protected Collection<Class<?>> getIdentifyingTypes() {
188175
return Collections.emptySet();
189176
}
190177

178+
/**
179+
* Returns the {@link ClassLoader} to load repository interfaces for configuration inspection. Subclasses may override
180+
* this method to provide a customized class loader.
181+
*
182+
* @param loader must not be {@literal null}.
183+
* @return the {@link ClassLoader} for repository interfaces configuration inspection.
184+
* @since 2.1
185+
*/
186+
@Nullable
187+
protected ClassLoader getConfigurationInspectionClassLoader(ResourceLoader loader) {
188+
return loader.getClassLoader();
189+
}
190+
191191
/**
192192
* Sets the given source on the given {@link AbstractBeanDefinition} and registers it inside the given
193-
* {@link BeanDefinitionRegistry}. For {@link BeanDefinition}s to be registerd once-and-only-once for all
193+
* {@link BeanDefinitionRegistry}. For {@link BeanDefinition}s to be registered once-and-only-once for all
194194
* configuration elements (annotation or XML), prefer calling
195195
* {@link #registerIfNotAlreadyRegistered(AbstractBeanDefinition, BeanDefinitionRegistry, String, Object)} with a
196196
* dedicated bean name to avoid the bead definition being registered multiple times. *
@@ -314,11 +314,12 @@ protected boolean useRepositoryConfiguration(RepositoryMetadata metadata) {
314314
* {@link ClassLoader}.
315315
*
316316
* @param configuration must not be {@literal null}.
317-
* @param classLoader must not be {@literal null}.
317+
* @param classLoader can be {@literal null}.
318318
* @return the repository interface or {@literal null} if it can't be loaded.
319319
*/
320320
@Nullable
321-
private Class<?> loadRepositoryInterface(RepositoryConfiguration<?> configuration, ClassLoader classLoader) {
321+
private Class<?> loadRepositoryInterface(RepositoryConfiguration<?> configuration,
322+
@Nullable ClassLoader classLoader) {
322323

323324
String repositoryInterface = configuration.getRepositoryInterface();
324325

0 commit comments

Comments
 (0)