@@ -49,7 +49,7 @@ public class JpaRepositoryExtension extends CdiRepositoryExtensionSupport {
49
49
50
50
private static final Log LOGGER = LogFactory .getLog (JpaRepositoryExtension .class );
51
51
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 <>();
53
53
54
54
public JpaRepositoryExtension () {
55
55
LOGGER .info ("Activating CDI extension for Spring Data JPA repositories." );
@@ -64,11 +64,12 @@ public JpaRepositoryExtension() {
64
64
*/
65
65
@ SuppressWarnings ("unchecked" )
66
66
<X > void processBean (@ Observes ProcessBean <X > processBean ) {
67
+
67
68
Bean <X > bean = processBean .getBean ();
68
69
for (Type type : bean .getTypes ()) {
69
70
// Check if the bean is an EntityManager.
70
71
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 ());
72
73
if (bean .isAlternative () || !entityManagers .containsKey (qualifiers )) {
73
74
LOGGER .debug (String .format ("Discovered '%s' with qualifiers %s." , EntityManager .class .getName (), qualifiers ));
74
75
entityManagers .put (qualifiers , (Bean <EntityManager >) bean );
@@ -122,7 +123,7 @@ private <T> CdiRepositoryBean<T> createRepositoryBean(Class<T> repositoryType, S
122
123
}
123
124
124
125
// Construct and return the repository bean.
125
- return new JpaRepositoryBean <T >(beanManager , entityManagerBean , qualifiers , repositoryType ,
126
+ return new JpaRepositoryBean <>(beanManager , entityManagerBean , qualifiers , repositoryType ,
126
127
Optional .of (getCustomImplementationDetector ()));
127
128
}
128
129
}
0 commit comments