private void listArchive(Archive archive,RelativeDirectory subdirectory,Set<JavaFileObject.Kind> fileKinds,boolean recurse,ListBuffer<JavaFileObject> resultList){
  List<String> files=archive.getFiles(subdirectory);
  if (files != null) {
    for (; !files.isEmpty(); files=files.tail) {
      String file=files.head;
      if (isValidFile(file,fileKinds)) {
        resultList.append(archive.getFileObject(subdirectory,file));
      }
    }
  }
  if (recurse) {
    for (    RelativeDirectory s : archive.getSubdirectories()) {
      if (subdirectory.contains(s)) {
        listArchive(archive,s,fileKinds,false,resultList);
      }
    }
  }
}

private void listArchive ( Archive archive , RelativeDirectory subdirectory , Set < JavaFileObject . Kind > fileKinds , boolean recurse , ListBuffer < JavaFileObject > resultList ) { List < String > files = archive . getFiles ( subdirectory ) ; if ( files != null ) { for ( ; ! files . isEmpty ( ) ; files = files . tail ) { String file = files . head ; if ( isValidFile ( file , fileKinds ) ) { resultList . append ( archive . getFileObject ( subdirectory , file ) ) ; } } } if ( recurse ) { for ( RelativeDirectory s : archive . getSubdirectories ( ) ) { if ( subdirectory . contains ( s ) ) { listArchive ( archive , s , fileKinds , false , resultList ) ; } } } }
insert all files in subdirectory subdirectory of archive archive which match filekinds into resultlist
