Java Reference
In-Depth Information
♦ There is a reachable
break
statement that exits the
for
statement.
The contained statement is reachable iff the
for
statement is reachable and the con-
dition expression is not a constant expression whose value is
false
.
• An enhanced
for
statement can complete normally iff it is reachable.
• A
break
,
continue
,
return
, or
throw
statement cannot complete normally.
• A
synchronized
statement can complete normally iff the contained statement can
complete normally.
The contained statement is reachable iff the
synchronized
statement is reachable.
• A
try
statement can complete normally iff both of the following are true:
♦ The
try
block can complete normally or any
catch
block can complete normally.
♦ If the
try
statement has a
finally
block, then the
finally
block can complete nor-
mally.
• The
try
block is reachable iff the
try
statement is reachable.
• A
catch
block
C
is reachable iff both of the following are true:
♦ Either the type of
C
's parameter is an unchecked exception type or
Throwable
;
or some expression or
throw
statement in the
try
block is reachable and can
throw a checked exception whose type is assignable to the parameter of the
catch
clause
C
.
An expression is reachable iff the innermost statement containing it is reach-
able.
See §
15.6
for normal and abrupt completion of expressions.
♦ There is no earlier
catch
block
A
in the
try
statement such that the type of
C
's
parameter is the same as or a subclass of the type of
A
's parameter.
• The
Block
of a
catch
block is reachable iff the
catch
block is reachable.
• If a
finally
block is present, it is reachable iff the
try
statement is reachable.
One
might expect
the
if
statement to be handled in the following manner:
• An
if-then
statement can complete normally iff at least one of the fol-
lowing is true:
♦ The
if-then
statement is reachable and the condition expression is not
a constant expression whose value is
true
.
♦ The
then
-statement can complete normally.