|
|
|
does this mean selecting by interfaces will work also?
Implemented in trunk and tested with examples from the Wicket framework.
Hi Eugene,
I've added 2 tests that demonstrate these 2 cases: * Allow a user to specify an interface - all implementing classes will be instrumented * Allow a user to specify a parent class - all subclasses (including parent class) will be instrumented And both of the tests fail if I just instrument the interface or the base class. The tests name are: InterfaceInstrumentTest SubtypeInstrumentTest They are currently disabled. Hung, your test cases are NOT using expression for subtype matching. Please check the existing SubtypeMatchingTest that I've added and incorporate your tests into that one. Anyways, I've committed fix for your test apps.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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);
}