sebb        2003/10/26 11:03:44

  Modified:    src/functions/org/apache/jmeter/functions
                        FileDataContainer.java
  Log:
  Always clear rowcount when new container created; add some debugging.
  
  Revision  Changes    Path
  1.7       +16 -11    
jakarta-jmeter/src/functions/org/apache/jmeter/functions/FileDataContainer.java
  
  Index: FileDataContainer.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jmeter/src/functions/org/apache/jmeter/functions/FileDataContainer.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- FileDataContainer.java    20 Oct 2003 23:58:02 -0000      1.6
  +++ FileDataContainer.java    26 Oct 2003 19:03:44 -0000      1.7
  @@ -72,7 +72,7 @@
       private ArrayList fileData;
   
       /** Keeping track on which row was last read. */
  -    private int rowPosition = -1;
  +    private int rowPosition = 0;
   
       /**
        * FileDataContainer constructor comment.
  @@ -81,6 +81,8 @@
       {
           super();
           this.fileData = new ArrayList();
  +        rowPosition = 0;
  +        log.debug(Thread.currentThread().getName() +" Constructed()");
       }
   
       /**
  @@ -90,6 +92,8 @@
       {
           super();
           fileData = newFileData;
  +             rowPosition = 0;
  +             log.debug(Thread.currentThread().getName() +" Constructed(fileData)");
       }
   
       /**
  @@ -110,13 +114,9 @@
           ArrayList result = null;
           if (fileData != null && fileData.size() > 0)
           {
  -
  -            // ensure row position has been initialized
  -            if (rowPosition == -1)
  -            {
  -                rowPosition = 0;
  -            }
  -
  +             if (log.isDebugEnabled()) {
  +                             log.debug(Thread.currentThread().getName() +" 
getNextline, Row = " + rowPosition);
  +             }
               result = (ArrayList) fileData.get(rowPosition);
           }
           return result;
  @@ -128,6 +128,9 @@
        */
       public int getRowPosition()
       {
  +             if (log.isDebugEnabled()) {
  +         log.debug(Thread.currentThread().getName() +" getRowPosition = " + 
rowPosition);
  +             }
           return rowPosition;
       }
   
  @@ -145,8 +148,10 @@
                   rowPosition = 0;
               }
           }
  -        //    log.debug (Thread.currentThread().getName() +
  -        //         " >>>> incrementRowPosition - returning : "+ rowPosition);
  +        if (log.isDebugEnabled()){
  +                     log.debug (Thread.currentThread().getName() +
  +                              " >>>> incrementRowPosition - returning : "+ 
rowPosition);
  +        }
       }
       
       /**
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to