Just found a bug in this code :
for(String link : tempList1){
if(!tempList2.contains(link));{
listToPopulate.add(link);
}
}
The ‘;’ at the end of if(!tempList2.contains(link)) causes the condition to evaluate to true, even though it should be false. Why is this occurring ?
Fix is to just remove the ‘;’
The compiler sees an
ifcondition followed by a stand-alone block. With standard indenting, it would look like this:http://en.wikipedia.org/wiki/NOP#NOP_code
Java inherited this syntax from C.