code: private boolean setNextObject() {
          while (true) {
              while (ds == null) {
                  if (!fileSetIterator.hasNext()) {
                      return false;
                  }
                  FileSet fs = fileSetIterator.next();
                  ds = fs.getDirectoryScanner(project);
                  ds.scan();
                  if (iterateDirectories) {
                      files = ds.getIncludedDirectories();
                  } else {
                      files = ds.getIncludedFiles();
                  }
                  if (files.length > 0) {
                      fileIndex = -1;
                      break;
                  } else {
                      ds = null;
                  }
              }
  
              if (ds != null && files != null) {
                  if (++fileIndex < files.length) {
                      nextFile = new File(ds.getBasedir(), files[fileIndex]);
                      nextObjectSet = true;
                      return true;
                  } else {
                      ds = null;
                  }
              }
          }
      }
docs: /*
  Set nextObject to the next object. If there are no more
  objects then return false. Otherwise, return true.