--- old/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractIndexWriter.java 2020-01-28 15:12:01.000000000 +0000 +++ new/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractIndexWriter.java 2020-01-28 15:12:01.000000000 +0000 @@ -426,8 +426,9 @@ */ protected void createSearchIndexFiles() throws DocFileIOException { if (configuration.showModules) { - createSearchIndexFile(DocPaths.MODULE_SEARCH_INDEX_JSON, DocPaths.MODULE_SEARCH_INDEX_ZIP, - DocPaths.MODULE_SEARCH_INDEX_JS, configuration.moduleSearchIndex, "moduleSearchIndex"); + createSearchIndexFile(DocPaths.MODULE_SEARCH_INDEX_JS, + configuration.moduleSearchIndex, + "moduleSearchIndex"); } if (!configuration.packages.isEmpty()) { SearchIndexItem si = new SearchIndexItem(); @@ -436,34 +437,39 @@ si.setUrl(DocPaths.ALLPACKAGES_INDEX.getPath()); configuration.packageSearchIndex.add(si); } - createSearchIndexFile(DocPaths.PACKAGE_SEARCH_INDEX_JSON, DocPaths.PACKAGE_SEARCH_INDEX_ZIP, - DocPaths.PACKAGE_SEARCH_INDEX_JS, configuration.packageSearchIndex, "packageSearchIndex"); + createSearchIndexFile(DocPaths.PACKAGE_SEARCH_INDEX_JS, + configuration.packageSearchIndex, + "packageSearchIndex"); SearchIndexItem si = new SearchIndexItem(); si.setCategory(SearchIndexItem.Category.TYPES); si.setLabel(resources.getText("doclet.All_Classes")); si.setUrl(DocPaths.ALLCLASSES_INDEX.getPath()); configuration.typeSearchIndex.add(si); - createSearchIndexFile(DocPaths.TYPE_SEARCH_INDEX_JSON, DocPaths.TYPE_SEARCH_INDEX_ZIP, - DocPaths.TYPE_SEARCH_INDEX_JS, configuration.typeSearchIndex, "typeSearchIndex"); - createSearchIndexFile(DocPaths.MEMBER_SEARCH_INDEX_JSON, DocPaths.MEMBER_SEARCH_INDEX_ZIP, - DocPaths.MEMBER_SEARCH_INDEX_JS, configuration.memberSearchIndex, "memberSearchIndex"); - createSearchIndexFile(DocPaths.TAG_SEARCH_INDEX_JSON, DocPaths.TAG_SEARCH_INDEX_ZIP, - DocPaths.TAG_SEARCH_INDEX_JS, configuration.tagSearchIndex, "tagSearchIndex"); + createSearchIndexFile(DocPaths.TYPE_SEARCH_INDEX_JS, + configuration.typeSearchIndex, + "typeSearchIndex"); + createSearchIndexFile(DocPaths.MEMBER_SEARCH_INDEX_JS, + configuration.memberSearchIndex, + "memberSearchIndex"); + createSearchIndexFile(DocPaths.TAG_SEARCH_INDEX_JS, + configuration.tagSearchIndex, + "tagSearchIndex"); } /** * Creates a search index file. * - * @param searchIndexFile the file to be generated - * @param searchIndexZip the zip file to be generated * @param searchIndexJS the file for the JavaScript to be generated * @param searchIndex the search index items * @param varName the variable name to write in the JavaScript file * @throws DocFileIOException if there is a problem creating the search index file */ - protected void createSearchIndexFile(DocPath searchIndexFile, DocPath searchIndexZip, - DocPath searchIndexJS, Collection searchIndex, String varName) throws DocFileIOException { - if (!searchIndex.isEmpty()) { + protected void createSearchIndexFile(DocPath searchIndexJS, + Collection searchIndex, + String varName) + throws DocFileIOException + { + if (!searchIndex.isEmpty()) { // TODO: write to disk straight StringBuilder searchVar = new StringBuilder("["); boolean first = true; for (SearchIndexItem item : searchIndex) { @@ -483,20 +489,6 @@ } catch (IOException ie) { throw new DocFileIOException(jsFile, DocFileIOException.Mode.WRITE, ie); } - - DocFile zipFile = DocFile.createFileForOutput(configuration, searchIndexZip); - try (OutputStream fos = zipFile.openOutputStream(); - ZipOutputStream zos = new ZipOutputStream(fos)) { - try { - ZipEntry ze = new ZipEntry(searchIndexFile.getPath()); - zos.putNextEntry(ze); - zos.write(searchVar.toString().getBytes()); - } finally { - zos.closeEntry(); - } - } catch (IOException ie) { - throw new DocFileIOException(zipFile, DocFileIOException.Mode.WRITE, ie); - } } } }