String entry;
try {
while (true) {
// could lock this next one on entries if it proves a problem
// but Vector is synchronized so shouldn't be necessary
try {
entry = (String) entries.pop();
}
catch (EmptyStackException e) {
if (log.isFinished()) break;
this.yield();
continue;
}
int index = entry.indexOf(' ", 0);
String remoteHost = entry.substring(0, index);
String theRest = entry.substring(index, entry.length());
try {
remoteHost = InetAddress.getByName(remoteHost).getHostName();
}
catch (Exception e) {
// remoteHost remains in dotted quad format
}
try {
log.log(remoteHost + theRest);
}
catch (IOException e) {
}
this.yield();
}
System.err.println("****************Thread finishing*****************");
} catch (NullPointerException e) {
System.out.println("Exception 3: " + e);
e.printStackTrace();
}