try {
boolean hasDefault = false;
NodeList<SwitchMember> memberList = node.getMembers();
SwitchMember[] members = memberList.toArray(new SwitchMember[memberList.size()]);
for (int i = 0; i < members.length; i++) {
SwitchMember switchMember = members[i];
if (switchMember instanceof SwitchDefault) {
hasDefault = true;
// If this is the last member and there are no statements, return false
if (switchMember.getStatements().isEmpty() && i + 1 == members.length) {
return false;
}
}
// For switch members with no statements, don't visit the children, otherwise, return false if
// no return is found in the children statements
if (!switchMember.getStatements().isEmpty() && !switchMember.accept(this)) {
return false;
}
}
return hasDefault;
} finally {