Hi,
I'm currently writing a class called FileIterator that implements the Iterator interface and enables to iterate over all files, dirs, files in those dirs etc. in a specific directory. As you can see, you can provide a FileFilter or a FilenameFilter to filter files you don't want to be returned. The strange thing is: if I specify a filter that somehow invokes a method on one of FileFilter or FilenameFilter's accept() args, a StackOverflowError is thrown(see WorkingFileiteratorTest and NotWorkingFileIteratorTest below). What's even more strange is is the fact, that the StackOverflowError is not thrown immediately and, if the number of files in the specified directory is small enough, everything works just fine. Sorry for the long listing, you don't have to read the whole code, the interesting parts lie in WorkingFileiteratorTest and NotWorkingFileIteratorTest.
FileIterator.java:
FilenameFilter.java:
NotWorkingFileiteratorTest.java(Throws a StackOverflowError after having found some files):
WorkingFileiteratorTest.java:
Sorry for this long post and thanks if vou'ye managed to get this far
