public static boolean canCompleteNormally ( CaseTree caseTree ) { List < ? extends StatementTree > statements = caseTree . getStatements ( ) ; if ( statements . isEmpty ( ) ) { return true ; } // We only care whether the last statement completes; javac would have already // reported an error if that statement wasn't reachable, and the answer is // independent of any preceding statements. // TODO(cushon): This isn't really making an exception for System.exit in the prior statements. return canCompleteNormally ( getLast ( statements ) ) ; }
Returns true if the given case tree can complete normally as defined by JLS 14 . 21 .