mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8238291: Fix inconsistencies in the format of the index files
Reviewed-by: jjg
This commit is contained in:
parent
898a903530
commit
fff1a59cfa
6 changed files with 80 additions and 78 deletions
|
@ -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.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -109,58 +109,60 @@ public class SearchIndexItem {
|
|||
return systemProperty;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder item = new StringBuilder("");
|
||||
// TODO: Additional processing is required, see JDK-8238495
|
||||
StringBuilder item = new StringBuilder();
|
||||
switch (category) {
|
||||
case MODULES:
|
||||
item.append("{")
|
||||
.append("\"l\":\"").append(label).append("\"")
|
||||
.append("}");
|
||||
break;
|
||||
case PACKAGES:
|
||||
item.append("{");
|
||||
if (!containingModule.isEmpty()) {
|
||||
item.append("\"m\":\"").append(containingModule).append("\",");
|
||||
}
|
||||
item.append("\"l\":\"").append(label).append("\"");
|
||||
if (!url.isEmpty()) {
|
||||
item.append(",\"url\":\"").append(url).append("\"");
|
||||
}
|
||||
item.append("}");
|
||||
break;
|
||||
case TYPES:
|
||||
item.append("{");
|
||||
if (!containingPackage.isEmpty()) {
|
||||
item.append("\"p\":\"").append(containingPackage).append("\",");
|
||||
}
|
||||
item.append("\"l\":\"").append(label).append("\"");
|
||||
if (!url.isEmpty()) {
|
||||
item.append(",\"url\":\"").append(url).append("\"");
|
||||
}
|
||||
item.append("}");
|
||||
break;
|
||||
case MEMBERS:
|
||||
item.append("{")
|
||||
.append("\"p\":\"").append(containingPackage).append("\",")
|
||||
.append("\"c\":\"").append(containingClass).append("\",")
|
||||
.append("\"l\":\"").append(label).append("\"");
|
||||
if (!url.isEmpty()) {
|
||||
item.append(",\"url\":\"").append(url).append("\"");
|
||||
}
|
||||
item.append("}");
|
||||
break;
|
||||
case SEARCH_TAGS:
|
||||
item.append("{")
|
||||
.append("\"l\":\"").append(label).append("\",")
|
||||
.append("\"h\":\"").append(holder).append("\",");
|
||||
if (!description.isEmpty()) {
|
||||
item.append("\"d\":\"").append(description).append("\",");
|
||||
}
|
||||
item.append("\"u\":\"").append(url).append("\"")
|
||||
.append("}");
|
||||
break;
|
||||
default:
|
||||
throw new IllegalStateException("category not set");
|
||||
case MODULES:
|
||||
item.append("{")
|
||||
.append("\"l\":\"").append(label).append("\"")
|
||||
.append("}");
|
||||
break;
|
||||
case PACKAGES:
|
||||
item.append("{");
|
||||
if (!containingModule.isEmpty()) {
|
||||
item.append("\"m\":\"").append(containingModule).append("\",");
|
||||
}
|
||||
item.append("\"l\":\"").append(label).append("\"");
|
||||
if (!url.isEmpty()) {
|
||||
item.append(",\"u\":\"").append(url).append("\"");
|
||||
}
|
||||
item.append("}");
|
||||
break;
|
||||
case TYPES:
|
||||
item.append("{");
|
||||
if (!containingPackage.isEmpty()) {
|
||||
item.append("\"p\":\"").append(containingPackage).append("\",");
|
||||
}
|
||||
item.append("\"l\":\"").append(label).append("\"");
|
||||
if (!url.isEmpty()) {
|
||||
item.append(",\"u\":\"").append(url).append("\"");
|
||||
}
|
||||
item.append("}");
|
||||
break;
|
||||
case MEMBERS:
|
||||
item.append("{")
|
||||
.append("\"p\":\"").append(containingPackage).append("\",")
|
||||
.append("\"c\":\"").append(containingClass).append("\",")
|
||||
.append("\"l\":\"").append(label).append("\"");
|
||||
if (!url.isEmpty()) {
|
||||
item.append(",\"u\":\"").append(url).append("\"");
|
||||
}
|
||||
item.append("}");
|
||||
break;
|
||||
case SEARCH_TAGS:
|
||||
item.append("{")
|
||||
.append("\"l\":\"").append(label).append("\",")
|
||||
.append("\"h\":\"").append(holder).append("\",");
|
||||
if (!description.isEmpty()) {
|
||||
item.append("\"d\":\"").append(description).append("\",");
|
||||
}
|
||||
item.append("\"u\":\"").append(url).append("\"")
|
||||
.append("}");
|
||||
break;
|
||||
default:
|
||||
throw new AssertionError("Unexpected category: " + category);
|
||||
}
|
||||
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.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -319,14 +319,14 @@ $(function() {
|
|||
if (ui.item.category === catModules) {
|
||||
url += "module-summary.html";
|
||||
} else if (ui.item.category === catPackages) {
|
||||
if (ui.item.url) {
|
||||
url = ui.item.url;
|
||||
if (ui.item.u) {
|
||||
url = ui.item.u;
|
||||
} 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) {
|
||||
if (ui.item.url) {
|
||||
url = ui.item.url;
|
||||
if (ui.item.u) {
|
||||
url = ui.item.u;
|
||||
} else if (ui.item.p === "<Unnamed>") {
|
||||
url += ui.item.l + ".html";
|
||||
} else {
|
||||
|
@ -338,8 +338,8 @@ $(function() {
|
|||
} else {
|
||||
url += ui.item.p.replace(/\./g, '/') + "/" + ui.item.c + ".html" + "#";
|
||||
}
|
||||
if (ui.item.url) {
|
||||
url += ui.item.url;
|
||||
if (ui.item.u) {
|
||||
url += ui.item.u;
|
||||
} else {
|
||||
url += ui.item.l;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue