8238291: Fix inconsistencies in the format of the index files
Reviewed-by: jjg
This commit is contained in:
parent
898a903530
commit
fff1a59cfa
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -109,58 +109,60 @@ public class SearchIndexItem {
|
|||||||
return systemProperty;
|
return systemProperty;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
StringBuilder item = new StringBuilder("");
|
// TODO: Additional processing is required, see JDK-8238495
|
||||||
|
StringBuilder item = new StringBuilder();
|
||||||
switch (category) {
|
switch (category) {
|
||||||
case MODULES:
|
case MODULES:
|
||||||
item.append("{")
|
item.append("{")
|
||||||
.append("\"l\":\"").append(label).append("\"")
|
.append("\"l\":\"").append(label).append("\"")
|
||||||
.append("}");
|
.append("}");
|
||||||
break;
|
break;
|
||||||
case PACKAGES:
|
case PACKAGES:
|
||||||
item.append("{");
|
item.append("{");
|
||||||
if (!containingModule.isEmpty()) {
|
if (!containingModule.isEmpty()) {
|
||||||
item.append("\"m\":\"").append(containingModule).append("\",");
|
item.append("\"m\":\"").append(containingModule).append("\",");
|
||||||
}
|
}
|
||||||
item.append("\"l\":\"").append(label).append("\"");
|
item.append("\"l\":\"").append(label).append("\"");
|
||||||
if (!url.isEmpty()) {
|
if (!url.isEmpty()) {
|
||||||
item.append(",\"url\":\"").append(url).append("\"");
|
item.append(",\"u\":\"").append(url).append("\"");
|
||||||
}
|
}
|
||||||
item.append("}");
|
item.append("}");
|
||||||
break;
|
break;
|
||||||
case TYPES:
|
case TYPES:
|
||||||
item.append("{");
|
item.append("{");
|
||||||
if (!containingPackage.isEmpty()) {
|
if (!containingPackage.isEmpty()) {
|
||||||
item.append("\"p\":\"").append(containingPackage).append("\",");
|
item.append("\"p\":\"").append(containingPackage).append("\",");
|
||||||
}
|
}
|
||||||
item.append("\"l\":\"").append(label).append("\"");
|
item.append("\"l\":\"").append(label).append("\"");
|
||||||
if (!url.isEmpty()) {
|
if (!url.isEmpty()) {
|
||||||
item.append(",\"url\":\"").append(url).append("\"");
|
item.append(",\"u\":\"").append(url).append("\"");
|
||||||
}
|
}
|
||||||
item.append("}");
|
item.append("}");
|
||||||
break;
|
break;
|
||||||
case MEMBERS:
|
case MEMBERS:
|
||||||
item.append("{")
|
item.append("{")
|
||||||
.append("\"p\":\"").append(containingPackage).append("\",")
|
.append("\"p\":\"").append(containingPackage).append("\",")
|
||||||
.append("\"c\":\"").append(containingClass).append("\",")
|
.append("\"c\":\"").append(containingClass).append("\",")
|
||||||
.append("\"l\":\"").append(label).append("\"");
|
.append("\"l\":\"").append(label).append("\"");
|
||||||
if (!url.isEmpty()) {
|
if (!url.isEmpty()) {
|
||||||
item.append(",\"url\":\"").append(url).append("\"");
|
item.append(",\"u\":\"").append(url).append("\"");
|
||||||
}
|
}
|
||||||
item.append("}");
|
item.append("}");
|
||||||
break;
|
break;
|
||||||
case SEARCH_TAGS:
|
case SEARCH_TAGS:
|
||||||
item.append("{")
|
item.append("{")
|
||||||
.append("\"l\":\"").append(label).append("\",")
|
.append("\"l\":\"").append(label).append("\",")
|
||||||
.append("\"h\":\"").append(holder).append("\",");
|
.append("\"h\":\"").append(holder).append("\",");
|
||||||
if (!description.isEmpty()) {
|
if (!description.isEmpty()) {
|
||||||
item.append("\"d\":\"").append(description).append("\",");
|
item.append("\"d\":\"").append(description).append("\",");
|
||||||
}
|
}
|
||||||
item.append("\"u\":\"").append(url).append("\"")
|
item.append("\"u\":\"").append(url).append("\"")
|
||||||
.append("}");
|
.append("}");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
throw new IllegalStateException("category not set");
|
throw new AssertionError("Unexpected category: " + category);
|
||||||
}
|
}
|
||||||
return item.toString();
|
return item.toString();
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -319,14 +319,14 @@ $(function() {
|
|||||||
if (ui.item.category === catModules) {
|
if (ui.item.category === catModules) {
|
||||||
url += "module-summary.html";
|
url += "module-summary.html";
|
||||||
} else if (ui.item.category === catPackages) {
|
} else if (ui.item.category === catPackages) {
|
||||||
if (ui.item.url) {
|
if (ui.item.u) {
|
||||||
url = ui.item.url;
|
url = ui.item.u;
|
||||||
} else {
|
} else {
|
||||||
url += ui.item.l.replace(/\./g, '/') + "/package-summary.html";
|
url += ui.item.l.replace(/\./g, '/') + "/package-summary.html";
|
||||||
}
|
}
|
||||||
} else if (ui.item.category === catTypes) {
|
} else if (ui.item.category === catTypes) {
|
||||||
if (ui.item.url) {
|
if (ui.item.u) {
|
||||||
url = ui.item.url;
|
url = ui.item.u;
|
||||||
} else if (ui.item.p === "<Unnamed>") {
|
} else if (ui.item.p === "<Unnamed>") {
|
||||||
url += ui.item.l + ".html";
|
url += ui.item.l + ".html";
|
||||||
} else {
|
} else {
|
||||||
@ -338,8 +338,8 @@ $(function() {
|
|||||||
} else {
|
} else {
|
||||||
url += ui.item.p.replace(/\./g, '/') + "/" + ui.item.c + ".html" + "#";
|
url += ui.item.p.replace(/\./g, '/') + "/" + ui.item.c + ".html" + "#";
|
||||||
}
|
}
|
||||||
if (ui.item.url) {
|
if (ui.item.u) {
|
||||||
url += ui.item.url;
|
url += ui.item.u;
|
||||||
} else {
|
} else {
|
||||||
url += ui.item.l;
|
url += ui.item.l;
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -1321,9 +1321,9 @@ public class TestModules extends JavadocTester {
|
|||||||
"<div class=\"packagesSummary\">\n"
|
"<div class=\"packagesSummary\">\n"
|
||||||
+ "<table summary=\"Package Summary table, listing packages, and an explanation\">");
|
+ "<table summary=\"Package Summary table, listing packages, and an explanation\">");
|
||||||
checkOutput("type-search-index.js", true,
|
checkOutput("type-search-index.js", true,
|
||||||
"{\"l\":\"All Classes\",\"url\":\"allclasses-index.html\"}");
|
"{\"l\":\"All Classes\",\"u\":\"allclasses-index.html\"}");
|
||||||
checkOutput("package-search-index.js", true,
|
checkOutput("package-search-index.js", true,
|
||||||
"{\"l\":\"All Packages\",\"url\":\"allpackages-index.html\"}");
|
"{\"l\":\"All Packages\",\"u\":\"allpackages-index.html\"}");
|
||||||
checkOutput("index-all.html", true,
|
checkOutput("index-all.html", true,
|
||||||
"<br><a href=\"allclasses-index.html\">All Classes</a>"
|
"<br><a href=\"allclasses-index.html\">All Classes</a>"
|
||||||
+ "<span class=\"verticalSeparator\">|</span>"
|
+ "<span class=\"verticalSeparator\">|</span>"
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2002, 2019, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2002, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -102,9 +102,9 @@ public class TestPackagePage extends JavadocTester {
|
|||||||
+ "</tr>\n"
|
+ "</tr>\n"
|
||||||
+ "</thead>\n");
|
+ "</thead>\n");
|
||||||
checkOutput("type-search-index.js", true,
|
checkOutput("type-search-index.js", true,
|
||||||
"{\"l\":\"All Classes\",\"url\":\"allclasses-index.html\"}");
|
"{\"l\":\"All Classes\",\"u\":\"allclasses-index.html\"}");
|
||||||
checkOutput("package-search-index.js", true,
|
checkOutput("package-search-index.js", true,
|
||||||
"{\"l\":\"All Packages\",\"url\":\"allpackages-index.html\"}");
|
"{\"l\":\"All Packages\",\"u\":\"allpackages-index.html\"}");
|
||||||
checkOutput("index-all.html", true,
|
checkOutput("index-all.html", true,
|
||||||
"<br><a href=\"allclasses-index.html\">All Classes</a>"
|
"<br><a href=\"allclasses-index.html\">All Classes</a>"
|
||||||
+ "<span class=\"verticalSeparator\">|</span>"
|
+ "<span class=\"verticalSeparator\">|</span>"
|
||||||
|
@ -402,15 +402,15 @@ public class TestSearch extends JavadocTester {
|
|||||||
|
|
||||||
void checkSearchIndex(boolean expectedOutput) {
|
void checkSearchIndex(boolean expectedOutput) {
|
||||||
checkOutput("member-search-index.js", expectedOutput,
|
checkOutput("member-search-index.js", expectedOutput,
|
||||||
"{\"p\":\"pkg\",\"c\":\"AnotherClass\",\"l\":\"AnotherClass()\",\"url\":\"%3Cinit%3E()\"}",
|
"{\"p\":\"pkg\",\"c\":\"AnotherClass\",\"l\":\"AnotherClass()\",\"u\":\"%3Cinit%3E()\"}",
|
||||||
"{\"p\":\"pkg1\",\"c\":\"RegClass\",\"l\":\"RegClass()\",\"url\":\"%3Cinit%3E()\"}",
|
"{\"p\":\"pkg1\",\"c\":\"RegClass\",\"l\":\"RegClass()\",\"u\":\"%3Cinit%3E()\"}",
|
||||||
"{\"p\":\"pkg2\",\"c\":\"TestError\",\"l\":\"TestError()\",\"url\":\"%3Cinit%3E()\"}",
|
"{\"p\":\"pkg2\",\"c\":\"TestError\",\"l\":\"TestError()\",\"u\":\"%3Cinit%3E()\"}",
|
||||||
"{\"p\":\"pkg\",\"c\":\"AnotherClass\",\"l\":\"method(byte[], int, String)\",\"url\":\"method(byte[],int,java.lang.String)\"}");
|
"{\"p\":\"pkg\",\"c\":\"AnotherClass\",\"l\":\"method(byte[], int, String)\",\"u\":\"method(byte[],int,java.lang.String)\"}");
|
||||||
checkOutput("member-search-index.js", !expectedOutput,
|
checkOutput("member-search-index.js", !expectedOutput,
|
||||||
"{\"p\":\"pkg\",\"c\":\"AnotherClass\",\"l\":\"method(RegClass)\",\"url\":\"method-pkg1.RegClass-\"}",
|
"{\"p\":\"pkg\",\"c\":\"AnotherClass\",\"l\":\"method(RegClass)\",\"u\":\"method-pkg1.RegClass-\"}",
|
||||||
"{\"p\":\"pkg2\",\"c\":\"TestClass\",\"l\":\"TestClass()\",\"url\":\"TestClass--\"}",
|
"{\"p\":\"pkg2\",\"c\":\"TestClass\",\"l\":\"TestClass()\",\"u\":\"TestClass--\"}",
|
||||||
"{\"p\":\"pkg\",\"c\":\"TestError\",\"l\":\"TestError()\",\"url\":\"TestError--\"}",
|
"{\"p\":\"pkg\",\"c\":\"TestError\",\"l\":\"TestError()\",\"u\":\"TestError--\"}",
|
||||||
"{\"p\":\"pkg\",\"c\":\"AnotherClass\",\"l\":\"method(byte[], int, String)\",\"url\":\"method-byte:A-int-java.lang.String-\"}");
|
"{\"p\":\"pkg\",\"c\":\"AnotherClass\",\"l\":\"method(byte[], int, String)\",\"u\":\"method-byte:A-int-java.lang.String-\"}");
|
||||||
}
|
}
|
||||||
|
|
||||||
void checkSearchOutput(boolean expectedOutput, boolean moduleDirectoriesVar) {
|
void checkSearchOutput(boolean expectedOutput, boolean moduleDirectoriesVar) {
|
||||||
@ -745,9 +745,9 @@ public class TestSearch extends JavadocTester {
|
|||||||
+ "<th class=\"colLast\" scope=\"col\">Description</th>\n"
|
+ "<th class=\"colLast\" scope=\"col\">Description</th>\n"
|
||||||
+ "</tr>\n");
|
+ "</tr>\n");
|
||||||
checkOutput("type-search-index.js", true,
|
checkOutput("type-search-index.js", true,
|
||||||
"{\"l\":\"All Classes\",\"url\":\"allclasses-index.html\"}");
|
"{\"l\":\"All Classes\",\"u\":\"allclasses-index.html\"}");
|
||||||
checkOutput("package-search-index.js", true,
|
checkOutput("package-search-index.js", true,
|
||||||
"{\"l\":\"All Packages\",\"url\":\"allpackages-index.html\"}");
|
"{\"l\":\"All Packages\",\"u\":\"allpackages-index.html\"}");
|
||||||
checkOutput("index-all.html", true,
|
checkOutput("index-all.html", true,
|
||||||
"<br><a href=\"allclasses-index.html\">All Classes</a>"
|
"<br><a href=\"allclasses-index.html\">All Classes</a>"
|
||||||
+ "<span class=\"verticalSeparator\">|</span>"
|
+ "<span class=\"verticalSeparator\">|</span>"
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -104,10 +104,10 @@ public class TestUnnamedPackage extends JavadocTester {
|
|||||||
+ "</table>");
|
+ "</table>");
|
||||||
|
|
||||||
checkOutput("type-search-index.js", true,
|
checkOutput("type-search-index.js", true,
|
||||||
"{\"l\":\"All Classes\",\"url\":\"allclasses-index.html\"}");
|
"{\"l\":\"All Classes\",\"u\":\"allclasses-index.html\"}");
|
||||||
|
|
||||||
checkOutput("package-search-index.js", true,
|
checkOutput("package-search-index.js", true,
|
||||||
"{\"l\":\"All Packages\",\"url\":\"allpackages-index.html\"}");
|
"{\"l\":\"All Packages\",\"u\":\"allpackages-index.html\"}");
|
||||||
|
|
||||||
checkOutput("index-all.html", true,
|
checkOutput("index-all.html", true,
|
||||||
"<br><a href=\"allclasses-index.html\">All Classes</a>"
|
"<br><a href=\"allclasses-index.html\">All Classes</a>"
|
||||||
|
Loading…
Reference in New Issue
Block a user