I have this code
public void getItems(Node node) {
if (!isFound) {
NodeList list = node.getChildNodes();
outer:
for (int i = 0; i < list.getLength(); i++) {
Node childNode = list.item(i);
if (node.getNodeName().equals("test")) {
for (int size=0; size<node.getChildNodes().getLength(); size++) {
//Some code here
}
isFound = true;
break outer;
}
getItems(childNode);
}
}
}
When its executed the "break outer" it breaks out of the outer for loop. Which is good. But the outer for loop continues to start once again after breaking out. Why is that so?
My isFound is an instance variable and is set to false.