This is an automated email from the ASF dual-hosted git repository.

ctubbsii pushed a commit to branch 1.9
in repository https://gitbox.apache.org/repos/asf/accumulo.git


The following commit(s) were added to refs/heads/1.9 by this push:
     new e999681  Add patch file for Java 11 generated apidocs
e999681 is described below

commit e999681d642b31fd28b20a3f7998a62647730ed2
Author: Christopher Tubbs <ctubb...@apache.org>
AuthorDate: Sun Aug 4 11:16:44 2019 -0400

    Add patch file for Java 11 generated apidocs
    
    Adds javadoc11.patch to patch broken javadoc in Java 11. These were
    patched in Java 12 and later, but have not yet been backported to 11 at
    the time of this writing, or they have not been patched upstream at all
    yet. So, it may be necessary to apply this patch wnen generating
    javadocs (using the aggregate-javadocs profile) for the API published on
    the accumulo-website, if they were generated using Java 11.
    
    The relevant upstream issues are:
    
    * https://bugs.openjdk.java.net/browse/JDK-8227487 (Missing dejavu font)
    * https://bugs.openjdk.java.net/browse/JDK-8214856 (JSZip API misuse)
    * https://bugs.openjdk.java.net/browse/JDK-8215291 (Broken search links)
    
    The patch can be applied by doing:
    
    ```bash
    # generate the javadocs for the site
    mvn clean package -DskipTests javadoc:aggregate -Paggregate-javadocs
    # apply the patch
    patch -p1 < contrib/javadoc11.patch
    ```
---
 contrib/javadoc11.patch | 91 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 91 insertions(+)

diff --git a/contrib/javadoc11.patch b/contrib/javadoc11.patch
new file mode 100644
index 0000000..028716b
--- /dev/null
+++ b/contrib/javadoc11.patch
@@ -0,0 +1,91 @@
+--- a/target/site/apidocs/script.js
++++ b/target/site/apidocs/script.js
+@@ -40,41 +40,51 @@ function loadScripts(doc, tag) {
+     $.get(pathtoroot + "module-search-index.zip")
+             .done(function() {
+                 JSZipUtils.getBinaryContent(pathtoroot + 
"module-search-index.zip", function(e, data) {
+-                    var zip = new JSZip(data);
+-                    zip.load(data);
+-                    moduleSearchIndex = 
JSON.parse(zip.file("module-search-index.json").asText());
++                    JSZip.loadAsync(data).then(function(zip){
++                        
zip.file("module-search-index.json").async("text").then(function(content){
++                            moduleSearchIndex = JSON.parse(content);
++                        });
++                    });
+                 });
+             });
+     $.get(pathtoroot + "package-search-index.zip")
+             .done(function() {
+                 JSZipUtils.getBinaryContent(pathtoroot + 
"package-search-index.zip", function(e, data) {
+-                    var zip = new JSZip(data);
+-                    zip.load(data);
+-                    packageSearchIndex = 
JSON.parse(zip.file("package-search-index.json").asText());
++                    JSZip.loadAsync(data).then(function(zip){
++                        
zip.file("package-search-index.json").async("text").then(function(content){
++                            packageSearchIndex = JSON.parse(content);
++                        });
++                    });
+                 });
+             });
+     $.get(pathtoroot + "type-search-index.zip")
+             .done(function() {
+                 JSZipUtils.getBinaryContent(pathtoroot + 
"type-search-index.zip", function(e, data) {
+-                    var zip = new JSZip(data);
+-                    zip.load(data);
+-                    typeSearchIndex = 
JSON.parse(zip.file("type-search-index.json").asText());
++                    JSZip.loadAsync(data).then(function(zip){
++                        
zip.file("type-search-index.json").async("text").then(function(content){
++                            typeSearchIndex = JSON.parse(content);
++                        });
++                    });
+                 });
+             });
+     $.get(pathtoroot + "member-search-index.zip")
+             .done(function() {
+                 JSZipUtils.getBinaryContent(pathtoroot + 
"member-search-index.zip", function(e, data) {
+-                    var zip = new JSZip(data);
+-                    zip.load(data);
+-                    memberSearchIndex = 
JSON.parse(zip.file("member-search-index.json").asText());
++                    JSZip.loadAsync(data).then(function(zip){
++                        
zip.file("member-search-index.json").async("text").then(function(content){
++                            memberSearchIndex = JSON.parse(content);
++                        });
++                    });
+                 });
+             });
+     $.get(pathtoroot + "tag-search-index.zip")
+             .done(function() {
+                 JSZipUtils.getBinaryContent(pathtoroot + 
"tag-search-index.zip", function(e, data) {
+-                    var zip = new JSZip(data);
+-                    zip.load(data);
+-                    tagSearchIndex = 
JSON.parse(zip.file("tag-search-index.json").asText());
++                    JSZip.loadAsync(data).then(function(zip){
++                        
zip.file("tag-search-index.json").async("text").then(function(content){
++                            tagSearchIndex = JSON.parse(content);
++                        });
++                    });
+                 });
+             });
+     if (!moduleSearchIndex) {
+--- a/target/site/apidocs/search.js
++++ b/target/site/apidocs/search.js
+@@ -50,7 +50,7 @@ function getURLPrefix(ui) {
+             return ui.item.m + slash;
+         } else if ((ui.item.category === catTypes && ui.item.p) || 
ui.item.category === catMembers) {
+             $.each(packageSearchIndex, function(index, item) {
+-                if (ui.item.p == item.l) {
++                if (item.m && ui.item.p == item.l) {
+                     urlPrefix = item.m + slash;
+                 }
+             });
+--- a/target/site/apidocs/stylesheet.css
++++ b/target/site/apidocs/stylesheet.css
+@@ -2,8 +2,6 @@
+  * Javadoc style sheet
+  */
+ 
+-@import url('resources/fonts/dejavu.css');
+-
+ /*
+  * Styles for individual HTML elements.
+  *

Reply via email to