AbstractTypeHierarchyTraversingFilter leniently ignores non-loadable super classes and interfaces
Issue: SPR-12042
This commit is contained in:
parent
036896a6b8
commit
a3163ceb88
|
@ -18,6 +18,9 @@ package org.springframework.core.type.filter;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import org.apache.commons.logging.Log;
|
||||||
|
import org.apache.commons.logging.LogFactory;
|
||||||
|
|
||||||
import org.springframework.core.type.ClassMetadata;
|
import org.springframework.core.type.ClassMetadata;
|
||||||
import org.springframework.core.type.classreading.MetadataReader;
|
import org.springframework.core.type.classreading.MetadataReader;
|
||||||
import org.springframework.core.type.classreading.MetadataReaderFactory;
|
import org.springframework.core.type.classreading.MetadataReaderFactory;
|
||||||
|
@ -36,6 +39,8 @@ import org.springframework.core.type.classreading.MetadataReaderFactory;
|
||||||
*/
|
*/
|
||||||
public abstract class AbstractTypeHierarchyTraversingFilter implements TypeFilter {
|
public abstract class AbstractTypeHierarchyTraversingFilter implements TypeFilter {
|
||||||
|
|
||||||
|
protected final Log logger = LogFactory.getLog(getClass());
|
||||||
|
|
||||||
private final boolean considerInherited;
|
private final boolean considerInherited;
|
||||||
|
|
||||||
private final boolean considerInterfaces;
|
private final boolean considerInterfaces;
|
||||||
|
@ -72,10 +77,16 @@ public abstract class AbstractTypeHierarchyTraversingFilter implements TypeFilte
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Need to read super class to determine a match...
|
// Need to read super class to determine a match...
|
||||||
|
try {
|
||||||
if (match(metadata.getSuperClassName(), metadataReaderFactory)) {
|
if (match(metadata.getSuperClassName(), metadataReaderFactory)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch (IOException ex) {
|
||||||
|
logger.debug("Could not read super class [" + metadata.getSuperClassName() +
|
||||||
|
"] of type-filtered class [" + metadata.getClassName() + "]");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -90,10 +101,16 @@ public abstract class AbstractTypeHierarchyTraversingFilter implements TypeFilte
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Need to read interface to determine a match...
|
// Need to read interface to determine a match...
|
||||||
|
try {
|
||||||
if (match(ifc, metadataReaderFactory)) {
|
if (match(ifc, metadataReaderFactory)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch (IOException ex) {
|
||||||
|
logger.debug("Could not read interface [" + ifc + "] for type-filtered class [" +
|
||||||
|
metadata.getClassName() + "]");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue