&& !Decl.isLocalToInitializer(decl)
&& !isWithinSuperInvocation()) {
// First check whether the expression is captured from an enclosing scope
TypeDeclaration outer = null;
// get the ClassOrInterface container of the declaration
Scope stop = Decl.getClassOrInterfaceContainer(decl, false);
if (stop instanceof TypeDeclaration) {// reified scope
Scope scope = expr.getScope();
while (!(scope instanceof Package)) {
if (scope.equals(stop)) {
outer = (TypeDeclaration)stop;
break;
}
scope = scope.getContainer();
}
}
// If not it might be inherited...
if (outer == null) {
outer = expr.getScope().getInheritingDeclaration(decl);