Consistency of return statements is checked between the case statements. If there is no default, then the switch can fall through. If there is a default,we check to see if all code paths in the default return or if there is a code path that can fall through. @return logical OR of END_ flags
()
| 709 | * @return logical OR of END_* flags |
| 710 | */ |
| 711 | private int endCheckSwitch() { |
| 712 | int rv = END_UNREACHED; |
| 713 | |
| 714 | // examine the cases |
| 715 | // for (n = first.next; n != null; n = n.next) |
| 716 | // { |
| 717 | // if (n.type == Token.CASE) { |
| 718 | // rv |= ((Jump)n).target.endCheck(); |
| 719 | // } else |
| 720 | // break; |
| 721 | // } |
| 722 | |
| 723 | // // we don't care how the cases drop into each other |
| 724 | // rv &= ~END_DROPS_OFF; |
| 725 | |
| 726 | // // examine the default |
| 727 | // n = ((Jump)this).getDefault(); |
| 728 | // if (n != null) |
| 729 | // rv |= n.endCheck(); |
| 730 | // else |
| 731 | // rv |= END_DROPS_OFF; |
| 732 | |
| 733 | // // remove the switch block |
| 734 | // rv |= getIntProp(CONTROL_BLOCK_PROP, END_UNREACHED); |
| 735 | |
| 736 | return rv; |
| 737 | } |
| 738 | |
| 739 | /** |
| 740 | * If the block has a finally, return consistency is checked in the finally block. If all code |