It's legal and technically correct Java, but I prefer to write such things like this:while (iterator.hasNext()) {} to make it obvious that it's an empty block.
If others feel strongly that this makes the intent more explicit, I will change it.
What about cases like this:
if (...) {
// Do something meaningful
} else if (...) {
// Do something meaningful
}
Should we also include an empty else block to complete the conditional?
