{
if (ScopeUtils.inCodeBlock(aAST)) {
return false;
}
final Scope declaredScope;
if (aAST.getType() == TokenTypes.ENUM_CONSTANT_DEF) {
declaredScope = Scope.PUBLIC;
}
else {
declaredScope = ScopeUtils.getScopeFromMods(
aAST.findFirstToken(TokenTypes.MODIFIERS));
}
final Scope scope =
ScopeUtils.inInterfaceOrAnnotationBlock(aAST)
? Scope.PUBLIC : declaredScope;
final Scope surroundingScope = ScopeUtils.getSurroundingScope(aAST);
return scope.isIn(mScope)
&& ((surroundingScope == null) || surroundingScope.isIn(mScope))
&& ((mExcludeScope == null)
|| !scope.isIn(mExcludeScope)
|| ((surroundingScope != null)
&& !surroundingScope.isIn(mExcludeScope)));
}