fix possible infinite loop on java import

infinite loop would occur if there was more than one blank line between
2 imports or between the imports and the next node.