I'm using a recursive function, and I'm getting this error when I execute :
Exception in thread "main" java.lang.StackOverflowError
at java.util.HashMap$Entry.<init>(Unknown Source)
at java.util.HashMap.addEntry(Unknown Source)
at java.util.HashMap.put(Unknown Source)
I debeugged the method and 100% sure it ends at some point.
So I think its related to a memory problem.
Is there any solution ?
EDIT:
public static Vector<String> _toOpen;
public static void openFiles(Vector<String> files)
{
...
while(actualFile.hasNext)
{
if(!_toOpen.contains(word))
{
_toOpen.add(word);
System.out.println("word");
}
}
...
if(_toOpen.size() > 0)
{
openFiles(_toOpen);
}
}
At the first call I pass to OpenFiles a Vector wich contains a list of files to open, each file has a list of files to open again and so on ...
What I'm doing is preventing a file to be opened if it was dopne before.