diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/DocLink.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/DocLink.java index fb63c6941aa..9e69c325a86 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/DocLink.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/DocLink.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -26,11 +26,10 @@ package jdk.javadoc.internal.doclets.toolkit.util; /** - * Abstraction for simple relative URIs, consisting of a path, - * an optional query, and an optional fragment. DocLink objects can - * be created by the constructors below or from a DocPath using the - * convenience methods, {@link DocPath#fragment fragment} and - * {@link DocPath#query query}. + * Abstraction for simple relative URIs, consisting of a path and an + * optional fragment. DocLink objects can be created by the constructors + * below or from a DocPath using the convenience + * {@link DocPath#fragment fragment} method. * *

This is NOT part of any supported API. * If you write code that depends on this, you do so at your own risk. @@ -40,7 +39,6 @@ package jdk.javadoc.internal.doclets.toolkit.util; */ public class DocLink { final DocPath path; - final String query; final String fragment; /** @@ -49,7 +47,7 @@ public class DocLink { * @return the DocLink */ public static DocLink fragment(String fragment) { - return new DocLink((DocPath) null, (String) null, fragment); + return new DocLink((DocPath) null, fragment); } /** @@ -57,31 +55,28 @@ public class DocLink { * @param path the path */ public DocLink(DocPath path) { - this(path, null, null); + this(path, null); } /** - * Creates a DocLink representing the URI {@code path?query#fragment}. + * Creates a DocLink representing the URI {@code path#fragment}. * Any of the component parts may be null. * @param path the path - * @param query the query * @param fragment the fragment */ - public DocLink(DocPath path, String query, String fragment) { + public DocLink(DocPath path, String fragment) { this.path = path; - this.query = query; this.fragment = fragment; } /** - * Creates a DocLink representing the URI {@code path?query#fragment}. + * Creates a DocLink representing the URI {@code path#fragment}. * Any of the component parts may be null. * @param path the path - * @param query the query * @param fragment the fragment */ - public DocLink(String path, String query, String fragment) { - this(DocPath.create(path), query, fragment); + public DocLink(String path, String fragment) { + this(DocPath.create(path), fragment); } /** @@ -101,10 +96,10 @@ public class DocLink { DocPath newPath = base.relativize(path); // avoid generating an empty link by using the basename of the path if necessary - if (newPath.isEmpty() && isEmpty(query) && isEmpty(fragment)) { + if (newPath.isEmpty() && isEmpty(fragment)) { newPath = path.basename(); } - return new DocLink(newPath, query, fragment); + return new DocLink(newPath, fragment); } // return true if the path begins :// @@ -121,21 +116,19 @@ public class DocLink { } /** - * Returns the link in the form "path?query#fragment", omitting any empty + * Returns the link in the form "path#fragment", omitting any empty * components. * @return the string */ @Override public String toString() { // common fast path - if (path != null && isEmpty(query) && isEmpty(fragment)) + if (path != null && isEmpty(fragment)) return path.getPath(); StringBuilder sb = new StringBuilder(); if (path != null) sb.append(path.getPath()); - if (!isEmpty(query)) - sb.append("?").append(query); if (!isEmpty(fragment)) sb.append("#").append(fragment); return sb.toString(); diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/DocPath.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/DocPath.java index 7a89162a0a8..a8ccfbd7e74 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/DocPath.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/DocPath.java @@ -210,16 +210,7 @@ public class DocPath { * @return the link */ public DocLink fragment(String fragment) { - return new DocLink(path, null, fragment); - } - - /** - * Creates a DocLink formed from this path and a query string. - * @param query the query string - * @return the link - */ - public DocLink query(String query) { - return new DocLink(path, query, null); + return new DocLink(path, fragment); } /** diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Extern.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Extern.java index d31d6e747e8..bcfdc720bf2 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Extern.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Extern.java @@ -190,7 +190,7 @@ public class Extern { DocPath p = fnd.relative ? relativepath.resolve(fnd.path).resolve(filename) : fnd.path.resolve(filename); - return new DocLink(p, "is-external=true", memberName); + return new DocLink(p, memberName); } /** diff --git a/test/langtools/jdk/javadoc/doclet/testClassCrossReferences/TestClassCrossReferences.java b/test/langtools/jdk/javadoc/doclet/testClassCrossReferences/TestClassCrossReferences.java index 914dfddda32..54daa53cd7f 100644 --- a/test/langtools/jdk/javadoc/doclet/testClassCrossReferences/TestClassCrossReferences.java +++ b/test/langtools/jdk/javadoc/doclet/testClassCrossReferences/TestClassCrossReferences.java @@ -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. * * This code is free software; you can redistribute it and/or modify it @@ -54,15 +54,15 @@ public class TestClassCrossReferences extends JavadocTester { checkExit(Exit.OK); checkOutput("C.html", true, - "" + "" + "Link to math package", - "Link to AttributeContext innerclass", - "Link to external class BigDecimal", - "Link to external member gcd", - "Link to external member URI", "

\n" + "
Overrides:
\n" diff --git a/test/langtools/jdk/javadoc/doclet/testDocRootInlineTag/TestDocRootInlineTag.java b/test/langtools/jdk/javadoc/doclet/testDocRootInlineTag/TestDocRootInlineTag.java index 0a99c52ad01..48772aa09a3 100644 --- a/test/langtools/jdk/javadoc/doclet/testDocRootInlineTag/TestDocRootInlineTag.java +++ b/test/langtools/jdk/javadoc/doclet/testDocRootInlineTag/TestDocRootInlineTag.java @@ -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. * * This code is free software; you can redistribute it and/or modify it @@ -55,10 +55,10 @@ public class TestDocRootInlineTag extends JavadocTester { checkExit(Exit.OK); checkOutput("TestDocRootTag.html", true, - "File", "index", - "Second File Link", "The value of @docRoot is \"./\""); diff --git a/test/langtools/jdk/javadoc/doclet/testExternalOverridenMethod/TestExternalOverridenMethod.java b/test/langtools/jdk/javadoc/doclet/testExternalOverridenMethod/TestExternalOverridenMethod.java index 19fdd4faac2..d628ac61c04 100644 --- a/test/langtools/jdk/javadoc/doclet/testExternalOverridenMethod/TestExternalOverridenMethod.java +++ b/test/langtools/jdk/javadoc/doclet/testExternalOverridenMethod/TestExternalOverridenMethod.java @@ -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. * * This code is free software; you can redistribute it and/or modify it @@ -54,14 +54,14 @@ public class TestExternalOverridenMethod extends JavadocTester { checkOutput("pkg/XReader.html", true, "
Overrides:
\n" - + "
read in class " - + "FilterReader
", "
Specified by:
\n" - + "
readInt in interface " - + "DataInput
" ); } diff --git a/test/langtools/jdk/javadoc/doclet/testHref/TestHref.java b/test/langtools/jdk/javadoc/doclet/testHref/TestHref.java index 526b6e4a764..8f05c60b75c 100644 --- a/test/langtools/jdk/javadoc/doclet/testHref/TestHref.java +++ b/test/langtools/jdk/javadoc/doclet/testHref/TestHref.java @@ -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. * * This code is free software; you can redistribute it and/or modify it @@ -52,7 +52,7 @@ public class TestHref extends JavadocTester { checkOutput("pkg/C1.html", true, //External link. - "href=\"http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html?is-external=true#wait(long,int)\"", + "href=\"http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#wait(long,int)\"", //Member summary table link. "href=\"#method(int,int,java.util.ArrayList)\"", //Anchor test. diff --git a/test/langtools/jdk/javadoc/doclet/testLinkOption/TestLinkOption.java b/test/langtools/jdk/javadoc/doclet/testLinkOption/TestLinkOption.java index 4ab87cb8941..9757deab282 100644 --- a/test/langtools/jdk/javadoc/doclet/testLinkOption/TestLinkOption.java +++ b/test/langtools/jdk/javadoc/doclet/testLinkOption/TestLinkOption.java @@ -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. * * This code is free software; you can redistribute it and/or modify it @@ -71,7 +71,7 @@ public class TestLinkOption extends JavadocTester { checkExit(Exit.OK); checkOutput("pkg/C.html", true, - "Link to String Class", //Make sure the parameters are formatted properly when the -link option is used. "(int p1,\n" @@ -79,18 +79,18 @@ public class TestLinkOption extends JavadocTester { + "int p3)", "(int p1,\n" + "int p2,\n" - + "" + + "" + "Object p3)"); checkOutput("pkg/B.html", true, "
A method with html tag the method " - + "getSystemClassLoader()" + " as the parent class loader.
", "
is equivalent to invoking " + "" + "createTempFile(prefix, suffix, null).
", - "Link-Plain to String Class", "getSystemClassLoader()", "createTempFile(prefix, suffix, null)", @@ -107,7 +107,7 @@ public class TestLinkOption extends JavadocTester { checkOutput("mylib/lang/StringBuilderChild.html", true, "
public abstract class StringBuilderChild\n"
-                + "extends Object
" ); @@ -121,7 +121,7 @@ public class TestLinkOption extends JavadocTester { "pkg2"); checkExit(Exit.OK); checkOutput("pkg2/C2.html", true, - "This is a link to Class C." ); @@ -150,10 +150,10 @@ public class TestLinkOption extends JavadocTester { + "extends java.lang.Object\n" + "
Test links.\n" + "
\n" - + " link to pkg2.C2\n" + "
\n" - + " " + "link to mylib.lang.StringBuilderChild.
\n" ); @@ -171,10 +171,10 @@ public class TestLinkOption extends JavadocTester { + "extends java.lang.Object\n" + "
Test links.\n" + "
\n" - + " link to pkg2.C2\n" + "
\n" - + " " + "link to mylib.lang.StringBuilderChild.
\n" ); diff --git a/test/langtools/jdk/javadoc/doclet/testLinkOption/TestLinkOptionWithAutomaticModule.java b/test/langtools/jdk/javadoc/doclet/testLinkOption/TestLinkOptionWithAutomaticModule.java index 31aa9f96c36..c0b2ab27eab 100644 --- a/test/langtools/jdk/javadoc/doclet/testLinkOption/TestLinkOptionWithAutomaticModule.java +++ b/test/langtools/jdk/javadoc/doclet/testLinkOption/TestLinkOptionWithAutomaticModule.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 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 @@ -103,7 +103,7 @@ public class TestLinkOptionWithAutomaticModule extends JavadocTester { "p"); checkExit(Exit.OK); checkOutput("p/MyClass.html", true, - "extends LibClass"); } @@ -127,7 +127,7 @@ public class TestLinkOptionWithAutomaticModule extends JavadocTester { "--module", "my.module"); checkExit(Exit.OK); checkOutput("my.module/p/MyClass.html", true, - "extends LibClass"); } @@ -151,7 +151,7 @@ public class TestLinkOptionWithAutomaticModule extends JavadocTester { "--module", "my.module"); checkExit(Exit.OK); checkOutput("my.module/p/MyClass.html", true, - "extends LibClass"); } } diff --git a/test/langtools/jdk/javadoc/doclet/testLinkOption/TestLinkOptionWithModule.java b/test/langtools/jdk/javadoc/doclet/testLinkOption/TestLinkOptionWithModule.java index 5a9fe3df096..437aa5301e1 100644 --- a/test/langtools/jdk/javadoc/doclet/testLinkOption/TestLinkOptionWithModule.java +++ b/test/langtools/jdk/javadoc/doclet/testLinkOption/TestLinkOptionWithModule.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 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 @@ -76,7 +76,7 @@ public class TestLinkOptionWithModule extends JavadocTester { checkExit(Exit.OK); checkOutput("com.ex2/com/ex2/B.html", true, - "A"); } @@ -95,7 +95,7 @@ public class TestLinkOptionWithModule extends JavadocTester { checkExit(Exit.OK); checkOutput("com/ex2/B.html", true, - "A"); } diff --git a/test/langtools/jdk/javadoc/doclet/testLinkOption/TestRedirectLinks.java b/test/langtools/jdk/javadoc/doclet/testLinkOption/TestRedirectLinks.java index 21de8cd9a50..ac1f294b742 100644 --- a/test/langtools/jdk/javadoc/doclet/testLinkOption/TestRedirectLinks.java +++ b/test/langtools/jdk/javadoc/doclet/testLinkOption/TestRedirectLinks.java @@ -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. * * This code is free software; you can redistribute it and/or modify it @@ -122,10 +122,10 @@ public class TestRedirectLinks extends JavadocTester { "pkg"); checkExit(Exit.OK); checkOutput("pkg/B.html", true, - "Link-Plain to String Class"); checkOutput("pkg/C.html", true, - "Object"); } @@ -216,10 +216,10 @@ public class TestRedirectLinks extends JavadocTester { checkOutput(Output.OUT, true, "javadoc: warning - URL " + oldURL + "/element-list was redirected to " + newURL + "/element-list"); checkOutput("mC/p5/C5.html", true, - "extends C1"); checkOutput("mC/p6/C6.html", true, - "C4"); } finally { if (oldServer != null) { diff --git a/test/langtools/jdk/javadoc/doclet/testModules/TestModules.java b/test/langtools/jdk/javadoc/doclet/testModules/TestModules.java index 6cb408d7c17..ad22d5eb6de 100644 --- a/test/langtools/jdk/javadoc/doclet/testModules/TestModules.java +++ b/test/langtools/jdk/javadoc/doclet/testModules/TestModules.java @@ -1246,13 +1246,13 @@ public class TestModules extends JavadocTester { void checkLinkOffline() { checkOutput("moduleB/testpkg3mdlB/package-summary.html", true, - "Link to String Class"); checkOutput("moduleB/testpkg3mdlB/package-summary.html", true, - "Link to java.lang package"); checkOutput("moduleB/testpkg3mdlB/package-summary.html", true, - "Link to java.base module"); } diff --git a/test/langtools/jdk/javadoc/doclet/testTitleInHref/TestTitleInHref.java b/test/langtools/jdk/javadoc/doclet/testTitleInHref/TestTitleInHref.java index 7812b609a50..5e640386da8 100644 --- a/test/langtools/jdk/javadoc/doclet/testTitleInHref/TestTitleInHref.java +++ b/test/langtools/jdk/javadoc/doclet/testTitleInHref/TestTitleInHref.java @@ -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. * * This code is free software; you can redistribute it and/or modify it @@ -56,7 +56,7 @@ public class TestTitleInHref extends JavadocTester { //Test to make sure that the title shows up in an interface link. "", //Test to make sure that the title shows up in cross link shows up - "" + "This is a cross link to class File"); }