|
1 | 1 | /*
|
2 |
| - * Copyright 2002-2012 the original author or authors. |
| 2 | + * Copyright 2002-2014 the original author or authors. |
3 | 3 | *
|
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
5 | 5 | * you may not use this file except in compliance with the License.
|
|
19 | 19 | import java.io.IOException;
|
20 | 20 |
|
21 | 21 | import org.springframework.core.type.ClassMetadata;
|
22 |
| -import org.springframework.core.type.classreading.MetadataReaderFactory; |
23 | 22 | import org.springframework.core.type.classreading.MetadataReader;
|
| 23 | +import org.springframework.core.type.classreading.MetadataReaderFactory; |
24 | 24 |
|
25 | 25 | /**
|
26 | 26 | * Type filter that is aware of traversing over hierarchy.
|
@@ -61,40 +61,38 @@ public boolean match(MetadataReader metadataReader, MetadataReaderFactory metada
|
61 | 61 | return true;
|
62 | 62 | }
|
63 | 63 |
|
64 |
| - if (!this.considerInherited) { |
65 |
| - return false; |
66 |
| - } |
67 |
| - if (metadata.hasSuperClass()) { |
68 |
| - // Optimization to avoid creating ClassReader for super class. |
69 |
| - Boolean superClassMatch = matchSuperClass(metadata.getSuperClassName()); |
70 |
| - if (superClassMatch != null) { |
71 |
| - if (superClassMatch.booleanValue()) { |
72 |
| - return true; |
| 64 | + if (this.considerInherited) { |
| 65 | + if (metadata.hasSuperClass()) { |
| 66 | + // Optimization to avoid creating ClassReader for super class. |
| 67 | + Boolean superClassMatch = matchSuperClass(metadata.getSuperClassName()); |
| 68 | + if (superClassMatch != null) { |
| 69 | + if (superClassMatch.booleanValue()) { |
| 70 | + return true; |
| 71 | + } |
73 | 72 | }
|
74 |
| - } |
75 |
| - else { |
76 |
| - // Need to read super class to determine a match... |
77 |
| - if (match(metadata.getSuperClassName(), metadataReaderFactory)) { |
78 |
| - return true; |
| 73 | + else { |
| 74 | + // Need to read super class to determine a match... |
| 75 | + if (match(metadata.getSuperClassName(), metadataReaderFactory)) { |
| 76 | + return true; |
| 77 | + } |
79 | 78 | }
|
80 | 79 | }
|
81 | 80 | }
|
82 | 81 |
|
83 |
| - if (!this.considerInterfaces) { |
84 |
| - return false; |
85 |
| - } |
86 |
| - for (String ifc : metadata.getInterfaceNames()) { |
87 |
| - // Optimization to avoid creating ClassReader for super class |
88 |
| - Boolean interfaceMatch = matchInterface(ifc); |
89 |
| - if (interfaceMatch != null) { |
90 |
| - if (interfaceMatch.booleanValue()) { |
91 |
| - return true; |
| 82 | + if (this.considerInterfaces) { |
| 83 | + for (String ifc : metadata.getInterfaceNames()) { |
| 84 | + // Optimization to avoid creating ClassReader for super class |
| 85 | + Boolean interfaceMatch = matchInterface(ifc); |
| 86 | + if (interfaceMatch != null) { |
| 87 | + if (interfaceMatch.booleanValue()) { |
| 88 | + return true; |
| 89 | + } |
92 | 90 | }
|
93 |
| - } |
94 |
| - else { |
95 |
| - // Need to read interface to determine a match... |
96 |
| - if (match(ifc, metadataReaderFactory)) { |
97 |
| - return true; |
| 91 | + else { |
| 92 | + // Need to read interface to determine a match... |
| 93 | + if (match(ifc, metadataReaderFactory)) { |
| 94 | + return true; |
| 95 | + } |
98 | 96 | }
|
99 | 97 | }
|
100 | 98 | }
|
@@ -132,7 +130,7 @@ protected Boolean matchSuperClass(String superClassName) {
|
132 | 130 | /**
|
133 | 131 | * Override this to match on interface type name.
|
134 | 132 | */
|
135 |
| - protected Boolean matchInterface(String interfaceNames) { |
| 133 | + protected Boolean matchInterface(String interfaceName) { |
136 | 134 | return null;
|
137 | 135 | }
|
138 | 136 |
|
|
0 commit comments