List<VirtualFile> () { LocalFileSystem fs = LocalFileSystem.getInstance(); List<VirtualFile> result = new ArrayList<>(); Set<String> pathsInStack = getModulePaths(); for (String each : pathsInStack) { VirtualFile f = fs.findFileByPath(each); if (f != null) result.add(f); } return result; }