--- HTMLParser.jj.bak 2003-10-31 11:57:43.000000000 +0100 +++ HTMLParser.jj 2003-10-31 12:16:39.000000000 +0100 @@ -70,6 +70,7 @@ public class HTMLParser { public static int SUMMARY_LENGTH = 200; + public static int MAX_WAIT = 1000; StringBuffer title = new StringBuffer(SUMMARY_LENGTH); StringBuffer summary = new StringBuffer(SUMMARY_LENGTH * 2); @@ -122,10 +123,14 @@ public String getSummary() throws IOException, InterruptedException { if (pipeIn == null) getReader(); // spawn parsing thread + int elapsedMillis = 0; while (true) { synchronized(this) { if (summary.length() >= SUMMARY_LENGTH) break; + elapsedMillis = elapsedMillis + 10; + if (elapsedMillis > MAX_WAIT) + break; wait(10); } }