List<FileContent> (@NotNull Project project, @Nullable Editor editor, @Nullable VirtualFile file, VirtualFile @Nullable [] files) { if (editor != null) { String content = getContentFromEditor(editor); if (content == null) { return Collections.emptyList(); } if (file != null) { return Collections.singletonList(new FileContent(file.getName(), content)); } else { return Collections.singletonList(new FileContent("", content)); } } if (files != null) { List<FileContent> contents = new ArrayList<>(); for (VirtualFile vf : files) { contents.addAll(getContentFromFile(vf, project, null)); } return contents; } if (file != null) { return getContentFromFile(file, project, null); } LOG.error("File, files and editor can't be null all at once!"); throw new IllegalStateException("File, files and editor can't be null all at once!"); }