CVS update: JGroups/src/org/jgroups/protocols FILE_PING.java

"Bela Ban" <[email protected]> Mon, 18 Oct 2010 07:23:50 +0000
Newsgroups gmane.comp.java.javagroups.cvs
Message-ID <[email protected]>
  User: belaban 
  Date: 10/10/18 07:23:50

  Modified:    src/org/jgroups/protocols Tag: Branch_JGroups_2_10
                        FILE_PING.java
  Log:
  removing files which are corrupted (https://jira.jboss.org/browse/JGRP-1246)
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.19.2.1  +11 -4     JGroups/src/org/jgroups/protocols/FILE_PING.java
  
  Index: FILE_PING.java
  ===================================================================
  RCS file: /cvsroot/javagroups/JGroups/src/org/jgroups/protocols/FILE_PING.java,v
  retrieving revision 1.19
  retrieving revision 1.19.2.1
  diff -u -r1.19 -r1.19.2.1
  --- FILE_PING.java	17 Jun 2010 14:57:15 -0000	1.19
  +++ FILE_PING.java	18 Oct 2010 07:23:50 -0000	1.19.2.1
  @@ -19,7 +19,7 @@
    * added to our transport's UUID-PhysicalAddress cache.<p/>
    * The design is at doc/design/FILE_PING.txt
    * @author Bela Ban
  - * @version $Id: FILE_PING.java,v 1.19 2010/06/17 14:57:15 belaban Exp $
  + * @version $Id: FILE_PING.java,v 1.19.2.1 2010/10/18 07:23:50 belaban Exp $
    */
   @Experimental
   public class FILE_PING extends Discovery {
  @@ -175,7 +175,7 @@
        * Reads all information from the given directory under clustername
        * @return
        */
  -   protected List<PingData> readAll(String clustername) {
  +    protected List<PingData> readAll(String clustername) {
           List<PingData> retval=new ArrayList<PingData>();
           File dir=new File(root_dir, clustername);
           if(!dir.exists())
  @@ -183,8 +183,15 @@
   
           File[] files=dir.listFiles(filter);
           if(files != null) {
  -            for(File file: files)
  -                retval.add(readFile(file));
  +            for(File file: files) {
  +                PingData data=readFile(file);
  +                if(data == null) {
  +                    log.warn("failed reading " + file.getName() + ": removing it");
  +                    file.delete();
  +                }
  +                else
  +                    retval.add(data);
  +            }
           }
           return retval;
       }
  
  
  

------------------------------------------------------------------------------
Download new Adobe(R) Flash(R) Builder(TM) 4
The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly 
Flex(R) Builder(TM)) enable the development of rich applications that run
across multiple browsers and platforms. Download your free trials today!
http://p.sf.net/sfu/adobe-dev2dev