Treat the contents of a loop as a separate block.
Read
while (xenum.hasMoreElements()) {
/* [...] */
if (object instanceof Resource) {
/* [...] */
if (!copy(is, os))
/* [...] */
} else if (object instanceof InputStream) {
/* [...] */
if (!copy((InputStream) object, os))
/* [...] */
} else if (object instanceof DirContext) {
/* [...] */
}
}
as
while (xenum.hasMoreElements()) {
/* [...] */
}