From 7efaa1b18aedaa23ee896f7e895e81dd03b0a1ab Mon Sep 17 00:00:00 2001 From: Oliver Gierke Date: Mon, 26 Feb 2018 15:21:58 +0100 Subject: [PATCH] DATACMNS-1263 - Polishing. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- ...positoryConfigurationExtensionSupport.java | 33 ++++++++++--------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/src/main/java/org/springframework/data/repository/config/RepositoryConfigurationExtensionSupport.java b/src/main/java/org/springframework/data/repository/config/RepositoryConfigurationExtensionSupport.java index 591a6516a..6fb0007c0 100644 --- a/src/main/java/org/springframework/data/repository/config/RepositoryConfigurationExtensionSupport.java +++ b/src/main/java/org/springframework/data/repository/config/RepositoryConfigurationExtensionSupport.java @@ -114,19 +114,6 @@ public abstract class RepositoryConfigurationExtensionSupport implements Reposit return result; } - /** - * Returns the {@link ClassLoader} to load repository interfaces for configuration inspection. Subclasses may override - * this method to provide a customized class loader. - * - * @param loader must not be {@literal null}. - * @return the {@link ClassLoader} for repository interfaces configuration inspection. - * @since 2.1 - */ - @Nullable - protected ClassLoader getConfigurationInspectionClassLoader(ResourceLoader loader) { - return loader.getClassLoader(); - } - /* * (non-Javadoc) * @see org.springframework.data.repository.config.RepositoryConfigurationExtension#getDefaultNamedQueryLocation() @@ -188,9 +175,22 @@ public abstract class RepositoryConfigurationExtensionSupport implements Reposit return Collections.emptySet(); } + /** + * Returns the {@link ClassLoader} to load repository interfaces for configuration inspection. Subclasses may override + * this method to provide a customized class loader. + * + * @param loader must not be {@literal null}. + * @return the {@link ClassLoader} for repository interfaces configuration inspection. + * @since 2.1 + */ + @Nullable + protected ClassLoader getConfigurationInspectionClassLoader(ResourceLoader loader) { + return loader.getClassLoader(); + } + /** * Sets the given source on the given {@link AbstractBeanDefinition} and registers it inside the given - * {@link BeanDefinitionRegistry}. For {@link BeanDefinition}s to be registerd once-and-only-once for all + * {@link BeanDefinitionRegistry}. For {@link BeanDefinition}s to be registered once-and-only-once for all * configuration elements (annotation or XML), prefer calling * {@link #registerIfNotAlreadyRegistered(AbstractBeanDefinition, BeanDefinitionRegistry, String, Object)} with a * dedicated bean name to avoid the bead definition being registered multiple times. * @@ -314,11 +314,12 @@ public abstract class RepositoryConfigurationExtensionSupport implements Reposit * {@link ClassLoader}. * * @param configuration must not be {@literal null}. - * @param classLoader must not be {@literal null}. + * @param classLoader can be {@literal null}. * @return the repository interface or {@literal null} if it can't be loaded. */ @Nullable - private Class loadRepositoryInterface(RepositoryConfiguration configuration, ClassLoader classLoader) { + private Class loadRepositoryInterface(RepositoryConfiguration configuration, + @Nullable ClassLoader classLoader) { String repositoryInterface = configuration.getRepositoryInterface();