Details
-
Type:
New Feature
-
Status:
Closed
-
Priority:
2 Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
Description
Support for matching on subtypes for class includes is supported in AW and we even had it working in spring branch at some point.
This feature would be beneficial for Spring's class hierarchy walker because it will allow to add included classes based on their supertypes (that are captured from field types by the class crawler).
Here is the old code Jonas wrote for subtype matching.
public boolean isAdaptable(ClassInfo classInfo) {
String fullName = classInfo.getName();
if (isInAdaptableCache(fullName)) { return isCachedAdaptable(fullName); }
// We make inner classes of logical classes not instrumented while logical
// bases are instrumented
String name = baseClassNameWithoutInners(fullName);
if (isLogical(name)) { return cacheIsAdaptable(fullName, name.equals(fullName)); }
if (hasCustomAdatper(fullName)) { return cacheIsAdaptable(fullName, true); }
if (getSpec(name) != null) { return cacheIsAdaptable(name, true); }
if (getSpec(fullName) != null) { return cacheIsAdaptable(name, true); }
classInfoFactory.setClassInfo(classInfo);
ExpressionContext ctxt = expressionHelper.createWithinExpressionContext(classInfo);
if (isExplicitlyExcluded(fullName, ctxt)) return cacheIsAdaptable(fullName, false);
if (isExplicitlyIncluded(ctxt)) { return cacheIsAdaptable(fullName, true); }
return cacheIsAdaptable(fullName, false);
}