title: Stack Overflow error from recursive directory traversal
body: <p>When I'm running this method I immediately get a stack overflow exception so obviously the method keeps recursively calling itself however I'm not sure why. For reference the file structure I'm testing it with is a load of folders and in those folders are files, no other folders </p>
  
  <pre><code>    public void files(File[] f)
      {
      if(f == null){
          return;
      }
      else
      {   
      for(int i = 0; i &lt; f.length; i++)
      {
          if(f[i].isFile() &amp;&amp; (f[i].getName().contains(".mp3") || f[i].getName().contains(".m4a"))) //iterate through files and check if each file matches the required criteria 
          {
                  String fullname = f[i].getName();
                  Log.v("full name", fullname);
                  String name = null;
                  if(fullname.contains(".mp3"))
                  {
                  name = fullname.substring(0, fullname.lastIndexOf(".mp3"));
                  }
                  else if(fullname.contains(".m4a"))                                  //Removing file extensions of music file so they can be displayed using an appropriate name
                  {
                      name = fullname.substring(0, fullname.lastIndexOf(".m4a"));
                  }
                  list.add(name);
                  mp3.add(f[i]);
                  Log.v("added", name);
          }
          if(f[i].isDirectory())
          {
              File inner[] = files[i].listFiles();
              files(inner);
          }
  
      }
      }
  
     }
  </code></pre>