Skip to content

Commit 5e6c791

Browse files
committed
Polishing.
See #2359
1 parent 8db770d commit 5e6c791

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/main/java/org/springframework/data/jpa/repository/cdi/JpaRepositoryExtension.java

+4-3
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public class JpaRepositoryExtension extends CdiRepositoryExtensionSupport {
4949

5050
private static final Log LOGGER = LogFactory.getLog(JpaRepositoryExtension.class);
5151

52-
private final Map<Set<Annotation>, Bean<EntityManager>> entityManagers = new HashMap<Set<Annotation>, Bean<EntityManager>>();
52+
private final Map<Set<Annotation>, Bean<EntityManager>> entityManagers = new HashMap<>();
5353

5454
public JpaRepositoryExtension() {
5555
LOGGER.info("Activating CDI extension for Spring Data JPA repositories.");
@@ -64,11 +64,12 @@ public JpaRepositoryExtension() {
6464
*/
6565
@SuppressWarnings("unchecked")
6666
<X> void processBean(@Observes ProcessBean<X> processBean) {
67+
6768
Bean<X> bean = processBean.getBean();
6869
for (Type type : bean.getTypes()) {
6970
// Check if the bean is an EntityManager.
7071
if (type instanceof Class<?> && EntityManager.class.isAssignableFrom((Class<?>) type)) {
71-
Set<Annotation> qualifiers = new HashSet<Annotation>(bean.getQualifiers());
72+
Set<Annotation> qualifiers = new HashSet<>(bean.getQualifiers());
7273
if (bean.isAlternative() || !entityManagers.containsKey(qualifiers)) {
7374
LOGGER.debug(String.format("Discovered '%s' with qualifiers %s.", EntityManager.class.getName(), qualifiers));
7475
entityManagers.put(qualifiers, (Bean<EntityManager>) bean);
@@ -122,7 +123,7 @@ private <T> CdiRepositoryBean<T> createRepositoryBean(Class<T> repositoryType, S
122123
}
123124

124125
// Construct and return the repository bean.
125-
return new JpaRepositoryBean<T>(beanManager, entityManagerBean, qualifiers, repositoryType,
126+
return new JpaRepositoryBean<>(beanManager, entityManagerBean, qualifiers, repositoryType,
126127
Optional.of(getCustomImplementationDetector()));
127128
}
128129
}

src/main/java/org/springframework/data/jpa/repository/config/JpaMetamodelMappingContextFactoryBean.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public Class<?> getObjectType() {
7171
* @see org.springframework.beans.factory.config.AbstractFactoryBean#createInstance()
7272
*/
7373
@Override
74-
protected JpaMetamodelMappingContext createInstance() throws Exception {
74+
protected JpaMetamodelMappingContext createInstance() {
7575

7676
if (LOG.isDebugEnabled()) {
7777
LOG.debug("Initializing JpaMetamodelMappingContext…");

0 commit comments

Comments
 (0)