Update of /cvsroot/nutch/nutch/src/java/net/nutch/fetcher
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22690

Modified Files:
        Fetcher.java 
Log Message:
Avoid NPE when the number of threads changes between the call to
group.activeCount() and the for(...) loop.

Noticed by Ralph the "Nutch Crawler" ;-)



Index: Fetcher.java
===================================================================
RCS file: /cvsroot/nutch/nutch/src/java/net/nutch/fetcher/Fetcher.java,v
retrieving revision 1.44
retrieving revision 1.45
diff -C2 -d -r1.44 -r1.45
*** Fetcher.java        27 Oct 2004 07:30:06 -0000      1.44
--- Fetcher.java        22 Nov 2004 16:49:17 -0000      1.45
***************
*** 294,298 ****
        group.enumerate(list);
        boolean noMoreFetcherThread = true; // assumption
!       for (int i=0; i<n; i++) {
          String name = list[i].getName();
          if (name.startsWith(THREAD_GROUP_NAME)) // prove it
--- 294,300 ----
        group.enumerate(list);
        boolean noMoreFetcherThread = true; // assumption
!       for (int i = 0; i < n; i++) {
!         // this thread may have gone away in the meantime
!         if (list[i] == null) continue;
          String name = list[i].getName();
          if (name.startsWith(THREAD_GROUP_NAME)) // prove it



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
_______________________________________________
Nutch-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nutch-cvs

Reply via email to