Browse Source

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.
pull/303/head
Oliver Gierke 8 years ago
parent
commit
7efaa1b18a
  1. 33
      src/main/java/org/springframework/data/repository/config/RepositoryConfigurationExtensionSupport.java

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

@ -114,19 +114,6 @@ public abstract class RepositoryConfigurationExtensionSupport implements Reposit @@ -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 @@ -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 @@ -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();

Loading…
Cancel
Save