cleanup: don't use File.list to find file by name
authornik <Nikolay.Chashnikov@jetbrains.com>
Thu, 25 Jun 2015 09:05:58 +0000 (12:05 +0300)
committernik <Nikolay.Chashnikov@jetbrains.com>
Thu, 25 Jun 2015 09:05:58 +0000 (12:05 +0300)
python/src/com/jetbrains/python/sdk/PythonSdkType.java

index 2fc66a9b222a0bf4ad0037a5ce8644a6027245f8..7a9fa3a6a8abf7d2692b3e3ac1dacea5e6505fac 100644 (file)
@@ -86,7 +86,6 @@ import javax.swing.*;
 import javax.swing.event.HyperlinkEvent;
 import java.awt.*;
 import java.io.File;
-import java.io.FilenameFilter;
 import java.io.IOException;
 import java.lang.ref.WeakReference;
 import java.util.*;
@@ -670,13 +669,7 @@ public class PythonSdkType extends SdkType {
           for (String s : inside) {
             if (PYTHON_NN_RE.matcher(s).matches()) {
               File py_lib_root = new File(lib_root, s);
-              String[] flag_files = py_lib_root.list(new FilenameFilter() {
-                @Override
-                public boolean accept(File file, String s) {
-                  return "no-global-site-packages.txt".equals(s);
-                }
-              });
-              if (flag_files != null) return; // don't add hardcoded paths
+              if (new File(py_lib_root, "no-global-site-packages.txt").exists()) return; // don't add hardcoded paths
             }
           }
         }