15
15
*/
16
16
package org .springframework .data .repository .config ;
17
17
18
- import java .io .IOException ;
19
18
import java .util .ArrayList ;
20
19
import java .util .List ;
21
20
31
30
import org .springframework .core .env .EnvironmentCapable ;
32
31
import org .springframework .core .env .StandardEnvironment ;
33
32
import org .springframework .core .io .ResourceLoader ;
34
- import org .springframework .core .type .classreading .MetadataReader ;
35
- import org .springframework .core .type .classreading .MetadataReaderFactory ;
36
33
import org .springframework .core .type .filter .AssignableTypeFilter ;
37
34
import org .springframework .data .repository .core .support .RepositoryFactorySupport ;
38
35
import org .springframework .util .Assert ;
@@ -162,7 +159,7 @@ private boolean multipleStoresDetected() {
162
159
ClassPathScanningCandidateComponentProvider scanner = new ClassPathScanningCandidateComponentProvider (false );
163
160
scanner .setEnvironment (environment );
164
161
scanner .setResourceLoader (resourceLoader );
165
- scanner .addIncludeFilter (new LenientAssignableTypeFilter (RepositoryFactorySupport .class ));
162
+ scanner .addIncludeFilter (new AssignableTypeFilter (RepositoryFactorySupport .class ));
166
163
167
164
if (scanner .findCandidateComponents (MODULE_DETECTION_PACKAGE ).size () > 1 ) {
168
165
@@ -172,38 +169,4 @@ private boolean multipleStoresDetected() {
172
169
173
170
return false ;
174
171
}
175
-
176
- /**
177
- * Special {@link AssignableTypeFilter} that generally considers exceptions during type matching indicating a
178
- * non-match. TODO: Remove after upgrade to Spring 4.0.7.
179
- *
180
- * @see https://jira.spring.io/browse/SPR-12042
181
- * @author Oliver Gierke
182
- */
183
- private static class LenientAssignableTypeFilter extends AssignableTypeFilter {
184
-
185
- /**
186
- * Creates a new {@link LenientAssignableTypeFilter} for the given target type.
187
- *
188
- * @param targetType must not be {@literal null}.
189
- */
190
- public LenientAssignableTypeFilter (Class <?> targetType ) {
191
- super (targetType );
192
- }
193
-
194
- /*
195
- * (non-Javadoc)
196
- * @see org.springframework.core.type.filter.AbstractTypeHierarchyTraversingFilter#match(org.springframework.core.type.classreading.MetadataReader, org.springframework.core.type.classreading.MetadataReaderFactory)
197
- */
198
- @ Override
199
- public boolean match (MetadataReader metadataReader , MetadataReaderFactory metadataReaderFactory )
200
- throws IOException {
201
-
202
- try {
203
- return super .match (metadataReader , metadataReaderFactory );
204
- } catch (Exception o_O ) {
205
- return false ;
206
- }
207
- }
208
- }
209
172
}
0 commit comments