You don't, at least not generally. You might find something for 3, but then there's a situation with 4 URLs, et cetera...
Detecting infinite loops is the Holy Grail of computer science - very tempting but nonexistent: You might implement some safeguards for a limited set of conditions, but...
I always build my KolMafia JAR via ant daily jarbundler.
svn reports my repository as up-to-date with version 15080, however the built jar and kolmafia interface state the version number as 15008 in filename, title bar and apparently also internally. I only realized it because it broke the...