8195796: Reduce the size of relative URLs in generated docs
authorjjg
Mon, 22 Jan 2018 11:15:51 -0800
changeset 48654 36f58bd6269f
parent 48653 89111a0e6355
child 48655 e1876e6b57b6
8195796: Reduce the size of relative URLs in generated docs Reviewed-by: ksrini
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractExecutableMemberWriter.java
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractMemberWriter.java
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeFieldWriterImpl.java
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeOptionalMemberWriterImpl.java
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeRequiredMemberWriterImpl.java
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeWriterImpl.java
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassUseWriter.java
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassWriterImpl.java
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ConstantsSummaryWriterImpl.java
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ConstructorWriterImpl.java
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/EnumConstantWriterImpl.java
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/FieldWriterImpl.java
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HelpWriter.java
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlConfiguration.java
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/LinkFactoryImpl.java
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/MethodWriterImpl.java
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleFrameWriter.java
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleIndexFrameWriter.java
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModulePackageIndexFrameWriter.java
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleWriterImpl.java
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/NestedClassWriterImpl.java
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageIndexFrameWriter.java
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageTreeWriter.java
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageUseWriter.java
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageWriterImpl.java
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PropertyWriterImpl.java
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SplitIndexWriter.java
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TagletWriterImpl.java
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TreeWriter.java
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/Links.java
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/DocLink.java
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/DocPath.java
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Extern.java
test/langtools/jdk/javadoc/doclet/AccessAsciiArt/AccessAsciiArt.java
test/langtools/jdk/javadoc/doclet/testAnchorNames/TestAnchorNames.java
test/langtools/jdk/javadoc/doclet/testAnnotationTypes/TestAnnotationTypes.java
test/langtools/jdk/javadoc/doclet/testClassLinks/TestClassLinks.java
test/langtools/jdk/javadoc/doclet/testClassTree/TestClassTree.java
test/langtools/jdk/javadoc/doclet/testConstructors/TestConstructors.java
test/langtools/jdk/javadoc/doclet/testCopyFiles/TestCopyFiles.java
test/langtools/jdk/javadoc/doclet/testDeprecatedDocs/TestDeprecatedDocs.java
test/langtools/jdk/javadoc/doclet/testDocPaths/TestDocPaths.java
test/langtools/jdk/javadoc/doclet/testHiddenTag/TestHiddenTag.java
test/langtools/jdk/javadoc/doclet/testHref/TestHref.java
test/langtools/jdk/javadoc/doclet/testHtmlDefinitionListTag/TestHtmlDefinitionListTag.java
test/langtools/jdk/javadoc/doclet/testHtmlTableTags/TestHtmlTableTags.java
test/langtools/jdk/javadoc/doclet/testHtmlTag/TestHtmlTag.java
test/langtools/jdk/javadoc/doclet/testHtmlVersion/TestHtmlVersion.java
test/langtools/jdk/javadoc/doclet/testInlineLinkLabel/TestInlineLinkLabel.java
test/langtools/jdk/javadoc/doclet/testInterface/TestInterface.java
test/langtools/jdk/javadoc/doclet/testJavaFX/TestJavaFX.java
test/langtools/jdk/javadoc/doclet/testLinkOption/TestLinkOption.java
test/langtools/jdk/javadoc/doclet/testLinkTaglet/TestLinkTaglet.java
test/langtools/jdk/javadoc/doclet/testMemberInheritance/TestMemberInheritance.java
test/langtools/jdk/javadoc/doclet/testMemberSummary/TestMemberSummary.java
test/langtools/jdk/javadoc/doclet/testModules/TestModules.java
test/langtools/jdk/javadoc/doclet/testNavigation/TestNavigation.java
test/langtools/jdk/javadoc/doclet/testNestedGenerics/TestNestedGenerics.java
test/langtools/jdk/javadoc/doclet/testNewLanguageFeatures/TestNewLanguageFeatures.java
test/langtools/jdk/javadoc/doclet/testOptions/TestOptions.java
test/langtools/jdk/javadoc/doclet/testOrdering/TestOrdering.java
test/langtools/jdk/javadoc/doclet/testOverriddenMethods/TestMultiInheritance.java
test/langtools/jdk/javadoc/doclet/testOverriddenMethods/TestOverriddenMethodDocCopy.java
test/langtools/jdk/javadoc/doclet/testOverriddenMethods/TestOverriddenPrivateMethods.java
test/langtools/jdk/javadoc/doclet/testOverriddenMethods/TestOverriddenPrivateMethodsWithPackageFlag.java
test/langtools/jdk/javadoc/doclet/testOverriddenMethods/TestOverriddenPrivateMethodsWithPrivateFlag.java
test/langtools/jdk/javadoc/doclet/testOverriddenMethods/TestOverrideMethods.java
test/langtools/jdk/javadoc/doclet/testPackagePage/TestPackagePage.java
test/langtools/jdk/javadoc/doclet/testPackageSummary/TestPackageSummary.java
test/langtools/jdk/javadoc/doclet/testPrivateClasses/TestPrivateClasses.java
test/langtools/jdk/javadoc/doclet/testProperty/TestProperty.java
test/langtools/jdk/javadoc/doclet/testRepeatedAnnotations/TestRepeatedAnnotations.java
test/langtools/jdk/javadoc/doclet/testSeeTag/TestSeeTag.java
test/langtools/jdk/javadoc/doclet/testSubTitle/TestSubTitle.java
test/langtools/jdk/javadoc/doclet/testThrowsTag/TestThrowsTag.java
test/langtools/jdk/javadoc/doclet/testTitleInHref/TestTitleInHref.java
test/langtools/jdk/javadoc/doclet/testTypeAnnotations/TestTypeAnnotations.java
test/langtools/jdk/javadoc/doclet/testTypeParams/TestTypeParameters.java
test/langtools/jdk/javadoc/doclet/testTypeVariableLinks/TestTypeVariableLinks.java
test/langtools/jdk/javadoc/doclet/testUseOption/TestUseOption.java
test/langtools/jdk/javadoc/doclet/testValueTag/TestValueTag.java
test/langtools/jdk/javadoc/doclet/testWarnings/TestWarnings.java
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractExecutableMemberWriter.java	Mon Jan 22 20:31:19 2018 +0530
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractExecutableMemberWriter.java	Mon Jan 22 11:15:51 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, 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
@@ -358,6 +358,6 @@
             }
         }
         buf.append(")");
-        return foundTypeVariable ? configuration.links.getName(buf.toString()) : null;
+        return foundTypeVariable ? writer.links.getName(buf.toString()) : null;
     }
 }
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractMemberWriter.java	Mon Jan 22 20:31:19 2018 +0530
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractMemberWriter.java	Mon Jan 22 11:15:51 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, 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
@@ -90,7 +90,7 @@
         this.utils = configuration.utils;
         this.contents = configuration.contents;
         this.resources = configuration.resources;
-        this.links = configuration.links;
+        this.links = writer.links;
     }
 
     public AbstractMemberWriter(SubWriterHolderWriter writer) {
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeFieldWriterImpl.java	Mon Jan 22 20:31:19 2018 +0530
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeFieldWriterImpl.java	Mon Jan 22 11:15:51 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2018, 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
@@ -27,8 +27,6 @@
 
 import jdk.javadoc.internal.doclets.formats.html.markup.Table;
 
-import java.util.Arrays;
-
 import javax.lang.model.element.Element;
 import javax.lang.model.element.ExecutableElement;
 import javax.lang.model.element.TypeElement;
@@ -292,7 +290,7 @@
      */
     protected Content getNavSummaryLink(TypeElement typeElement, boolean link) {
         if (link) {
-            return Links.createLink(
+            return links.createLink(
                     SectionName.ANNOTATION_TYPE_FIELD_SUMMARY,
                     contents.navField);
         } else {
@@ -305,7 +303,7 @@
      */
     protected void addNavDetailLink(boolean link, Content liNav) {
         if (link) {
-            liNav.addContent(Links.createLink(
+            liNav.addContent(links.createLink(
                     SectionName.ANNOTATION_TYPE_FIELD_DETAIL,
                     contents.navField));
         } else {
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeOptionalMemberWriterImpl.java	Mon Jan 22 20:31:19 2018 +0530
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeOptionalMemberWriterImpl.java	Mon Jan 22 11:15:51 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, 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
@@ -159,7 +159,7 @@
     @Override
     protected Content getNavSummaryLink(TypeElement typeElement, boolean link) {
         if (link) {
-            return Links.createLink(
+            return links.createLink(
                     SectionName.ANNOTATION_TYPE_OPTIONAL_ELEMENT_SUMMARY,
                     contents.navAnnotationTypeOptionalMember);
         } else {
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeRequiredMemberWriterImpl.java	Mon Jan 22 20:31:19 2018 +0530
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeRequiredMemberWriterImpl.java	Mon Jan 22 11:15:51 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, 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
@@ -27,9 +27,6 @@
 
 import jdk.javadoc.internal.doclets.formats.html.markup.Table;
 
-import java.util.Arrays;
-import java.util.List;
-
 import javax.lang.model.element.Element;
 import javax.lang.model.element.ExecutableElement;
 import javax.lang.model.element.TypeElement;
@@ -308,7 +305,7 @@
      */
     protected Content getNavSummaryLink(TypeElement typeElement, boolean link) {
         if (link) {
-            return Links.createLink(
+            return links.createLink(
                     SectionName.ANNOTATION_TYPE_REQUIRED_ELEMENT_SUMMARY,
                     contents.navAnnotationTypeRequiredMember);
         } else {
@@ -321,7 +318,7 @@
      */
     protected void addNavDetailLink(boolean link, Content liNav) {
         if (link) {
-            liNav.addContent(Links.createLink(
+            liNav.addContent(links.createLink(
                     SectionName.ANNOTATION_TYPE_ELEMENT_DETAIL,
                     contents.navAnnotationTypeMember));
         } else {
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeWriterImpl.java	Mon Jan 22 20:31:19 2018 +0530
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeWriterImpl.java	Mon Jan 22 11:15:51 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, 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,7 +109,7 @@
      */
     @Override
     protected Content getNavLinkPackage() {
-        Content linkContent = Links.createLink(DocPaths.PACKAGE_SUMMARY,
+        Content linkContent = links.createLink(DocPaths.PACKAGE_SUMMARY,
                 contents.packageLabel);
         Content li = HtmlTree.LI(linkContent);
         return li;
@@ -133,7 +133,7 @@
      */
     @Override
     protected Content getNavLinkClassUse() {
-        Content linkContent = Links.createLink(DocPaths.CLASS_USE.resolve(filename), contents.useLabel);
+        Content linkContent = links.createLink(DocPaths.CLASS_USE.resolve(filename), contents.useLabel);
         Content li = HtmlTree.LI(linkContent);
         return li;
     }
@@ -347,7 +347,7 @@
      */
     @Override
     protected Content getNavLinkTree() {
-        Content treeLinkContent = Links.createLink(DocPaths.PACKAGE_TREE,
+        Content treeLinkContent = links.createLink(DocPaths.PACKAGE_TREE,
                 contents.treeLabel, "", "");
         Content li = HtmlTree.LI(treeLinkContent);
         return li;
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassUseWriter.java	Mon Jan 22 20:31:19 2018 +0530
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassUseWriter.java	Mon Jan 22 11:15:51 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2018, 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
@@ -515,7 +515,7 @@
      */
     protected Content getNavLinkPackage() {
         Content linkContent =
-                Links.createLink(DocPath.parent.resolve(DocPaths.PACKAGE_SUMMARY), contents.packageLabel);
+                links.createLink(DocPath.parent.resolve(DocPaths.PACKAGE_SUMMARY), contents.packageLabel);
         Content li = HtmlTree.LI(linkContent);
         return li;
     }
@@ -550,8 +550,8 @@
      */
     protected Content getNavLinkTree() {
         Content linkContent = utils.isEnclosingPackageIncluded(typeElement)
-                ? Links.createLink(DocPath.parent.resolve(DocPaths.PACKAGE_TREE), contents.treeLabel)
-                : Links.createLink(pathToRoot.resolve(DocPaths.OVERVIEW_TREE), contents.treeLabel);
+                ? links.createLink(DocPath.parent.resolve(DocPaths.PACKAGE_TREE), contents.treeLabel)
+                : links.createLink(pathToRoot.resolve(DocPaths.OVERVIEW_TREE), contents.treeLabel);
         Content li = HtmlTree.LI(linkContent);
         return li;
     }
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassWriterImpl.java	Mon Jan 22 20:31:19 2018 +0530
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassWriterImpl.java	Mon Jan 22 11:15:51 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, 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
@@ -120,7 +120,7 @@
      */
     @Override
     protected Content getNavLinkPackage() {
-        Content linkContent = Links.createLink(DocPaths.PACKAGE_SUMMARY,
+        Content linkContent = links.createLink(DocPaths.PACKAGE_SUMMARY,
                 contents.packageLabel);
         Content li = HtmlTree.LI(linkContent);
         return li;
@@ -144,7 +144,7 @@
      */
     @Override
     protected Content getNavLinkClassUse() {
-        Content linkContent = Links.createLink(DocPaths.CLASS_USE.resolve(filename), contents.useLabel);
+        Content linkContent = links.createLink(DocPaths.CLASS_USE.resolve(filename), contents.useLabel);
         Content li = HtmlTree.LI(linkContent);
         return li;
     }
@@ -660,7 +660,7 @@
      */
     @Override
     protected Content getNavLinkTree() {
-        Content treeLinkContent = Links.createLink(DocPaths.PACKAGE_TREE,
+        Content treeLinkContent = links.createLink(DocPaths.PACKAGE_TREE,
                 contents.treeLabel, "", "");
         Content li = HtmlTree.LI(treeLinkContent);
         return li;
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ConstantsSummaryWriterImpl.java	Mon Jan 22 20:31:19 2018 +0530
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ConstantsSummaryWriterImpl.java	Mon Jan 22 11:15:51 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2018, 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
@@ -135,13 +135,13 @@
         //add link to summary
         Content link;
         if (pkg.isUnnamed()) {
-            link = Links.createLink(SectionName.UNNAMED_PACKAGE_ANCHOR,
+            link = links.createLink(SectionName.UNNAMED_PACKAGE_ANCHOR,
                     contents.defaultPackageLabel, "", "");
         } else {
             String parsedPackageName = utils.parsePackageName(pkg);
             Content packageNameContent = getPackageLabel(parsedPackageName);
             packageNameContent.addContent(".*");
-            link = Links.createLink(DocLink.fragment(parsedPackageName),
+            link = links.createLink(DocLink.fragment(parsedPackageName),
                     packageNameContent, "", "");
             PackageElement abbrevPkg = configuration.workArounds.getAbbreviatedPackageElement(pkg);
             printedPackageHeaders.add(abbrevPkg);
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ConstructorWriterImpl.java	Mon Jan 22 20:31:19 2018 +0530
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ConstructorWriterImpl.java	Mon Jan 22 11:15:51 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, 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
@@ -300,7 +300,7 @@
     @Override
     protected Content getNavSummaryLink(TypeElement typeElement, boolean link) {
         if (link) {
-            return Links.createLink(SectionName.CONSTRUCTOR_SUMMARY,
+            return links.createLink(SectionName.CONSTRUCTOR_SUMMARY,
                     contents.navConstructor);
         } else {
             return contents.navConstructor;
@@ -313,7 +313,7 @@
     @Override
     protected void addNavDetailLink(boolean link, Content liNav) {
         if (link) {
-            liNav.addContent(Links.createLink(
+            liNav.addContent(links.createLink(
                     SectionName.CONSTRUCTOR_DETAIL,
                     contents.navConstructor));
         } else {
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/EnumConstantWriterImpl.java	Mon Jan 22 20:31:19 2018 +0530
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/EnumConstantWriterImpl.java	Mon Jan 22 11:15:51 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, 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
@@ -281,7 +281,7 @@
     protected Content getNavSummaryLink(TypeElement typeElement, boolean link) {
         if (link) {
             if (typeElement == null) {
-                return Links.createLink(SectionName.ENUM_CONSTANT_SUMMARY,
+                return links.createLink(SectionName.ENUM_CONSTANT_SUMMARY,
                         contents.navEnum);
             } else {
                 return links.createLink(
@@ -299,7 +299,7 @@
     @Override
     protected void addNavDetailLink(boolean link, Content liNav) {
         if (link) {
-            liNav.addContent(Links.createLink(
+            liNav.addContent(links.createLink(
                     SectionName.ENUM_CONSTANT_DETAIL,
                     contents.navEnum));
         } else {
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/FieldWriterImpl.java	Mon Jan 22 20:31:19 2018 +0530
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/FieldWriterImpl.java	Mon Jan 22 11:15:51 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, 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
@@ -310,7 +310,7 @@
     protected Content getNavSummaryLink(TypeElement typeElement, boolean link) {
         if (link) {
             if (typeElement == null) {
-                return Links.createLink(
+                return links.createLink(
                         SectionName.FIELD_SUMMARY,
                         contents.navField);
             } else {
@@ -329,7 +329,7 @@
     @Override
     protected void addNavDetailLink(boolean link, Content liNav) {
         if (link) {
-            liNav.addContent(Links.createLink(
+            liNav.addContent(links.createLink(
                     SectionName.FIELD_DETAIL,
                     contents.navField));
         } else {
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HelpWriter.java	Mon Jan 22 20:31:19 2018 +0530
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HelpWriter.java	Mon Jan 22 11:15:51 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2018, 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
@@ -29,7 +29,6 @@
 import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
 import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
 import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
-import jdk.javadoc.internal.doclets.formats.html.markup.Links;
 import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
 import jdk.javadoc.internal.doclets.toolkit.Content;
 import jdk.javadoc.internal.doclets.toolkit.util.DocFileIOException;
@@ -54,6 +53,7 @@
 
     /**
      * Constructor to construct HelpWriter object.
+     * @param configuration the configuration
      * @param filename File to be generated.
      */
     public HelpWriter(HtmlConfiguration configuration,
@@ -67,6 +67,7 @@
      * will get generated if and only if "-helpfile" and "-nohelp" is not used
      * on the command line.
      *
+     * @param configuration the configuration
      * @throws DocFileIOException if there is a problem while generating the documentation
      */
     public static void generate(HtmlConfiguration configuration) throws DocFileIOException {
@@ -133,7 +134,7 @@
                     ? HtmlTree.SECTION(overviewHeading)
                     : HtmlTree.LI(HtmlStyle.blockList, overviewHeading);
             Content line3 = contents.getContent("doclet.Help_line_3",
-                    Links.createLink(DocPaths.overviewSummary(configuration.frames),
+                    links.createLink(DocPaths.overviewSummary(configuration.frames),
                     configuration.getText("doclet.Overview")));
             Content overviewPara = HtmlTree.P(line3);
             htmlTree.addContent(overviewPara);
@@ -283,7 +284,7 @@
                     ? HtmlTree.SECTION(treeHead)
                     : HtmlTree.LI(HtmlStyle.blockList, treeHead);
             Content line17 = contents.getContent("doclet.Help_line_17_with_tree_link",
-                    Links.createLink(DocPaths.OVERVIEW_TREE,
+                    links.createLink(DocPaths.OVERVIEW_TREE,
                     configuration.getText("doclet.Class_Hierarchy")),
                     HtmlTree.CODE(new StringContent("java.lang.Object")));
             Content treePara = HtmlTree.P(line17);
@@ -308,7 +309,7 @@
                     ? HtmlTree.SECTION(dHead)
                     : HtmlTree.LI(HtmlStyle.blockList, dHead);
             Content line20 = contents.getContent("doclet.Help_line_20_with_deprecated_api_link",
-                    Links.createLink(DocPaths.DEPRECATED_LIST,
+                    links.createLink(DocPaths.DEPRECATED_LIST,
                     configuration.getText("doclet.Deprecated_API")));
             Content dPara = HtmlTree.P(line20);
             htmlTree.addContent(dPara);
@@ -321,10 +322,10 @@
         if (configuration.createindex) {
             Content indexlink;
             if (configuration.splitindex) {
-                indexlink = Links.createLink(DocPaths.INDEX_FILES.resolve(DocPaths.indexN(1)),
+                indexlink = links.createLink(DocPaths.INDEX_FILES.resolve(DocPaths.indexN(1)),
                         configuration.getText("doclet.Index"));
             } else {
-                indexlink = Links.createLink(DocPaths.INDEX_ALL,
+                indexlink = links.createLink(DocPaths.INDEX_ALL,
                         configuration.getText("doclet.Index"));
             }
             Content indexHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
@@ -378,7 +379,7 @@
                 ? HtmlTree.SECTION(allclassesHead)
                 : HtmlTree.LI(HtmlStyle.blockList, allclassesHead);
         Content line27 = contents.getContent("doclet.Help_line_27",
-                Links.createLink(DocPaths.AllClasses(configuration.frames),
+                links.createLink(DocPaths.AllClasses(configuration.frames),
                 resources.getText("doclet.All_Classes")));
         Content allclassesPara = HtmlTree.P(line27);
         htmlTree.addContent(allclassesPara);
@@ -406,7 +407,7 @@
                 ? HtmlTree.SECTION(constHead)
                 : HtmlTree.LI(HtmlStyle.blockList, constHead);
         Content line29 = contents.getContent("doclet.Help_line_29",
-                Links.createLink(DocPaths.CONSTANT_VALUES,
+                links.createLink(DocPaths.CONSTANT_VALUES,
                 resources.getText("doclet.Constants_Summary")));
         Content constPara = HtmlTree.P(line29);
         htmlTree.addContent(constPara);
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlConfiguration.java	Mon Jan 22 20:31:19 2018 +0530
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlConfiguration.java	Mon Jan 22 11:15:51 2018 -0800
@@ -245,8 +245,6 @@
 
     protected final Messages messages;
 
-    protected Links links;
-
     /**
      * Creates an object to hold the configuration for a doclet.
      *
@@ -363,7 +361,6 @@
         setTopFile(docEnv);
         workArounds.initDocLint(doclintOpts.values(), tagletManager.getCustomTagNames(),
                 Utils.toLowerCase(htmlVersion.name()));
-        links = new Links(htmlVersion);
         return true;
     }
 
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java	Mon Jan 22 20:31:19 2018 +0530
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java	Mon Jan 22 11:15:51 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2018, 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
@@ -197,7 +197,7 @@
         this.contents = configuration.contents;
         this.messages = configuration.messages;
         this.resources = configuration.resources;
-        this.links = configuration.links;
+        this.links = new Links(path, configuration.htmlVersion);
         this.utils = configuration.utils;
         this.path = path;
         this.pathToRoot = path.parent().invert();
@@ -371,7 +371,7 @@
      */
     public Content getTargetPackageLink(PackageElement pkg, String target,
             Content label) {
-        return Links.createLink(pathString(pkg, DocPaths.PACKAGE_SUMMARY), label, "", target);
+        return links.createLink(pathString(pkg, DocPaths.PACKAGE_SUMMARY), label, "", target);
     }
 
     /**
@@ -385,7 +385,7 @@
      */
     public Content getTargetModulePackageLink(PackageElement pkg, String target,
             Content label, ModuleElement mdle) {
-        return Links.createLink(pathString(pkg, DocPaths.PACKAGE_SUMMARY),
+        return links.createLink(pathString(pkg, DocPaths.PACKAGE_SUMMARY),
                 label, "", target);
     }
 
@@ -398,7 +398,7 @@
      * @return a content for the target module link
      */
     public Content getTargetModuleLink(String target, Content label, ModuleElement mdle) {
-        return Links.createLink(pathToRoot.resolve(
+        return links.createLink(pathToRoot.resolve(
                 DocPaths.moduleSummary(mdle)), label, "", target);
     }
 
@@ -509,7 +509,7 @@
                 //WCAG - Hyperlinks should contain text or an image with alt text - for AT tools
                 navDiv.addContent(a);
                 Content skipLinkContent = HtmlTree.DIV(HtmlStyle.skipNav,
-                        Links.createLink(SectionName.SKIP_NAVBAR_TOP, skipNavLinks,
+                        links.createLink(SectionName.SKIP_NAVBAR_TOP, skipNavLinks,
                         skipNavLinks.toString(), ""));
                 navDiv.addContent(skipLinkContent);
             } else {
@@ -519,7 +519,7 @@
                 Content a = links.createAnchor(SectionName.NAVBAR_BOTTOM);
                 navDiv.addContent(a);
                 Content skipLinkContent = HtmlTree.DIV(HtmlStyle.skipNav,
-                        Links.createLink(SectionName.SKIP_NAVBAR_BOTTOM, skipNavLinks,
+                        links.createLink(SectionName.SKIP_NAVBAR_BOTTOM, skipNavLinks,
                         skipNavLinks.toString(), ""));
                 navDiv.addContent(skipLinkContent);
             }
@@ -651,7 +651,7 @@
      * @return a content tree for the link
      */
     protected Content getNavLinkContents() {
-        Content linkContent = Links.createLink(pathToRoot.resolve(DocPaths.overviewSummary(configuration.frames)),
+        Content linkContent = links.createLink(pathToRoot.resolve(DocPaths.overviewSummary(configuration.frames)),
                 contents.overviewLabel, "", "");
         Content li = HtmlTree.LI(linkContent);
         return li;
@@ -720,7 +720,7 @@
     public Content getNavLinkPrevious(DocPath prev) {
         Content li;
         if (prev != null) {
-            li = HtmlTree.LI(Links.createLink(prev, contents.prevLabel, "", ""));
+            li = HtmlTree.LI(links.createLink(prev, contents.prevLabel, "", ""));
         }
         else
             li = HtmlTree.LI(contents.prevLabel);
@@ -737,7 +737,7 @@
     public Content getNavLinkNext(DocPath next) {
         Content li;
         if (next != null) {
-            li = HtmlTree.LI(Links.createLink(next, contents.nextLabel, "", ""));
+            li = HtmlTree.LI(links.createLink(next, contents.nextLabel, "", ""));
         }
         else
             li = HtmlTree.LI(contents.nextLabel);
@@ -752,7 +752,7 @@
      */
     protected Content getNavShowLists(DocPath link) {
         DocLink dl = new DocLink(link, path.getPath(), null);
-        Content framesContent = Links.createLink(dl, contents.framesLabel, "", "_top");
+        Content framesContent = links.createLink(dl, contents.framesLabel, "", "_top");
         Content li = HtmlTree.LI(framesContent);
         return li;
     }
@@ -773,7 +773,7 @@
      * @return a content tree for the link
      */
     protected Content getNavHideLists(DocPath link) {
-        Content noFramesContent = Links.createLink(link, contents.noFramesLabel, "", "_top");
+        Content noFramesContent = links.createLink(link, contents.noFramesLabel, "", "_top");
         Content li = HtmlTree.LI(noFramesContent);
         return li;
     }
@@ -791,7 +791,7 @@
         DocPath docPath = packages.size() == 1 && configuration.getSpecifiedTypeElements().isEmpty()
                 ? pathString(packages.get(0), DocPaths.PACKAGE_TREE)
                 : pathToRoot.resolve(DocPaths.OVERVIEW_TREE);
-        return HtmlTree.LI(Links.createLink(docPath, contents.treeLabel, "", ""));
+        return HtmlTree.LI(links.createLink(docPath, contents.treeLabel, "", ""));
     }
 
     /**
@@ -801,7 +801,7 @@
      * @return a content tree for the link
      */
     protected Content getNavLinkMainTree(String label) {
-        Content mainTreeContent = Links.createLink(pathToRoot.resolve(DocPaths.OVERVIEW_TREE),
+        Content mainTreeContent = links.createLink(pathToRoot.resolve(DocPaths.OVERVIEW_TREE),
                 new StringContent(label));
         Content li = HtmlTree.LI(mainTreeContent);
         return li;
@@ -823,7 +823,7 @@
      * @return a content tree for the link
      */
     protected Content getNavLinkDeprecated() {
-        Content linkContent = Links.createLink(pathToRoot.resolve(DocPaths.DEPRECATED_LIST),
+        Content linkContent = links.createLink(pathToRoot.resolve(DocPaths.DEPRECATED_LIST),
                 contents.deprecatedLabel, "", "");
         Content li = HtmlTree.LI(linkContent);
         return li;
@@ -837,7 +837,7 @@
      * @return a content tree for the link
      */
     protected Content getNavLinkClassIndex() {
-        Content allClassesContent = Links.createLink(pathToRoot.resolve(
+        Content allClassesContent = links.createLink(pathToRoot.resolve(
                 DocPaths.AllClasses(configuration.frames)),
                 contents.allClassesLabel, "", "");
         Content li = HtmlTree.LI(allClassesContent);
@@ -850,7 +850,7 @@
      * @return a content tree for the link
      */
     protected Content getNavLinkIndex() {
-        Content linkContent = Links.createLink(pathToRoot.resolve(
+        Content linkContent = links.createLink(pathToRoot.resolve(
                 (configuration.splitindex
                     ? DocPaths.INDEX_FILES.resolve(DocPaths.indexN(1))
                     : DocPaths.INDEX_ALL)),
@@ -875,7 +875,7 @@
             DocFile file = DocFile.createFileForInput(configuration, helpfile);
             helpfilenm = DocPath.create(file.getName());
         }
-        Content linkContent = Links.createLink(pathToRoot.resolve(helpfilenm),
+        Content linkContent = links.createLink(pathToRoot.resolve(helpfilenm),
                 contents.helpLabel, "", "");
         Content li = HtmlTree.LI(linkContent);
         return li;
@@ -999,12 +999,12 @@
             }
         }
         if (included || packageElement == null) {
-            return Links.createLink(pathString(packageElement, DocPaths.PACKAGE_SUMMARY),
+            return links.createLink(pathString(packageElement, DocPaths.PACKAGE_SUMMARY),
                     label);
         } else {
             DocLink crossPkgLink = getCrossPackageLink(utils.getPackageName(packageElement));
             if (crossPkgLink != null) {
-                return Links.createLink(crossPkgLink, label);
+                return links.createLink(crossPkgLink, label);
             } else {
                 return label;
             }
@@ -1021,7 +1021,7 @@
     public Content getModuleLink(ModuleElement mdle, Content label) {
         boolean included = utils.isIncluded(mdle);
         return (included)
-                ? Links.createLink(pathToRoot.resolve(DocPaths.moduleSummary(mdle)), label, "", "")
+                ? links.createLink(pathToRoot.resolve(DocPaths.moduleSummary(mdle)), label, "", "")
                 : label;
     }
 
@@ -1051,7 +1051,7 @@
         DocPath href = pathToRoot
                 .resolve(DocPaths.SOURCE_OUTPUT)
                 .resolve(DocPath.forClass(utils, te));
-        Content linkContent = Links.createLink(href
+        Content linkContent = links.createLink(href
                 .fragment(SourceToHTMLConverter.getAnchorName(utils, typeElement)), label, "", "");
         htmltree.addContent(linkContent);
     }
@@ -1115,7 +1115,7 @@
                 */
                 DocLink link = configuration.extern.getExternalLink(packageName, pathToRoot,
                                 className + ".html", refMemName);
-                return Links.createLink(link,
+                return links.createLink(link,
                     (label == null) || label.isEmpty() ? defaultLabel : label,
                     strong,
                     resources.getText("doclet.Href_Class_Or_Interface_Title", packageName),
@@ -1422,7 +1422,7 @@
                         ? getCrossModuleLink(refClassName) : getCrossPackageLink(refClassName);
                 if (elementCrossLink != null) {
                     // Element cross link found
-                    return Links.createLink(elementCrossLink,
+                    return links.createLink(elementCrossLink,
                             (label.isEmpty() ? text : label), true);
                 } else if ((classCrossLink = getCrossClassLink(refClassName,
                         refMemName, label, false, !isLinkPlain)) != null) {
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/LinkFactoryImpl.java	Mon Jan 22 20:31:19 2018 +0530
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/LinkFactoryImpl.java	Mon Jan 22 11:15:51 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, 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
@@ -33,7 +33,6 @@
 import javax.lang.model.type.TypeMirror;
 
 import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder;
-import jdk.javadoc.internal.doclets.formats.html.markup.Links;
 import jdk.javadoc.internal.doclets.toolkit.BaseConfiguration;
 import jdk.javadoc.internal.doclets.toolkit.Content;
 import jdk.javadoc.internal.doclets.toolkit.util.DocPath;
@@ -93,7 +92,7 @@
                 DocPath filename = getPath(classLinkInfo);
                 if (linkInfo.linkToSelf ||
                                 !(DocPath.forName(utils, typeElement)).equals(m_writer.filename)) {
-                        link.addContent(Links.createLink(
+                        link.addContent(m_writer.links.createLink(
                                 filename.fragment(classLinkInfo.where),
                                 label,
                                 classLinkInfo.isStrong,
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/MethodWriterImpl.java	Mon Jan 22 20:31:19 2018 +0530
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/MethodWriterImpl.java	Mon Jan 22 11:15:51 2018 -0800
@@ -432,7 +432,7 @@
     protected Content getNavSummaryLink(TypeElement typeElement, boolean link) {
         if (link) {
             if (typeElement == null) {
-                return Links.createLink(
+                return links.createLink(
                         SectionName.METHOD_SUMMARY,
                         contents.navMethod);
             } else {
@@ -451,7 +451,7 @@
     @Override
     protected void addNavDetailLink(boolean link, Content liNav) {
         if (link) {
-            liNav.addContent(Links.createLink(
+            liNav.addContent(links.createLink(
                     SectionName.METHOD_DETAIL, contents.navMethod));
         } else {
             liNav.addContent(contents.navMethod);
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleFrameWriter.java	Mon Jan 22 20:31:19 2018 +0530
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleFrameWriter.java	Mon Jan 22 11:15:51 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2018, 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
@@ -101,7 +101,7 @@
                 ? HtmlTree.MAIN()
                 : body;
         Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, HtmlStyle.bar,
-                Links.createLink(DocPaths.moduleSummary(moduleElement), mdlLabel, "", "classFrame"));
+                mdlgen.links.createLink(DocPaths.moduleSummary(moduleElement), mdlLabel, "", "classFrame"));
         htmlTree.addContent(heading);
         HtmlTree div = new HtmlTree(HtmlTag.DIV);
         div.setStyle(HtmlStyle.indexContainer);
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleIndexFrameWriter.java	Mon Jan 22 20:31:19 2018 +0530
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleIndexFrameWriter.java	Mon Jan 22 11:15:51 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2018, 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
@@ -152,7 +152,7 @@
      * @param ul the Content object to which the all classes link should be added
      */
     protected void addAllClassesLink(Content ul) {
-        Content linkContent = Links.createLink(DocPaths.ALLCLASSES_FRAME,
+        Content linkContent = links.createLink(DocPaths.ALLCLASSES_FRAME,
                 contents.allClassesLabel, "", "packageFrame");
         Content li = HtmlTree.LI(linkContent);
         ul.addContent(li);
@@ -165,7 +165,7 @@
      * @param ul the Content object to which the all packages link should be added
      */
     protected void addAllPackagesLink(Content ul) {
-        Content linkContent = Links.createLink(DocPaths.OVERVIEW_FRAME,
+        Content linkContent = links.createLink(DocPaths.OVERVIEW_FRAME,
                 contents.allPackagesLabel, "", "packageListFrame");
         Content li = HtmlTree.LI(linkContent);
         ul.addContent(li);
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModulePackageIndexFrameWriter.java	Mon Jan 22 20:31:19 2018 +0530
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModulePackageIndexFrameWriter.java	Mon Jan 22 11:15:51 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2018, 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
@@ -143,12 +143,12 @@
         Content pkgLabel;
         if (!pkg.isUnnamed()) {
             pkgLabel = getPackageLabel(utils.getPackageName(pkg));
-            packageLinkContent = Links.createLink(pathString(pkg,
+            packageLinkContent = links.createLink(pathString(pkg,
                      DocPaths.PACKAGE_FRAME), pkgLabel, "",
                     "packageFrame");
         } else {
             pkgLabel = new StringContent("<unnamed package>");
-            packageLinkContent = Links.createLink(DocPaths.PACKAGE_FRAME,
+            packageLinkContent = links.createLink(DocPaths.PACKAGE_FRAME,
                     pkgLabel, "", "packageFrame");
         }
         Content li = HtmlTree.LI(packageLinkContent);
@@ -189,7 +189,7 @@
      * @param ul the Content object to which the all classes link should be added
      */
     protected void addAllClassesLink(Content ul) {
-        Content linkContent = Links.createLink(DocPaths.ALLCLASSES_FRAME,
+        Content linkContent = links.createLink(DocPaths.ALLCLASSES_FRAME,
                 contents.allClassesLabel, "", "packageFrame");
         Content li = HtmlTree.LI(linkContent);
         ul.addContent(li);
@@ -202,7 +202,7 @@
      * @param ul the Content object to which the all packages link should be added
      */
     protected void addAllPackagesLink(Content ul) {
-        Content linkContent = Links.createLink(DocPaths.OVERVIEW_FRAME,
+        Content linkContent = links.createLink(DocPaths.OVERVIEW_FRAME,
                 contents.allPackagesLabel, "", "packageListFrame");
         Content li = HtmlTree.LI(linkContent);
         ul.addContent(li);
@@ -215,7 +215,7 @@
      * @param ul the Content object to which the all modules link should be added
      */
     protected void addAllModulesLink(Content ul) {
-        Content linkContent = Links.createLink(DocPaths.MODULE_OVERVIEW_FRAME,
+        Content linkContent = links.createLink(DocPaths.MODULE_OVERVIEW_FRAME,
                 contents.allModulesLabel, "", "packageListFrame");
         Content li = HtmlTree.LI(linkContent);
         ul.addContent(li);
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleWriterImpl.java	Mon Jan 22 20:31:19 2018 +0530
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleWriterImpl.java	Mon Jan 22 11:15:51 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2018, 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
@@ -951,20 +951,20 @@
         Content ulNav = HtmlTree.UL(HtmlStyle.subNavList, li);
         Content liNav = new HtmlTree(HtmlTag.LI);
         liNav.addContent(!utils.getFullBody(mdle).isEmpty() && !configuration.nocomment
-                ? Links.createLink(SectionName.MODULE_DESCRIPTION, contents.navModuleDescription)
+                ? links.createLink(SectionName.MODULE_DESCRIPTION, contents.navModuleDescription)
                 : contents.navModuleDescription);
         addNavGap(liNav);
         liNav.addContent((display(requires) || display(indirectModules))
-                ? Links.createLink(SectionName.MODULES, contents.navModules)
+                ? links.createLink(SectionName.MODULES, contents.navModules)
                 : contents.navModules);
         addNavGap(liNav);
         liNav.addContent((display(packages)
                 || display(indirectPackages) || display(indirectOpenPackages))
-                ? Links.createLink(SectionName.PACKAGES, contents.navPackages)
+                ? links.createLink(SectionName.PACKAGES, contents.navPackages)
                 : contents.navPackages);
         addNavGap(liNav);
         liNav.addContent((displayServices(uses, usesTrees) || displayServices(provides.keySet(), providesTrees))
-                ? Links.createLink(SectionName.SERVICES, contents.navServices)
+                ? links.createLink(SectionName.SERVICES, contents.navServices)
                 : contents.navServices);
         ulNav.addContent(liNav);
         return ulNav;
@@ -1056,7 +1056,7 @@
         if (prevModule == null) {
             li = HtmlTree.LI(contents.prevModuleLabel);
         } else {
-            li = HtmlTree.LI(Links.createLink(pathToRoot.resolve(DocPaths.moduleSummary(
+            li = HtmlTree.LI(links.createLink(pathToRoot.resolve(DocPaths.moduleSummary(
                     prevModule)), contents.prevModuleLabel, "", ""));
         }
         return li;
@@ -1073,7 +1073,7 @@
         if (nextModule == null) {
             li = HtmlTree.LI(contents.nextModuleLabel);
         } else {
-            li = HtmlTree.LI(Links.createLink(pathToRoot.resolve(DocPaths.moduleSummary(
+            li = HtmlTree.LI(links.createLink(pathToRoot.resolve(DocPaths.moduleSummary(
                     nextModule)), contents.nextModuleLabel, "", ""));
         }
         return li;
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/NestedClassWriterImpl.java	Mon Jan 22 20:31:19 2018 +0530
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/NestedClassWriterImpl.java	Mon Jan 22 11:15:51 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, 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
@@ -213,7 +213,7 @@
     protected Content getNavSummaryLink(TypeElement typeElement, boolean link) {
         if (link) {
             if (typeElement == null) {
-                return Links.createLink(
+                return links.createLink(
                         SectionName.NESTED_CLASS_SUMMARY,
                         contents.navNested);
             } else {
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageIndexFrameWriter.java	Mon Jan 22 20:31:19 2018 +0530
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageIndexFrameWriter.java	Mon Jan 22 11:15:51 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2018, 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
@@ -25,8 +25,6 @@
 
 package jdk.javadoc.internal.doclets.formats.html;
 
-import java.util.Collection;
-
 import javax.lang.model.element.PackageElement;
 
 import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
@@ -110,11 +108,11 @@
         Content packageLabel;
         if (pe.isUnnamed()) {
             packageLabel = new StringContent("<unnamed package>");
-            packageLinkContent = Links.createLink(DocPaths.PACKAGE_FRAME,
+            packageLinkContent = links.createLink(DocPaths.PACKAGE_FRAME,
                     packageLabel, "", "packageFrame");
         } else {
             packageLabel = getPackageLabel(pe.getQualifiedName());
-            packageLinkContent = Links.createLink(pathString(pe,
+            packageLinkContent = links.createLink(pathString(pe,
                      DocPaths.PACKAGE_FRAME), packageLabel, "",
                     "packageFrame");
         }
@@ -153,7 +151,7 @@
      */
     @Override
     protected void addAllClassesLink(Content ul) {
-        Content linkContent = Links.createLink(DocPaths.ALLCLASSES_FRAME,
+        Content linkContent = links.createLink(DocPaths.ALLCLASSES_FRAME,
                 contents.allClassesLabel, "", "packageFrame");
         Content li = HtmlTree.LI(linkContent);
         ul.addContent(li);
@@ -167,7 +165,7 @@
      */
     @Override
     protected void addAllModulesLink(Content ul) {
-        Content linkContent = Links.createLink(DocPaths.MODULE_OVERVIEW_FRAME,
+        Content linkContent = links.createLink(DocPaths.MODULE_OVERVIEW_FRAME,
                 contents.allModulesLabel, "", "packageListFrame");
         Content li = HtmlTree.LI(linkContent);
         ul.addContent(li);
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageTreeWriter.java	Mon Jan 22 20:31:19 2018 +0530
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageTreeWriter.java	Mon Jan 22 11:15:51 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2018, 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
@@ -232,7 +232,7 @@
      */
     @Override
     protected Content getNavLinkPackage() {
-        Content linkContent = Links.createLink(DocPaths.PACKAGE_SUMMARY,
+        Content linkContent = links.createLink(DocPaths.PACKAGE_SUMMARY,
                 contents.packageLabel);
         Content li = HtmlTree.LI(linkContent);
         return li;
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageUseWriter.java	Mon Jan 22 20:31:19 2018 +0530
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageUseWriter.java	Mon Jan 22 11:15:51 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2018, 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
@@ -223,7 +223,7 @@
                 DocPath dp = pathString(te,
                         DocPaths.CLASS_USE.resolve(DocPath.forName(utils, te)));
                 Content stringContent = new StringContent(utils.getSimpleName(te));
-                Content typeContent = Links.createLink(dp.fragment(getPackageAnchorName(usingPackage)),
+                Content typeContent = links.createLink(dp.fragment(getPackageAnchorName(usingPackage)),
                         stringContent);
                 Content summary = new ContentBuilder();
                 addIndexComment(te, summary);
@@ -288,7 +288,7 @@
      */
     @Override
     protected Content getNavLinkPackage() {
-        Content linkContent = Links.createLink(DocPaths.PACKAGE_SUMMARY,
+        Content linkContent = links.createLink(DocPaths.PACKAGE_SUMMARY,
                 contents.packageLabel);
         Content li = HtmlTree.LI(linkContent);
         return li;
@@ -312,7 +312,7 @@
      */
     @Override
     protected Content getNavLinkTree() {
-        Content linkContent = Links.createLink(DocPaths.PACKAGE_TREE,
+        Content linkContent = links.createLink(DocPaths.PACKAGE_TREE,
                 contents.treeLabel);
         Content li = HtmlTree.LI(linkContent);
         return li;
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageWriterImpl.java	Mon Jan 22 20:31:19 2018 +0530
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageWriterImpl.java	Mon Jan 22 11:15:51 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, 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
@@ -385,7 +385,7 @@
      */
     @Override
     protected Content getNavLinkClassUse() {
-        Content useLink = Links.createLink(DocPaths.PACKAGE_USE,
+        Content useLink = links.createLink(DocPaths.PACKAGE_USE,
                 contents.useLabel, "", "");
         Content li = HtmlTree.LI(useLink);
         return li;
@@ -403,7 +403,7 @@
             li = HtmlTree.LI(contents.prevPackageLabel);
         } else {
             DocPath p = DocPath.relativePath(packageElement, prev);
-            li = HtmlTree.LI(Links.createLink(p.resolve(DocPaths.PACKAGE_SUMMARY),
+            li = HtmlTree.LI(links.createLink(p.resolve(DocPaths.PACKAGE_SUMMARY),
                 contents.prevPackageLabel, "", ""));
         }
         return li;
@@ -421,7 +421,7 @@
             li = HtmlTree.LI(contents.nextPackageLabel);
         } else {
             DocPath p = DocPath.relativePath(packageElement, next);
-            li = HtmlTree.LI(Links.createLink(p.resolve(DocPaths.PACKAGE_SUMMARY),
+            li = HtmlTree.LI(links.createLink(p.resolve(DocPaths.PACKAGE_SUMMARY),
                 contents.nextPackageLabel, "", ""));
         }
         return li;
@@ -435,7 +435,7 @@
      */
     @Override
     protected Content getNavLinkTree() {
-        Content useLink = Links.createLink(DocPaths.PACKAGE_TREE,
+        Content useLink = links.createLink(DocPaths.PACKAGE_TREE,
                 contents.treeLabel, "", "");
         Content li = HtmlTree.LI(useLink);
         return li;
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PropertyWriterImpl.java	Mon Jan 22 20:31:19 2018 +0530
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PropertyWriterImpl.java	Mon Jan 22 11:15:51 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, 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
@@ -332,7 +332,7 @@
     protected Content getNavSummaryLink(TypeElement typeElement, boolean link) {
         if (link) {
             if (typeElement == null) {
-                return Links.createLink(
+                return links.createLink(
                         SectionName.PROPERTY_SUMMARY,
                         contents.navProperty);
             } else {
@@ -351,7 +351,7 @@
     @Override
     protected void addNavDetailLink(boolean link, Content liNav) {
         if (link) {
-            liNav.addContent(Links.createLink(
+            liNav.addContent(links.createLink(
                     SectionName.PROPERTY_DETAIL,
                     contents.navProperty));
         } else {
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SplitIndexWriter.java	Mon Jan 22 20:31:19 2018 +0530
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SplitIndexWriter.java	Mon Jan 22 11:15:51 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2018, 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
@@ -177,7 +177,7 @@
     protected void addLinksForIndexes(Content contentTree) {
         for (int i = 0; i < indexElements.size(); i++) {
             int j = i + 1;
-            contentTree.addContent(Links.createLink(DocPaths.indexN(j),
+            contentTree.addContent(links.createLink(DocPaths.indexN(j),
                     new StringContent(indexElements.get(i).toString())));
             contentTree.addContent(Contents.SPACE);
         }
@@ -195,7 +195,7 @@
             return HtmlTree.LI(prevletterLabel);
         }
         else {
-            Content prevLink = Links.createLink(DocPaths.indexN(prev),
+            Content prevLink = links.createLink(DocPaths.indexN(prev),
                     prevletterLabel);
             return HtmlTree.LI(prevLink);
         }
@@ -213,7 +213,7 @@
             return HtmlTree.LI(nextletterLabel);
         }
         else {
-            Content nextLink = Links.createLink(DocPaths.indexN(next),
+            Content nextLink = links.createLink(DocPaths.indexN(next),
                     nextletterLabel);
             return HtmlTree.LI(nextLink);
         }
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TagletWriterImpl.java	Mon Jan 22 20:31:19 2018 +0530
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TagletWriterImpl.java	Mon Jan 22 11:15:51 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, 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
@@ -106,7 +106,7 @@
         }
         String desc = ch.getText(itt.getDescription());
 
-        String anchorName = configuration.links.getName(tagText);
+        String anchorName = htmlWriter.links.getName(tagText);
         Content result = HtmlTree.A_ID(HtmlStyle.searchTagResult, anchorName, new StringContent(tagText));
         if (configuration.createindex && !tagText.isEmpty()) {
             SearchIndexItem si = new SearchIndexItem();
@@ -288,7 +288,7 @@
                     ((ClassWriterImpl) htmlWriter).getTypeElement().getQualifiedName() + "." +
                     utils.getSimpleName(holder);
             DocLink link = constantsPath.fragment(whichConstant);
-            body.addContent(Links.createLink(link,
+            body.addContent(htmlWriter.links.createLink(link,
                     new StringContent(configuration.getText("doclet.Constants_Summary"))));
         }
         if (utils.isClass(holder) && utils.isSerializable((TypeElement)holder)) {
@@ -298,7 +298,7 @@
                 appendSeparatorIfNotEmpty(body);
                 DocPath serialPath = htmlWriter.pathToRoot.resolve(DocPaths.SERIALIZED_FORM);
                 DocLink link = serialPath.fragment(utils.getFullyQualifiedName(holder));
-                body.addContent(Links.createLink(link,
+                body.addContent(htmlWriter.links.createLink(link,
                         new StringContent(configuration.getText("doclet.Serialized_Form"))));
             }
         }
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TreeWriter.java	Mon Jan 22 20:31:19 2018 +0530
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TreeWriter.java	Mon Jan 22 11:15:51 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, 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
@@ -162,7 +162,7 @@
                     continue;
                 }
                 DocPath link = pathString(pkg, DocPaths.PACKAGE_TREE);
-                Content li = HtmlTree.LI(Links.createLink(link,
+                Content li = HtmlTree.LI(links.createLink(link,
                         new StringContent(utils.getPackageName(pkg))));
                 if (i < packages.size() - 1) {
                     li.addContent(", ");
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/Links.java	Mon Jan 22 20:31:19 2018 +0530
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/Links.java	Mon Jan 22 11:15:51 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, 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
@@ -46,17 +46,20 @@
  */
 public class Links {
 
+    private final DocPath file;
     private final HtmlVersion version;
 
     /**
-     * Creates a {@code Links} object for a specific HTML version.
+     * Creates a {@code Links} object for a specific file, to be written in a specific HTML version.
      * The version is used by the {@link #getName(String) getName} method
      * to help determine valid HTML names (ids), and to determine whether
      * to use an {@code id} or {@code name} attribute when creating anchors.
      *
+     * @param file the file
      * @param version the HTML version
      */
-    public Links(HtmlVersion version) {
+    public Links(DocPath file, HtmlVersion version) {
+        this.file = file;
         this.version = version;
     }
 
@@ -118,7 +121,7 @@
      */
     public Content createLink(String where, Content label) {
         DocLink l = DocLink.fragment(getName(where));
-        return Links.createLink(l, label, "", "");
+        return createLink(l, label, "", "");
     }
 
     /**
@@ -128,9 +131,9 @@
      * @param label         the content for the link
      * @return a content tree for the link
      */
-    public static Content createLink(SectionName sectionName, Content label) {
+    public Content createLink(SectionName sectionName, Content label) {
         DocLink l =  DocLink.fragment(sectionName.getName());
-        return Links.createLink(l, label, "", "");
+        return createLink(l, label, "", "");
     }
 
     /**
@@ -145,7 +148,7 @@
      */
     public Content createLink(SectionName sectionName, String where, Content label) {
         DocLink l =  DocLink.fragment(sectionName.getName() + getName(where));
-        return Links.createLink(l, label, "", "");
+        return createLink(l, label, "", "");
     }
 
     /**
@@ -157,7 +160,7 @@
      * @param target    the target for the link, or null
      * @return a content tree for the link
      */
-    public static Content createLink(SectionName sectionName, Content label, String title, String target) {
+    public Content createLink(SectionName sectionName, Content label, String title, String target) {
         DocLink l = DocLink.fragment(sectionName.getName());
         return createLink(l, label, title, target);
     }
@@ -169,8 +172,8 @@
      * @param label  the content for the link
      * @return a content tree for the link
      */
-    public static Content createLink(DocPath path, String label) {
-        return Links.createLink(path, new StringContent(label), false, "", "");
+    public Content createLink(DocPath path, String label) {
+        return createLink(path, new StringContent(label), false, "", "");
     }
 
     /**
@@ -180,8 +183,8 @@
      * @param label  the content for the link
      * @return a content tree for the link
      */
-    public static Content createLink(DocPath path, Content label) {
-        return Links.createLink(path, label, "", "");
+    public Content createLink(DocPath path, Content label) {
+        return createLink(path, label, "", "");
     }
 
     /**
@@ -196,7 +199,7 @@
      * @param target    the target for the link, or null
      * @return a content tree for the link
      */
-    public static Content createLink(DocPath path, Content label, boolean strong,
+    public Content createLink(DocPath path, Content label, boolean strong,
             String title, String target) {
         return createLink(new DocLink(path), label, strong, title, target);
     }
@@ -210,8 +213,8 @@
      * @param target    the target for the link, or null
      * @return a content tree for the link
      */
-    public static Content createLink(DocPath path, Content label, String title, String target) {
-        return Links.createLink(new DocLink(path), label, title, target);
+    public Content createLink(DocPath path, Content label, String title, String target) {
+        return createLink(new DocLink(path), label, title, target);
     }
 
     /**
@@ -221,8 +224,8 @@
      * @param label     the content for the link
      * @return a content tree for the link
      */
-    public static Content createLink(DocLink link, Content label) {
-        return Links.createLink(link, label, "", "");
+    public Content createLink(DocLink link, Content label) {
+        return createLink(link, label, "", "");
     }
 
     /**
@@ -234,8 +237,8 @@
      * @param target    the target for the link, or null
      * @return a content tree for the link
      */
-    public static Content createLink(DocLink link, Content label, String title, String target) {
-        HtmlTree anchor = HtmlTree.A(link.toString(), label);
+    public Content createLink(DocLink link, Content label, String title, String target) {
+        HtmlTree anchor = HtmlTree.A(link.relativizeAgainst(file).toString(), label);
         if (title != null && title.length() != 0) {
             anchor.addAttr(HtmlAttr.TITLE, title);
         }
@@ -257,7 +260,7 @@
      * @param target    the target for the link, or null
      * @return a content tree for the link
      */
-    public static Content createLink(DocLink link, Content label, boolean strong,
+    public Content createLink(DocLink link, Content label, boolean strong,
             String title, String target) {
         return createLink(link, label, strong, title, target, false);
     }
@@ -275,13 +278,13 @@
      * @param isExternal is the link external to the generated documentation
      * @return a content tree for the link
      */
-    public static Content createLink(DocLink link, Content label, boolean strong,
+    public Content createLink(DocLink link, Content label, boolean strong,
             String title, String target, boolean isExternal) {
         Content body = label;
         if (strong) {
             body = HtmlTree.SPAN(HtmlStyle.typeNameLink, body);
         }
-        HtmlTree l = HtmlTree.A(link.toString(), body);
+        HtmlTree l = HtmlTree.A(link.relativizeAgainst(file).toString(), body);
         if (title != null && title.length() != 0) {
             l.addAttr(HtmlAttr.TITLE, title);
         }
@@ -302,13 +305,12 @@
      * @param isExternal is the link external to the generated documentation
      * @return a content tree for the link
      */
-    public static Content createLink(DocLink link, Content label, boolean isExternal) {
-        HtmlTree anchor = HtmlTree.A(link.toString(), label);
+    public Content createLink(DocLink link, Content label, boolean isExternal) {
+        HtmlTree anchor = HtmlTree.A(link.relativizeAgainst(file).toString(), label);
         anchor.setStyle(HtmlStyle.externalLink);
         return anchor;
     }
 
-
     /**
      * Converts a name to a valid HTML name (id).
      * This depends on the HTML version specified when the {@code Links} object was created.
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/DocLink.java	Mon Jan 22 20:31:19 2018 +0530
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/DocLink.java	Mon Jan 22 11:15:51 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, 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
@@ -39,51 +39,101 @@
  *
  */
 public class DocLink {
-    final String path;
+    final DocPath path;
     final String query;
     final String fragment;
 
-    /** Create a DocLink representing the URI {@code #fragment}. */
+    /**
+     * Creates a DocLink representing the URI {@code #fragment}.
+     * @param fragment the fragment
+     * @return the DocLink
+     */
     public static DocLink fragment(String fragment) {
-        return new DocLink((String) null, (String) null, fragment);
-    }
-
-    /** Create a DocLink representing the URI {@code path}. */
-    public DocLink(DocPath path) {
-        this(path.getPath(), null, null);
+        return new DocLink((DocPath) null, (String) null, fragment);
     }
 
     /**
-     * Create a DocLink representing the URI {@code path?query#fragment}.
-     * query and fragment may be null.
+     * Creates a DocLink representing the URI {@code path}.
+     * @param path the path
      */
-    public DocLink(DocPath path, String query, String fragment) {
-        this(path.getPath(), query, fragment);
+    public DocLink(DocPath path) {
+        this(path, null, null);
     }
 
     /**
-     * Create a DocLink representing the URI {@code path?query#fragment}.
+     * Creates a DocLink representing the URI {@code path?query#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) {
+    public DocLink(DocPath path, String query, String fragment) {
         this.path = path;
         this.query = query;
         this.fragment = fragment;
     }
 
     /**
-     * Return the link in the form "path?query#fragment", omitting any empty
+     * Creates a DocLink representing the URI {@code path?query#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);
+    }
+
+    /**
+     * Creates a DocLink formed by relativizing the path against a given base.
+     * @param base the base
+     * @return the DocLink
+     */
+    public DocLink relativizeAgainst(DocPath base) {
+        if (base.isEmpty() || path == null) {
+            return this;
+        }
+
+        // The following guards against the (ugly) use-case of using DocPath to contain a URL
+        if (isAbsoluteURL(path)) {
+            return this;
+        }
+
+        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)) {
+            newPath = path.basename();
+        }
+        return new DocLink(newPath, query, fragment);
+    }
+
+    // return true if the path begins <letters>://
+    private boolean isAbsoluteURL(DocPath path) {
+        String s = path.getPath();
+        for (int i = 0; i < s.length(); i++) {
+            char c = s.charAt(i);
+            if (Character.isLetter(c)) {
+                continue;
+            }
+            return (c == ':' && i + 2 < s.length() && s.charAt(i + 1)== '/' && s.charAt(i + 2)== '/');
+        }
+        return false;
+    }
+
+    /**
+     * Returns the link in the form "path?query#fragment", omitting any empty
      * components.
+     * @return the string
      */
     @Override
     public String toString() {
         // common fast path
         if (path != null && isEmpty(query) && isEmpty(fragment))
-            return path;
+            return path.getPath();
 
         StringBuilder sb = new StringBuilder();
         if (path != null)
-            sb.append(path);
+            sb.append(path.getPath());
         if (!isEmpty(query))
             sb.append("?").append(query);
         if (!isEmpty(fragment))
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/DocPath.java	Mon Jan 22 20:31:19 2018 +0530
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/DocPath.java	Mon Jan 22 11:15:51 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2018, 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
@@ -25,6 +25,11 @@
 
 package jdk.javadoc.internal.doclets.toolkit.util;
 
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+
 import javax.lang.model.element.ModuleElement;
 import javax.lang.model.element.PackageElement;
 import javax.lang.model.element.TypeElement;
@@ -48,16 +53,21 @@
     public static final DocPath parent = new DocPath("..");
 
     /**
-     * Create a path from a string.
+     * Creates a path from a string.
+     * @param p the string
+     * @return the path
      */
     public static DocPath create(String p) {
         return (p == null) || p.isEmpty() ? empty : new DocPath(p);
     }
 
     /**
-     * Return the path for a class.
+     * Returns the path for a class.
      * For example, if the class is java.lang.Object,
      * the path is java/lang/Object.html.
+     * @param utils utility class for handling type elements
+     * @param typeElement the type element
+     * @return the path
      */
     public static DocPath forClass(Utils utils, TypeElement typeElement) {
         return (typeElement == null)
@@ -66,14 +76,24 @@
     }
 
     /**
-     * Return the path for the simple name of the class.
+     * Returns the path for the simple name of a class.
      * For example, if the class is java.lang.Object,
      * the path is Object.html.
+     * @param utils utility class for handling type elements
+     * @param typeElement the type element
+     * @return the path
      */
     public static DocPath forName(Utils utils, TypeElement typeElement) {
         return (typeElement == null) ? empty : new DocPath(utils.getSimpleName(typeElement) + ".html");
     }
 
+    /**
+     * Returns the path for the name of a module.
+     * For example, if the module is java.base,
+     * the path is java.base.
+     * @param mdle the module element
+     * @return the path
+     */
     public static DocPath forModule(ModuleElement mdle) {
         return mdle == null || mdle.isUnnamed()
                 ? empty
@@ -81,18 +101,23 @@
     }
 
     /**
-     * Return the path for the package of a class.
+     * Returns the path for the package of a class.
      * For example, if the class is java.lang.Object,
      * the path is java/lang.
+     * @param utils utility class for handling type elements
+     * @param typeElement the type element
+     * @return the path
      */
     public static DocPath forPackage(Utils utils, TypeElement typeElement) {
         return (typeElement == null) ? empty : forPackage(utils.containingPackage(typeElement));
     }
 
     /**
-     * Return the path for a package.
+     * Returns the path for a package.
      * For example, if the package is java.lang,
      * the path is java/lang.
+     * @param pkgElement the package element
+     * @return the path
      */
     public static DocPath forPackage(PackageElement pkgElement) {
         return pkgElement == null || pkgElement.isUnnamed()
@@ -101,9 +126,11 @@
     }
 
     /**
-     * Return the inverse path for a package.
+     * Returns the inverse path for a package.
      * For example, if the package is java.lang,
      * the inverse path is ../...
+     * @param pkgElement the package element
+     * @return the path
      */
     public static DocPath forRoot(PackageElement pkgElement) {
         String name = (pkgElement == null || pkgElement.isUnnamed())
@@ -113,7 +140,10 @@
     }
 
     /**
-     * Return the relative path from one package to another.
+     * Returns the relative path from one package to another.
+     * @param from the initial package
+     * @param to the target package
+     * @return the path
      */
     public static DocPath relativePath(PackageElement from, PackageElement to) {
         return forRoot(from).resolve(forPackage(to));
@@ -146,7 +176,9 @@
     }
 
     /**
-     * Return the path formed by appending the specified string to the current path.
+     * Returns the path formed by appending the specified string to the current path.
+     * @param p the string
+     * @return the path
      */
     public DocPath resolve(String p) {
         if (p == null || p.isEmpty())
@@ -157,7 +189,9 @@
     }
 
     /**
-     * Return the path by appending the specified path to the current path.
+     * Returns the path by appending the specified path to the current path.
+     * @param p the path
+     * @return the path
      */
     public DocPath resolve(DocPath p) {
         if (p == null || p.isEmpty())
@@ -170,28 +204,121 @@
     /**
      * Return the inverse path for this path.
      * For example, if the path is a/b/c, the inverse path is ../../..
+     * @return the path
      */
     public DocPath invert() {
         return new DocPath(path.replaceAll("[^/]+", ".."));
     }
 
     /**
+     * Returns the path formed by eliminating empty components,
+     * '.' components, and redundant name/.. components.
+     * @return the path
+     */
+    public DocPath normalize() {
+        return path.isEmpty()
+                ? this
+                : new DocPath(String.join("/", normalize(path)));
+    }
+
+    private static List<String> normalize(String path) {
+        return normalize(Arrays.asList(path.split("/")));
+    }
+
+    private static List<String> normalize(List<String> parts) {
+        if (parts.stream().noneMatch(s -> s.isEmpty() || s.equals(".") || s.equals(".."))) {
+            return parts;
+        }
+        List<String> normalized = new ArrayList<>();
+        for (String part : parts) {
+            switch (part) {
+                case "":
+                case ".":
+                    break;
+                case "..":
+                    int n = normalized.size();
+                    if (n > 0 && !normalized.get(n - 1).equals("..")) {
+                        normalized.remove(n - 1);
+                    } else {
+                        normalized.add(part);
+                    }
+                    break;
+                default:
+                    normalized.add(part);
+            }
+        }
+        return normalized;
+    }
+
+    /**
+     * Normalize and relativize a path against this path,
+     * assuming that this path is for a file (not a directory),
+     * in which the other path will appear.
+     *
+     * @param other the path to be relativized.
+     * @return the simplified path
+     */
+    public DocPath relativize(DocPath other) {
+        if (other == null || other.path.isEmpty()) {
+            return this;
+        }
+
+        if (path.isEmpty()) {
+            return other;
+        }
+
+        List<String> originParts = normalize(path);
+        int sep = path.lastIndexOf("/");
+        List<String> destParts = sep == -1
+                ? normalize(other.path)
+                : normalize(path.substring(0, sep + 1) + other.path);
+        int common = 0;
+        while (common < originParts.size()
+                && common < destParts.size()
+                && originParts.get(common).equals(destParts.get(common))) {
+            common++;
+        }
+
+        List<String> newParts;
+        if (common == originParts.size()) {
+            newParts = destParts.subList(common, destParts.size());
+        } else {
+            newParts = new ArrayList<>();
+            newParts.addAll(Collections.nCopies(originParts.size() - common - 1, ".."));
+            newParts.addAll(destParts.subList(common, destParts.size()));
+        }
+        return new DocPath(String.join("/", newParts));
+    }
+
+    /**
      * Return true if this path is empty.
+     * @return true if this path is empty
      */
     public boolean isEmpty() {
         return path.isEmpty();
     }
 
+    /**
+     * Creates a DocLink formed from this path and a fragment identifier.
+     * @param fragment the fragment
+     * @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 this path as a string.
+     * Returns this path as a string.
+     * @return the path
      */
     // This is provided instead of using toString() to help catch
     // unintended use of toString() in string concatenation sequences.
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Extern.java	Mon Jan 22 20:31:19 2018 +0530
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Extern.java	Mon Jan 22 11:15:51 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2018, 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
@@ -180,10 +180,11 @@
         if (fnd == null)
             return null;
 
+        // The following is somewhat questionable since we are using DocPath
+        // to contain external URLs!
         DocPath p = fnd.relative ?
                 relativepath.resolve(fnd.path).resolve(filename) :
                 DocPath.create(fnd.path).resolve(filename);
-
         return new DocLink(p, "is-external=true", memberName);
     }
 
--- a/test/langtools/jdk/javadoc/doclet/AccessAsciiArt/AccessAsciiArt.java	Mon Jan 22 20:31:19 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/AccessAsciiArt/AccessAsciiArt.java	Mon Jan 22 11:15:51 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2018, 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
@@ -48,9 +48,9 @@
 
         checkOutput("p1/subpkg/SSC.html", true,
                 // Test the top line of the class tree
-                "<li><a href=\"../../p1/C.html\" title=\"class in p1\">p1.C</a></li>",
+                "<li><a href=\"../C.html\" title=\"class in p1\">p1.C</a></li>",
                 // Test the second line of the class tree
-                "<li><a href=\"../../p1/SC.html\" title=\"class in p1\">p1.SC</a></li>",
+                "<li><a href=\"../SC.html\" title=\"class in p1\">p1.SC</a></li>",
                 // Test the third line of the class tree
                 "<li>p1.subpkg.SSC</li>");
     }
--- a/test/langtools/jdk/javadoc/doclet/testAnchorNames/TestAnchorNames.java	Mon Jan 22 20:31:19 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testAnchorNames/TestAnchorNames.java	Mon Jan 22 11:15:51 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2018, 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
@@ -82,63 +82,63 @@
         // Test some fields
         checkOutput("pkg1/RegClass.html", true,
                 "<a name=\"Z:Z_\">",
-                "<a href=\"../pkg1/RegClass.html#Z:Z_\">",
+                "<a href=\"#Z:Z_\">",
                 "<a name=\"Z:Z_:D\">",
-                "<a href=\"../pkg1/RegClass.html#Z:Z_:D\">",
+                "<a href=\"#Z:Z_:D\">",
                 "<a name=\"Z:Z:D_\">",
-                "<a href=\"../pkg1/RegClass.html#Z:Z:D_\">",
+                "<a href=\"#Z:Z:D_\">",
                 "<a name=\"Z:Z:Dfield\">",
-                "<a href=\"../pkg1/RegClass.html#Z:Z:Dfield\">",
+                "<a href=\"#Z:Z:Dfield\">",
                 "<a name=\"fieldInCla:D:D\">",
-                "<a href=\"../pkg1/RegClass.html#fieldInCla:D:D\">",
+                "<a href=\"#fieldInCla:D:D\">",
                 "<a name=\"S_:D:D:D:D:DINT\">",
-                "<a href=\"../pkg1/RegClass.html#S_:D:D:D:D:DINT\">",
+                "<a href=\"#S_:D:D:D:D:DINT\">",
                 "<a name=\"method:D:D\">",
-                "<a href=\"../pkg1/RegClass.html#method:D:D\">");
+                "<a href=\"#method:D:D\">");
 
         checkOutput("pkg1/DeprMemClass.html", true,
                 "<a name=\"Z:Z_field_In_Class\">",
-                "<a href=\"../pkg1/DeprMemClass.html#Z:Z_field_In_Class\">");
+                "<a href=\"#Z:Z_field_In_Class\">");
 
         // Test constructor
         checkOutput("pkg1/RegClass.html", true,
                 "<a name=\"RegClass-java.lang.String-int-\">",
-                "<a href=\"../pkg1/RegClass.html#RegClass-java.lang.String-int-\">");
+                "<a href=\"#RegClass-java.lang.String-int-\">");
 
         // Test some methods
         checkOutput("pkg1/RegClass.html", true,
                 "<a name=\"Z:Z_methodInClass-java.lang.String-\">",
-                "<a href=\"../pkg1/RegClass.html#Z:Z_methodInClass-java.lang.String-\">",
+                "<a href=\"#Z:Z_methodInClass-java.lang.String-\">",
                 "<a name=\"method--\">",
-                "<a href=\"../pkg1/RegClass.html#method--\">",
+                "<a href=\"#method--\">",
                 "<a name=\"foo-java.util.Map-\">",
-                "<a href=\"../pkg1/RegClass.html#foo-java.util.Map-\">",
+                "<a href=\"#foo-java.util.Map-\">",
                 "<a name=\"methodInCla:Ds-java.lang.String:A-\">",
-                "<a href=\"../pkg1/RegClass.html#methodInCla:Ds-java.lang.String:A-\">",
+                "<a href=\"#methodInCla:Ds-java.lang.String:A-\">",
                 "<a name=\"Z:Z_methodInClas:D-java.lang.String-int-\">",
-                "<a href=\"../pkg1/RegClass.html#Z:Z_methodInClas:D-java.lang.String-int-\">",
+                "<a href=\"#Z:Z_methodInClas:D-java.lang.String-int-\">",
                 "<a name=\"methodD-pkg1.RegClass.:DA-\">",
-                "<a href=\"../pkg1/RegClass.html#methodD-pkg1.RegClass.:DA-\">",
+                "<a href=\"#methodD-pkg1.RegClass.:DA-\">",
                 "<a name=\"methodD-pkg1.RegClass.D:A-\">",
-                "<a href=\"../pkg1/RegClass.html#methodD-pkg1.RegClass.D:A-\">");
+                "<a href=\"#methodD-pkg1.RegClass.D:A-\">");
 
         checkOutput("pkg1/DeprMemClass.html", true,
                 "<a name=\"Z:Z:Dmethod_In_Class--\">",
-                "<a href=\"../pkg1/DeprMemClass.html#Z:Z:Dmethod_In_Class--\">");
+                "<a href=\"#Z:Z:Dmethod_In_Class--\">");
 
         // Test enum
         checkOutput("pkg1/RegClass.Te$t_Enum.html", true,
                 "<a name=\"Z:Z:DFLD2\">",
-                "<a href=\"../pkg1/RegClass.Te$t_Enum.html#Z:Z:DFLD2\">");
+                "<a href=\"#Z:Z:DFLD2\">");
 
         // Test nested class
         checkOutput("pkg1/RegClass._NestedClas$.html", true,
                 "<a name=\"Z:Z_NestedClas:D--\">",
-                "<a href=\"../pkg1/RegClass._NestedClas$.html#Z:Z_NestedClas:D--\">");
+                "<a href=\"#Z:Z_NestedClas:D--\">");
 
         // Test class use page
         checkOutput("pkg1/class-use/DeprMemClass.html", true,
-                "<a href=\"../../pkg1/RegClass.html#d____mc\">");
+                "<a href=\"../RegClass.html#d____mc\">");
 
         // Test deprecated list page
         checkOutput("deprecated-list.html", true,
@@ -201,63 +201,63 @@
         // Test some fields
         checkOutput("pkg1/RegClass.html", true,
                 "<a id=\"_\">",
-                "<a href=\"../pkg1/RegClass.html#_\">",
+                "<a href=\"#_\">",
                 "<a id=\"_$\">",
-                "<a href=\"../pkg1/RegClass.html#_$\">",
+                "<a href=\"#_$\">",
                 "<a id=\"$_\">",
-                "<a href=\"../pkg1/RegClass.html#$_\">",
+                "<a href=\"#$_\">",
                 "<a id=\"$field\">",
-                "<a href=\"../pkg1/RegClass.html#$field\">",
+                "<a href=\"#$field\">",
                 "<a id=\"fieldInCla$$\">",
-                "<a href=\"../pkg1/RegClass.html#fieldInCla$$\">",
+                "<a href=\"#fieldInCla$$\">",
                 "<a id=\"S_$$$$$INT\">",
-                "<a href=\"../pkg1/RegClass.html#S_$$$$$INT\">",
+                "<a href=\"#S_$$$$$INT\">",
                 "<a id=\"method$$\">",
-                "<a href=\"../pkg1/RegClass.html#method$$\">");
+                "<a href=\"#method$$\">");
 
         checkOutput("pkg1/DeprMemClass.html", true,
                 "<a id=\"_field_In_Class\">",
-                "<a href=\"../pkg1/DeprMemClass.html#_field_In_Class\">");
+                "<a href=\"#_field_In_Class\">");
 
         // Test constructor
         checkOutput("pkg1/RegClass.html", true,
                 "<a id=\"&lt;init&gt;(java.lang.String,int)\">",
-                "<a href=\"../pkg1/RegClass.html#%3Cinit%3E(java.lang.String,int)\">");
+                "<a href=\"#%3Cinit%3E(java.lang.String,int)\">");
 
         // Test some methods
         checkOutput("pkg1/RegClass.html", true,
                 "<a id=\"_methodInClass(java.lang.String)\">",
-                "<a href=\"../pkg1/RegClass.html#_methodInClass(java.lang.String)\">",
+                "<a href=\"#_methodInClass(java.lang.String)\">",
                 "<a id=\"method()\">",
-                "<a href=\"../pkg1/RegClass.html#method()\">",
+                "<a href=\"#method()\">",
                 "<a id=\"foo(java.util.Map)\">",
-                "<a href=\"../pkg1/RegClass.html#foo(java.util.Map)\">",
+                "<a href=\"#foo(java.util.Map)\">",
                 "<a id=\"methodInCla$s(java.lang.String[])\">",
-                "<a href=\"../pkg1/RegClass.html#methodInCla$s(java.lang.String%5B%5D)\">",
+                "<a href=\"#methodInCla$s(java.lang.String%5B%5D)\">",
                 "<a id=\"_methodInClas$(java.lang.String,int)\">",
-                "<a href=\"../pkg1/RegClass.html#_methodInClas$(java.lang.String,int)\">",
+                "<a href=\"#_methodInClas$(java.lang.String,int)\">",
                 "<a id=\"methodD(pkg1.RegClass.$A)\">",
-                "<a href=\"../pkg1/RegClass.html#methodD(pkg1.RegClass.$A)\">",
+                "<a href=\"#methodD(pkg1.RegClass.$A)\">",
                 "<a id=\"methodD(pkg1.RegClass.D[])\">",
-                "<a href=\"../pkg1/RegClass.html#methodD(pkg1.RegClass.D%5B%5D)\">");
+                "<a href=\"#methodD(pkg1.RegClass.D%5B%5D)\">");
 
         checkOutput("pkg1/DeprMemClass.html", true,
                 "<a id=\"$method_In_Class()\">",
-                "<a href=\"../pkg1/DeprMemClass.html#$method_In_Class()\">");
+                "<a href=\"#$method_In_Class()\">");
 
         // Test enum
         checkOutput("pkg1/RegClass.Te$t_Enum.html", true,
                 "<a id=\"$FLD2\">",
-                "<a href=\"../pkg1/RegClass.Te$t_Enum.html#$FLD2\">");
+                "<a href=\"#$FLD2\">");
 
         // Test nested class
         checkOutput("pkg1/RegClass._NestedClas$.html", true,
                 "<a id=\"&lt;init&gt;()\">",
-                "<a href=\"../pkg1/RegClass._NestedClas$.html#%3Cinit%3E()\">");
+                "<a href=\"#%3Cinit%3E()\">");
 
         // Test class use page
         checkOutput("pkg1/class-use/DeprMemClass.html", true,
-                "<a href=\"../../pkg1/RegClass.html#d____mc\">");
+                "<a href=\"../RegClass.html#d____mc\">");
 
         // Test deprecated list page
         checkOutput("deprecated-list.html", true,
@@ -320,10 +320,10 @@
                 "<a id=\"\u0391\u0392\u0393()\">");
 
         checkOutput("p/Ref.html", true,
-                "<a href=\"../p/Def.html#%C3%A0%C3%A9\"><code>&agrave;&eacute;</code></a>",
-                "<a href=\"../p/Def.html#%C3%80%C3%89()\"><code>&Agrave;&Eacute;</code></a>",
-                "<a href=\"../p/Def.html#%CE%B1%CE%B2%CE%B3\"><code>&alpha;&beta;&gamma;</code></a>",
-                "<a href=\"../p/Def.html#%CE%91%CE%92%CE%93()\"><code>&Alpha;&Beta;&Gamma;</code></a>");
+                "<a href=\"Def.html#%C3%A0%C3%A9\"><code>&agrave;&eacute;</code></a>",
+                "<a href=\"Def.html#%C3%80%C3%89()\"><code>&Agrave;&Eacute;</code></a>",
+                "<a href=\"Def.html#%CE%B1%CE%B2%CE%B3\"><code>&alpha;&beta;&gamma;</code></a>",
+                "<a href=\"Def.html#%CE%91%CE%92%CE%93()\"><code>&Alpha;&Beta;&Gamma;</code></a>");
 
     }
 }
--- a/test/langtools/jdk/javadoc/doclet/testAnnotationTypes/TestAnnotationTypes.java	Mon Jan 22 20:31:19 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testAnnotationTypes/TestAnnotationTypes.java	Mon Jan 22 11:15:51 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2018, 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,8 +56,7 @@
                 + "field.detail\">Field</a>&nbsp;|&nbsp;</li>",
                 "<!-- =========== ANNOTATION TYPE FIELD SUMMARY =========== -->",
                 "<h3>Field Summary</h3>",
-                "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\"><a href=\"../"
-                + "pkg/AnnotationTypeField.html#DEFAULT_NAME\">DEFAULT_NAME</a></span>"
+                "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\"><a href=\"#DEFAULT_NAME\">DEFAULT_NAME</a></span>"
                 + "</code></th>",
                 "<!-- ============ ANNOTATION TYPE FIELD DETAIL =========== -->",
                 "<h4>DEFAULT_NAME</h4>\n"
--- a/test/langtools/jdk/javadoc/doclet/testClassLinks/TestClassLinks.java	Mon Jan 22 20:31:19 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testClassLinks/TestClassLinks.java	Mon Jan 22 11:15:51 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2018, 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
@@ -50,38 +50,38 @@
         checkExit(Exit.OK);
 
         checkOutput("p/C1.html", true,
-                "<code><a href=\"../p/C2.html\" title=\"class in p\">C2</a></code>",
-                "<code><span class=\"memberNameLink\"><a href=\"../p/C1.html#C1--\">C1</a></span>()</code>");
+                "<code><a href=\"C2.html\" title=\"class in p\">C2</a></code>",
+                "<code><span class=\"memberNameLink\"><a href=\"#C1--\">C1</a></span>()</code>");
 
         checkOutput("p/C2.html", true,
-                "<code><a href=\"../p/C3.html\" title=\"class in p\">C3</a></code>",
-                "<code><span class=\"memberNameLink\"><a href=\"../p/C2.html#C2--\">C2</a></span>()</code>");
+                "<code><a href=\"C3.html\" title=\"class in p\">C3</a></code>",
+                "<code><span class=\"memberNameLink\"><a href=\"#C2--\">C2</a></span>()</code>");
 
         checkOutput("p/C3.html", true,
-                "<code><a href=\"../p/I1.html\" title=\"interface in p\">I1</a></code>, "
-                + "<code><a href=\"../p/I12.html\" title=\"interface in p\">I12</a></code>, "
-                + "<code><a href=\"../p/I2.html\" title=\"interface in p\">I2</a></code>, "
-                + "<code><a href=\"../p/IT1.html\" title=\"interface in p\">IT1</a>&lt;T&gt;</code>, "
-                + "<code><a href=\"../p/IT2.html\" title=\"interface in p\">IT2</a>&lt;java.lang.String&gt;</code>",
-                "<code><span class=\"memberNameLink\"><a href=\"../p/C3.html#C3--\">C3</a></span>()</code>");
+                "<code><a href=\"I1.html\" title=\"interface in p\">I1</a></code>, "
+                + "<code><a href=\"I12.html\" title=\"interface in p\">I12</a></code>, "
+                + "<code><a href=\"I2.html\" title=\"interface in p\">I2</a></code>, "
+                + "<code><a href=\"IT1.html\" title=\"interface in p\">IT1</a>&lt;T&gt;</code>, "
+                + "<code><a href=\"IT2.html\" title=\"interface in p\">IT2</a>&lt;java.lang.String&gt;</code>",
+                "<code><span class=\"memberNameLink\"><a href=\"#C3--\">C3</a></span>()</code>");
 
         checkOutput("p/I1.html", true,
-                "<code><a href=\"../p/C3.html\" title=\"class in p\">C3</a></code>",
-                "<code><a href=\"../p/I12.html\" title=\"interface in p\">I12</a></code>");
+                "<code><a href=\"C3.html\" title=\"class in p\">C3</a></code>",
+                "<code><a href=\"I12.html\" title=\"interface in p\">I12</a></code>");
 
         checkOutput("p/I2.html", true,
-                "<code><a href=\"../p/C3.html\" title=\"class in p\">C3</a></code>",
-                "<code><a href=\"../p/I12.html\" title=\"interface in p\">I12</a></code>");
+                "<code><a href=\"C3.html\" title=\"class in p\">C3</a></code>",
+                "<code><a href=\"I12.html\" title=\"interface in p\">I12</a></code>");
 
         checkOutput("p/I12.html", true,
-                "<code><a href=\"../p/C3.html\" title=\"class in p\">C3</a></code>",
-                "<code><a href=\"../p/I1.html\" title=\"interface in p\">I1</a></code>, <code><a href=\"../p/I2.html\" title=\"interface in p\">I2</a></code>");
+                "<code><a href=\"C3.html\" title=\"class in p\">C3</a></code>",
+                "<code><a href=\"I1.html\" title=\"interface in p\">I1</a></code>, <code><a href=\"I2.html\" title=\"interface in p\">I2</a></code>");
 
         checkOutput("p/IT1.html", true,
-                "<code><a href=\"../p/C3.html\" title=\"class in p\">C3</a></code>");
+                "<code><a href=\"C3.html\" title=\"class in p\">C3</a></code>");
 
         checkOutput("p/IT2.html", true,
-                "code><a href=\"../p/C3.html\" title=\"class in p\">C3</a></code>");
+                "code><a href=\"C3.html\" title=\"class in p\">C3</a></code>");
 
     }
 
--- a/test/langtools/jdk/javadoc/doclet/testClassTree/TestClassTree.java	Mon Jan 22 20:31:19 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testClassTree/TestClassTree.java	Mon Jan 22 11:15:51 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2018, 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
@@ -51,11 +51,11 @@
 
         checkOutput("pkg/package-tree.html", true,
                 "<ul>\n"
-                + "<li class=\"circle\">pkg.<a href=\"../pkg/ParentClass.html\" "
+                + "<li class=\"circle\">pkg.<a href=\"ParentClass.html\" "
                 + "title=\"class in pkg\"><span class=\"typeNameLink\">ParentClass</span></a>",
                 "<h2 title=\"Annotation Type Hierarchy\">Annotation Type Hierarchy</h2>\n"
                 + "<ul>\n"
-                + "<li class=\"circle\">pkg.<a href=\"../pkg/AnnotationType.html\" "
+                + "<li class=\"circle\">pkg.<a href=\"AnnotationType.html\" "
                 + "title=\"annotation in pkg\"><span class=\"typeNameLink\">AnnotationType</span></a> "
                 + "(implements java.lang.annotation.Annotation)</li>\n"
                 + "</ul>",
@@ -66,7 +66,7 @@
                 + "<li class=\"circle\">java.lang.Enum&lt;E&gt; (implements java.lang."
                 + "Comparable&lt;T&gt;, java.io.Serializable)\n"
                 + "<ul>\n"
-                + "<li class=\"circle\">pkg.<a href=\"../pkg/Coin.html\" "
+                + "<li class=\"circle\">pkg.<a href=\"Coin.html\" "
                 + "title=\"enum in pkg\"><span class=\"typeNameLink\">Coin</span></a></li>\n"
                 + "</ul>\n"
                 + "</li>\n"
@@ -75,7 +75,7 @@
                 + "</ul>");
 
         checkOutput("pkg/package-tree.html", false,
-                "<li class=\"circle\">class pkg.<a href=\"../pkg/ParentClass.html\" "
+                "<li class=\"circle\">class pkg.<a href=\".ParentClass.html\" "
                 + "title=\"class in pkg\"><span class=\"typeNameLink\">ParentClass</span></a></li>");
     }
 }
--- a/test/langtools/jdk/javadoc/doclet/testConstructors/TestConstructors.java	Mon Jan 22 20:31:19 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testConstructors/TestConstructors.java	Mon Jan 22 11:15:51 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2018, 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
@@ -48,31 +48,31 @@
 
         checkOutput("pkg1/Outer.html", true,
                 "<dt><span class=\"seeLabel\">See Also:</span></dt>\n"
-                + "<dd><a href=\"../pkg1/Outer.Inner.html#Inner--\"><code>Inner()</code></a>, \n"
-                + "<a href=\"../pkg1/Outer.Inner.html#Inner-int-\"><code>Inner(int)</code></a>, \n"
-                + "<a href=\"../pkg1/Outer.Inner.NestedInner.html#NestedInner--\"><code>NestedInner()</code></a>, \n"
-                + "<a href=\"../pkg1/Outer.Inner.NestedInner.html#NestedInner-int-\"><code>NestedInner(int)</code></a>, \n"
-                + "<a href=\"../pkg1/Outer.html#Outer--\"><code>Outer()</code></a>, \n"
-                + "<a href=\"../pkg1/Outer.html#Outer-int-\"><code>Outer(int)</code></a>",
-                "Link: <a href=\"../pkg1/Outer.Inner.html#Inner--\"><code>Inner()</code></a>, "
-                + "<a href=\"../pkg1/Outer.html#Outer-int-\"><code>Outer(int)</code></a>, "
-                + "<a href=\"../pkg1/Outer.Inner.NestedInner.html#NestedInner-int-\"><code>"
+                + "<dd><a href=\"Outer.Inner.html#Inner--\"><code>Inner()</code></a>, \n"
+                + "<a href=\"Outer.Inner.html#Inner-int-\"><code>Inner(int)</code></a>, \n"
+                + "<a href=\"Outer.Inner.NestedInner.html#NestedInner--\"><code>NestedInner()</code></a>, \n"
+                + "<a href=\"Outer.Inner.NestedInner.html#NestedInner-int-\"><code>NestedInner(int)</code></a>, \n"
+                + "<a href=\"#Outer--\"><code>Outer()</code></a>, \n"
+                + "<a href=\"#Outer-int-\"><code>Outer(int)</code></a>",
+                "Link: <a href=\"Outer.Inner.html#Inner--\"><code>Inner()</code></a>, "
+                + "<a href=\"#Outer-int-\"><code>Outer(int)</code></a>, "
+                + "<a href=\"Outer.Inner.NestedInner.html#NestedInner-int-\"><code>"
                 + "NestedInner(int)</code></a>",
-                "<a href=\"../pkg1/Outer.html#Outer--\">Outer</a></span>()",
+                "<a href=\"#Outer--\">Outer</a></span>()",
                 "<a name=\"Outer--\">",
-                "<a href=\"../pkg1/Outer.html#Outer-int-\">Outer</a></span>&#8203;(int&nbsp;i)",
+                "<a href=\"#Outer-int-\">Outer</a></span>&#8203;(int&nbsp;i)",
                 "<a name=\"Outer-int-\">");
 
         checkOutput("pkg1/Outer.Inner.html", true,
-                "<a href=\"../pkg1/Outer.Inner.html#Inner--\">Inner</a></span>()",
+                "<a href=\"#Inner--\">Inner</a></span>()",
                 "<a name=\"Inner--\">",
-                "<a href=\"../pkg1/Outer.Inner.html#Inner-int-\">Inner</a></span>&#8203;(int&nbsp;i)",
+                "<a href=\"#Inner-int-\">Inner</a></span>&#8203;(int&nbsp;i)",
                 "<a name=\"Inner-int-\">");
 
         checkOutput("pkg1/Outer.Inner.NestedInner.html", true,
-                "<a href=\"../pkg1/Outer.Inner.NestedInner.html#NestedInner--\">NestedInner</a></span>()",
+                "<a href=\"#NestedInner--\">NestedInner</a></span>()",
                 "<a name=\"NestedInner--\">",
-                "<a href=\"../pkg1/Outer.Inner.NestedInner.html#NestedInner-int-\">NestedInner</a></span>&#8203;(int&nbsp;i)",
+                "<a href=\"#NestedInner-int-\">NestedInner</a></span>&#8203;(int&nbsp;i)",
                 "<a name=\"NestedInner-int-\">");
 
         checkOutput("pkg1/Outer.Inner.html", false,
@@ -84,9 +84,9 @@
                 "Outer.Inner.NestedInner-int-");
 
         checkOutput("pkg1/Outer.html", false,
-                "<a href=\"../pkg1/Outer.Inner.html#Outer.Inner--\"><code>Outer.Inner()</code></a>",
-                "<a href=\"../pkg1/Outer.Inner.html#Outer.Inner-int-\"><code>Outer.Inner(int)</code></a>",
-                "<a href=\"../pkg1/Outer.Inner.NestedInner.html#Outer.Inner.NestedInner--\"><code>Outer.Inner.NestedInner()</code></a>",
-                "<a href=\"../pkg1/Outer.Inner.NestedInner.html#Outer.Inner.NestedInner-int-\"><code>Outer.Inner.NestedInner(int)</code></a>");
+                "<a href=\"Outer.Inner.html#Outer.Inner--\"><code>Outer.Inner()</code></a>",
+                "<a href=\"Outer.Inner.html#Outer.Inner-int-\"><code>Outer.Inner(int)</code></a>",
+                "<a href=\"Outer.Inner.NestedInner.html#Outer.Inner.NestedInner--\"><code>Outer.Inner.NestedInner()</code></a>",
+                "<a href=\"Outer.Inner.NestedInner.html#Outer.Inner.NestedInner-int-\"><code>Outer.Inner.NestedInner(int)</code></a>");
     }
 }
--- a/test/langtools/jdk/javadoc/doclet/testCopyFiles/TestCopyFiles.java	Mon Jan 22 20:31:19 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testCopyFiles/TestCopyFiles.java	Mon Jan 22 11:15:51 2018 -0800
@@ -54,18 +54,18 @@
                 "phi-TOP-phi",
                 // check top navbar
                 "<a href=\"../../acme.mdle-summary.html\">Module</a>",
-                "<a href=\"../../p/package-summary.html\">Package</a>",
+                "<a href=\"../package-summary.html\">Package</a>",
                 "<a href=\"../../overview-tree.html\">Tree</a>",
                 "<a href=\"../../deprecated-list.html\">Deprecated</a>",
                 "<a href=\"../../index-all.html\">Index</a>",
                 "phi-HEADER-phi",
                 "In a named module acme.module and named package "
-                        + "<a href=\"../../p/package-summary.html\"><code>p</code></a>.",
+                        + "<a href=\"../package-summary.html\"><code>p</code></a>.",
                 "\"simpleTagLabel\">Since:</",
                 "1940",
                 // check bottom navbar
                 "<a href=\"../../acme.mdle-summary.html\">Module</a>",
-                "<a href=\"../../p/package-summary.html\">Package</a>",
+                "<a href=\"../package-summary.html\">Package</a>",
                 "<a href=\"../../overview-tree.html\">Tree</a>",
                 "<a href=\"../../deprecated-list.html\">Deprecated</a>",
                 "<a href=\"../../index-all.html\">Index</a>",
@@ -91,18 +91,18 @@
                 "phi-TOP-phi",
                 // check top navbar
                 "<a href=\"../../acme.mdle-summary.html\">Module</a>",
-                "<a href=\"../../p/package-summary.html\">Package</a>",
+                "<a href=\"../package-summary.html\">Package</a>",
                 "<a href=\"../../overview-tree.html\">Tree</a>",
                 "<a href=\"../../deprecated-list.html\">Deprecated</a>",
                 "<a href=\"../../index-all.html\">Index</a>",
                 "phi-HEADER-phi",
                 "In a named module acme.module and named package "
-                        + "<a href=\"../../p/package-summary.html\"><code>p</code></a>.",
+                        + "<a href=\"../package-summary.html\"><code>p</code></a>.",
                 "\"simpleTagLabel\">Since:</",
                 "1940",
                 // check bottom navbar
                 "<a href=\"../../acme.mdle-summary.html\">Module</a>",
-                "<a href=\"../../p/package-summary.html\">Package</a>",
+                "<a href=\"../package-summary.html\">Package</a>",
                 "<a href=\"../../overview-tree.html\">Tree</a>",
                 "<a href=\"../../deprecated-list.html\">Deprecated</a>",
                 "<a href=\"../../index-all.html\">Index</a>",
@@ -116,7 +116,7 @@
                 "phi-TOP-phi",
                 // check top navbar
                 "<a href=\"../../../../acme2.mdle-summary.html\">Module</a>",
-                "<a href=\"../../../../p2/package-summary.html\">Package</a>",
+                "<a href=\"../../../package-summary.html\">Package</a>",
                 "<a href=\"../../../../overview-tree.html\">Tree</a>",
                 "<a href=\"../../../../deprecated-list.html\">Deprecated</a>",
                 "<a href=\"../../../../index-all.html\">Index</a>",
@@ -124,7 +124,7 @@
                 "SubSubReadme.html at third level of doc-file directory.",
                 // check bottom navbar
                 "<a href=\"../../../../acme2.mdle-summary.html\">Module</a>",
-                "<a href=\"../../../../p2/package-summary.html\">Package</a>",
+                "<a href=\"../../../package-summary.html\">Package</a>",
                 "<a href=\"../../../../overview-tree.html\">Tree</a>",
                 "<a href=\"../../../../deprecated-list.html\">Deprecated</a>",
                 "<a href=\"../../../../index-all.html\">Index</a>",
@@ -141,7 +141,7 @@
         checkExit(Exit.OK);
         checkOutput("p/doc-files/inpackage.html", true,
                 "In a named module acme.module and named package "
-                + "<a href=\"../../p/package-summary.html\"><code>p</code></a>."
+                + "<a href=\"../package-summary.html\"><code>p</code></a>."
         );
     }
 
@@ -155,7 +155,7 @@
         checkExit(Exit.OK);
         checkOutput("p/doc-files/inpackage.html", true,
                 "In a named module acme.module and named package "
-                + "<a href=\"../../p/package-summary.html\"><code>p</code></a>."
+                + "<a href=\"../package-summary.html\"><code>p</code></a>."
         );
     }
 
--- a/test/langtools/jdk/javadoc/doclet/testDeprecatedDocs/TestDeprecatedDocs.java	Mon Jan 22 20:31:19 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testDeprecatedDocs/TestDeprecatedDocs.java	Mon Jan 22 11:15:51 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, 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
@@ -158,12 +158,12 @@
                 "<hr>\n"
                 + "<pre>@Deprecated(forRemoval=true)\n"
                 + "public enum <span class=\"typeNameLabel\">TestEnum</span>\n"
-                + "extends java.lang.Enum&lt;<a href=\"../pkg/TestEnum.html\" title=\"enum in pkg\">TestEnum</a>&gt;</pre>\n"
+                + "extends java.lang.Enum&lt;<a href=\"TestEnum.html\" title=\"enum in pkg\">TestEnum</a>&gt;</pre>\n"
                 + "<div class=\"deprecationBlock\"><span class=\"deprecatedLabel\">Deprecated, for removal: This API element is subject to removal in a future version.</span>\n"
                 + "<div class=\"deprecationComment\">enum_test1 passes.</div>\n"
                 + "</div>",
                 "<pre>@Deprecated(forRemoval=true)\n"
-                + "public static final&nbsp;<a href=\"../pkg/TestEnum.html\" title=\"enum in pkg\">TestEnum</a> FOR_REMOVAL</pre>\n"
+                + "public static final&nbsp;<a href=\"TestEnum.html\" title=\"enum in pkg\">TestEnum</a> FOR_REMOVAL</pre>\n"
                 + "<div class=\"deprecationBlock\"><span class=\"deprecatedLabel\">Deprecated, for removal: This API element is subject to removal in a future version.</span>\n"
                 + "<div class=\"deprecationComment\">enum_test3 passes.</div>\n"
                 + "</div>");
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/langtools/jdk/javadoc/doclet/testDocPaths/TestDocPaths.java	Mon Jan 22 11:15:51 2018 -0800
@@ -0,0 +1,99 @@
+/*
+ * Copyright (c) 2018, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8195796
+ * @summary Add normalize and relative methods to DocPath
+ * @library /tools/lib
+ * @modules jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.util
+ * @build toolbox.TestRunner
+ * @run main TestDocPaths
+ */
+
+import jdk.javadoc.internal.doclets.toolkit.util.DocPath;
+import toolbox.TestRunner;
+
+public class TestDocPaths extends TestRunner {
+
+    public static void main(String... args) throws Exception {
+        TestDocPaths tester = new TestDocPaths();
+        tester.runTests();
+    }
+
+    TestDocPaths() {
+        super(System.err);
+    }
+
+    @Test
+    public void testNormalize() {
+        testNormalize("", "");
+        testNormalize(".", "");
+        testNormalize("a/b", "a/b");
+        testNormalize("a//b", "a/b");
+        testNormalize("./b", "b");
+        testNormalize("a/.", "a");
+        testNormalize("a/./b", "a/b");
+        testNormalize("../b", "../b");
+        testNormalize("a/..", "");
+        testNormalize("a/../b", "b");
+        testNormalize("a/../../b", "../b");
+        testNormalize("a/./../b", "b");
+        testNormalize("./../b", "../b");
+        testNormalize("a/./../b", "b");
+    }
+
+    private void testNormalize(String p, String expect) {
+        out.println("test " + p);
+        String found = DocPath.create(p).normalize().getPath();
+        out.println("  result: " + found);
+        if (!expect.equals(found)) {
+            error("Mismatch:\n"
+                + "  expect: " + expect);
+        }
+        out.println();
+    }
+
+    @Test
+    public void testRelativize() {
+        testRelativize("a/b/c/file.html", "file.html", "");
+        testRelativize("a/b/c/file.html", "file2.html", "file2.html");
+        testRelativize("a/b/c/file.html", "../../../a/b/file.html", "../file.html");
+        testRelativize("a/b/c/file.html", "../../../a/b/c/file.html", "");
+        testRelativize("a/b/c/file.html", "../../../a/b/c2/file.html", "../c2/file.html");
+        testRelativize("a/b/c/file.html", "../../../a/b/c/d/file.html", "d/file.html");
+    }
+
+    private void testRelativize(String file, String href, String expect) {
+        out.println("test " + file + " " + href);
+        String found = DocPath.create(file)
+                .relativize(DocPath.create(href))
+                .getPath();
+        out.println("  result: " + found);
+        if (!expect.equals(found)) {
+            error("Mismatch:\n"
+                + "  expect: " + expect);
+        }
+        out.println();
+    }
+}
--- a/test/langtools/jdk/javadoc/doclet/testHiddenTag/TestHiddenTag.java	Mon Jan 22 20:31:19 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testHiddenTag/TestHiddenTag.java	Mon Jan 22 11:15:51 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2018, 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,8 +54,8 @@
                 "<a name=\"visibleField\">",
                 "<a name=\"visibleMethod--\">",
                 "<dt>Direct Known Subclasses:</dt>\n" +
-                "<dd><code><a href=\"../pkg1/A.VisibleInner.html\" title=\"class in pkg1\">" +
-                "A.VisibleInner</a></code>, <code><a href=\"../pkg1/A.VisibleInnerExtendsInvisibleInner.html\" " +
+                "<dd><code><a href=\"A.VisibleInner.html\" title=\"class in pkg1\">" +
+                "A.VisibleInner</a></code>, <code><a href=\"A.VisibleInnerExtendsInvisibleInner.html\" " +
                 "title=\"class in pkg1\">A.VisibleInnerExtendsInvisibleInner</a></code></dd>");
 
         checkOutput("pkg1/A.html", false,
@@ -63,12 +63,12 @@
                 "<a name=\"inVisibleMethod--\">");
 
         checkOutput("pkg1/A.VisibleInner.html", true,
-                "<code><a href=\"../pkg1/A.html#visibleField\">visibleField</a></code>",
-                "<code><a href=\"../pkg1/A.html#visibleMethod--\">visibleMethod</a></code>",
+                "<code><a href=\"A.html#visibleField\">visibleField</a></code>",
+                "<code><a href=\"A.html#visibleMethod--\">visibleMethod</a></code>",
                 "<h3>Nested classes/interfaces inherited from class&nbsp;pkg1." +
-                "<a href=\"../pkg1/A.html\" title=\"class in pkg1\">A</a></h3>\n" +
-                "<code><a href=\"../pkg1/A.VisibleInner.html\" title=\"class in pkg1\">" +
-                "A.VisibleInner</a>, <a href=\"../pkg1/A.VisibleInnerExtendsInvisibleInner.html\" " +
+                "<a href=\"A.html\" title=\"class in pkg1\">A</a></h3>\n" +
+                "<code><a href=\"A.VisibleInner.html\" title=\"class in pkg1\">" +
+                "A.VisibleInner</a>, <a href=\"A.VisibleInnerExtendsInvisibleInner.html\" " +
                 "title=\"class in pkg1\">A.VisibleInnerExtendsInvisibleInner</a></code></li>\n" +
                 "</ul>");
 
@@ -80,9 +80,9 @@
         checkOutput("pkg1/A.VisibleInnerExtendsInvisibleInner.html", true,
                 "<pre>public static class <span class=\"typeNameLabel\">" +
                 "A.VisibleInnerExtendsInvisibleInner</span>\n" +
-                "extends <a href=\"../pkg1/A.html\" title=\"class in pkg1\">A</a></pre>",
-                "<code><a href=\"../pkg1/A.html#visibleField\">visibleField</a></code></li>",
-                "<code><a href=\"../pkg1/A.html#visibleMethod--\">visibleMethod</a></code>");
+                "extends <a href=\"A.html\" title=\"class in pkg1\">A</a></pre>",
+                "<code><a href=\"A.html#visibleField\">visibleField</a></code></li>",
+                "<code><a href=\"A.html#visibleMethod--\">visibleMethod</a></code>");
 
         checkOutput("pkg1/A.VisibleInnerExtendsInvisibleInner.html", false,
                 "invisibleField",
--- a/test/langtools/jdk/javadoc/doclet/testHref/TestHref.java	Mon Jan 22 20:31:19 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testHref/TestHref.java	Mon Jan 22 11:15:51 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, 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 @@
                 //External link.
                 "href=\"http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html?is-external=true#wait-long-int-\"",
                 //Member summary table link.
-                "href=\"../pkg/C1.html#method-int-int-java.util.ArrayList-\"",
+                "href=\"#method-int-int-java.util.ArrayList-\"",
                 //Anchor test.
                 "<a name=\"method-int-int-java.util.ArrayList-\">\n"
                 + "<!--   -->\n"
@@ -64,10 +64,10 @@
 
         checkOutput("pkg/C2.html", true,
                 //{@link} test.
-                "Link: <a href=\"../pkg/C1.html#method-int-int-java.util.ArrayList-\">",
+                "Link: <a href=\"C1.html#method-int-int-java.util.ArrayList-\">",
                 //@see test.
                 "See Also:</span></dt>\n"
-                + "<dd><a href=\"../pkg/C1.html#method-int-int-java.util.ArrayList-\">"
+                + "<dd><a href=\"C1.html#method-int-int-java.util.ArrayList-\">"
         );
 
         checkOutput("pkg/C4.html", true,
--- a/test/langtools/jdk/javadoc/doclet/testHtmlDefinitionListTag/TestHtmlDefinitionListTag.java	Mon Jan 22 20:31:19 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testHtmlDefinitionListTag/TestHtmlDefinitionListTag.java	Mon Jan 22 11:15:51 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2018, 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
@@ -157,7 +157,7 @@
                 + "<dt><span class=\"simpleTagLabel\">Since:</span></dt>\n"
                 + "<dd>JDK1.0</dd>\n"
                 + "<dt><span class=\"seeLabel\">See Also:</span></dt>\n"
-                + "<dd><a href=\"../pkg1/C2.html\" title=\"class in pkg1\"><code>"
+                + "<dd><a href=\"C2.html\" title=\"class in pkg1\"><code>"
                 + "C2</code></a>, \n"
                 + "<a href=\"../serialized-form.html#pkg1.C1\">"
                 + "Serialized Form</a></dd>\n"
@@ -166,7 +166,7 @@
                 + "<dt><span class=\"simpleTagLabel\">Since:</span></dt>\n"
                 + "<dd>1.4</dd>\n"
                 + "<dt><span class=\"seeLabel\">See Also:</span></dt>\n"
-                + "<dd><a href=\"../pkg1/C1.html#setUndecorated-boolean-\">"
+                + "<dd><a href=\"#setUndecorated-boolean-\">"
                 + "<code>setUndecorated(boolean)</code></a></dd>\n"
                 + "</dl>",
                 "<dl>\n"
@@ -193,7 +193,7 @@
                 + "<dd>1.4</dd>\n"
                 + "<dt><span class=\"seeLabel\">See Also:</span></dt>\n"
                 + "<dd>"
-                + "<a href=\"../pkg1/C1.html#readObject--\"><code>readObject()"
+                + "<a href=\"#readObject--\"><code>readObject()"
                 + "</code></a></dd>\n"
                 + "</dl>",
                 "<dl>\n"
@@ -201,7 +201,7 @@
                 + "<dd><code>java.io.IOException</code></dd>\n"
                 + "<dt><span class=\"seeLabel\">See Also:"
                 + "</span></dt>\n"
-                + "<dd><a href=\"../pkg1/C1.html#setUndecorated-boolean-\">"
+                + "<dd><a href=\"#setUndecorated-boolean-\">"
                 + "<code>setUndecorated(boolean)</code></a></dd>\n"
                 + "</dl>");
 
@@ -277,7 +277,7 @@
                 "<dd>JDK1.0</dd>\n" +
                 "<dt><span class=\"seeLabel\">See Also:" +
                 "</span></dt>\n" +
-                "<dd><a href=\"../pkg1/C2.html\" title=\"class in pkg1\">" +
+                "<dd><a href=\"C2.html\" title=\"class in pkg1\">" +
                 "<code>C2</code></a>, \n" +
                 "<a href=\"../serialized-form.html#pkg1.C1\">" +
                 "Serialized Form</a></dd>\n" +
@@ -310,7 +310,7 @@
                 + "<dt><span class=\"simpleTagLabel\">Since:</span></dt>\n"
                 + "<dd>1.4</dd>\n"
                 + "<dt><span class=\"seeLabel\">See Also:</span></dt>\n"
-                + "<dd><a href=\"../pkg1/C1.html#readObject--\">"
+                + "<dd><a href=\"#readObject--\">"
                 + "<code>readObject()</code></a></dd>\n"
                 + "</dl>",
                 "<dl>\n"
@@ -319,7 +319,7 @@
                 + "<dd><code>java.io.IOException</code></dd>\n"
                 + "<dt>"
                 + "<span class=\"seeLabel\">See Also:</span></dt>\n"
-                + "<dd><a href=\"../pkg1/C1.html#setUndecorated-boolean-\">"
+                + "<dd><a href=\"#setUndecorated-boolean-\">"
                 + "<code>setUndecorated(boolean)</code></a></dd>\n"
                 + "</dl>");
 
@@ -381,7 +381,7 @@
 
         checkOutput("pkg1/C1.ModalExclusionType.html", expectFound,
                 "<pre>public " +
-                "static final&nbsp;<a href=\"../pkg1/C1.ModalExclusionType.html\" " +
+                "static final&nbsp;<a href=\"C1.ModalExclusionType.html\" " +
                 "title=\"enum in pkg1\">C1.ModalExclusionType</a> " +
                 "APPLICATION_EXCLUDE</pre>\n" +
                 "</li>");
--- a/test/langtools/jdk/javadoc/doclet/testHtmlTableTags/TestHtmlTableTags.java	Mon Jan 22 20:31:19 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testHtmlTableTags/TestHtmlTableTags.java	Mon Jan 22 11:15:51 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2018, 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
@@ -192,48 +192,48 @@
 
         // Class use documentation
         checkOutput("pkg1/class-use/I1.html", true,
-                "<caption><span>Packages that use <a href=\"../../pkg1/I1.html\" "
+                "<caption><span>Packages that use <a href=\"../I1.html\" "
                 + "title=\"interface in pkg1\">I1</a></span><span class=\"tabEnd\">"
                 + "&nbsp;</span></caption>");
 
         checkOutput("pkg1/class-use/C1.html", true,
                 "<caption><span>Fields in <a href=\"../../pkg2/package-summary.html\">"
-                + "pkg2</a> declared as <a href=\"../../pkg1/C1.html\" "
+                + "pkg2</a> declared as <a href=\"../C1.html\" "
                 + "title=\"class in pkg1\">C1</a></span><span class=\"tabEnd\">&nbsp;"
                 + "</span></caption>",
                 "<caption><span>Methods in <a href=\"../../pkg2/package-summary.html\">"
-                + "pkg2</a> that return <a href=\"../../pkg1/C1.html\" "
+                + "pkg2</a> that return <a href=\"../C1.html\" "
                 + "title=\"class in pkg1\">C1</a></span><span class=\"tabEnd\">"
                 + "&nbsp;</span></caption>");
 
         checkOutput("pkg2/class-use/C2.html", true,
                 "<caption><span>Fields in <a href=\"../../pkg1/package-summary.html\">"
-                + "pkg1</a> declared as <a href=\"../../pkg2/C2.html\" "
+                + "pkg1</a> declared as <a href=\"../C2.html\" "
                 + "title=\"class in pkg2\">C2</a></span><span class=\"tabEnd\">"
                 + "&nbsp;</span></caption>",
                 "<caption><span>Methods in <a href=\"../../pkg1/package-summary.html\">"
-                + "pkg1</a> that return <a href=\"../../pkg2/C2.html\" "
+                + "pkg1</a> that return <a href=\"../C2.html\" "
                 + "title=\"class in pkg2\">C2</a></span><span class=\"tabEnd\">"
                 + "&nbsp;</span></caption>");
 
         checkOutput("pkg2/class-use/C2.ModalExclusionType.html", true,
-                "<caption><span>Methods in <a href=\"../../pkg2/package-summary.html\">"
-                + "pkg2</a> that return <a href=\"../../pkg2/C2.ModalExclusionType.html\" "
+                "<caption><span>Methods in <a href=\"../package-summary.html\">"
+                + "pkg2</a> that return <a href=\"../C2.ModalExclusionType.html\" "
                 + "title=\"enum in pkg2\">C2.ModalExclusionType</a></span>"
                 + "<span class=\"tabEnd\">&nbsp;</span></caption>");
 
         // Package use documentation
         checkOutput("pkg1/package-use.html", true,
-                "<caption><span>Packages that use <a href=\"../pkg1/package-summary.html\">"
+                "<caption><span>Packages that use <a href=\"package-summary.html\">"
                 + "pkg1</a></span><span class=\"tabEnd\">&nbsp;</span></caption>",
-                "<caption><span>Classes in <a href=\"../pkg1/package-summary.html\">"
-                + "pkg1</a> used by <a href=\"../pkg1/package-summary.html\">pkg1</a>"
+                "<caption><span>Classes in <a href=\"package-summary.html\">"
+                + "pkg1</a> used by <a href=\"package-summary.html\">pkg1</a>"
                 + "</span><span class=\"tabEnd\">&nbsp;</span></caption>");
 
         checkOutput("pkg2/package-use.html", true,
-                "<caption><span>Packages that use <a href=\"../pkg2/package-summary.html\">"
+                "<caption><span>Packages that use <a href=\"package-summary.html\">"
                 + "pkg2</a></span><span class=\"tabEnd\">&nbsp;</span></caption>",
-                "<caption><span>Classes in <a href=\"../pkg2/package-summary.html\">"
+                "<caption><span>Classes in <a href=\"package-summary.html\">"
                 + "pkg2</a> used by <a href=\"../pkg1/package-summary.html\">pkg1</a>"
                 + "</span><span class=\"tabEnd\">&nbsp;</span></caption>");
 
--- a/test/langtools/jdk/javadoc/doclet/testHtmlTag/TestHtmlTag.java	Mon Jan 22 20:31:19 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testHtmlTag/TestHtmlTag.java	Mon Jan 22 11:15:51 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2018, 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
@@ -119,11 +119,11 @@
                 + "\n"
                 + " <p>\n"
                 + " A new instance of the <code>DatatypeFactory</code> is created through the\n"
-                + " <a href=\"../pkg3/A.DatatypeFactory.html#newInstance--\"><code>newInstance()</code></a> method that uses the following implementation\n"
+                + " <a href=\"#newInstance--\"><code>newInstance()</code></a> method that uses the following implementation\n"
                 + " resolution mechanisms to determine an implementation:</p>\n"
                 + " <ol>\n"
                 + " <li>\n"
-                + " If the system property specified by <a href=\"../pkg3/A.DatatypeFactory.html#DATATYPEFACTORY_PROPERTY\"><code>DATATYPEFACTORY_PROPERTY</code></a>,\n"
+                + " If the system property specified by <a href=\"#DATATYPEFACTORY_PROPERTY\"><code>DATATYPEFACTORY_PROPERTY</code></a>,\n"
                 + " \"<code>javax.xml.datatype.DatatypeFactory</code>\", exists, a class with\n"
                 + " the name of the property value is instantiated. Any Exception thrown\n"
                 + " during the instantiation process is wrapped as a\n"
@@ -148,7 +148,7 @@
                 + " </li>\n"
                 + " <li>\n"
                 + " The final mechanism is to attempt to instantiate the <code>Class</code>\n"
-                + " specified by <a href=\"../pkg3/A.DatatypeFactory.html#DATATYPEFACTORY_IMPLEMENTATION_CLASS\">"
+                + " specified by <a href=\"#DATATYPEFACTORY_IMPLEMENTATION_CLASS\">"
                 + "<code>DATATYPEFACTORY_IMPLEMENTATION_CLASS</code></a>. Any Exception\n"
                 + " thrown during the instantiation process is wrapped as a\n"
                 + " <code>IllegalStateException</code>.\n"
--- a/test/langtools/jdk/javadoc/doclet/testHtmlVersion/TestHtmlVersion.java	Mon Jan 22 20:31:19 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testHtmlVersion/TestHtmlVersion.java	Mon Jan 22 11:15:51 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, 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
@@ -133,7 +133,7 @@
                 "<!DOCTYPE HTML>",
                 "<meta name=\"dc.created\"",
                 "<main role=\"main\">\n"
-                + "<h1 class=\"bar\"><a href=\"../pkg/package-summary.html\" target=\"classFrame\">pkg</a></h1>",
+                + "<h1 class=\"bar\"><a href=\"package-summary.html\" target=\"classFrame\">pkg</a></h1>",
                 "<section role=\"region\">\n"
                 + "<h2 title=\"Interfaces\">Interfaces</h2>",
                 "<section role=\"region\">\n"
@@ -598,7 +598,7 @@
                 "<section role=\"region\"><a id=\"pkg\">\n"
                 + "<!--   -->\n"
                 + "</a>\n"
-                + "<h3>Uses of <a href=\"../../pkg1/RegClass.html\" title=\"class in pkg1\">RegClass</a> in <a href=\"../../pkg/package-summary.html\">pkg</a></h3>\n"
+                + "<h3>Uses of <a href=\"../RegClass.html\" title=\"class in pkg1\">RegClass</a> in <a href=\"../../pkg/package-summary.html\">pkg</a></h3>\n"
                 + "<table class=\"useSummary\">",
                 "<footer role=\"contentinfo\">\n"
                 + "<nav role=\"navigation\">\n"
@@ -667,7 +667,7 @@
                 "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
                 "<meta name=\"date\"",
                 "<body>\n"
-                + "<h1 class=\"bar\"><a href=\"../pkg/package-summary.html\" target=\"classFrame\">pkg</a></h1>");
+                + "<h1 class=\"bar\"><a href=\"package-summary.html\" target=\"classFrame\">pkg</a></h1>");
 
         // Negated test for package-summary page
         checkOutput("pkg/package-summary.html", false,
@@ -1040,7 +1040,7 @@
                 "<li class=\"blockList\"><a name=\"pkg\">\n"
                 + "<!--   -->\n"
                 + "</a>\n"
-                + "<h3>Uses of <a href=\"../../pkg1/RegClass.html\" title=\"class in pkg1\">RegClass</a> in <a href=\"../../pkg/package-summary.html\">pkg</a></h3>\n"
+                + "<h3>Uses of <a href=\"../RegClass.html\" title=\"class in pkg1\">RegClass</a> in <a href=\"../../pkg/package-summary.html\">pkg</a></h3>\n"
                 + "<table class=\"useSummary\" summary=\"Use table, listing fields, and an explanation\">");
 
         // Negated test for main index page
@@ -1100,7 +1100,7 @@
                 "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
                 "<meta name=\"date\"",
                 "<body>\n"
-                + "<h1 class=\"bar\"><a href=\"../pkg/package-summary.html\" target=\"classFrame\">pkg</a></h1>");
+                + "<h1 class=\"bar\"><a href=\"package-summary.html\" target=\"classFrame\">pkg</a></h1>");
 
         // Test for package-summary page
         checkOutput("pkg/package-summary.html", true,
@@ -1486,7 +1486,7 @@
                 "<li class=\"blockList\"><a name=\"pkg\">\n"
                 + "<!--   -->\n"
                 + "</a>\n"
-                + "<h3>Uses of <a href=\"../../pkg1/RegClass.html\" title=\"class in pkg1\">RegClass</a> in <a href=\"../../pkg/package-summary.html\">pkg</a></h3>\n"
+                + "<h3>Uses of <a href=\"../RegClass.html\" title=\"class in pkg1\">RegClass</a> in <a href=\"../../pkg/package-summary.html\">pkg</a></h3>\n"
                 + "<table class=\"useSummary\" summary=\"Use table, listing fields, and an explanation\">");
 
         // Test for main index page
@@ -1551,7 +1551,7 @@
                 "<!DOCTYPE HTML>",
                 "<meta name=\"dc.created\"",
                 "<main role=\"main\">\n"
-                + "<h1 class=\"bar\"><a href=\"../pkg/package-summary.html\" target=\"classFrame\">pkg</a></h1>",
+                + "<h1 class=\"bar\"><a href=\"package-summary.html\" target=\"classFrame\">pkg</a></h1>",
                 "<section role=\"region\">\n"
                 + "<h2 title=\"Interfaces\">Interfaces</h2>",
                 "<section role=\"region\">\n"
@@ -1988,7 +1988,7 @@
                 "<section role=\"region\"><a id=\"pkg\">\n"
                 + "<!--   -->\n"
                 + "</a>\n"
-                + "<h3>Uses of <a href=\"../../pkg1/RegClass.html\" title=\"class in pkg1\">RegClass</a> in <a href=\"../../pkg/package-summary.html\">pkg</a></h3>\n"
+                + "<h3>Uses of <a href=\"../RegClass.html\" title=\"class in pkg1\">RegClass</a> in <a href=\"../../pkg/package-summary.html\">pkg</a></h3>\n"
                 + "\n"
                 + "<table class=\"useSummary\">",
                 "<footer role=\"contentinfo\">\n"
--- a/test/langtools/jdk/javadoc/doclet/testInlineLinkLabel/TestInlineLinkLabel.java	Mon Jan 22 20:31:19 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testInlineLinkLabel/TestInlineLinkLabel.java	Mon Jan 22 11:15:51 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2018, 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
@@ -48,8 +48,8 @@
 
         checkOutput("pkg/C1.html", true,
                 //Search for the label to the package link.
-                "<a href=\"../pkg/package-summary.html\"><code>Here is a link to a package</code></a>",
+                "<a href=\"package-summary.html\"><code>Here is a link to a package</code></a>",
                 //Search for the label to the class link
-                "<a href=\"../pkg/C2.html\" title=\"class in pkg\"><code>Here is a link to a class</code></a>");
+                "<a href=\"C2.html\" title=\"class in pkg\"><code>Here is a link to a class</code></a>");
     }
 }
--- a/test/langtools/jdk/javadoc/doclet/testInterface/TestInterface.java	Mon Jan 22 20:31:19 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testInterface/TestInterface.java	Mon Jan 22 11:15:51 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, 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
@@ -70,8 +70,8 @@
                 // Make sure known implementing class list is correct and omits type parameters.
                 "<dl>\n"
                 + "<dt>All Known Implementing Classes:</dt>\n"
-                + "<dd><code><a href=\"../pkg/Child.html\" title=\"class in pkg\">Child"
-                + "</a></code>, <code><a href=\"../pkg/Parent.html\" title=\"class in pkg\">Parent"
+                + "<dd><code><a href=\"Child.html\" title=\"class in pkg\">Child"
+                + "</a></code>, <code><a href=\"Parent.html\" title=\"class in pkg\">Parent"
                 + "</a></code></dd>\n"
                 + "</dl>");
 
@@ -79,7 +79,7 @@
                 // Make sure "All Implemented Interfaces": has substituted type parameters
                 "<dl>\n"
                 + "<dt>All Implemented Interfaces:</dt>\n"
-                + "<dd><code><a href=\"../pkg/Interface.html\" title=\"interface in pkg\">"
+                + "<dd><code><a href=\"Interface.html\" title=\"interface in pkg\">"
                 + "Interface</a>&lt;CE&gt;</code></dd>\n"
                 + "</dl>",
                 //Make sure Class Tree has substituted type parameters.
@@ -87,7 +87,7 @@
                 + "<li>java.lang.Object</li>\n"
                 + "<li>\n"
                 + "<ul class=\"inheritance\">\n"
-                + "<li><a href=\"../pkg/Parent.html\" title=\"class in pkg\">"
+                + "<li><a href=\"Parent.html\" title=\"class in pkg\">"
                 + "pkg.Parent</a>&lt;CE&gt;</li>\n"
                 + "<li>\n"
                 + "<ul class=\"inheritance\">\n"
@@ -99,23 +99,23 @@
                 + "</ul>",
                 //Make sure "Specified By" has substituted type parameters.
                 "<dt><span class=\"overrideSpecifyLabel\">Specified by:</span></dt>\n"
-                + "<dd><code><a href=\"../pkg/Interface.html#method--\">method</a>"
+                + "<dd><code><a href=\"Interface.html#method--\">method</a>"
                 + "</code>&nbsp;in interface&nbsp;<code>"
-                + "<a href=\"../pkg/Interface.html\" title=\"interface in pkg\">"
-                + "Interface</a>&lt;<a href=\"../pkg/Child.html\" title=\"type parameter in Child\">"
+                + "<a href=\"Interface.html\" title=\"interface in pkg\">"
+                + "Interface</a>&lt;<a href=\"Child.html\" title=\"type parameter in Child\">"
                 + "CE</a>&gt;</code></dd>",
                 //Make sure "Overrides" has substituted type parameters.
                 "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n"
-                + "<dd><code><a href=\"../pkg/Parent.html#method--\">method</a>"
-                + "</code>&nbsp;in class&nbsp;<code><a href=\"../pkg/Parent.html\" "
-                + "title=\"class in pkg\">Parent</a>&lt;<a href=\"../pkg/Child.html\" "
+                + "<dd><code><a href=\"Parent.html#method--\">method</a>"
+                + "</code>&nbsp;in class&nbsp;<code><a href=\"Parent.html\" "
+                + "title=\"class in pkg\">Parent</a>&lt;<a href=\"Child.html\" "
                 + "title=\"type parameter in Child\">CE</a>&gt;</code></dd>");
 
         checkOutput("pkg/Parent.html", true,
                 //Make sure "Direct Know Subclasses" omits type parameters
                 "<dl>\n"
                 + "<dt>Direct Known Subclasses:</dt>\n"
-                + "<dd><code><a href=\"../pkg/Child.html\" title=\"class in pkg\">Child"
+                + "<dd><code><a href=\"Child.html\" title=\"class in pkg\">Child"
                 + "</a></code></dd>\n"
                 + "</dl>");
 
@@ -135,7 +135,7 @@
 
                 "<td class=\"colFirst\"><code>static void</code></td>\n"
                 + "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\">"
-                + "<a href=\"../pkg/ClassWithStaticMembers.html#m--\">m</a></span>()</code></th>\n"
+                + "<a href=\"#m--\">m</a></span>()</code></th>\n"
                 + "<td class=\"colLast\">\n"
                 + "<div class=\"block\">A hider method</div>\n"
                 + "</td>\n",
@@ -144,7 +144,7 @@
                 + "<pre>public static&nbsp;void&nbsp;staticMethod()</pre>\n"
                 + "<div class=\"block\"><span class=\"descfrmTypeLabel\">"
                 + "Description copied from interface:&nbsp;<code>"
-                + "<a href=\"../pkg/InterfaceWithStaticMembers.html#staticMethod--\">"
+                + "<a href=\"InterfaceWithStaticMembers.html#staticMethod--\">"
                 + "InterfaceWithStaticMembers</a></code></span></div>\n"
                 + "<div class=\"block\">A static method</div>\n");
 
@@ -165,10 +165,10 @@
         checkOutput("pkg1/Child.html", true,
             // Ensure the correct Overrides in the inheritance hierarchy is reported
             "<span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n" +
-            "<dd><code><a href=\"../pkg1/GrandParent.html#method1--\">method1</a></code>" +
+            "<dd><code><a href=\"GrandParent.html#method1--\">method1</a></code>" +
             "&nbsp;in class&nbsp;" +
-            "<code><a href=\"../pkg1/GrandParent.html\" title=\"class in pkg1\">GrandParent</a>" +
-            "&lt;<a href=\"../pkg1/Child.html\" title=\"type parameter in Child\">CE</a>&gt;</code>");
+            "<code><a href=\"GrandParent.html\" title=\"class in pkg1\">GrandParent</a>" +
+            "&lt;<a href=\"Child.html\" title=\"type parameter in Child\">CE</a>&gt;</code>");
     }
 
     @Test
@@ -182,21 +182,21 @@
         checkOutput("pkg2/Spliterator.OfDouble.html", true,
             // Ensure the correct type parameters are displayed correctly
             "<h3>Nested classes/interfaces inherited from interface&nbsp;pkg2."
-            + "<a href=\"../pkg2/Spliterator.html\" title=\"interface in pkg2\">Spliterator</a></h3>\n"
-            + "<code><a href=\"../pkg2/Spliterator.OfDouble.html\" title=\"interface in pkg2\">"
-            + "Spliterator.OfDouble</a>, <a href=\"../pkg2/Spliterator.OfInt.html\" "
+            + "<a href=\"Spliterator.html\" title=\"interface in pkg2\">Spliterator</a></h3>\n"
+            + "<code><a href=\"Spliterator.OfDouble.html\" title=\"interface in pkg2\">"
+            + "Spliterator.OfDouble</a>, <a href=\"Spliterator.OfInt.html\" "
             + "title=\"interface in pkg2\">Spliterator.OfInt</a>&lt;"
-            + "<a href=\"../pkg2/Spliterator.OfInt.html\" title=\"type parameter in Spliterator.OfInt\">"
-            + "Integer</a>&gt;, <a href=\"../pkg2/Spliterator.OfPrimitive.html\" title=\"interface in pkg2\">"
-            + "Spliterator.OfPrimitive</a>&lt;<a href=\"../pkg2/Spliterator.OfPrimitive.html\" "
-            + "title=\"type parameter in Spliterator.OfPrimitive\">T</a>,<a href=\"../pkg2/Spliterator.OfPrimitive.html\" "
+            + "<a href=\"Spliterator.OfInt.html\" title=\"type parameter in Spliterator.OfInt\">"
+            + "Integer</a>&gt;, <a href=\"Spliterator.OfPrimitive.html\" title=\"interface in pkg2\">"
+            + "Spliterator.OfPrimitive</a>&lt;<a href=\"Spliterator.OfPrimitive.html\" "
+            + "title=\"type parameter in Spliterator.OfPrimitive\">T</a>,<a href=\"Spliterator.OfPrimitive.html\" "
             + "title=\"type parameter in Spliterator.OfPrimitive\">T_CONS</a>,"
-            + "<a href=\"../pkg2/Spliterator.OfPrimitive.html\" title=\"type parameter in Spliterator.OfPrimitive\">"
-            + "T_SPLITR</a> extends <a href=\"../pkg2/Spliterator.OfPrimitive.html\" title=\"interface in pkg2\">"
-            + "Spliterator.OfPrimitive</a>&lt;<a href=\"../pkg2/Spliterator.OfPrimitive.html\" "
+            + "<a href=\"Spliterator.OfPrimitive.html\" title=\"type parameter in Spliterator.OfPrimitive\">"
+            + "T_SPLITR</a> extends <a href=\"Spliterator.OfPrimitive.html\" title=\"interface in pkg2\">"
+            + "Spliterator.OfPrimitive</a>&lt;<a href=\"Spliterator.OfPrimitive.html\" "
             + "title=\"type parameter in Spliterator.OfPrimitive\">T</a>,"
-            + "<a href=\"../pkg2/Spliterator.OfPrimitive.html\" title=\"type parameter in Spliterator.OfPrimitive\">"
-            + "T_CONS</a>,<a href=\"../pkg2/Spliterator.OfPrimitive.html\" title=\"type parameter in Spliterator.OfPrimitive\">"
+            + "<a href=\"Spliterator.OfPrimitive.html\" title=\"type parameter in Spliterator.OfPrimitive\">"
+            + "T_CONS</a>,<a href=\"Spliterator.OfPrimitive.html\" title=\"type parameter in Spliterator.OfPrimitive\">"
             + "T_SPLITR</a>&gt;&gt;</code>");
     }
 }
--- a/test/langtools/jdk/javadoc/doclet/testJavaFX/TestJavaFX.java	Mon Jan 22 20:31:19 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testJavaFX/TestJavaFX.java	Mon Jan 22 11:15:51 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, 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
@@ -51,8 +51,8 @@
 
         checkOutput("pkg1/C.html", true,
                 "<dt><span class=\"seeLabel\">See Also:</span></dt>\n"
-                + "<dd><a href=\"../pkg1/C.html#getRate--\"><code>getRate()</code></a>, \n"
-                + "<a href=\"../pkg1/C.html#setRate-double-\">"
+                + "<dd><a href=\"#getRate--\"><code>getRate()</code></a>, \n"
+                + "<a href=\"#setRate-double-\">"
                 + "<code>setRate(double)</code></a></dd>",
                 "<pre>public final&nbsp;void&nbsp;setRate&#8203;(double&nbsp;value)</pre>\n"
                 + "<div class=\"block\">Sets the value of the property rate.</div>\n"
@@ -62,10 +62,10 @@
                 + "<div class=\"block\">Gets the value of the property rate.</div>\n"
                 + "<dl>\n"
                 + "<dt><span class=\"simpleTagLabel\">Property description:</span></dt>",
-                "<td class=\"colFirst\"><code><a href=\"../pkg1/C.DoubleProperty.html\" "
+                "<td class=\"colFirst\"><code><a href=\"C.DoubleProperty.html\" "
                 + "title=\"class in pkg1\">C.DoubleProperty</a></code></td>\n"
                 + "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\">"
-                + "<a href=\"../pkg1/C.html#rateProperty\">rate</a></span></code></th>\n"
+                + "<a href=\"#rateProperty\">rate</a></span></code></th>\n"
                 + "<td class=\"colLast\">\n"
                 + "<div class=\"block\">Defines the direction/speed at which the "
                 + "<code>Timeline</code> is expected to\n"
@@ -77,14 +77,14 @@
                 "<p>Gets the value of the property <code>Property</code>",
                 "<span class=\"simpleTagLabel\">Property description:</span>",
                 "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\">"
-                + "<a href=\"../pkg1/C.html#setTestMethodProperty--\">"
+                + "<a href=\"#setTestMethodProperty--\">"
                 + "setTestMethodProperty</a></span>()</code></th>",
                 "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\">"
-                + "<a href=\"../pkg1/C.html#pausedProperty\">paused</a></span></code></th>\n"
+                + "<a href=\"#pausedProperty\">paused</a></span></code></th>\n"
                 + "<td class=\"colLast\">\n"
                 + "<div class=\"block\">Defines if paused.</div>",
                 "<h4>paused</h4>\n"
-                + "<pre>public final&nbsp;<a href=\"../pkg1/C.BooleanProperty.html\" "
+                + "<pre>public final&nbsp;<a href=\"C.BooleanProperty.html\" "
                 + "title=\"class in pkg1\">C.BooleanProperty</a> pausedProperty</pre>\n"
                 + "<div class=\"block\">Defines if paused. The second line.</div>",
                 "<h4>isPaused</h4>\n"
@@ -107,7 +107,7 @@
                 + "<dt><span class=\"simpleTagLabel\">Default value:</span></dt>\n"
                 + "<dd>false</dd>",
                 "<h4>rate</h4>\n"
-                + "<pre>public final&nbsp;<a href=\"../pkg1/C.DoubleProperty.html\" "
+                + "<pre>public final&nbsp;<a href=\"C.DoubleProperty.html\" "
                 + "title=\"class in pkg1\">C.DoubleProperty</a> rateProperty</pre>\n"
                 + "<div class=\"block\">Defines the direction/speed at which the "
                 + "<code>Timeline</code> is expected to\n"
@@ -138,9 +138,9 @@
                 + "<table class=\"memberSummary\" summary=\"Property Summary table, listing properties, and an explanation\">\n"
                 + "<caption><span>Properties</span><span class=\"tabEnd\">&nbsp;</span></caption>",
                 "<tr class=\"altColor\">\n"
-                + "<td class=\"colFirst\"><code><a href=\"../pkg1/C.BooleanProperty.html\" title=\"class in pkg1\">C.BooleanProperty</a></code></td>\n",
+                + "<td class=\"colFirst\"><code><a href=\"C.BooleanProperty.html\" title=\"class in pkg1\">C.BooleanProperty</a></code></td>\n",
                 "<tr class=\"rowColor\">\n"
-                + "<td class=\"colFirst\"><code><a href=\"../pkg1/C.DoubleProperty.html\" title=\"class in pkg1\">C.DoubleProperty</a></code></td>\n");
+                + "<td class=\"colFirst\"><code><a href=\"C.DoubleProperty.html\" title=\"class in pkg1\">C.DoubleProperty</a></code></td>\n");
 
         checkOutput("pkg1/C.html", false,
                 "A()",
@@ -152,9 +152,9 @@
                 + "<a href=\"javascript:show(8);\">Concrete Methods</a></span><span class=\"tabEnd\">&nbsp;</span></span>"
                 + "</caption>",
                 "<tr id=\"i0\" class=\"altColor\">\n"
-                + "<td class=\"colFirst\"><code><a href=\"../pkg1/C.BooleanProperty.html\" title=\"class in pkg1\">C.BooleanProperty</a></code></td>\n",
+                + "<td class=\"colFirst\"><code><a href=\"C.BooleanProperty.html\" title=\"class in pkg1\">C.BooleanProperty</a></code></td>\n",
                 "<tr id=\"i1\" class=\"rowColor\">\n"
-                + "<td class=\"colFirst\"><code><a href=\"../pkg1/C.DoubleProperty.html\" title=\"class in pkg1\">C.DoubleProperty</a></code></td>\n");
+                + "<td class=\"colFirst\"><code><a href=\"C.DoubleProperty.html\" title=\"class in pkg1\">C.DoubleProperty</a></code></td>\n");
 
         checkOutput("index-all.html", true,
                 "<div class=\"block\">Gets the value of the property paused.</div>",
@@ -162,9 +162,9 @@
 
         checkOutput("pkg1/D.html", true,
                 "<h3>Properties inherited from class&nbsp;pkg1."
-                    + "<a href=\"../pkg1/C.html\" title=\"class in pkg1\">C</a></h3>\n"
-                    + "<code><a href=\"../pkg1/C.html#pausedProperty\">"
-                    + "paused</a>, <a href=\"../pkg1/C.html#rateProperty\">rate</a></code></li>");
+                    + "<a href=\"C.html\" title=\"class in pkg1\">C</a></h3>\n"
+                    + "<code><a href=\"C.html#pausedProperty\">"
+                    + "paused</a>, <a href=\"C.html#rateProperty\">rate</a></code></li>");
 
         checkOutput("pkg1/D.html", false, "shouldNotAppear");
     }
@@ -246,27 +246,27 @@
                 + "<tr id=\"i0\" class=\"altColor\">\n"
                 + "<td class=\"colFirst\"><code>&lt;T&gt;&nbsp;java.lang.Object</code></td>\n"
                 + "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\">"
-                + "<a href=\"../pkg2/Test.html#alphaProperty-java.util.List-\">alphaProperty</a>"
+                + "<a href=\"#alphaProperty-java.util.List-\">alphaProperty</a>"
                 + "</span>&#8203;(java.util.List&lt;T&gt;&nbsp;foo)</code></th>\n"
                 + "<td class=\"colLast\">&nbsp;</td>\n"
                 + "</tr>\n"
                 + "<tr id=\"i1\" class=\"rowColor\">\n"
                 + "<td class=\"colFirst\"><code>java.lang.Object</code></td>\n"
                 + "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\">"
-                + "<a href=\"../pkg2/Test.html#betaProperty--\">betaProperty</a></span>()</code></th>\n"
+                + "<a href=\"#betaProperty--\">betaProperty</a></span>()</code></th>\n"
                 + "<td class=\"colLast\">&nbsp;</td>\n"
                 + "</tr>\n"
                 + "<tr id=\"i2\" class=\"altColor\">\n"
                 + "<td class=\"colFirst\"><code>java.util.List&lt;java.util.Set&lt;? super java.lang.Object&gt;&gt;"
                 + "</code></td>\n"
                 + "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\">"
-                + "<a href=\"../pkg2/Test.html#deltaProperty--\">deltaProperty</a></span>()</code></th>\n"
+                + "<a href=\"#deltaProperty--\">deltaProperty</a></span>()</code></th>\n"
                 + "<td class=\"colLast\">&nbsp;</td>\n"
                 + "</tr>\n"
                 + "<tr id=\"i3\" class=\"rowColor\">\n"
                 + "<td class=\"colFirst\"><code>java.util.List&lt;java.lang.String&gt;</code></td>\n"
                 + "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\">"
-                + "<a href=\"../pkg2/Test.html#gammaProperty--\">gammaProperty</a></span>()</code></th>\n"
+                + "<a href=\"#gammaProperty--\">gammaProperty</a></span>()</code></th>\n"
                 + "<td class=\"colLast\">&nbsp;</td>"
         );
     }
--- a/test/langtools/jdk/javadoc/doclet/testLinkOption/TestLinkOption.java	Mon Jan 22 20:31:19 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testLinkOption/TestLinkOption.java	Mon Jan 22 11:15:51 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2018, 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
@@ -86,7 +86,7 @@
                 + " title=\"class or interface in java.lang\" class=\"externalLink\"><code><tt>getSystemClassLoader()</tt>"
                 + "</code></a> as the parent class loader.</div>",
                 "<div class=\"block\">is equivalent to invoking <code>"
-                + "<a href=\"../pkg/B.html#createTempFile-java.lang.String-java.lang.String-java.io.File-\">"
+                + "<a href=\"#createTempFile-java.lang.String-java.lang.String-java.io.File-\">"
                 + "<code>createTempFile(prefix,&nbsp;suffix,&nbsp;null)</code></a></code>.</div>",
                 "<a href=\"" + url + "java/lang/String.html?is-external=true\" "
                 + "title=\"class or interface in java.lang\" class=\"externalLink\">Link-Plain to String Class</a>",
--- a/test/langtools/jdk/javadoc/doclet/testLinkTaglet/TestLinkTaglet.java	Mon Jan 22 20:31:19 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testLinkTaglet/TestLinkTaglet.java	Mon Jan 22 11:15:51 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2018, 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
@@ -49,23 +49,23 @@
         checkExit(Exit.OK);
 
         checkOutput("pkg/C.html", true,
-                "Qualified Link: <a href=\"../pkg/C.InnerC.html\" title=\"class in pkg\"><code>C.InnerC</code></a>.<br/>\n"
-                + " Unqualified Link1: <a href=\"../pkg/C.InnerC.html\" title=\"class in pkg\"><code>C.InnerC</code></a>.<br/>\n"
-                + " Unqualified Link2: <a href=\"../pkg/C.InnerC.html\" title=\"class in pkg\"><code>C.InnerC</code></a>.<br/>\n"
-                + " Qualified Link: <a href=\"../pkg/C.html#method-pkg.C.InnerC-pkg.C.InnerC2-\"><code>method(pkg.C.InnerC, pkg.C.InnerC2)</code></a>.<br/>\n"
-                + " Unqualified Link: <a href=\"../pkg/C.html#method-pkg.C.InnerC-pkg.C.InnerC2-\"><code>method(C.InnerC, C.InnerC2)</code></a>.<br/>\n"
-                + " Unqualified Link: <a href=\"../pkg/C.html#method-pkg.C.InnerC-pkg.C.InnerC2-\"><code>method(InnerC, InnerC2)</code></a>.<br/>\n"
-                + " Package Link: <a href=\"../pkg/package-summary.html\"><code>pkg</code></a>.<br/>");
+                "Qualified Link: <a href=\"C.InnerC.html\" title=\"class in pkg\"><code>C.InnerC</code></a>.<br/>\n"
+                + " Unqualified Link1: <a href=\"C.InnerC.html\" title=\"class in pkg\"><code>C.InnerC</code></a>.<br/>\n"
+                + " Unqualified Link2: <a href=\"C.InnerC.html\" title=\"class in pkg\"><code>C.InnerC</code></a>.<br/>\n"
+                + " Qualified Link: <a href=\"#method-pkg.C.InnerC-pkg.C.InnerC2-\"><code>method(pkg.C.InnerC, pkg.C.InnerC2)</code></a>.<br/>\n"
+                + " Unqualified Link: <a href=\"#method-pkg.C.InnerC-pkg.C.InnerC2-\"><code>method(C.InnerC, C.InnerC2)</code></a>.<br/>\n"
+                + " Unqualified Link: <a href=\"#method-pkg.C.InnerC-pkg.C.InnerC2-\"><code>method(InnerC, InnerC2)</code></a>.<br/>\n"
+                + " Package Link: <a href=\"package-summary.html\"><code>pkg</code></a>.<br/>");
 
         checkOutput("pkg/C.InnerC.html", true,
-                "Link to member in outer class: <a href=\"../pkg/C.html#MEMBER\"><code>C.MEMBER</code></a> <br/>\n"
-                + " Link to member in inner class: <a href=\"../pkg/C.InnerC2.html#MEMBER2\"><code>C.InnerC2.MEMBER2</code></a> <br/>\n"
-                + " Link to another inner class: <a href=\"../pkg/C.InnerC2.html\" title=\"class in pkg\"><code>C.InnerC2</code></a>");
+                "Link to member in outer class: <a href=\"C.html#MEMBER\"><code>C.MEMBER</code></a> <br/>\n"
+                + " Link to member in inner class: <a href=\"C.InnerC2.html#MEMBER2\"><code>C.InnerC2.MEMBER2</code></a> <br/>\n"
+                + " Link to another inner class: <a href=\"C.InnerC2.html\" title=\"class in pkg\"><code>C.InnerC2</code></a>");
 
         checkOutput("pkg/C.InnerC2.html", true,
                 "<dl>\n"
                 + "<dt>Enclosing class:</dt>\n"
-                + "<dd><a href=\"../pkg/C.html\" title=\"class in pkg\">C</a></dd>\n"
+                + "<dd><a href=\"C.html\" title=\"class in pkg\">C</a></dd>\n"
                 + "</dl>");
 
         checkOutput(Output.OUT, false,
--- a/test/langtools/jdk/javadoc/doclet/testMemberInheritance/TestMemberInheritance.java	Mon Jan 22 20:31:19 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testMemberInheritance/TestMemberInheritance.java	Mon Jan 22 11:15:51 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2018, 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
@@ -50,56 +50,56 @@
 
         checkOutput("pkg/SubClass.html", true,
                 // Public field should be inherited
-                "<a href=\"../pkg/BaseClass.html#pubField\">",
+                "<a href=\"BaseClass.html#pubField\">",
                 // Public method should be inherited
-                "<a href=\"../pkg/BaseClass.html#pubMethod--\">",
+                "<a href=\"BaseClass.html#pubMethod--\">",
                 // Public inner class should be inherited.
-                "<a href=\"../pkg/BaseClass.pubInnerClass.html\" title=\"class in pkg\">",
+                "<a href=\"BaseClass.pubInnerClass.html\" title=\"class in pkg\">",
                 // Protected field should be inherited
-                "<a href=\"../pkg/BaseClass.html#proField\">",
+                "<a href=\"BaseClass.html#proField\">",
                 // Protected method should be inherited
-                "<a href=\"../pkg/BaseClass.html#proMethod--\">",
+                "<a href=\"BaseClass.html#proMethod--\">",
                 // Protected inner class should be inherited.
-                "<a href=\"../pkg/BaseClass.proInnerClass.html\" title=\"class in pkg\">",
+                "<a href=\"BaseClass.proInnerClass.html\" title=\"class in pkg\">",
                 // New labels as of 1.5.0
                 "Nested classes/interfaces inherited from class&nbsp;pkg."
-                + "<a href=\"../pkg/BaseClass.html\" title=\"class in pkg\">BaseClass</a>",
+                + "<a href=\"BaseClass.html\" title=\"class in pkg\">BaseClass</a>",
                 "Nested classes/interfaces inherited from interface&nbsp;pkg."
-                + "<a href=\"../pkg/BaseInterface.html\" title=\"interface in pkg\">BaseInterface</a>");
+                + "<a href=\"BaseInterface.html\" title=\"interface in pkg\">BaseInterface</a>");
 
         checkOutput("pkg/BaseClass.html", true,
                 // Test overriding/implementing methods with generic parameters.
                 "<dl>\n"
                 + "<dt><span class=\"overrideSpecifyLabel\">Specified by:</span></dt>\n"
-                + "<dd><code><a href=\"../pkg/BaseInterface.html#getAnnotation-java.lang.Class-\">"
+                + "<dd><code><a href=\"BaseInterface.html#getAnnotation-java.lang.Class-\">"
                 + "getAnnotation</a></code>&nbsp;in interface&nbsp;<code>"
-                + "<a href=\"../pkg/BaseInterface.html\" title=\"interface in pkg\">"
+                + "<a href=\"BaseInterface.html\" title=\"interface in pkg\">"
                 + "BaseInterface</a></code></dd>\n"
                 + "</dl>");
 
         checkOutput("diamond/Z.html", true,
                 // Test diamond inheritance member summary (6256068)
-                "<code><a href=\"../diamond/A.html#aMethod--\">aMethod</a></code>");
+                "<code><a href=\"A.html#aMethod--\">aMethod</a></code>");
 
         checkOutput("inheritDist/C.html", true,
                 // Test that doc is inherited from closed parent (6270645)
                 "<div class=\"block\">m1-B</div>");
 
         checkOutput("pkg/SubClass.html", false,
-                "<a href=\"../pkg/BaseClass.html#staticMethod--\">staticMethod</a></code>");
+                "<a href=\"BaseClass.html#staticMethod--\">staticMethod</a></code>");
 
         checkOutput("pkg1/Implementer.html", true,
                 // ensure the method makes it
                 "<td class=\"colFirst\"><code>static java.time.Period</code></td>\n"
                 + "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\">"
-                + "<a href=\"../pkg1/Implementer.html#between-java.time.LocalDate-java.time.LocalDate-\">"
+                + "<a href=\"#between-java.time.LocalDate-java.time.LocalDate-\">"
                 + "between</a></span>&#8203;(java.time.LocalDate&nbsp;startDateInclusive,\n"
                 + "       java.time.LocalDate&nbsp;endDateExclusive)</code></th>");
 
         checkOutput("pkg1/Implementer.html", false,
-                "<h3>Methods inherited from interface&nbsp;pkg1.<a href=\"../pkg1/Interface.html\""
+                "<h3>Methods inherited from interface&nbsp;pkg1.<a href=\"Interface.html\""
                 + " title=\"interface in pkg1\">Interface</a></h3>\n"
-                + "<code><a href=\"../pkg1/Interface.html#between-java.time.chrono.ChronoLocalDate"
+                + "<code><a href=\"Interface.html#between-java.time.chrono.ChronoLocalDate"
                 + "-java.time.chrono.ChronoLocalDate-\">between</a></code>"
         );
     }
--- a/test/langtools/jdk/javadoc/doclet/testMemberSummary/TestMemberSummary.java	Mon Jan 22 20:31:19 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testMemberSummary/TestMemberSummary.java	Mon Jan 22 11:15:51 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, 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
@@ -50,19 +50,19 @@
 
         checkOutput("pkg/PublicChild.html", true,
                 // Check return type in member summary.
-                "<code><a href=\"../pkg/PublicChild.html\" title=\"class in pkg\">PublicChild</a></code></td>\n"
-                + "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\"><a href=\"../pkg/PublicChild.html#returnTypeTest--\">"
+                "<code><a href=\"PublicChild.html\" title=\"class in pkg\">PublicChild</a></code></td>\n"
+                + "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\"><a href=\"#returnTypeTest--\">"
                 + "returnTypeTest</a></span>()</code>",
                 // Check return type in member detail.
-                "<pre>public&nbsp;<a href=\"../pkg/PublicChild.html\" title=\"class in pkg\">"
+                "<pre>public&nbsp;<a href=\"PublicChild.html\" title=\"class in pkg\">"
                 + "PublicChild</a>&nbsp;returnTypeTest()</pre>",
                 "<th class=\"colConstructorName\" scope=\"row\"><code><span class=\"memberNameLink\">"
-                + "<a href=\"../pkg/PublicChild.html#PublicChild--\">PublicChild</a></span>()</code></th>");
+                + "<a href=\"#PublicChild--\">PublicChild</a></span>()</code></th>");
 
         checkOutput("pkg/PrivateParent.html", true,
                 "<td class=\"colFirst\"><code>private </code></td>\n"
                 + "<th class=\"colConstructorName\" scope=\"row\"><code><span class=\"memberNameLink\">"
-                + "<a href=\"../pkg/PrivateParent.html#PrivateParent-int-\">PrivateParent</a></span>&#8203;(int&nbsp;i)</code>"
+                + "<a href=\"#PrivateParent-int-\">PrivateParent</a></span>&#8203;(int&nbsp;i)</code>"
                 + "</th>");
 
         // Legacy anchor dimensions (6290760)
--- a/test/langtools/jdk/javadoc/doclet/testModules/TestModules.java	Mon Jan 22 20:31:19 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testModules/TestModules.java	Mon Jan 22 11:15:51 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2018, 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
@@ -854,7 +854,7 @@
                 "<div class=\"subTitle\"><span class=\"moduleLabelInType\">Module</span>&nbsp;"
                 + "<a href=\"../moduleB-summary.html\">moduleB</a></div>",
                 "<div class=\"subTitle\"><span class=\"packageLabelInType\">"
-                + "Package</span>&nbsp;<a href=\"../testpkgmdlB/package-summary.html\">testpkgmdlB</a></div>");
+                + "Package</span>&nbsp;<a href=\"package-summary.html\">testpkgmdlB</a></div>");
         checkFiles(found,
                 "moduleA-frame.html",
                 "moduleA-summary.html",
--- a/test/langtools/jdk/javadoc/doclet/testNavigation/TestNavigation.java	Mon Jan 22 20:31:19 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testNavigation/TestNavigation.java	Mon Jan 22 11:15:51 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, 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
@@ -49,21 +49,21 @@
 
         checkOutput("pkg/A.html", true,
                 "<li>Prev&nbsp;Class</li>",
-                "<a href=\"../pkg/C.html\" title=\"class in pkg\"><span class=\"typeNameLink\">Next&nbsp;Class</span></a>",
+                "<a href=\"C.html\" title=\"class in pkg\"><span class=\"typeNameLink\">Next&nbsp;Class</span></a>",
                 "<li><a href=\"../overview-summary.html\">Overview</a></li>");
 
         checkOutput("pkg/C.html", true,
-                "<a href=\"../pkg/A.html\" title=\"annotation in pkg\"><span class=\"typeNameLink\">Prev&nbsp;Class</span></a>",
-                "<a href=\"../pkg/E.html\" title=\"enum in pkg\"><span class=\"typeNameLink\">Next&nbsp;Class</span></a>",
+                "<a href=\"A.html\" title=\"annotation in pkg\"><span class=\"typeNameLink\">Prev&nbsp;Class</span></a>",
+                "<a href=\"E.html\" title=\"enum in pkg\"><span class=\"typeNameLink\">Next&nbsp;Class</span></a>",
                 "<li><a href=\"../overview-summary.html\">Overview</a></li>");
 
         checkOutput("pkg/E.html", true,
-                "<a href=\"../pkg/C.html\" title=\"class in pkg\"><span class=\"typeNameLink\">Prev&nbsp;Class</span></a>",
-                "<a href=\"../pkg/I.html\" title=\"interface in pkg\"><span class=\"typeNameLink\">Next&nbsp;Class</span></a>",
+                "<a href=\"C.html\" title=\"class in pkg\"><span class=\"typeNameLink\">Prev&nbsp;Class</span></a>",
+                "<a href=\"I.html\" title=\"interface in pkg\"><span class=\"typeNameLink\">Next&nbsp;Class</span></a>",
                 "<li><a href=\"../overview-summary.html\">Overview</a></li>");
 
         checkOutput("pkg/I.html", true,
-                "<a href=\"../pkg/E.html\" title=\"enum in pkg\"><span class=\"typeNameLink\">Prev&nbsp;Class</span></a>",
+                "<a href=\"E.html\" title=\"enum in pkg\"><span class=\"typeNameLink\">Prev&nbsp;Class</span></a>",
                 "<li>Next&nbsp;Class</li>",
                 // Test for 4664607
                 "<div class=\"skipNav\"><a href=\"#skip.navbar.top\" title=\"Skip navigation links\">Skip navigation links</a></div>\n"
--- a/test/langtools/jdk/javadoc/doclet/testNestedGenerics/TestNestedGenerics.java	Mon Jan 22 20:31:19 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testNestedGenerics/TestNestedGenerics.java	Mon Jan 22 11:15:51 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2018, 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
@@ -48,7 +48,7 @@
 
         checkOutput("pkg/NestedGenerics.html", true,
             "<div class=\"block\">Contains <a " +
-            "href=\"../pkg/NestedGenerics.html#foo-java.util.Map-\"><code>foo" +
+            "href=\"#foo-java.util.Map-\"><code>foo" +
             "(java.util.Map&lt;A, java.util.Map&lt;A, A&gt;&gt;)</code></a></div>");
     }
 }
--- a/test/langtools/jdk/javadoc/doclet/testNewLanguageFeatures/TestNewLanguageFeatures.java	Mon Jan 22 20:31:19 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testNewLanguageFeatures/TestNewLanguageFeatures.java	Mon Jan 22 11:15:51 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, 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
@@ -67,20 +67,20 @@
                 // Make sure enum signature is correct.
                 "<pre>public enum "
                 + "<span class=\"typeNameLabel\">Coin</span>\n"
-                + "extends java.lang.Enum&lt;<a href=\"../pkg/Coin.html\" "
+                + "extends java.lang.Enum&lt;<a href=\"Coin.html\" "
                 + "title=\"enum in pkg\">Coin</a>&gt;</pre>",
                 // Check for enum constant section
                 "<caption><span>Enum Constants"
                 + "</span><span class=\"tabEnd\">&nbsp;</span></caption>",
                 // Detail for enum constant
-                "<span class=\"memberNameLink\"><a href=\"../pkg/Coin.html#Dime\">Dime</a></span>",
+                "<span class=\"memberNameLink\"><a href=\"#Dime\">Dime</a></span>",
                 // Automatically insert documentation for values() and valueOf().
                 "Returns an array containing the constants of this enum type,",
                 "Returns the enum constant of this type with the specified name",
                 "for (Coin c : Coin.values())",
                 "Overloaded valueOf() method has correct documentation.",
                 "Overloaded values method  has correct documentation.",
-                "<pre>public static&nbsp;<a href=\"../pkg/Coin.html\" title=\"enum in pkg\">Coin</a>" +
+                "<pre>public static&nbsp;<a href=\"Coin.html\" title=\"enum in pkg\">Coin</a>" +
                 "&nbsp;valueOf&#8203;(java.lang.String&nbsp;name)</pre>\n" +
                 "<div class=\"block\">Returns the enum constant of this type with the specified name.\n" +
                 "The string must match <i>exactly</i> an identifier used to declare an\n" +
@@ -117,11 +117,11 @@
                 "<dl>\n"
                 + "<dt><span class=\"seeLabel\">See Also:</span></dt>\n"
                 + "<dd>"
-                + "<a href=\"../pkg/TypeParameters.html\" title=\"class in pkg\">"
+                + "<a href=\"TypeParameters.html\" title=\"class in pkg\">"
                 + "<code>TypeParameters</code></a></dd>\n"
                 + "</dl>",
                 // Method that uses class type parameter.
-                "(<a href=\"../pkg/TypeParameters.html\" title=\"type "
+                "(<a href=\"TypeParameters.html\" title=\"type "
                 + "parameter in TypeParameters\">E</a>&nbsp;param)",
                 // Method type parameter section.
                 "<span class=\"paramLabel\">Type Parameters:</span></dt>\n"
@@ -133,38 +133,38 @@
                 "public&nbsp;&lt;T extends java.util.List,V&gt;&nbsp;"
                 + "java.lang.String[]&nbsp;methodThatHasTypeParameters",
                 // Method that returns TypeParameters
-                "<td class=\"colFirst\"><code><a href=\"../pkg/TypeParameters.html\" "
+                "<td class=\"colFirst\"><code><a href=\"TypeParameters.html\" "
                 + "title=\"type parameter in TypeParameters\">E</a>[]</code></td>\n"
                 + "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\">"
-                + "<a href=\"../pkg/TypeParameters.html#methodThatReturnsTypeParameterA-E:A-\">"
-                + "methodThatReturnsTypeParameterA</a></span>&#8203;(<a href=\"../pkg/TypeParameters.html\" "
+                + "<a href=\"#methodThatReturnsTypeParameterA-E:A-\">"
+                + "methodThatReturnsTypeParameterA</a></span>&#8203;(<a href=\"TypeParameters.html\" "
                 + "title=\"type parameter in TypeParameters\">E</a>[]&nbsp;e)</code>",
-                "<pre>public&nbsp;<a href=\"../pkg/TypeParameters.html\" "
+                "<pre>public&nbsp;<a href=\"TypeParameters.html\" "
                 + "title=\"type parameter in TypeParameters\">E</a>[]&nbsp;"
-                + "methodThatReturnsTypeParameterA&#8203;(<a href=\"../pkg/TypeParameters.html\" "
+                + "methodThatReturnsTypeParameterA&#8203;(<a href=\"TypeParameters.html\" "
                 + "title=\"type parameter in TypeParameters\">E</a>[]&nbsp;e)</pre>\n",
                 "<td class=\"colFirst\"><code>&lt;T extends java.lang.Object &amp; java.lang.Comparable&lt;? super T&gt;&gt;"
                 + "<br>T</code></td>\n"
                 + "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\">"
-                + "<a href=\"../pkg/TypeParameters.html#methodtThatReturnsTypeParametersB-java.util.Collection-\">"
+                + "<a href=\"#methodtThatReturnsTypeParametersB-java.util.Collection-\">"
                 + "methodtThatReturnsTypeParametersB</a></span>&#8203;(java.util.Collection&lt;? extends T&gt;&nbsp;coll)</code>",
                 "<div class=\"block\">Returns TypeParameters</div>\n",
                 // Method takes a TypeVariable
                 "<td class=\"colFirst\"><code>&lt;X extends java.lang.Throwable&gt;<br>"
-                + "<a href=\"../pkg/TypeParameters.html\" title=\"type parameter in TypeParameters\">E</a>"
+                + "<a href=\"TypeParameters.html\" title=\"type parameter in TypeParameters\">E</a>"
                 + "</code></td>\n"
                 + "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\">"
-                + "<a href=\"../pkg/TypeParameters.html#orElseThrow-java.util.function.Supplier-\">"
+                + "<a href=\"#orElseThrow-java.util.function.Supplier-\">"
                 + "orElseThrow</a></span>&#8203;(java.util.function.Supplier&lt;? extends X&gt;&nbsp;exceptionSupplier)</code>"
                 );
 
         checkOutput("pkg/Wildcards.html", true,
                 // Wildcard testing.
-                "<a href=\"../pkg/TypeParameters.html\" title=\"class in pkg\">"
+                "<a href=\"TypeParameters.html\" title=\"class in pkg\">"
                 + "TypeParameters</a>&lt;? super java.lang.String&gt;&nbsp;a",
-                "<a href=\"../pkg/TypeParameters.html\" title=\"class in pkg\">"
+                "<a href=\"TypeParameters.html\" title=\"class in pkg\">"
                 + "TypeParameters</a>&lt;? extends java.lang.StringBuffer&gt;&nbsp;b",
-                "<a href=\"../pkg/TypeParameters.html\" title=\"class in pkg\">"
+                "<a href=\"TypeParameters.html\" title=\"class in pkg\">"
                 + "TypeParameters</a>&nbsp;c");
 
         checkOutput(Output.OUT, true,
@@ -179,7 +179,7 @@
                 "<pre>public class <span class=\"typeNameLabel\">TypeParameterSubClass&lt;T extends "
                 + "java.lang.String&gt;</span>\n"
                 + "extends "
-                + "<a href=\"../pkg/TypeParameterSuperClass.html\" title=\"class in pkg\">"
+                + "<a href=\"TypeParameterSuperClass.html\" title=\"class in pkg\">"
                 + "TypeParameterSuperClass</a>&lt;T&gt;</pre>");
 
         // Interface generic parameter substitution
@@ -187,21 +187,21 @@
         checkOutput("pkg/TypeParameters.html", true,
                 "<dl>\n"
                 + "<dt>All Implemented Interfaces:</dt>\n"
-                + "<dd><code><a href=\"../pkg/SubInterface.html\" title=\"interface in pkg\">"
-                + "SubInterface</a>&lt;E&gt;</code>, <code><a href=\"../pkg/SuperInterface.html\" "
+                + "<dd><code><a href=\"SubInterface.html\" title=\"interface in pkg\">"
+                + "SubInterface</a>&lt;E&gt;</code>, <code><a href=\"SuperInterface.html\" "
                 + "title=\"interface in pkg\">SuperInterface</a>&lt;E&gt;</code></dd>\n"
                 + "</dl>");
 
         checkOutput("pkg/SuperInterface.html", true,
                 "<dl>\n"
                 + "<dt>All Known Subinterfaces:</dt>\n"
-                + "<dd><code><a href=\"../pkg/SubInterface.html\" title=\"interface in pkg\">"
+                + "<dd><code><a href=\"SubInterface.html\" title=\"interface in pkg\">"
                 + "SubInterface</a>&lt;V&gt;</code></dd>\n"
                 + "</dl>");
         checkOutput("pkg/SubInterface.html", true,
                 "<dl>\n"
                 + "<dt>All Superinterfaces:</dt>\n"
-                + "<dd><code><a href=\"../pkg/SuperInterface.html\" title=\"interface in pkg\">"
+                + "<dd><code><a href=\"SuperInterface.html\" title=\"interface in pkg\">"
                 + "SuperInterface</a>&lt;V&gt;</code></dd>\n"
                 + "</dl>");
 
@@ -216,212 +216,212 @@
         //==============================================================
         // ClassUseTest1: <T extends Foo & Foo2>
         checkOutput("pkg2/class-use/Foo.html", true,
-                "<caption><span>Classes in <a href=\"../../pkg2/"
+                "<caption><span>Classes in <a href=\"../"
                 + "package-summary.html\">pkg2</a> with type parameters of "
-                + "type <a href=\"../../pkg2/Foo.html\" title=\"class in pkg2\">"
+                + "type <a href=\"../Foo.html\" title=\"class in pkg2\">"
                 + "Foo</a></span><span class=\"tabEnd\">&nbsp;</span></caption>",
-                "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\"><a href=\"../../pkg2/ClassUseTest1.html\" "
+                "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\"><a href=\"../ClassUseTest1.html\" "
                 + "title=\"class in pkg2\">ClassUseTest1</a>&lt;T extends "
-                + "<a href=\"../../pkg2/Foo.html\" title=\"class in pkg2\">Foo"
-                + "</a> &amp; <a href=\"../../pkg2/Foo2.html\" title=\"interface in pkg2\">"
+                + "<a href=\"../Foo.html\" title=\"class in pkg2\">Foo"
+                + "</a> &amp; <a href=\"../Foo2.html\" title=\"interface in pkg2\">"
                 + "Foo2</a>&gt;</span></code></th>",
-                "<caption><span>Methods in <a href=\"../../pkg2/"
+                "<caption><span>Methods in <a href=\"../"
                 + "package-summary.html\">pkg2</a> with type parameters of "
-                + "type <a href=\"../../pkg2/Foo.html\" title=\"class in "
+                + "type <a href=\"../Foo.html\" title=\"class in "
                 + "pkg2\">Foo</a></span><span class=\"tabEnd\">&nbsp;</span></caption>",
                 "<th class=\"colSecond\" scope=\"row\"><span class=\"typeNameLabel\">ClassUseTest1."
-                + "</span><code><span class=\"memberNameLink\"><a href=\"../../pkg2/"
+                + "</span><code><span class=\"memberNameLink\"><a href=\"../"
                 + "ClassUseTest1.html#method-T-\">method</a></span>"
                 + "&#8203;(T&nbsp;t)</code></th>",
-                "<caption><span>Fields in <a href=\"../../pkg2/"
+                "<caption><span>Fields in <a href=\"../"
                 + "package-summary.html\">pkg2</a> with type parameters of "
-                + "type <a href=\"../../pkg2/Foo.html\" title=\"class in pkg2\">"
+                + "type <a href=\"../Foo.html\" title=\"class in pkg2\">"
                 + "Foo</a></span><span class=\"tabEnd\">&nbsp;</span></caption>",
-                "td class=\"colFirst\"><code><a href=\"../../pkg2/"
+                "td class=\"colFirst\"><code><a href=\"../"
                 + "ParamTest.html\" title=\"class in pkg2\">ParamTest</a>"
-                + "&lt;<a href=\"../../pkg2/Foo.html\" title=\"class in pkg2\""
+                + "&lt;<a href=\"../Foo.html\" title=\"class in pkg2\""
                 + ">Foo</a>&gt;</code></td>"
         );
 
         checkOutput("pkg2/class-use/ParamTest.html", true,
-                "<caption><span>Fields in <a href=\"../../pkg2/"
+                "<caption><span>Fields in <a href=\"../"
                 + "package-summary.html\">pkg2</a> declared as <a href=\"../"
-                + "../pkg2/ParamTest.html\" title=\"class in pkg2\">ParamTest"
+                + "ParamTest.html\" title=\"class in pkg2\">ParamTest"
                 + "</a></span><span class=\"tabEnd\">&nbsp;</span></caption>",
-                "<td class=\"colFirst\"><code><a href=\"../../pkg2/"
+                "<td class=\"colFirst\"><code><a href=\"../"
                 + "ParamTest.html\" title=\"class in pkg2\">ParamTest</a>&lt;<a "
-                + "href=\"../../pkg2/Foo.html\" title=\"class in pkg2\">Foo</a"
+                + "href=\"../Foo.html\" title=\"class in pkg2\">Foo</a"
                 + ">&gt;</code></td>"
         );
 
         checkOutput("pkg2/class-use/Foo2.html", true,
-                "<caption><span>Classes in <a href=\"../../pkg2/"
+                "<caption><span>Classes in <a href=\"../"
                 + "package-summary.html\">pkg2</a> with type parameters of "
-                + "type <a href=\"../../pkg2/Foo2.html\" title=\"interface "
+                + "type <a href=\"../Foo2.html\" title=\"interface "
                 + "in pkg2\">Foo2</a></span><span class=\"tabEnd\">&nbsp;"
                 + "</span></caption>",
-                "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\"><a href=\"../../pkg2/ClassUseTest1.html\" "
+                "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\"><a href=\"../ClassUseTest1.html\" "
                 + "title=\"class in pkg2\">ClassUseTest1</a>&lt;T extends "
-                + "<a href=\"../../pkg2/Foo.html\" title=\"class in pkg2\">Foo"
-                + "</a> &amp; <a href=\"../../pkg2/Foo2.html\" title=\"interface in pkg2\">"
+                + "<a href=\"../Foo.html\" title=\"class in pkg2\">Foo"
+                + "</a> &amp; <a href=\"../Foo2.html\" title=\"interface in pkg2\">"
                 + "Foo2</a>&gt;</span></code></th>",
-                "<caption><span>Methods in <a href=\"../../pkg2/"
+                "<caption><span>Methods in <a href=\"../"
                 + "package-summary.html\">pkg2</a> with type parameters of "
-                + "type <a href=\"../../pkg2/Foo2.html\" title=\"interface "
+                + "type <a href=\"../Foo2.html\" title=\"interface "
                 + "in pkg2\">Foo2</a></span><span class=\"tabEnd\">&nbsp;"
                 + "</span></caption>",
                 "<th class=\"colSecond\" scope=\"row\"><span class=\"typeNameLabel\">"
-                + "ClassUseTest1.</span><code><span class=\"memberNameLink\"><a href=\"../../"
-                + "pkg2/ClassUseTest1.html#method-T-\">method</a></span>"
+                + "ClassUseTest1.</span><code><span class=\"memberNameLink\"><a href=\"../"
+                + "ClassUseTest1.html#method-T-\">method</a></span>"
                 + "&#8203;(T&nbsp;t)</code></th>"
         );
 
         // ClassUseTest2: <T extends ParamTest<Foo3>>
         checkOutput("pkg2/class-use/ParamTest.html", true,
-                "<caption><span>Classes in <a href=\"../../pkg2/"
+                "<caption><span>Classes in <a href=\"../"
                 + "package-summary.html\">pkg2</a> with type parameters of "
-                + "type <a href=\"../../pkg2/ParamTest.html\" title=\"class "
+                + "type <a href=\"../ParamTest.html\" title=\"class "
                 + "in pkg2\">ParamTest</a></span><span class=\"tabEnd\">"
                 + "&nbsp;</span></caption>",
-                "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\"><a href=\"../../pkg2/ClassUseTest2.html\" "
+                "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\"><a href=\"../ClassUseTest2.html\" "
                 + "title=\"class in pkg2\">ClassUseTest2</a>&lt;T extends "
-                + "<a href=\"../../pkg2/ParamTest.html\" title=\"class in pkg2\">"
-                + "ParamTest</a>&lt;<a href=\"../../pkg2/Foo3.html\" title=\"class in pkg2\">"
+                + "<a href=\"../ParamTest.html\" title=\"class in pkg2\">"
+                + "ParamTest</a>&lt;<a href=\"../Foo3.html\" title=\"class in pkg2\">"
                 + "Foo3</a>&gt;&gt;</span></code></th>",
-                "<caption><span>Methods in <a href=\"../../pkg2/"
+                "<caption><span>Methods in <a href=\"../"
                 + "package-summary.html\">pkg2</a> with type parameters of "
-                + "type <a href=\"../../pkg2/ParamTest.html\" title=\"class "
+                + "type <a href=\"../ParamTest.html\" title=\"class "
                 + "in pkg2\">ParamTest</a></span><span class=\"tabEnd\">"
                 + "&nbsp;</span></caption>",
                 "<th class=\"colSecond\" scope=\"row\"><span class=\"typeNameLabel\">ClassUseTest2."
-                + "</span><code><span class=\"memberNameLink\"><a href=\"../../pkg2/"
+                + "</span><code><span class=\"memberNameLink\"><a href=\"../"
                 + "ClassUseTest2.html#method-T-\">method</a></span>"
                 + "&#8203;(T&nbsp;t)</code></th>",
-                "<caption><span>Fields in <a href=\"../../pkg2/"
+                "<caption><span>Fields in <a href=\"../"
                 + "package-summary.html\">pkg2</a> declared as <a href=\"../"
-                + "../pkg2/ParamTest.html\" title=\"class in pkg2\">ParamTest"
+                + "ParamTest.html\" title=\"class in pkg2\">ParamTest"
                 + "</a></span><span class=\"tabEnd\">&nbsp;</span></caption>",
-                "<td class=\"colFirst\"><code><a href=\"../../pkg2/"
+                "<td class=\"colFirst\"><code><a href=\"../"
                 + "ParamTest.html\" title=\"class in pkg2\">ParamTest</a>"
-                + "&lt;<a href=\"../../pkg2/Foo.html\" title=\"class in pkg2\">"
+                + "&lt;<a href=\"../Foo.html\" title=\"class in pkg2\">"
                 + "Foo</a>&gt;</code></td>",
-                "<caption><span>Methods in <a href=\"../../pkg2/"
+                "<caption><span>Methods in <a href=\"../"
                 + "package-summary.html\">pkg2</a> with type parameters of "
-                + "type <a href=\"../../pkg2/ParamTest.html\" title=\"class "
+                + "type <a href=\"../ParamTest.html\" title=\"class "
                 + "in pkg2\">ParamTest</a></span><span class=\"tabEnd\">"
                 + "&nbsp;</span></caption>",
                 "<td class=\"colFirst\"><code>&lt;T extends <a href=\"../"
-                + "../pkg2/ParamTest.html\" title=\"class in pkg2\">ParamTest"
-                + "</a>&lt;<a href=\"../../pkg2/Foo3.html\" title=\"class in "
-                + "pkg2\">Foo3</a>&gt;&gt;<br><a href=\"../../pkg2/"
+                + "ParamTest.html\" title=\"class in pkg2\">ParamTest"
+                + "</a>&lt;<a href=\"../Foo3.html\" title=\"class in "
+                + "pkg2\">Foo3</a>&gt;&gt;<br><a href=\"../"
                 + "ParamTest.html\" title=\"class in pkg2\">ParamTest</a>"
-                + "&lt;<a href=\"../../pkg2/Foo3.html\" title=\"class in "
+                + "&lt;<a href=\"../Foo3.html\" title=\"class in "
                 + "pkg2\">Foo3</a>&gt;</code></td>"
         );
 
         checkOutput("pkg2/class-use/Foo3.html", true,
-                "<caption><span>Classes in <a href=\"../../pkg2/"
+                "<caption><span>Classes in <a href=\"../"
                 + "package-summary.html\">pkg2</a> with type parameters of "
-                + "type <a href=\"../../pkg2/Foo3.html\" title=\"class in pkg2\">"
+                + "type <a href=\"../Foo3.html\" title=\"class in pkg2\">"
                 + "Foo3</a></span><span class=\"tabEnd\">&nbsp;</span></caption>",
-                "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\"><a href=\"../../pkg2/ClassUseTest2.html\" "
+                "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\"><a href=\"../ClassUseTest2.html\" "
                 + "title=\"class in pkg2\">ClassUseTest2</a>&lt;T extends "
-                + "<a href=\"../../pkg2/ParamTest.html\" title=\"class in pkg2\">"
-                + "ParamTest</a>&lt;<a href=\"../../pkg2/Foo3.html\" title=\"class in pkg2\">"
+                + "<a href=\"../ParamTest.html\" title=\"class in pkg2\">"
+                + "ParamTest</a>&lt;<a href=\"../Foo3.html\" title=\"class in pkg2\">"
                 + "Foo3</a>&gt;&gt;</span></code></th>",
-                "<caption><span>Methods in <a href=\"../../pkg2/"
+                "<caption><span>Methods in <a href=\"../"
                 + "package-summary.html\">pkg2</a> with type parameters of "
-                + "type <a href=\"../../pkg2/Foo3.html\" title=\"class in "
+                + "type <a href=\"../Foo3.html\" title=\"class in "
                 + "pkg2\">Foo3</a></span><span class=\"tabEnd\">&nbsp;"
                 + "</span></caption>",
                 "<th class=\"colSecond\" scope=\"row\"><span class=\"typeNameLabel\">ClassUseTest2."
-                + "</span><code><span class=\"memberNameLink\"><a href=\"../../pkg2/"
+                + "</span><code><span class=\"memberNameLink\"><a href=\"../"
                 + "ClassUseTest2.html#method-T-\">method</a></span>"
                 + "&#8203;(T&nbsp;t)</code></th>",
-                "<caption><span>Methods in <a href=\"../../pkg2/"
+                "<caption><span>Methods in <a href=\"../"
                 + "package-summary.html\">pkg2</a> that return types with "
-                + "arguments of type <a href=\"../../pkg2/Foo3.html\" title"
+                + "arguments of type <a href=\"../Foo3.html\" title"
                 + "=\"class in pkg2\">Foo3</a></span><span class=\"tabEnd\">"
                 + "&nbsp;</span></caption>",
-                "<td class=\"colFirst\"><code>&lt;T extends <a href=\"../../"
-                + "pkg2/ParamTest.html\" title=\"class in pkg2\">ParamTest</a>&lt;"
-                + "<a href=\"../../pkg2/Foo3.html\" title=\"class in pkg2\">Foo3"
-                + "</a>&gt;&gt;<br><a href=\"../../pkg2/ParamTest.html\" "
-                + "title=\"class in pkg2\">ParamTest</a>&lt;<a href=\"../../pkg2/"
+                "<td class=\"colFirst\"><code>&lt;T extends <a href=\"../"
+                + "ParamTest.html\" title=\"class in pkg2\">ParamTest</a>&lt;"
+                + "<a href=\"../Foo3.html\" title=\"class in pkg2\">Foo3"
+                + "</a>&gt;&gt;<br><a href=\"../ParamTest.html\" "
+                + "title=\"class in pkg2\">ParamTest</a>&lt;<a href=\"../"
                 + "Foo3.html\" title=\"class in pkg2\">Foo3</a>&gt;</code></td>"
         );
 
         // ClassUseTest3: <T extends ParamTest2<List<? extends Foo4>>>
         checkOutput("pkg2/class-use/ParamTest2.html", true,
-                "<caption><span>Classes in <a href=\"../../pkg2/"
+                "<caption><span>Classes in <a href=\"../"
                 + "package-summary.html\">pkg2</a> with type parameters of "
-                + "type <a href=\"../../pkg2/ParamTest2.html\" title=\"class "
+                + "type <a href=\"../ParamTest2.html\" title=\"class "
                 + "in pkg2\">ParamTest2</a></span><span class=\"tabEnd\">"
                 + "&nbsp;</span></caption>",
-                "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\"><a href=\"../../pkg2/ClassUseTest3.html\" "
+                "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\"><a href=\"../ClassUseTest3.html\" "
                 + "title=\"class in pkg2\">ClassUseTest3</a>&lt;T extends "
-                + "<a href=\"../../pkg2/ParamTest2.html\" title=\"class in pkg2\">"
+                + "<a href=\"../ParamTest2.html\" title=\"class in pkg2\">"
                 + "ParamTest2</a>&lt;java.util.List&lt;? extends "
-                + "<a href=\"../../pkg2/Foo4.html\" title=\"class in pkg2\">"
+                + "<a href=\"../Foo4.html\" title=\"class in pkg2\">"
                 + "Foo4</a>&gt;&gt;&gt;</span></code></th>",
-                "<caption><span>Methods in <a href=\"../../pkg2/"
+                "<caption><span>Methods in <a href=\"../"
                 + "package-summary.html\">pkg2</a> with type parameters of "
-                + "type <a href=\"../../pkg2/ParamTest2.html\" title=\"class "
+                + "type <a href=\"../ParamTest2.html\" title=\"class "
                 + "in pkg2\">ParamTest2</a></span><span class=\"tabEnd\">"
                 + "&nbsp;</span></caption>",
                 "<th class=\"colSecond\" scope=\"row\"><span class=\"typeNameLabel\">ClassUseTest3"
-                + ".</span><code><span class=\"memberNameLink\"><a href=\"../../pkg2/ClassUseTest3."
+                + ".</span><code><span class=\"memberNameLink\"><a href=\"../ClassUseTest3."
                 + "html#method-T-\">method</a></span>&#8203;(T&nbsp;t)</code></th>",
                 "<td class=\"colFirst\"><code>&lt;T extends <a href=\"../"
-                + "../pkg2/ParamTest2.html\" title=\"class in pkg2\">"
+                + "ParamTest2.html\" title=\"class in pkg2\">"
                 + "ParamTest2</a>&lt;java.util.List&lt;? extends <a href=\".."
-                + "/../pkg2/Foo4.html\" title=\"class in pkg2\">Foo4</a>&gt;"
-                + "&gt;&gt;<br><a href=\"../../pkg2/ParamTest2.html\" "
+                + "/Foo4.html\" title=\"class in pkg2\">Foo4</a>&gt;"
+                + "&gt;&gt;<br><a href=\"../ParamTest2.html\" "
                 + "title=\"class in pkg2\">ParamTest2</a>&lt;java.util.List"
-                + "&lt;? extends <a href=\"../../pkg2/Foo4.html\" title=\""
+                + "&lt;? extends <a href=\"../Foo4.html\" title=\""
                 + "class in pkg2\">Foo4</a>&gt;&gt;</code></td>"
         );
 
         checkOutput("pkg2/class-use/Foo4.html", true,
-                "<caption><span>Classes in <a href=\"../../pkg2/"
+                "<caption><span>Classes in <a href=\"../"
                 + "package-summary.html\">pkg2</a> with type parameters of "
-                + "type <a href=\"../../pkg2/Foo4.html\" title=\"class in "
+                + "type <a href=\"../Foo4.html\" title=\"class in "
                 + "pkg2\">Foo4</a></span><span class=\"tabEnd\">&nbsp;"
                 + "</span></caption>",
-                "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\"><a href=\"../../pkg2/ClassUseTest3.html\" "
+                "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\"><a href=\"../ClassUseTest3.html\" "
                 + "title=\"class in pkg2\">ClassUseTest3</a>&lt;T extends "
-                + "<a href=\"../../pkg2/ParamTest2.html\" title=\"class in pkg2\">"
+                + "<a href=\"../ParamTest2.html\" title=\"class in pkg2\">"
                 + "ParamTest2</a>&lt;java.util.List&lt;? extends "
-                + "<a href=\"../../pkg2/Foo4.html\" title=\"class in pkg2\">"
+                + "<a href=\"../Foo4.html\" title=\"class in pkg2\">"
                 + "Foo4</a>&gt;&gt;&gt;</span></code></th>",
-                "<caption><span>Methods in <a href=\"../../pkg2/"
+                "<caption><span>Methods in <a href=\"../"
                 + "package-summary.html\">pkg2</a> with type parameters of "
-                + "type <a href=\"../../pkg2/Foo4.html\" title=\"class in "
+                + "type <a href=\"../Foo4.html\" title=\"class in "
                 + "pkg2\">Foo4</a></span><span class=\"tabEnd\">&nbsp;</span></caption>",
                 "<th class=\"colSecond\" scope=\"row\"><span class=\"typeNameLabel\">ClassUseTest3."
-                + "</span><code><span class=\"memberNameLink\"><a href=\"../../pkg2/ClassUseTest3."
+                + "</span><code><span class=\"memberNameLink\"><a href=\"../ClassUseTest3."
                 + "html#method-T-\">method</a></span>&#8203;(T&nbsp;t)</code>"
                 + "</th>",
-                "<caption><span>Methods in <a href=\"../../pkg2/"
+                "<caption><span>Methods in <a href=\"../"
                 + "package-summary.html\">pkg2</a> that return types with "
-                + "arguments of type <a href=\"../../pkg2/Foo4.html\" "
+                + "arguments of type <a href=\"../Foo4.html\" "
                 + "title=\"class in pkg2\">Foo4</a></span><span class=\""
                 + "tabEnd\">&nbsp;</span></caption>",
                 "<td class=\"colFirst\"><code>&lt;T extends <a href=\"../"
-                + "../pkg2/ParamTest2.html\" title=\"class in pkg2\">"
+                + "ParamTest2.html\" title=\"class in pkg2\">"
                 + "ParamTest2</a>&lt;java.util.List&lt;? extends <a href=\".."
-                + "/../pkg2/Foo4.html\" title=\"class in pkg2\">Foo4</a>&gt;"
-                + "&gt;&gt;<br><a href=\"../../pkg2/ParamTest2.html\" "
+                + "/Foo4.html\" title=\"class in pkg2\">Foo4</a>&gt;"
+                + "&gt;&gt;<br><a href=\"../ParamTest2.html\" "
                 + "title=\"class in pkg2\">ParamTest2</a>&lt;java.util.List"
-                + "&lt;? extends <a href=\"../../pkg2/Foo4.html\" title=\""
+                + "&lt;? extends <a href=\"../Foo4.html\" title=\""
                 + "class in pkg2\">Foo4</a>&gt;&gt;</code></td>"
         );
 
         // Type parameters in constructor and method args
         checkOutput("pkg2/class-use/Foo4.html", true,
-                "<caption><span>Method parameters in <a href=\"../../pkg2/"
+                "<caption><span>Method parameters in <a href=\"../"
                 + "package-summary.html\">pkg2</a> with type arguments of "
-                + "type <a href=\"../../pkg2/Foo4.html\" title=\"class in "
+                + "type <a href=\"../Foo4.html\" title=\"class in "
                 + "pkg2\">Foo4</a></span><span class=\"tabEnd\">&nbsp;"
                 + "</span></caption>\n"
                 + "<tr>\n"
@@ -433,13 +433,13 @@
                 + "<tr class=\"altColor\">\n"
                 + "<td class=\"colFirst\"><code>void</code></td>\n"
                 + "<th class=\"colSecond\" scope=\"row\"><span class=\"typeNameLabel\">ClassUseTest3."
-                + "</span><code><span class=\"memberNameLink\"><a href=\"../../pkg2/ClassUseTest3."
+                + "</span><code><span class=\"memberNameLink\"><a href=\"../ClassUseTest3."
                 + "html#method-java.util.Set-\">method</a></span>&#8203;(java."
-                + "util.Set&lt;<a href=\"../../pkg2/Foo4.html\" title=\""
+                + "util.Set&lt;<a href=\"../Foo4.html\" title=\""
                 + "class in pkg2\">Foo4</a>&gt;&nbsp;p)</code></th>",
-                "<caption><span>Constructor parameters in <a href=\"../../"
-                + "pkg2/package-summary.html\">pkg2</a> with type arguments "
-                + "of type <a href=\"../../pkg2/Foo4.html\" title=\"class in "
+                "<caption><span>Constructor parameters in <a href=\"../"
+                + "package-summary.html\">pkg2</a> with type arguments "
+                + "of type <a href=\"../Foo4.html\" title=\"class in "
                 + "pkg2\">Foo4</a></span><span class=\"tabEnd\">&nbsp;"
                 + "</span></caption>"
         );
@@ -478,7 +478,7 @@
                 "(int...&nbsp;i)",
                 "(int[][]...&nbsp;i)",
                 "-int:A...-",
-                "<a href=\"../pkg/TypeParameters.html\" title=\"class in pkg\">"
+                "<a href=\"TypeParameters.html\" title=\"class in pkg\">"
                 + "TypeParameters</a>...&nbsp;t");
     }
 
@@ -520,58 +520,58 @@
     void checkAnnotationTypeUsage() {
         checkOutput("pkg/package-summary.html", true,
                 // PACKAGE
-                "<a href=\"../pkg/AnnotationType.html\" title=\"annotation in pkg\">@AnnotationType</a>(<a href=\"../pkg/AnnotationType.html#optional--\">optional</a>=\"Package Annotation\",\n"
-                + "                <a href=\"../pkg/AnnotationType.html#required--\">required</a>=1994)");
+                "<a href=\"AnnotationType.html\" title=\"annotation in pkg\">@AnnotationType</a>(<a href=\"AnnotationType.html#optional--\">optional</a>=\"Package Annotation\",\n"
+                + "                <a href=\"AnnotationType.html#required--\">required</a>=1994)");
 
         checkOutput("pkg/AnnotationTypeUsage.html", true,
                 // CLASS
-                "<pre><a href=\"../pkg/AnnotationType.html\" "
+                "<pre><a href=\"AnnotationType.html\" "
                 + "title=\"annotation in pkg\">@AnnotationType</a>("
-                + "<a href=\"../pkg/AnnotationType.html#optional--\">optional</a>"
+                + "<a href=\"AnnotationType.html#optional--\">optional</a>"
                 + "=\"Class Annotation\",\n"
-                + "                <a href=\"../pkg/AnnotationType.html#required--\">"
+                + "                <a href=\"AnnotationType.html#required--\">"
                 + "required</a>=1994)\n"
                 + "public class <span class=\"typeNameLabel\">"
                 + "AnnotationTypeUsage</span>\n"
                 + "extends java.lang.Object</pre>",
                 // FIELD
-                "<pre><a href=\"../pkg/AnnotationType.html\" "
+                "<pre><a href=\"AnnotationType.html\" "
                 + "title=\"annotation in pkg\">@AnnotationType</a>("
-                + "<a href=\"../pkg/AnnotationType.html#optional--\">optional</a>"
+                + "<a href=\"AnnotationType.html#optional--\">optional</a>"
                 + "=\"Field Annotation\",\n"
-                + "                <a href=\"../pkg/AnnotationType.html#required--\">"
+                + "                <a href=\"AnnotationType.html#required--\">"
                 + "required</a>=1994)\n"
                 + "public&nbsp;int field</pre>",
                 // CONSTRUCTOR
-                "<pre><a href=\"../pkg/AnnotationType.html\" "
+                "<pre><a href=\"AnnotationType.html\" "
                 + "title=\"annotation in pkg\">@AnnotationType</a>("
-                + "<a href=\"../pkg/AnnotationType.html#optional--\">optional</a>"
+                + "<a href=\"AnnotationType.html#optional--\">optional</a>"
                 + "=\"Constructor Annotation\",\n"
-                + "                <a href=\"../pkg/AnnotationType.html#required--\">"
+                + "                <a href=\"AnnotationType.html#required--\">"
                 + "required</a>=1994)\n"
                 + "public&nbsp;AnnotationTypeUsage()</pre>",
                 // METHOD
-                "<pre><a href=\"../pkg/AnnotationType.html\" "
+                "<pre><a href=\"AnnotationType.html\" "
                 + "title=\"annotation in pkg\">@AnnotationType</a>("
-                + "<a href=\"../pkg/AnnotationType.html#optional--\">optional</a>"
+                + "<a href=\"AnnotationType.html#optional--\">optional</a>"
                 + "=\"Method Annotation\",\n"
-                + "                <a href=\"../pkg/AnnotationType.html#required--\">"
+                + "                <a href=\"AnnotationType.html#required--\">"
                 + "required</a>=1994)\n"
                 + "public&nbsp;void&nbsp;method()</pre>",
                 // METHOD PARAMS
                 "<pre>public&nbsp;void&nbsp;methodWithParams&#8203;("
-                + "<a href=\"../pkg/AnnotationType.html\" title=\"annotation in pkg\">"
-                + "@AnnotationType</a>(<a href=\"../pkg/AnnotationType.html#optional--\">"
+                + "<a href=\"AnnotationType.html\" title=\"annotation in pkg\">"
+                + "@AnnotationType</a>(<a href=\"AnnotationType.html#optional--\">"
                 + "optional</a>=\"Parameter Annotation\",<a "
-                + "href=\"../pkg/AnnotationType.html#required--\">required</a>=1994)\n"
+                + "href=\"AnnotationType.html#required--\">required</a>=1994)\n"
                 + "                             int&nbsp;documented,\n"
                 + "                             int&nbsp;undocmented)</pre>",
                 // CONSTRUCTOR PARAMS
                 "<pre>public&nbsp;AnnotationTypeUsage&#8203;(<a "
-                + "href=\"../pkg/AnnotationType.html\" title=\"annotation in pkg\">"
-                + "@AnnotationType</a>(<a href=\"../pkg/AnnotationType.html#optional--\">"
+                + "href=\"AnnotationType.html\" title=\"annotation in pkg\">"
+                + "@AnnotationType</a>(<a href=\"AnnotationType.html#optional--\">"
                 + "optional</a>=\"Constructor Param Annotation\",<a "
-                + "href=\"../pkg/AnnotationType.html#required--\">required</a>=1994)\n"
+                + "href=\"AnnotationType.html#required--\">required</a>=1994)\n"
                 + "                           int&nbsp;documented,\n"
                 + "                           int&nbsp;undocmented)</pre>");
 
@@ -580,37 +580,37 @@
         //=================================
         checkOutput("pkg/class-use/AnnotationType.html", true,
                 "<caption><span>Packages with annotations of type <a href=\""
-                + "../../pkg/AnnotationType.html\" title=\"annotation in pkg\">"
+                + "../AnnotationType.html\" title=\"annotation in pkg\">"
                 + "AnnotationType</a></span><span class=\"tabEnd\">&nbsp;"
                 + "</span></caption>",
-                "<caption><span>Classes in <a href=\"../../pkg/"
+                "<caption><span>Classes in <a href=\"../"
                 + "package-summary.html\">pkg</a> with annotations of type "
-                + "<a href=\"../../pkg/AnnotationType.html\" title=\""
+                + "<a href=\"../AnnotationType.html\" title=\""
                 + "annotation in pkg\">AnnotationType</a></span><span class"
                 + "=\"tabEnd\">&nbsp;</span></caption>",
-                "<caption><span>Fields in <a href=\"../../pkg/"
+                "<caption><span>Fields in <a href=\"../"
                 + "package-summary.html\">pkg</a> with annotations of type "
-                + "<a href=\"../../pkg/AnnotationType.html\" title=\"annotation "
+                + "<a href=\"../AnnotationType.html\" title=\"annotation "
                 + "in pkg\">AnnotationType</a></span><span class=\"tabEnd\">"
                 + "&nbsp;</span></caption>",
-                "<caption><span>Methods in <a href=\"../../pkg/"
+                "<caption><span>Methods in <a href=\"../"
                 + "package-summary.html\">pkg</a> with annotations of type "
-                + "<a href=\"../../pkg/AnnotationType.html\" title=\"annotation "
+                + "<a href=\"../AnnotationType.html\" title=\"annotation "
                 + "in pkg\">AnnotationType</a></span><span class=\"tabEnd\">"
                 + "&nbsp;</span></caption>",
-                "<caption><span>Method parameters in <a href=\"../../pkg/"
+                "<caption><span>Method parameters in <a href=\"../"
                 + "package-summary.html\">pkg</a> with annotations of type "
-                + "<a href=\"../../pkg/AnnotationType.html\" title=\"annotation "
+                + "<a href=\"../AnnotationType.html\" title=\"annotation "
                 + "in pkg\">AnnotationType</a></span><span class=\"tabEnd\">"
                 + "&nbsp;</span></caption>",
-                "<caption><span>Constructors in <a href=\"../../pkg/"
+                "<caption><span>Constructors in <a href=\"../"
                 + "package-summary.html\">pkg</a> with annotations of type "
-                + "<a href=\"../../pkg/AnnotationType.html\" title=\"annotation "
+                + "<a href=\"../AnnotationType.html\" title=\"annotation "
                 + "in pkg\">AnnotationType</a></span><span class=\"tabEnd\">"
                 + "&nbsp;</span></caption>",
-                "<caption><span>Constructor parameters in <a href=\"../../"
-                + "pkg/package-summary.html\">pkg</a> with annotations of "
-                + "type <a href=\"../../pkg/AnnotationType.html\" title=\""
+                "<caption><span>Constructor parameters in <a href=\"../"
+                + "package-summary.html\">pkg</a> with annotations of "
+                + "type <a href=\"../AnnotationType.html\" title=\""
                 + "annotation in pkg\">AnnotationType</a></span><span class=\""
                 + "tabEnd\">&nbsp;</span></caption>"
         );
@@ -620,20 +620,20 @@
         //===============================================================
         checkOutput("pkg/AnnotationTypeUsage.html", false,
                 // CLASS
-                "<a href=\"../pkg/AnnotationTypeUndocumented.html\" title=\"annotation in pkg\">@AnnotationTypeUndocumented</a>(<a href=\"../pkg/AnnotationType.html#optional\">optional</a>=\"Class Annotation\",\n"
-                + "                <a href=\"../pkg/AnnotationType.html#required\">required</a>=1994)\n"
+                "<a href=\"AnnotationTypeUndocumented.html\" title=\"annotation in pkg\">@AnnotationTypeUndocumented</a>(<a href=\"AnnotationType.html#optional\">optional</a>=\"Class Annotation\",\n"
+                + "                <a href=\"AnnotationType.html#required\">required</a>=1994)\n"
                 + "public class <span class=\"typeNameLabel\">AnnotationTypeUsage</span></dt><dt>extends java.lang.Object</dt>",
                 // FIELD
-                "<a href=\"../pkg/AnnotationTypeUndocumented.html\" title=\"annotation in pkg\">@AnnotationTypeUndocumented</a>(<a href=\"../pkg/AnnotationType.html#optional\">optional</a>=\"Field Annotation\",\n"
-                + "                <a href=\"../pkg/AnnotationType.html#required\">required</a>=1994)\n"
+                "<a href=\"AnnotationTypeUndocumented.html\" title=\"annotation in pkg\">@AnnotationTypeUndocumented</a>(<a href=\"AnnotationType.html#optional\">optional</a>=\"Field Annotation\",\n"
+                + "                <a href=\"AnnotationType.html#required\">required</a>=1994)\n"
                 + "public int <span class=\"memberNameLabel\">field</span>",
                 // CONSTRUCTOR
-                "<a href=\"../pkg/AnnotationTypeUndocumented.html\" title=\"annotation in pkg\">@AnnotationTypeUndocumented</a>(<a href=\"../pkg/AnnotationType.html#optional\">optional</a>=\"Constructor Annotation\",\n"
-                + "                <a href=\"../pkg/AnnotationType.html#required\">required</a>=1994)\n"
+                "<a href=\"AnnotationTypeUndocumented.html\" title=\"annotation in pkg\">@AnnotationTypeUndocumented</a>(<a href=\"AnnotationType.html#optional\">optional</a>=\"Constructor Annotation\",\n"
+                + "                <a href=\"AnnotationType.html#required\">required</a>=1994)\n"
                 + "public <span class=\"typeNameLabel\">AnnotationTypeUsage</span>()",
                 // METHOD
-                "<a href=\"../pkg/AnnotationTypeUndocumented.html\" title=\"annotation in pkg\">@AnnotationTypeUndocumented</a>(<a href=\"../pkg/AnnotationType.html#optional\">optional</a>=\"Method Annotation\",\n"
-                + "                <a href=\"../pkg/AnnotationType.html#required\">required</a>=1994)\n"
+                "<a href=\"AnnotationTypeUndocumented.html\" title=\"annotation in pkg\">@AnnotationTypeUndocumented</a>(<a href=\"AnnotationType.html#optional\">optional</a>=\"Method Annotation\",\n"
+                + "                <a href=\"AnnotationType.html#required\">required</a>=1994)\n"
                 + "public void <span class=\"memberNameLabel\">method</span>()");
 
         //=================================
@@ -648,31 +648,31 @@
         //=================================
         checkOutput("pkg1/B.html", true,
                 // Integer
-                "<a href=\"../pkg1/A.html#d--\">d</a>=3.14,",
+                "<a href=\"A.html#d--\">d</a>=3.14,",
                 // Double
-                "<a href=\"../pkg1/A.html#d--\">d</a>=3.14,",
+                "<a href=\"A.html#d--\">d</a>=3.14,",
                 // Boolean
-                "<a href=\"../pkg1/A.html#b--\">b</a>=true,",
+                "<a href=\"A.html#b--\">b</a>=true,",
                 // String
-                "<a href=\"../pkg1/A.html#s--\">s</a>=\"sigh\",",
+                "<a href=\"A.html#s--\">s</a>=\"sigh\",",
                 // Class
-                "<a href=\"../pkg1/A.html#c--\">c</a>=<a href=\"../pkg2/Foo.html\" title=\"class in pkg2\">Foo.class</a>,",
+                "<a href=\"A.html#c--\">c</a>=<a href=\"../pkg2/Foo.html\" title=\"class in pkg2\">Foo.class</a>,",
                 // Bounded Class
-                "<a href=\"../pkg1/A.html#w--\">w</a>=<a href=\"../pkg/TypeParameterSubClass.html\" title=\"class in pkg\">TypeParameterSubClass.class</a>,",
+                "<a href=\"A.html#w--\">w</a>=<a href=\"../pkg/TypeParameterSubClass.html\" title=\"class in pkg\">TypeParameterSubClass.class</a>,",
                 // Enum
-                "<a href=\"../pkg1/A.html#e--\">e</a>=<a href=\"../pkg/Coin.html#Penny\">Penny</a>,",
+                "<a href=\"A.html#e--\">e</a>=<a href=\"../pkg/Coin.html#Penny\">Penny</a>,",
                 // Annotation Type
-                "<a href=\"../pkg1/A.html#a--\">a</a>=<a href=\"../pkg/AnnotationType.html\" title=\"annotation in pkg\">@AnnotationType</a>(<a href=\"../pkg/AnnotationType.html#optional--\">optional</a>=\"foo\",<a href=\"../pkg/AnnotationType.html#required--\">required</a>=1994),",
+                "<a href=\"A.html#a--\">a</a>=<a href=\"../pkg/AnnotationType.html\" title=\"annotation in pkg\">@AnnotationType</a>(<a href=\"../pkg/AnnotationType.html#optional--\">optional</a>=\"foo\",<a href=\"../pkg/AnnotationType.html#required--\">required</a>=1994),",
                 // String Array
-                "<a href=\"../pkg1/A.html#sa--\">sa</a>={\"up\",\"down\"},",
+                "<a href=\"A.html#sa--\">sa</a>={\"up\",\"down\"},",
                 // Primitive
-                "<a href=\"../pkg1/A.html#primitiveClassTest--\">primitiveClassTest</a>=boolean.class,");
+                "<a href=\"A.html#primitiveClassTest--\">primitiveClassTest</a>=boolean.class,");
 
         // XXX:  Add array test case after this if fixed:
         //5020899: Incorrect internal representation of class-valued annotation elements
         // Make sure that annotations are surrounded by <pre> and </pre>
         checkOutput("pkg1/B.html", true,
-                "<pre><a href=\"../pkg1/A.html\" title=\"annotation in pkg1\">@A</a>",
+                "<pre><a href=\"A.html\" title=\"annotation in pkg1\">@A</a>",
                 "public interface <span class=\"typeNameLabel\">B</span></pre>");
 
     }
--- a/test/langtools/jdk/javadoc/doclet/testOptions/TestOptions.java	Mon Jan 22 20:31:19 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testOptions/TestOptions.java	Mon Jan 22 11:15:51 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2018, 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
@@ -236,10 +236,10 @@
                 + "public int method() {</a>");
 
         checkOutput("linksource/SomeEnum.html", true,
-                "<pre>public static final&nbsp;<a href=\"../linksource/SomeEnum.html\" "
+                "<pre>public static final&nbsp;<a href=\"SomeEnum.html\" "
                 + "title=\"enum in linksource\">SomeEnum</a> <a href="
                 + "\"../src-html/linksource/SomeEnum.html#line.29\">VALUE1</a></pre>",
-                "<pre>public static final&nbsp;<a href=\"../linksource/SomeEnum.html\" "
+                "<pre>public static final&nbsp;<a href=\"SomeEnum.html\" "
                 + "title=\"enum in linksource\">SomeEnum</a> <a href="
                 + "\"../src-html/linksource/SomeEnum.html#line.30\">VALUE2</a></pre>");
 
--- a/test/langtools/jdk/javadoc/doclet/testOrdering/TestOrdering.java	Mon Jan 22 20:31:19 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testOrdering/TestOrdering.java	Mon Jan 22 11:15:51 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2018, 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
@@ -135,42 +135,42 @@
             checkClassUseOrdering("pkg1/class-use/UsedClass.html");
 
             tester.checkOrder("pkg1/class-use/UsedClass.html",
-                    "../../pkg1/MethodOrder.html#m--",
-                    "../../pkg1/MethodOrder.html#m-byte:A-",
-                    "../../pkg1/MethodOrder.html#m-double-",
-                    "../../pkg1/MethodOrder.html#m-double-double-",
-                    "../../pkg1/MethodOrder.html#m-double-java.lang.Double-",
-                    "../../pkg1/MethodOrder.html#m-int-",
-                    "../../pkg1/MethodOrder.html#m-int-int-",
-                    "../../pkg1/MethodOrder.html#m-int-java.lang.Integer-",
-                    "../../pkg1/MethodOrder.html#m-long-",
-                    "../../pkg1/MethodOrder.html#m-long-long-",
-                    "../../pkg1/MethodOrder.html#m-long-java.lang.Long-",
-                    "../../pkg1/MethodOrder.html#m-long-java.lang.Long...-",
-                    "../../pkg1/MethodOrder.html#m-java.lang.Double-",
-                    "../../pkg1/MethodOrder.html#m-java.lang.Double-double-",
-                    "../../pkg1/MethodOrder.html#m-java.lang.Double-java.lang.Double-",
-                    "../../pkg1/MethodOrder.html#m-java.lang.Integer-",
-                    "../../pkg1/MethodOrder.html#m-java.lang.Integer-int-",
-                    "../../pkg1/MethodOrder.html#m-java.lang.Integer-java.lang.Integer-",
-                    "../../pkg1/MethodOrder.html#m-java.lang.Object:A-",
-                    "../../pkg1/MethodOrder.html#m-java.util.ArrayList-",
-                    "../../pkg1/MethodOrder.html#m-java.util.Collection-",
-                    "../../pkg1/MethodOrder.html#m-java.util.List-");
+                    "../MethodOrder.html#m--",
+                    "../MethodOrder.html#m-byte:A-",
+                    "../MethodOrder.html#m-double-",
+                    "../MethodOrder.html#m-double-double-",
+                    "../MethodOrder.html#m-double-java.lang.Double-",
+                    "../MethodOrder.html#m-int-",
+                    "../MethodOrder.html#m-int-int-",
+                    "../MethodOrder.html#m-int-java.lang.Integer-",
+                    "../MethodOrder.html#m-long-",
+                    "../MethodOrder.html#m-long-long-",
+                    "../MethodOrder.html#m-long-java.lang.Long-",
+                    "../MethodOrder.html#m-long-java.lang.Long...-",
+                    "../MethodOrder.html#m-java.lang.Double-",
+                    "../MethodOrder.html#m-java.lang.Double-double-",
+                    "../MethodOrder.html#m-java.lang.Double-java.lang.Double-",
+                    "../MethodOrder.html#m-java.lang.Integer-",
+                    "../MethodOrder.html#m-java.lang.Integer-int-",
+                    "../MethodOrder.html#m-java.lang.Integer-java.lang.Integer-",
+                    "../MethodOrder.html#m-java.lang.Object:A-",
+                    "../MethodOrder.html#m-java.util.ArrayList-",
+                    "../MethodOrder.html#m-java.util.Collection-",
+                    "../MethodOrder.html#m-java.util.List-");
 
             tester.checkOrder("pkg1/class-use/UsedClass.html",
-                    "../../pkg1/MethodOrder.html#tpm-pkg1.UsedClass-",
-                    "../../pkg1/MethodOrder.html#tpm-pkg1.UsedClass-pkg1.UsedClass-",
-                    "../../pkg1/MethodOrder.html#tpm-pkg1.UsedClass-pkg1.UsedClass:A-",
-                    "../../pkg1/MethodOrder.html#tpm-pkg1.UsedClass-java.lang.String-");
+                    "../MethodOrder.html#tpm-pkg1.UsedClass-",
+                    "../MethodOrder.html#tpm-pkg1.UsedClass-pkg1.UsedClass-",
+                    "../MethodOrder.html#tpm-pkg1.UsedClass-pkg1.UsedClass:A-",
+                    "../MethodOrder.html#tpm-pkg1.UsedClass-java.lang.String-");
 
             tester.checkOrder("pkg1/class-use/UsedClass.html",
-                    "../../pkg1/A.html#A-pkg1.UsedClass-",
-                    "../../pkg1/B.A.html#A-pkg1.UsedClass-",
-                    "../../pkg1/B.html#B-pkg1.UsedClass-",
-                    "../../pkg1/A.C.html#C-pkg1.UsedClass-java.lang.Object:A-",
-                    "../../pkg1/A.C.html#C-pkg1.UsedClass-java.util.Collection-",
-                    "../../pkg1/A.C.html#C-pkg1.UsedClass-java.util.List-");
+                    "../A.html#A-pkg1.UsedClass-",
+                    "../B.A.html#A-pkg1.UsedClass-",
+                    "../B.html#B-pkg1.UsedClass-",
+                    "../A.C.html#C-pkg1.UsedClass-java.lang.Object:A-",
+                    "../A.C.html#C-pkg1.UsedClass-java.util.Collection-",
+                    "../A.C.html#C-pkg1.UsedClass-java.util.List-");
 
             tester.checkOrder("pkg1/ImplementsOrdering.html",
                     "<dd><code>close</code>&nbsp;in interface&nbsp;<code>java.lang.AutoCloseable</code></dd>",
@@ -211,10 +211,10 @@
         }
 
         void checkClassUseOrdering(String usePage) {
-            checkClassUseOrdering(usePage, "pkg1/C#ITERATION#.html#zfield");
-            checkClassUseOrdering(usePage, "pkg1/C#ITERATION#.html#fieldInC#ITERATION#");
-            checkClassUseOrdering(usePage, "pkg1/C#ITERATION#.html#zmethod-pkg1.UsedClass");
-            checkClassUseOrdering(usePage, "pkg1/C#ITERATION#.html#methodInC#ITERATION#");
+            checkClassUseOrdering(usePage, "C#ITERATION#.html#zfield");
+            checkClassUseOrdering(usePage, "C#ITERATION#.html#fieldInC#ITERATION#");
+            checkClassUseOrdering(usePage, "C#ITERATION#.html#zmethod-pkg1.UsedClass");
+            checkClassUseOrdering(usePage, "C#ITERATION#.html#methodInC#ITERATION#");
         }
 
         void checkClassUseOrdering(String usePage, String searchString) {
@@ -405,8 +405,8 @@
             tester.checkExit(Exit.OK);
             tester.checkOrder("index-all.html", composeTestVectors());
             tester.checkOrder("add0/add/package-tree.html",
-                    "<a href=\"../../add0/add/Add.add.html\" title=\"enum in add0.add\">",
-                    "<a href=\"../../add0/add/Add.ADD.html\" title=\"enum in add0.add\">");
+                    "<a href=\"Add.add.html\" title=\"enum in add0.add\">",
+                    "<a href=\"Add.ADD.html\" title=\"enum in add0.add\">");
             tester.checkOrder("overview-tree.html",
                     "<a href=\"Add.add.html\" title=\"enum in &lt;Unnamed&gt;\">",
                     "<a href=\"add0/Add.add.html\" title=\"enum in add0\">",
@@ -593,10 +593,10 @@
 
             tester.checkOrder("pkg5/AnnoOptionalTest.html",
                     "<h3>Optional Element Summary</h3>",
-                    "<a href=\"../pkg5/AnnoOptionalTest.html#four--\">four</a>",
-                    "<a href=\"../pkg5/AnnoOptionalTest.html#one--\">one</a>",
-                    "<a href=\"../pkg5/AnnoOptionalTest.html#three--\">three</a>",
-                    "<a href=\"../pkg5/AnnoOptionalTest.html#two--\">two</a>",
+                    "<a href=\"#four--\">four</a>",
+                    "<a href=\"#one--\">one</a>",
+                    "<a href=\"#three--\">three</a>",
+                    "<a href=\"#two--\">two</a>",
                     "<h3>Element Detail</h3>",
                     "<h4>one</h4>",
                     "<h4>two</h4>",
@@ -605,10 +605,10 @@
 
             tester.checkOrder("pkg5/AnnoRequiredTest.html",
                     "<h3>Required Element Summary</h3>",
-                    "<a href=\"../pkg5/AnnoRequiredTest.html#four--\">four</a>",
-                    "<a href=\"../pkg5/AnnoRequiredTest.html#one--\">one</a>",
-                    "<a href=\"../pkg5/AnnoRequiredTest.html#three--\">three</a>",
-                    "<a href=\"../pkg5/AnnoRequiredTest.html#two--\">two</a>",
+                    "<a href=\"#four--\">four</a>",
+                    "<a href=\"#one--\">one</a>",
+                    "<a href=\"#three--\">three</a>",
+                    "<a href=\"#two--\">two</a>",
                     "<h3>Element Detail</h3>",
                     "<h4>one</h4>",
                     "<h4>two</h4>",
@@ -617,10 +617,10 @@
 
             tester.checkOrder("pkg5/CtorTest.html",
                     "<h3>Constructor Summary</h3>",
-                    "<a href=\"../pkg5/CtorTest.html#CtorTest-int-\"",
-                    "<a href=\"../pkg5/CtorTest.html#CtorTest-int-int-\"",
-                    "<a href=\"../pkg5/CtorTest.html#CtorTest-int-int-int-\"",
-                    "<a href=\"../pkg5/CtorTest.html#CtorTest-int-int-int-int-\"",
+                    "<a href=\"#CtorTest-int-\"",
+                    "<a href=\"#CtorTest-int-int-\"",
+                    "<a href=\"#CtorTest-int-int-int-\"",
+                    "<a href=\"#CtorTest-int-int-int-int-\"",
                     "<h3>Constructor Detail</h3>",
                     "<a name=\"CtorTest-int-int-int-int-\">",
                     "<a name=\"CtorTest-int-int-int-\">",
@@ -629,10 +629,10 @@
 
             tester.checkOrder("pkg5/EnumTest.html",
                     "<h3>Enum Constant Summary</h3>",
-                    "<a href=\"../pkg5/EnumTest.html#FOUR\">FOUR</a>",
-                    "<a href=\"../pkg5/EnumTest.html#ONE\">ONE</a>",
-                    "<a href=\"../pkg5/EnumTest.html#THREE\">THREE</a>",
-                    "<a href=\"../pkg5/EnumTest.html#TWO\">TWO</a>",
+                    "<a href=\"#FOUR\">FOUR</a>",
+                    "<a href=\"#ONE\">ONE</a>",
+                    "<a href=\"#THREE\">THREE</a>",
+                    "<a href=\"#TWO\">TWO</a>",
                     "<h3>Enum Constant Detail</h3>",
                     "<h4>ONE</h4>",
                     "<h4>TWO</h4>",
@@ -641,10 +641,10 @@
 
             tester.checkOrder("pkg5/FieldTest.html",
                     "<h3>Field Summary</h3>",
-                    "<a href=\"../pkg5/FieldTest.html#four\">four</a>",
-                    "<a href=\"../pkg5/FieldTest.html#one\">one</a>",
-                    "<a href=\"../pkg5/FieldTest.html#three\">three</a>",
-                    "<a href=\"../pkg5/FieldTest.html#two\">two</a>",
+                    "<a href=\"#four\">four</a>",
+                    "<a href=\"#one\">one</a>",
+                    "<a href=\"#three\">three</a>",
+                    "<a href=\"#two\">two</a>",
                     "<h3>Field Detail</h3>",
                     "<h4>one</h4>",
                     "<h4>two</h4>",
@@ -653,10 +653,10 @@
 
             tester.checkOrder("pkg5/IntfTest.html",
                     "<h3>Method Summary</h3>",
-                    "<a href=\"../pkg5/IntfTest.html#four--\">four</a>",
-                    "<a href=\"../pkg5/IntfTest.html#one--\">one</a>",
-                    "<a href=\"../pkg5/IntfTest.html#three--\">three</a>",
-                    "<a href=\"../pkg5/IntfTest.html#two--\">two</a>",
+                    "<a href=\"#four--\">four</a>",
+                    "<a href=\"#one--\">one</a>",
+                    "<a href=\"#three--\">three</a>",
+                    "<a href=\"#two--\">two</a>",
                     "<h3>Method Detail</h3>",
                     "<h4>one</h4>",
                     "<h4>two</h4>",
@@ -665,10 +665,10 @@
 
             tester.checkOrder("pkg5/MethodTest.html",
                     "<h3>Method Summary</h3>",
-                    "<a href=\"../pkg5/MethodTest.html#four--\">four</a>",
-                    "<a href=\"../pkg5/MethodTest.html#one--\">one</a>",
-                    "<a href=\"../pkg5/MethodTest.html#three--\">three</a>",
-                    "<a href=\"../pkg5/MethodTest.html#two--\">two</a>",
+                    "<a href=\"#four--\">four</a>",
+                    "<a href=\"#one--\">one</a>",
+                    "<a href=\"#three--\">three</a>",
+                    "<a href=\"#two--\">two</a>",
                     "<h3>Method Detail</h3>",
                     "<h4>one</h4>",
                     "<h4>two</h4>",
@@ -677,10 +677,10 @@
 
             tester.checkOrder("pkg5/PropertyTest.html",
                     "<h3>Property Summary</h3>",
-                    "<a href=\"../pkg5/PropertyTest.html#fourProperty\">four</a>",
-                    "<a href=\"../pkg5/PropertyTest.html#oneProperty\">one</a>",
-                    "<a href=\"../pkg5/PropertyTest.html#threeProperty\">three</a>",
-                    "<a href=\"../pkg5/PropertyTest.html#twoProperty\">two</a>",
+                    "<a href=\"#fourProperty\">four</a>",
+                    "<a href=\"#oneProperty\">one</a>",
+                    "<a href=\"#threeProperty\">three</a>",
+                    "<a href=\"#twoProperty\">two</a>",
                     "<h3>Property Detail</h3>",
                     "<h4>oneProperty</h4>",
                     "<h4>twoProperty</h4>",
--- a/test/langtools/jdk/javadoc/doclet/testOverriddenMethods/TestMultiInheritance.java	Mon Jan 22 20:31:19 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testOverriddenMethods/TestMultiInheritance.java	Mon Jan 22 11:15:51 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, 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
@@ -51,30 +51,30 @@
 
         checkOutput("pkg3/I1.html", true,
                 "Methods inherited from interface&nbsp;pkg3."
-                + "<a href=\"../pkg3/I2.html\" title=\"interface in pkg3\">"
+                + "<a href=\"I2.html\" title=\"interface in pkg3\">"
                 + "I2</a>",
                 "Methods inherited from interface&nbsp;pkg3."
-                + "<a href=\"../pkg3/I3.html\" title=\"interface in pkg3\">"
+                + "<a href=\"I3.html\" title=\"interface in pkg3\">"
                 + "I3</a>");
 
         checkOutput("pkg3/I0.html", true,
                 "Methods inherited from interface&nbsp;pkg3."
-                + "<a href=\"../pkg3/I2.html\" title=\"interface in pkg3\">"
+                + "<a href=\"I2.html\" title=\"interface in pkg3\">"
                 + "I2</a>",
                 "Methods inherited from interface&nbsp;pkg3."
-                + "<a href=\"../pkg3/I3.html\" title=\"interface in pkg3\">"
+                + "<a href=\"I3.html\" title=\"interface in pkg3\">"
                 + "I3</a>");
 
         // Method foo() is NOT inherited from I4 because it is overriden by I3.
 
         checkOutput("pkg3/I1.html", false,
                 "Methods inherited from interface&nbsp;pkg3."
-                + "<a href=\"../pkg3/I4.html\" title=\"interface in pkg3\">"
+                + "<a href=\"I4.html\" title=\"interface in pkg3\">"
                 + "I4</a>");
 
         checkOutput("pkg3/I0.html", false,
                 "Methods inherited from interface&nbsp;pkg3."
-                + "<a href=\"../pkg3/I4.html\" title=\"interface in pkg3\">"
+                + "<a href=\"I4.html\" title=\"interface in pkg3\">"
                 + "I4</a>");
     }
 }
--- a/test/langtools/jdk/javadoc/doclet/testOverriddenMethods/TestOverriddenMethodDocCopy.java	Mon Jan 22 20:31:19 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testOverriddenMethods/TestOverriddenMethodDocCopy.java	Mon Jan 22 11:15:51 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, 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
@@ -53,7 +53,7 @@
 
         checkOutput("pkg1/SubClass.html", true,
                 "<span class=\"descfrmTypeLabel\">Description copied from class:&nbsp;<code>"
-                + "<a href=\"../pkg1/BaseClass.html#overridenMethodWithDocsToCopy--\">"
+                + "<a href=\"BaseClass.html#overridenMethodWithDocsToCopy--\">"
                 + "BaseClass</a></code></span>");
     }
 }
--- a/test/langtools/jdk/javadoc/doclet/testOverriddenMethods/TestOverriddenPrivateMethods.java	Mon Jan 22 20:31:19 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testOverriddenMethods/TestOverriddenPrivateMethods.java	Mon Jan 22 11:15:51 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2018, 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
@@ -50,7 +50,7 @@
         // The public method should be overridden
         checkOutput("pkg1/SubClass.html", true,
                 "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n"
-                + "<dd><code><a href=\"../pkg1/BaseClass.html#publicMethod");
+                + "<dd><code><a href=\"BaseClass.html#publicMethod");
 
         // The public method in different package should be overridden
         checkOutput("pkg2/SubClass.html", true,
--- a/test/langtools/jdk/javadoc/doclet/testOverriddenMethods/TestOverriddenPrivateMethodsWithPackageFlag.java	Mon Jan 22 20:31:19 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testOverriddenMethods/TestOverriddenPrivateMethodsWithPackageFlag.java	Mon Jan 22 11:15:51 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2018, 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
@@ -51,9 +51,9 @@
         // The public method should be overridden
         checkOutput("pkg1/SubClass.html", true,
                 "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n"
-                + "<dd><code><a href=\"../pkg1/BaseClass.html#publicMethod--\">"
+                + "<dd><code><a href=\"BaseClass.html#publicMethod--\">"
                 + "publicMethod</a></code>&nbsp;in class&nbsp;<code>"
-                + "<a href=\"../pkg1/BaseClass.html\" title=\"class in pkg1\">BaseClass</a></code></dd>");
+                + "<a href=\"BaseClass.html\" title=\"class in pkg1\">BaseClass</a></code></dd>");
 
         // The public method in different package should be overridden
         checkOutput("pkg2/SubClass.html", true,
@@ -66,14 +66,14 @@
         // package.
         checkOutput("pkg1/SubClass.html", true,
                 "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n"
-                + "<dd><code><a href=\"../pkg1/BaseClass.html#packagePrivateMethod--\">"
+                + "<dd><code><a href=\"BaseClass.html#packagePrivateMethod--\">"
                 + "packagePrivateMethod</a></code>&nbsp;in class&nbsp;<code>"
-                + "<a href=\"../pkg1/BaseClass.html\" title=\"class in pkg1\">BaseClass</a></code></dd>");
+                + "<a href=\"BaseClass.html\" title=\"class in pkg1\">BaseClass</a></code></dd>");
 
         // The private method in should not be overridden
         checkOutput("pkg1/SubClass.html", false,
                 "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n"
-                + "<dd><code><a href=\"../pkg1/BaseClass.html#privateMethod()\">");
+                + "<dd><code><a href=\"BaseClass.html#privateMethod()\">");
 
         // The private method in different package should not be overridden
         checkOutput("pkg2/SubClass.html", false,
--- a/test/langtools/jdk/javadoc/doclet/testOverriddenMethods/TestOverriddenPrivateMethodsWithPrivateFlag.java	Mon Jan 22 20:31:19 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testOverriddenMethods/TestOverriddenPrivateMethodsWithPrivateFlag.java	Mon Jan 22 11:15:51 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2018, 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
@@ -51,13 +51,13 @@
         // The public method should be overridden
         checkOutput("pkg1/SubClass.html", true,
          "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n" +
-                 "<dd><code><a href=\"../pkg1/BaseClass.html#publicMethod");
+                 "<dd><code><a href=\"BaseClass.html#publicMethod");
 
         // The package private method should be overridden since the base and sub class are in the same
         // package.
         checkOutput("pkg1/SubClass.html", true,
          "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n" +
-                 "<dd><code><a href=\"../pkg1/BaseClass.html#packagePrivateMethod");
+                 "<dd><code><a href=\"BaseClass.html#packagePrivateMethod");
 
         // The public method in different package should be overridden
         checkOutput("pkg2/SubClass.html", true,
@@ -67,7 +67,7 @@
         // The private method in should not be overridden
         checkOutput("pkg1/SubClass.html", false,
          "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n" +
-                 "<dd><code><a href=\"../pkg1/BaseClass.html#privateMethod");
+                 "<dd><code><a href=\"BaseClass.html#privateMethod");
 
         // The private method in different package should not be overridden
         checkOutput("pkg2/SubClass.html", false,
--- a/test/langtools/jdk/javadoc/doclet/testOverriddenMethods/TestOverrideMethods.java	Mon Jan 22 20:31:19 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testOverriddenMethods/TestOverrideMethods.java	Mon Jan 22 11:15:51 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2018, 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
@@ -73,94 +73,94 @@
 
         checkOrder("pkg5/Classes.C.html",
                 // Check properties
-                "Properties declared in class&nbsp;pkg5.<a href=\"../pkg5/Classes.P.html",
+                "Properties declared in class&nbsp;pkg5.<a href=\"Classes.P.html",
                 "Classes.P",
-                "../pkg5/Classes.P.html#rateProperty\">rate",
+                "Classes.P.html#rateProperty\">rate",
 
                 // Check nested classes
                 "Nested classes/interfaces declared in class&nbsp;pkg5.",
                 "Classes.P",
-                "./pkg5/Classes.P.PN.html",
+                "Classes.P.PN.html",
                 "Classes.P.PN.html",
                 "type parameter in Classes.P.PN\">K",
                 "type parameter in Classes.P.PN",
                 "V",
 
                 // Check fields
-                "Fields declared in class&nbsp;pkg5.<a href=\"../pkg5/Classes.P.html",
+                "Fields declared in class&nbsp;pkg5.<a href=\"Classes.P.html",
                 "Classes.P",
-                "../pkg5/Classes.P.html#field0\">field0",
+                "Classes.P.html#field0\">field0",
 
                 // Check method summary
                 "Method Summary",
                 "void",
-                "../pkg5/Classes.C.html#m1--\">m1",
+                "#m1--\">m1",
                 "A modified method",
 
                 "void",
-                "../pkg5/Classes.C.html#m4-java.lang.String-java.lang.String-\">m4",
+                "#m4-java.lang.String-java.lang.String-\">m4",
                 "java.lang.String&nbsp;k,",
                 "java.lang.String",
                 "&nbsp;v)",
 
                 // Check footnotes
-                "Methods declared in class&nbsp;pkg5.<a href=\"../pkg5/Classes.GP.html",
+                "Methods declared in class&nbsp;pkg5.<a href=\"Classes.GP.html",
                 "Classes.GP",
-                "../pkg5/Classes.GP.html#m0--\">m0",
+                "Classes.GP.html#m0--\">m0",
 
                 // Check method details for override
                 "overrideSpecifyLabel",
                 "Overrides:",
-                "../pkg5/Classes.GP.html#m7--\">m7",
+                "Classes.GP.html#m7--\">m7",
                 "in class",
-                "../pkg5/Classes.GP.html",
+                "Classes.GP.html",
                 "Classes.GP"
         );
 
         checkOrder("pkg5/Classes.C.html",
                 // Check footnotes 2
                 "Methods declared in class&nbsp;pkg5.",
-                "../pkg5/Classes.P.html#getRate--\">getRate",
-                "../pkg5/Classes.P.html#m2--\">m2",
-                "../pkg5/Classes.P.html#m3--\">m3",
-                "../pkg5/Classes.P.html#m4-K-V-\">m4",
-                "../pkg5/Classes.P.html#rateProperty--\">rateProperty",
-                "../pkg5/Classes.P.html#setRate-double-\">setRate",
+                "Classes.P.html#getRate--\">getRate",
+                "Classes.P.html#m2--\">m2",
+                "Classes.P.html#m3--\">m3",
+                "Classes.P.html#m4-K-V-\">m4",
+                "Classes.P.html#rateProperty--\">rateProperty",
+                "Classes.P.html#setRate-double-\">setRate",
 
                 // Check @link
                 "A test of links to the methods in this class. <p>\n",
-                "../pkg5/Classes.GP.html#m0--",
+                "Classes.GP.html#m0--",
                 "Classes.GP.m0()",
-                "../pkg5/Classes.C.html#m1--",
+                "#m1--",
                 "m1()",
-                "../pkg5/Classes.P.html#m2--",
+                "Classes.P.html#m2--",
                 "Classes.P.m2()",
-                "../pkg5/Classes.P.html#m3--",
+                "Classes.P.html#m3--",
                 "Classes.P.m3()",
                 "m4(java.lang.String,java.lang.String)",
-                "../pkg5/Classes.P.html#m5--",
+                "Classes.P.html#m5--",
                 "Classes.P.m5()",
-                "../pkg5/Classes.C.html#m6--",
+                "#m6--",
                 "m6()",
-                "../pkg5/Classes.C.html#m7--",
+                "#m7--",
                 "m7()",
                 "End of links",
 
                 // Check @see
                 "See Also:",
-                "../pkg5/Classes.GP.html#m0--",
+                "Classes.GP.html#m0--",
                 "Classes.GP.m0()",
-                "../pkg5/Classes.C.html#m1--",
+                "#m1--",
                 "m1()",
-                "../pkg5/Classes.P.html#m2--",
+                "Classes.P.html#m2--",
                 "Classes.P.m2()",
-                "../pkg5/Classes.P.html#m3--",
+                "Classes.P.html#m3--",
                 "Classes.P.m3()",
-                "../pkg5/Classes.C.html#m4-java.lang.String-java.lang.String-",
+                "#m4-java.lang.String-java.lang.String-",
                 "m4(String k, String v)",
-                "../pkg5/Classes.P.html#m5--\"><code>Classes.P.m5()",
-                "../pkg5/Classes.C.html#m6--\"><code>m6()",
-                "../pkg5/Classes.C.html#m7--\"><code>m7()"
+                "Classes.P.html#m5--\"><code>Classes.P.m5()",
+                "#m6--\"><code>m6()",
+                "#m7--\"><code>m7()"
         );
 
         // Tests for interfaces
@@ -172,56 +172,56 @@
 
         checkOrder("pkg5/Interfaces.D.html",
                 "Start of links <p>",
-                "../pkg5/Interfaces.A.html#m0--\"><code>Interfaces.A.m0()",
-                "../pkg5/Interfaces.A.html#m1--\"><code>Interfaces.A.m1()",
-                "../pkg5/Interfaces.A.html#m2--\"><code>Interfaces.A.m2()",
-                "../pkg5/Interfaces.A.html#m3--\"><code>Interfaces.A.m3()",
-                "../pkg5/Interfaces.D.html#m--\"><code>m()",
-                "../pkg5/Interfaces.D.html#n--\"><code>n()",
-                "../pkg5/Interfaces.C.html#o--\"><code>Interfaces.C.o()",
+                "Interfaces.A.html#m0--\"><code>Interfaces.A.m0()",
+                "Interfaces.A.html#m1--\"><code>Interfaces.A.m1()",
+                "Interfaces.A.html#m2--\"><code>Interfaces.A.m2()",
+                "Interfaces.A.html#m3--\"><code>Interfaces.A.m3()",
+                "#m--\"><code>m()",
+                "#n--\"><code>n()",
+                "Interfaces.C.html#o--\"><code>Interfaces.C.o()",
                 "End of links",
 
                 // Check @see links
                 "See Also:",
-                "../pkg5/Interfaces.A.html#m0--\"><code>Interfaces.A.m0()",
-                "../pkg5/Interfaces.A.html#m1--\"><code>Interfaces.A.m1()",
-                "../pkg5/Interfaces.A.html#m2--\"><code>Interfaces.A.m2()",
-                "../pkg5/Interfaces.A.html#m3--\"><code>Interfaces.A.m3()",
-                "../pkg5/Interfaces.D.html#m--\"><code>m()",
-                "../pkg5/Interfaces.D.html#n--\"><code>n()",
-                "../pkg5/Interfaces.C.html#o--\"><code>Interfaces.C.o()",
+                "Interfaces.A.html#m0--\"><code>Interfaces.A.m0()",
+                "Interfaces.A.html#m1--\"><code>Interfaces.A.m1()",
+                "Interfaces.A.html#m2--\"><code>Interfaces.A.m2()",
+                "Interfaces.A.html#m3--\"><code>Interfaces.A.m3()",
+                "#m--\"><code>m()",
+                "#n--\"><code>n()",
+                "Interfaces.C.html#o--\"><code>Interfaces.C.o()",
 
                 // Check properties
-                "Properties declared in interface&nbsp;pkg5.<a href=\"../pkg5/Interfaces.A.html\" "
+                "Properties declared in interface&nbsp;pkg5.<a href=\"Interfaces.A.html\" "
                 + "title=\"interface in pkg5\">Interfaces.A</a>",
 
                 // Check nested classes
                 "Nested classes/interfaces declared in interface&nbsp;pkg5.",
                 "Interfaces.A",
-                "../pkg5/Interfaces.A.AA.html",
+                "Interfaces.A.AA.html",
                 "Interfaces.A.AA",
 
                 // Check Fields
-                "Fields declared in interface&nbsp;pkg5.<a href=\"../pkg5/Interfaces.A.html",
-                "../pkg5/Interfaces.A.html#f",
-                "../pkg5/Interfaces.A.html#QUOTE\">QUOTE",
-                "../pkg5/Interfaces.A.html#rate\">rate",
+                "Fields declared in interface&nbsp;pkg5.<a href=\"Interfaces.A.html",
+                "Interfaces.A.html#f",
+                "Interfaces.A.html#QUOTE\">QUOTE",
+                "Interfaces.A.html#rate\">rate",
 
                 // Check Method Summary
                 "Method Summary",
-                "../pkg5/Interfaces.D.html#m--\">m",
-                "../pkg5/Interfaces.D.html#n--\">n",
+                "#m--\">m",
+                "#n--\">n",
 
                 // Check footnotes
-                "Methods declared in interface&nbsp;pkg5.<a href=\"../pkg5/Interfaces.A.html",
-                "../pkg5/Interfaces.A.html#getRate--\">getRate",
-                "../pkg5/Interfaces.A.html#rateProperty--\">rateProperty",
-                "../pkg5/Interfaces.A.html#setRate-double-",
-                "Methods declared in interface&nbsp;pkg5.<a href=\"../pkg5/Interfaces.B.html",
-                "../pkg5/Interfaces.B.html#m1--\">m1",
-                "../pkg5/Interfaces.B.html#m3--\">m3",
-                "Methods declared in interface&nbsp;pkg5.<a href=\"../pkg5/Interfaces.C.html",
-                "<a href=\"../pkg5/Interfaces.C.html#o--\">o</a>"
+                "Methods declared in interface&nbsp;pkg5.<a href=\"Interfaces.A.html",
+                "Interfaces.A.html#getRate--\">getRate",
+                "Interfaces.A.html#rateProperty--\">rateProperty",
+                "Interfaces.A.html#setRate-double-",
+                "Methods declared in interface&nbsp;pkg5.<a href=\"Interfaces.B.html",
+                "Interfaces.B.html#m1--\">m1",
+                "Interfaces.B.html#m3--\">m3",
+                "Methods declared in interface&nbsp;pkg5.<a href=\"Interfaces.C.html",
+                "<a href=\"Interfaces.C.html#o--\">o</a>"
         );
 
         // Test synthetic values and valuesof of an enum.
--- a/test/langtools/jdk/javadoc/doclet/testPackagePage/TestPackagePage.java	Mon Jan 22 20:31:19 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testPackagePage/TestPackagePage.java	Mon Jan 22 11:15:51 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2018, 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
@@ -53,9 +53,9 @@
 
         // With just one package, all general pages link to the single package page.
         checkOutput("com/pkg/C.html", true,
-            "<a href=\"../../com/pkg/package-summary.html\">Package</a>");
+            "<a href=\"package-summary.html\">Package</a>");
         checkOutput("com/pkg/package-tree.html", true,
-            "<li><a href=\"../../com/pkg/package-summary.html\">Package</a></li>");
+            "<li><a href=\"package-summary.html\">Package</a></li>");
         checkOutput("deprecated-list.html", true,
             "<li><a href=\"com/pkg/package-summary.html\">Package</a></li>");
         checkOutput("index-all.html", true,
--- a/test/langtools/jdk/javadoc/doclet/testPackageSummary/TestPackageSummary.java	Mon Jan 22 20:31:19 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testPackageSummary/TestPackageSummary.java	Mon Jan 22 11:15:51 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2018, 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
@@ -49,23 +49,23 @@
         checkOutput("pkg/package-summary.html", true,
                 "<tbody>\n"
                 + "<tr class=\"altColor\">\n"
-                + "<th class=\"colFirst\" scope=\"row\"><a href=\"../pkg/C0.html\" title=\"class in pkg\">C0</a></th>\n"
+                + "<th class=\"colFirst\" scope=\"row\"><a href=\"C0.html\" title=\"class in pkg\">C0</a></th>\n"
                 + "<td class=\"colLast\">&nbsp;</td>\n"
                 + "</tr>\n"
                 + "<tr class=\"rowColor\">\n"
-                + "<th class=\"colFirst\" scope=\"row\"><a href=\"../pkg/C1.html\" title=\"class in pkg\">C1</a></th>\n"
+                + "<th class=\"colFirst\" scope=\"row\"><a href=\"C1.html\" title=\"class in pkg\">C1</a></th>\n"
                 + "<td class=\"colLast\">&nbsp;</td>\n"
                 + "</tr>\n"
                 + "<tr class=\"altColor\">\n"
-                + "<th class=\"colFirst\" scope=\"row\"><a href=\"../pkg/C2.html\" title=\"class in pkg\">C2</a></th>\n"
+                + "<th class=\"colFirst\" scope=\"row\"><a href=\"C2.html\" title=\"class in pkg\">C2</a></th>\n"
                 + "<td class=\"colLast\">&nbsp;</td>\n"
                 + "</tr>\n"
                 + "<tr class=\"rowColor\">\n"
-                + "<th class=\"colFirst\" scope=\"row\"><a href=\"../pkg/C3.html\" title=\"class in pkg\">C3</a></th>\n"
+                + "<th class=\"colFirst\" scope=\"row\"><a href=\"C3.html\" title=\"class in pkg\">C3</a></th>\n"
                 + "<td class=\"colLast\">&nbsp;</td>\n"
                 + "</tr>\n"
                 + "<tr class=\"altColor\">\n"
-                + "<th class=\"colFirst\" scope=\"row\"><a href=\"../pkg/C4.html\" title=\"class in pkg\">C4</a></th>\n"
+                + "<th class=\"colFirst\" scope=\"row\"><a href=\"C4.html\" title=\"class in pkg\">C4</a></th>\n"
                 + "<td class=\"colLast\">&nbsp;</td>\n"
                 + "</tr>\n"
                 + "</tbody>\n"
--- a/test/langtools/jdk/javadoc/doclet/testPrivateClasses/TestPrivateClasses.java	Mon Jan 22 20:31:19 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testPrivateClasses/TestPrivateClasses.java	Mon Jan 22 11:15:51 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, 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
@@ -59,10 +59,10 @@
 
         checkOutput("pkg/PublicChild.html", true,
                 // Field inheritence from non-public superclass.
-                "<a href=\"../pkg/PublicChild.html#fieldInheritedFromParent\">"
+                "<a href=\"#fieldInheritedFromParent\">"
                 + "fieldInheritedFromParent</a>",
                 // Method inheritance from non-public superclass.
-                "<a href=\"../pkg/PublicChild.html#methodInheritedFromParent-int-\">"
+                "<a href=\"#methodInheritedFromParent-int-\">"
                 + "methodInheritedFromParent</a>",
                 // private class does not show up in tree
                 "<ul class=\"inheritance\">\n"
@@ -77,7 +77,7 @@
                 "<pre>public&nbsp;void&nbsp;methodInheritedFromParent&#8203;(int&nbsp;p1)",
                 "<dl>\n"
                 + "<dt>All Implemented Interfaces:</dt>\n"
-                + "<dd><code><a href=\"../pkg/PublicInterface.html\" title=\"interface in pkg\">"
+                + "<dd><code><a href=\"PublicInterface.html\" title=\"interface in pkg\">"
                 + "PublicInterface</a></code></dd>\n"
                 + "</dl>");
 
@@ -95,27 +95,27 @@
         checkOutput("pkg/PublicChild.html", false,
                 // Should not document comments from private inherited interfaces
                 "<td class=\"colLast\"><code><span class=\"memberNameLink\">" +
-                "<a href=\"../pkg/PublicChild.html#methodInterface-int-\">" +
+                "<a href=\"#methodInterface-int-\">" +
                 "methodInterface</a></span>&#8203;(int&nbsp;p1)</code>\n" +
                 "<div class=\"block\">Comment from interface.</div>\n</td>",
                 // and similarly one more
                 "<td class=\"colLast\"><code><span class=\"memberNameLink\">" +
-                "<a href=\"../pkg/PublicChild.html#methodInterface2-int-\">" +
+                "<a href=\"#methodInterface2-int-\">" +
                 "methodInterface2</a></span>&#8203;(int&nbsp;p1)</code>\n" +
                 "<div class=\"block\">Comment from interface.</div>\n</td>"
         );
 
         checkOutput("pkg/PublicInterface.html", true,
                 // Field inheritance from non-public superinterface.
-                "<a href=\"../pkg/PublicInterface.html#fieldInheritedFromInterface\">"
+                "<a href=\"#fieldInheritedFromInterface\">"
                 + "fieldInheritedFromInterface</a>",
                 // Method inheritance from non-public superinterface.
-                "<a href=\"../pkg/PublicInterface.html#methodInterface-int-\">"
+                "<a href=\"#methodInterface-int-\">"
                 + "methodInterface</a>",
                 //Make sure implemented interfaces from private superclass are inherited
                 "<dl>\n"
                 + "<dt>All Known Implementing Classes:</dt>\n"
-                + "<dd><code><a href=\"../pkg/PublicChild.html\" title=\"class in pkg\">"
+                + "<dd><code><a href=\"PublicChild.html\" title=\"class in pkg\">"
                 + "PublicChild</a></code></dd>\n"
                 + "</dl>");
 
@@ -132,7 +132,7 @@
         checkOutput("pkg2/C.html", false,
                 //Do not inherit private interface method with generic parameters.
                 //This method has been implemented.
-                "<span class=\"memberNameLink\"><a href=\"../pkg2/I.html#hello-T-\">hello</a></span>");
+                "<span class=\"memberNameLink\"><a href=\"I.html#hello-T-\">hello</a></span>");
 
         checkOutput("constant-values.html", false,
                 // Make inherited constant are documented correctly.
@@ -150,27 +150,27 @@
         checkOutput("pkg/PublicChild.html", true,
                 // Field inheritence from non-public superclass.
                 "Fields inherited from class&nbsp;pkg."
-                + "<a href=\"../pkg/PrivateParent.html\" title=\"class in pkg\">"
+                + "<a href=\"PrivateParent.html\" title=\"class in pkg\">"
                 + "PrivateParent</a>",
-                "<a href=\"../pkg/PrivateParent.html#fieldInheritedFromParent\">"
+                "<a href=\"PrivateParent.html#fieldInheritedFromParent\">"
                 + "fieldInheritedFromParent</a>",
                 // Method inheritence from non-public superclass.
                 "Methods inherited from class&nbsp;pkg."
-                + "<a href=\"../pkg/PrivateParent.html\" title=\"class in pkg\">"
+                + "<a href=\"PrivateParent.html\" title=\"class in pkg\">"
                 + "PrivateParent</a>",
-                "<a href=\"../pkg/PrivateParent.html#methodInheritedFromParent-int-\">"
+                "<a href=\"PrivateParent.html#methodInheritedFromParent-int-\">"
                 + "methodInheritedFromParent</a>",
                 // Should document that a method overrides method from private class.
                 "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n"
-                + "<dd><code><a href=\"../pkg/PrivateParent.html#methodOverridenFromParent-char:A-int-T-V-java.util.List-\">"
+                + "<dd><code><a href=\"PrivateParent.html#methodOverridenFromParent-char:A-int-T-V-java.util.List-\">"
                 + "methodOverridenFromParent</a></code>&nbsp;in class&nbsp;<code>"
-                + "<a href=\"../pkg/PrivateParent.html\" title=\"class in pkg\">"
+                + "<a href=\"PrivateParent.html\" title=\"class in pkg\">"
                 + "PrivateParent</a></code></dd>",
                 // Should document that a method is specified by private interface.
                 "<dt><span class=\"overrideSpecifyLabel\">Specified by:</span></dt>\n"
-                + "<dd><code><a href=\"../pkg/PrivateInterface.html#methodInterface-int-\">"
+                + "<dd><code><a href=\"PrivateInterface.html#methodInterface-int-\">"
                 + "methodInterface</a></code>&nbsp;in interface&nbsp;<code>"
-                + "<a href=\"../pkg/PrivateInterface.html\" title=\"interface in pkg\">"
+                + "<a href=\"PrivateInterface.html\" title=\"interface in pkg\">"
                 + "PrivateInterface</a></code></dd>",
                 // Should mention that any documentation was copied.
                 "Description copied from",
@@ -178,9 +178,9 @@
                 "extends",
                 "<dl>\n"
                 + "<dt>All Implemented Interfaces:</dt>\n"
-                + "<dd><code><a href=\"../pkg/PrivateInterface.html\" title=\"interface in pkg\">"
+                + "<dd><code><a href=\"PrivateInterface.html\" title=\"interface in pkg\">"
                 + "PrivateInterface</a></code>, "
-                + "<code><a href=\"../pkg/PublicInterface.html\" title=\"interface in pkg\">"
+                + "<code><a href=\"PublicInterface.html\" title=\"interface in pkg\">"
                 + "PublicInterface</a></code></dd>\n"
                 + "</dl>",
                 "<pre>public class <span class=\"typeNameLabel\">PublicChild</span>");
@@ -188,13 +188,13 @@
         checkOutput("pkg/PublicInterface.html", true,
                 // Field inheritence from non-public superinterface.
                 "Fields inherited from interface&nbsp;pkg."
-                + "<a href=\"../pkg/PrivateInterface.html\" title=\"interface in pkg\">"
+                + "<a href=\"PrivateInterface.html\" title=\"interface in pkg\">"
                 + "PrivateInterface</a>",
-                "<a href=\"../pkg/PrivateInterface.html#fieldInheritedFromInterface\">"
+                "<a href=\"PrivateInterface.html#fieldInheritedFromInterface\">"
                 + "fieldInheritedFromInterface</a>",
                 // Method inheritance from non-public superinterface.
                 "Methods inherited from interface&nbsp;pkg."
-                + "<a href=\"../pkg/PrivateInterface.html\" title=\"interface in pkg\">"
+                + "<a href=\"PrivateInterface.html\" title=\"interface in pkg\">"
                 + "PrivateInterface</a>",
                 // Extend documented private classes or interfaces
                 "extends",
@@ -202,14 +202,14 @@
                 //Make sure implemented interfaces from private superclass are inherited
                 "<dl>\n"
                 + "<dt>All Known Implementing Classes:</dt>\n"
-                + "<dd><code><a href=\"../pkg/PrivateParent.html\" title=\"class in pkg\">"
+                + "<dd><code><a href=\"PrivateParent.html\" title=\"class in pkg\">"
                 + "PrivateParent</a></code>, "
-                + "<code><a href=\"../pkg/PublicChild.html\" title=\"class in pkg\">PublicChild"
+                + "<code><a href=\"PublicChild.html\" title=\"class in pkg\">PublicChild"
                 + "</a></code></dd>\n"
                 + "</dl>");
 
         checkOutput("pkg/PrivateInterface.html", true,
-                "<a href=\"../pkg/PrivateInterface.html#methodInterface-int-\">"
+                "<a href=\"#methodInterface-int-\">"
                 + "methodInterface</a>"
         );
 
@@ -217,11 +217,11 @@
                 //Since private flag is used, we can document that private interface method
                 //with generic parameters has been implemented.
                 "<span class=\"descfrmTypeLabel\">Description copied from interface:&nbsp;<code>"
-                + "<a href=\"../pkg2/I.html#hello-T-\">I</a></code></span>",
+                + "<a href=\"I.html#hello-T-\">I</a></code></span>",
                 "<dt><span class=\"overrideSpecifyLabel\">Specified by:</span></dt>\n"
-                + "<dd><code><a href=\"../pkg2/I.html#hello-T-\">hello</a></code>"
+                + "<dd><code><a href=\"I.html#hello-T-\">hello</a></code>"
                 + "&nbsp;in interface&nbsp;<code>"
-                + "<a href=\"../pkg2/I.html\" title=\"interface in pkg2\">I</a>"
+                + "<a href=\"I.html\" title=\"interface in pkg2\">I</a>"
                 + "&lt;java.lang.String&gt;</code></dd>");
 
         checkOutput("pkg/PrivateParent.html", true,
--- a/test/langtools/jdk/javadoc/doclet/testProperty/TestProperty.java	Mon Jan 22 20:31:19 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testProperty/TestProperty.java	Mon Jan 22 11:15:51 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2018, 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
@@ -47,62 +47,62 @@
         checkExit(Exit.OK);
 
         checkOutput("pkg/MyClass.html", true,
-                "<pre>public final&nbsp;<a href=\"../pkg/ObjectProperty.html\" "
+                "<pre>public final&nbsp;<a href=\"ObjectProperty.html\" "
                 + "title=\"class in pkg\">ObjectProperty</a>"
-                + "&lt;<a href=\"../pkg/MyObj.html\" "
+                + "&lt;<a href=\"MyObj.html\" "
                 + "title=\"class in pkg\">MyObj</a>&gt; goodProperty</pre>\n"
                 + "<div class=\"block\">This is an Object property where the "
                 + "Object is a single Object.</div>\n"
                 + "<dl>\n"
                 + "<dt><span class=\"seeLabel\">See Also:</span></dt>\n"
-                + "<dd><a href=\"../pkg/MyClass.html#getGood--\"><code>getGood()</code></a>, \n"
-                + "<a href=\"../pkg/MyClass.html#setGood-pkg.MyObj-\">"
+                + "<dd><a href=\"#getGood--\"><code>getGood()</code></a>, \n"
+                + "<a href=\"#setGood-pkg.MyObj-\">"
                 + "<code>setGood(MyObj)</code></a></dd>\n"
                 + "</dl>",
 
-                "<pre>public final&nbsp;<a href=\"../pkg/ObjectProperty.html\" "
+                "<pre>public final&nbsp;<a href=\"ObjectProperty.html\" "
                 + "title=\"class in pkg\">ObjectProperty</a>"
-                + "&lt;<a href=\"../pkg/MyObj.html\" "
+                + "&lt;<a href=\"MyObj.html\" "
                 + "title=\"class in pkg\">MyObj</a>[]&gt; badProperty</pre>\n"
                 + "<div class=\"block\">This is an Object property where the "
                 + "Object is an array.</div>\n"
                 + "<dl>\n"
                 + "<dt><span class=\"seeLabel\">See Also:</span></dt>\n"
-                + "<dd><a href=\"../pkg/MyClass.html#getBad--\"><code>getBad()</code></a>, \n"
-                + "<a href=\"../pkg/MyClass.html#setBad-pkg.MyObj:A-\">"
+                + "<dd><a href=\"#getBad--\"><code>getBad()</code></a>, \n"
+                + "<a href=\"#setBad-pkg.MyObj:A-\">"
                 + "<code>setBad(MyObj[])</code></a></dd>\n"
                 + "</dl>",
 
                 // id should not be used in the property table
                 "<tr class=\"altColor\">\n"
-                + "<td class=\"colFirst\"><code><a href=\"../pkg/ObjectProperty.html\" "
-                + "title=\"class in pkg\">ObjectProperty</a>&lt;<a href=\"../pkg/MyObj.html\" "
+                + "<td class=\"colFirst\"><code><a href=\"ObjectProperty.html\" "
+                + "title=\"class in pkg\">ObjectProperty</a>&lt;<a href=\"MyObj.html\" "
                 + "title=\"class in pkg\">MyObj</a>[]&gt;</code></td>\n"
                 + "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\">"
-                + "<a href=\"../pkg/MyClass.html#badProperty\">bad</a></span></code></th>",
+                + "<a href=\"#badProperty\">bad</a></span></code></th>",
 
                 // id should be used in the method table
                 "<tr id=\"i0\" class=\"altColor\">\n"
-                + "<td class=\"colFirst\"><code><a href=\"../pkg/ObjectProperty.html\" "
-                + "title=\"class in pkg\">ObjectProperty</a>&lt;<a href=\"../pkg/MyObj.html\" "
+                + "<td class=\"colFirst\"><code><a href=\"ObjectProperty.html\" "
+                + "title=\"class in pkg\">ObjectProperty</a>&lt;<a href=\"MyObj.html\" "
                 + "title=\"class in pkg\">MyObj</a>[]&gt;</code></td>\n"
                 + "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\">"
-                + "<a href=\"../pkg/MyClass.html#badProperty--\">badProperty</a></span>()</code></th>"
+                + "<a href=\"#badProperty--\">badProperty</a></span>()</code></th>"
         );
 
         checkOutput("pkg/MyClassT.html", true,
-                "<pre>public final&nbsp;<a href=\"../pkg/ObjectProperty.html\" "
+                "<pre>public final&nbsp;<a href=\"ObjectProperty.html\" "
                 + "title=\"class in pkg\">ObjectProperty</a>"
-                + "&lt;java.util.List&lt;<a href=\"../pkg/MyClassT.html\" "
+                + "&lt;java.util.List&lt;<a href=\"MyClassT.html\" "
                 + "title=\"type parameter in MyClassT\">T</a>&gt;&gt; "
                 + "listProperty</pre>\n"
                 + "<div class=\"block\">This is an Object property where the "
                 + "Object is a single <code>List&lt;T&gt;</code>.</div>\n"
                 + "<dl>\n"
                 + "<dt><span class=\"seeLabel\">See Also:</span></dt>\n"
-                + "<dd><a href=\"../pkg/MyClassT.html#getList--\">"
+                + "<dd><a href=\"#getList--\">"
                 + "<code>getList()</code></a>, \n"
-                + "<a href=\"../pkg/MyClassT.html#setList-java.util.List-\">"
+                + "<a href=\"#setList-java.util.List-\">"
                 + "<code>setList(List)</code></a></dd>\n"
                 + "</dl>"
         );
--- a/test/langtools/jdk/javadoc/doclet/testRepeatedAnnotations/TestRepeatedAnnotations.java	Mon Jan 22 20:31:19 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testRepeatedAnnotations/TestRepeatedAnnotations.java	Mon Jan 22 11:15:51 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, 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
@@ -47,91 +47,91 @@
         checkExit(Exit.OK);
 
         checkOutput("pkg/C.html", true,
-                "<a href=\"../pkg/ContaineeSynthDoc.html\" "
+                "<a href=\"ContaineeSynthDoc.html\" "
                 + "title=\"annotation in pkg\">@ContaineeSynthDoc</a> "
-                + "<a href=\"../pkg/ContaineeSynthDoc.html\" "
+                + "<a href=\"ContaineeSynthDoc.html\" "
                 + "title=\"annotation in pkg\">@ContaineeSynthDoc</a>",
-                "<a href=\"../pkg/ContaineeRegDoc.html\" "
+                "<a href=\"ContaineeRegDoc.html\" "
                 + "title=\"annotation in pkg\">@ContaineeRegDoc</a> "
-                + "<a href=\"../pkg/ContaineeRegDoc.html\" "
+                + "<a href=\"ContaineeRegDoc.html\" "
                 + "title=\"annotation in pkg\">@ContaineeRegDoc</a>",
-                "<a href=\"../pkg/RegContainerDoc.html\" "
+                "<a href=\"RegContainerDoc.html\" "
                 + "title=\"annotation in pkg\">@RegContainerDoc</a>"
                 + "({"
-                + "<a href=\"../pkg/RegContaineeNotDoc.html\" "
+                + "<a href=\"RegContaineeNotDoc.html\" "
                 + "title=\"annotation in pkg\">@RegContaineeNotDoc</a>,"
-                + "<a href=\"../pkg/RegContaineeNotDoc.html\" "
+                + "<a href=\"RegContaineeNotDoc.html\" "
                 + "title=\"annotation in pkg\">@RegContaineeNotDoc</a>})");
 
         checkOutput("pkg/D.html", true,
-                "<a href=\"../pkg/RegDoc.html\" title=\"annotation in pkg\">@RegDoc</a>"
-                + "(<a href=\"../pkg/RegDoc.html#x--\">x</a>=1)",
-                "<a href=\"../pkg/RegArryDoc.html\" title=\"annotation in pkg\">@RegArryDoc</a>"
-                + "(<a href=\"../pkg/RegArryDoc.html#y--\">y</a>=1)",
-                "<a href=\"../pkg/RegArryDoc.html\" title=\"annotation in pkg\">@RegArryDoc</a>"
-                + "(<a href=\"../pkg/RegArryDoc.html#y--\">y</a>={1,2})",
-                "<a href=\"../pkg/NonSynthDocContainer.html\" "
+                "<a href=\"RegDoc.html\" title=\"annotation in pkg\">@RegDoc</a>"
+                + "(<a href=\"RegDoc.html#x--\">x</a>=1)",
+                "<a href=\"RegArryDoc.html\" title=\"annotation in pkg\">@RegArryDoc</a>"
+                + "(<a href=\"RegArryDoc.html#y--\">y</a>=1)",
+                "<a href=\"RegArryDoc.html\" title=\"annotation in pkg\">@RegArryDoc</a>"
+                + "(<a href=\"RegArryDoc.html#y--\">y</a>={1,2})",
+                "<a href=\"NonSynthDocContainer.html\" "
                 + "title=\"annotation in pkg\">@NonSynthDocContainer</a>"
                 + "("
-                + "<a href=\"../pkg/RegArryDoc.html\" title=\"annotation in pkg\">@RegArryDoc</a>"
-                + "(<a href=\"../pkg/RegArryDoc.html#y--\">y</a>=1))");
+                + "<a href=\"RegArryDoc.html\" title=\"annotation in pkg\">@RegArryDoc</a>"
+                + "(<a href=\"RegArryDoc.html#y--\">y</a>=1))");
 
         checkOutput("pkg1/C.html", true,
-                "<a href=\"../pkg1/RegContainerValDoc.html\" "
+                "<a href=\"RegContainerValDoc.html\" "
                 + "title=\"annotation in pkg1\">@RegContainerValDoc</a>"
-                + "(<a href=\"../pkg1/RegContainerValDoc.html#value--\">value</a>={"
-                + "<a href=\"../pkg1/RegContaineeNotDoc.html\" "
+                + "(<a href=\"RegContainerValDoc.html#value--\">value</a>={"
+                + "<a href=\"RegContaineeNotDoc.html\" "
                 + "title=\"annotation in pkg1\">@RegContaineeNotDoc</a>,"
-                + "<a href=\"../pkg1/RegContaineeNotDoc.html\" "
+                + "<a href=\"RegContaineeNotDoc.html\" "
                 + "title=\"annotation in pkg1\">@RegContaineeNotDoc</a>},"
-                + "<a href=\"../pkg1/RegContainerValDoc.html#y--\">y</a>=3)",
-                "<a href=\"../pkg1/ContainerValDoc.html\" "
+                + "<a href=\"RegContainerValDoc.html#y--\">y</a>=3)",
+                "<a href=\"ContainerValDoc.html\" "
                 + "title=\"annotation in pkg1\">@ContainerValDoc</a>"
-                + "(<a href=\"../pkg1/ContainerValDoc.html#value--\">value</a>={"
-                + "<a href=\"../pkg1/ContaineeNotDoc.html\" "
+                + "(<a href=\"ContainerValDoc.html#value--\">value</a>={"
+                + "<a href=\"ContaineeNotDoc.html\" "
                 + "title=\"annotation in pkg1\">@ContaineeNotDoc</a>,"
-                + "<a href=\"../pkg1/ContaineeNotDoc.html\" "
+                + "<a href=\"ContaineeNotDoc.html\" "
                 + "title=\"annotation in pkg1\">@ContaineeNotDoc</a>},"
-                + "<a href=\"../pkg1/ContainerValDoc.html#x--\">x</a>=1)");
+                + "<a href=\"ContainerValDoc.html#x--\">x</a>=1)");
 
         checkOutput("pkg/C.html", false,
-                "<a href=\"../pkg/RegContaineeDoc.html\" "
+                "<a href=\"RegContaineeDoc.html\" "
                 + "title=\"annotation in pkg\">@RegContaineeDoc</a> "
-                + "<a href=\"../pkg/RegContaineeDoc.html\" "
+                + "<a href=\"RegContaineeDoc.html\" "
                 + "title=\"annotation in pkg\">@RegContaineeDoc</a>",
-                "<a href=\"../pkg/RegContainerNotDoc.html\" "
+                "<a href=\"RegContainerNotDoc.html\" "
                 + "title=\"annotation in pkg\">@RegContainerNotDoc</a>"
-                + "(<a href=\"../pkg/RegContainerNotDoc.html#value--\">value</a>={"
-                + "<a href=\"../pkg/RegContaineeNotDoc.html\" "
+                + "(<a href=\"RegContainerNotDoc.html#value--\">value</a>={"
+                + "<a href=\"RegContaineeNotDoc.html\" "
                 + "title=\"annotation in pkg\">@RegContaineeNotDoc</a>,"
-                + "<a href=\"../pkg/RegContaineeNotDoc.html\" "
+                + "<a href=\"RegContaineeNotDoc.html\" "
                 + "title=\"annotation in pkg\">@RegContaineeNotDoc</a>})");
 
         checkOutput("pkg1/C.html", false,
-                "<a href=\"../pkg1/ContaineeSynthDoc.html\" "
+                "<a href=\"ContaineeSynthDoc.html\" "
                 + "title=\"annotation in pkg1\">@ContaineeSynthDoc</a> "
-                + "<a href=\"../pkg1/ContaineeSynthDoc.html\" "
+                + "<a href=\"ContaineeSynthDoc.html\" "
                 + "title=\"annotation in pkg1\">@ContaineeSynthDoc</a>",
-                "<a href=\"../pkg1/RegContainerValNotDoc.html\" "
+                "<a href=\"RegContainerValNotDoc.html\" "
                 + "title=\"annotation in pkg1\">@RegContainerValNotDoc</a>"
-                + "(<a href=\"../pkg1/RegContainerValNotDoc.html#value--\">value</a>={"
-                + "<a href=\"../pkg1/RegContaineeDoc.html\" "
+                + "(<a href=\"RegContainerValNotDoc.html#value--\">value</a>={"
+                + "<a href=\"RegContaineeDoc.html\" "
                 + "title=\"annotation in pkg1\">@RegContaineeDoc</a>,"
-                + "<a href=\"../pkg1/RegContaineeDoc.html\" "
+                + "<a href=\"RegContaineeDoc.html\" "
                 + "title=\"annotation in pkg1\">@RegContaineeDoc</a>},"
-                + "<a href=\"../pkg1/RegContainerValNotDoc.html#y--\">y</a>=4)",
-                "<a href=\"../pkg1/ContainerValNotDoc.html\" "
+                + "<a href=\"RegContainerValNotDoc.html#y--\">y</a>=4)",
+                "<a href=\"ContainerValNotDoc.html\" "
                 + "title=\"annotation in pkg1\">@ContainerValNotDoc</a>"
-                + "(<a href=\"../pkg1/ContainerValNotDoc.html#value--\">value</a>={"
-                + "<a href=\"../pkg1/ContaineeNotDoc.html\" "
+                + "(<a href=\"ContainerValNotDoc.html#value--\">value</a>={"
+                + "<a href=\"ContaineeNotDoc.html\" "
                 + "title=\"annotation in pkg1\">@ContaineeNotDoc</a>,"
-                + "<a href=\"../pkg1/ContaineeNotDoc.html\" "
+                + "<a href=\"ContaineeNotDoc.html\" "
                 + "title=\"annotation in pkg1\">@ContaineeNotDoc</a>},"
-                + "<a href=\"../pkg1/ContainerValNotDoc.html#x--\">x</a>=2)",
-                "<a href=\"../pkg1/ContainerSynthNotDoc.html\" "
+                + "<a href=\"ContainerValNotDoc.html#x--\">x</a>=2)",
+                "<a href=\"ContainerSynthNotDoc.html\" "
                 + "title=\"annotation in pkg1\">@ContainerSynthNotDoc</a>("
-                + "<a href=\"../pkg1/ContainerSynthNotDoc.html#value--\">value</a>="
-                + "<a href=\"../pkg1/ContaineeSynthDoc.html\" "
+                + "<a href=\"ContainerSynthNotDoc.html#value--\">value</a>="
+                + "<a href=\"ContaineeSynthDoc.html\" "
                 + "title=\"annotation in pkg1\">@ContaineeSynthDoc</a>)");
     }
 }
--- a/test/langtools/jdk/javadoc/doclet/testSeeTag/TestSeeTag.java	Mon Jan 22 20:31:19 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testSeeTag/TestSeeTag.java	Mon Jan 22 11:15:51 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2018, 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
@@ -50,10 +50,10 @@
             "<code>List</code>",
             "<dl>\n"
             + "<dt><span class=\"seeLabel\">See Also:</span></dt>\n"
-            + "<dd><a href=\"../pkg/Test.InnerOne.html#foo--\"><code>Test.InnerOne.foo()</code></a>, \n"
-            + "<a href=\"../pkg/Test.InnerOne.html#bar-java.lang.Object-\"><code>Test.InnerOne.bar(Object)</code></a>, \n"
+            + "<dd><a href=\"Test.InnerOne.html#foo--\"><code>Test.InnerOne.foo()</code></a>, \n"
+            + "<a href=\"Test.InnerOne.html#bar-java.lang.Object-\"><code>Test.InnerOne.bar(Object)</code></a>, \n"
             + "<a href=\"http://docs.oracle.com/javase/7/docs/technotes/tools/windows/javadoc.html#see\">Javadoc</a>, \n"
-            + "<a href=\"../pkg/Test.InnerOne.html#baz-float-\"><code>something</code></a></dd>\n"
+            + "<a href=\"Test.InnerOne.html#baz-float-\"><code>something</code></a></dd>\n"
             + "</dl>");
 
         checkOutput("pkg/Test.html", false,
--- a/test/langtools/jdk/javadoc/doclet/testSubTitle/TestSubTitle.java	Mon Jan 22 20:31:19 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testSubTitle/TestSubTitle.java	Mon Jan 22 11:15:51 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2018, 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
@@ -51,7 +51,7 @@
 
         checkOutput("pkg/C.html", true,
                 "<div class=\"subTitle\"><span class=\"packageLabelInType\">" +
-                "Package</span>&nbsp;<a href=\"../pkg/package-summary.html\">pkg</a></div>");
+                "Package</span>&nbsp;<a href=\"package-summary.html\">pkg</a></div>");
 
         checkOutput("pkg/package-summary.html", false,
             "<p class=\"subTitle\">\n" +
--- a/test/langtools/jdk/javadoc/doclet/testThrowsTag/TestThrowsTag.java	Mon Jan 22 20:31:19 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testThrowsTag/TestThrowsTag.java	Mon Jan 22 11:15:51 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2018, 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
@@ -48,14 +48,14 @@
         checkExit(Exit.OK);
 
         checkOutput("pkg/C.html", true,
-            "<dd><code><a href=\"../pkg/T1.html\" title=\"class in pkg\">T1</a></code> - the first throws tag.</dd>\n" +
-            "<dd><code><a href=\"../pkg/T2.html\" title=\"class in pkg\">T2</a></code> - the second throws tag.</dd>\n" +
-            "<dd><code><a href=\"../pkg/T3.html\" title=\"class in pkg\">T3</a></code> - the third throws tag.</dd>\n" +
-            "<dd><code><a href=\"../pkg/T4.html\" title=\"class in pkg\">T4</a></code> - the fourth throws tag.</dd>\n" +
-            "<dd><code><a href=\"../pkg/T5.html\" title=\"class in pkg\">T5</a></code> - the first inherited throws tag.</dd>\n" +
-            "<dd><code><a href=\"../pkg/T6.html\" title=\"class in pkg\">T6</a></code> - the second inherited throws tag.</dd>\n" +
-            "<dd><code><a href=\"../pkg/T7.html\" title=\"class in pkg\">T7</a></code> - the third inherited throws tag.</dd>\n" +
-            "<dd><code><a href=\"../pkg/T8.html\" title=\"class in pkg\">T8</a></code> - the fourth inherited throws tag.</dd>"
+            "<dd><code><a href=\"T1.html\" title=\"class in pkg\">T1</a></code> - the first throws tag.</dd>\n" +
+            "<dd><code><a href=\"T2.html\" title=\"class in pkg\">T2</a></code> - the second throws tag.</dd>\n" +
+            "<dd><code><a href=\"T3.html\" title=\"class in pkg\">T3</a></code> - the third throws tag.</dd>\n" +
+            "<dd><code><a href=\"T4.html\" title=\"class in pkg\">T4</a></code> - the fourth throws tag.</dd>\n" +
+            "<dd><code><a href=\"T5.html\" title=\"class in pkg\">T5</a></code> - the first inherited throws tag.</dd>\n" +
+            "<dd><code><a href=\"T6.html\" title=\"class in pkg\">T6</a></code> - the second inherited throws tag.</dd>\n" +
+            "<dd><code><a href=\"T7.html\" title=\"class in pkg\">T7</a></code> - the third inherited throws tag.</dd>\n" +
+            "<dd><code><a href=\"T8.html\" title=\"class in pkg\">T8</a></code> - the fourth inherited throws tag.</dd>"
         );
     }
 }
--- a/test/langtools/jdk/javadoc/doclet/testTitleInHref/TestTitleInHref.java	Mon Jan 22 20:31:19 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testTitleInHref/TestTitleInHref.java	Mon Jan 22 11:15:51 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2018, 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
@@ -50,9 +50,9 @@
 
         checkOutput("pkg/Links.html", true,
                 //Test to make sure that the title shows up in a class link.
-                "<a href=\"../pkg/Class.html\" title=\"class in pkg\">",
+                "<a href=\"Class.html\" title=\"class in pkg\">",
                 //Test to make sure that the title shows up in an interface link.
-                "<a href=\"../pkg/Interface.html\" title=\"interface in pkg\">",
+                "<a href=\"Interface.html\" title=\"interface in pkg\">",
                 //Test to make sure that the title shows up in cross link shows up
                 "<a href=\"" + uri + "/java/io/File.html?is-external=true\" "
                 + "title=\"class or interface in java.io\" class=\"externalLink\">"
--- a/test/langtools/jdk/javadoc/doclet/testTypeAnnotations/TestTypeAnnotations.java	Mon Jan 22 20:31:19 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testTypeAnnotations/TestTypeAnnotations.java	Mon Jan 22 11:15:51 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2018, 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
@@ -49,675 +49,675 @@
 
         // Test for type annotations on Class Extends (ClassExtends.java).
         checkOutput("typeannos/MyClass.html", true,
-                "extends <a href=\"../typeannos/ClassExtA.html\" title=\"annotation "
-                + "in typeannos\">@ClassExtA</a> <a href=\"../typeannos/ParameterizedClass.html\" "
+                "extends <a href=\"ClassExtA.html\" title=\"annotation "
+                + "in typeannos\">@ClassExtA</a> <a href=\"ParameterizedClass.html\" "
                 + "title=\"class in typeannos\">ParameterizedClass</a>&lt;<a href=\""
-                + "../typeannos/ClassExtB.html\" title=\"annotation in typeannos\">"
+                + "ClassExtB.html\" title=\"annotation in typeannos\">"
                 + "@ClassExtB</a> java.lang.String&gt;",
 
-                "implements <a href=\"../typeannos/ClassExtB.html\" title=\""
+                "implements <a href=\"ClassExtB.html\" title=\""
                 + "annotation in typeannos\">@ClassExtB</a> java.lang.CharSequence, "
-                + "<a href=\"../typeannos/ClassExtA.html\" title=\"annotation in "
-                + "typeannos\">@ClassExtA</a> <a href=\"../typeannos/ParameterizedInterface.html\" "
+                + "<a href=\"ClassExtA.html\" title=\"annotation in "
+                + "typeannos\">@ClassExtA</a> <a href=\"ParameterizedInterface.html\" "
                 + "title=\"interface in typeannos\">ParameterizedInterface</a>&lt;"
-                + "<a href=\"../typeannos/ClassExtB.html\" title=\"annotation in "
+                + "<a href=\"ClassExtB.html\" title=\"annotation in "
                 + "typeannos\">@ClassExtB</a> java.lang.String&gt;</pre>");
 
         checkOutput("typeannos/MyInterface.html", true,
-                "extends <a href=\"../typeannos/ClassExtA.html\" title=\"annotation "
-                + "in typeannos\">@ClassExtA</a> <a href=\"../typeannos/"
+                "extends <a href=\"ClassExtA.html\" title=\"annotation "
+                + "in typeannos\">@ClassExtA</a> <a href=\""
                 + "ParameterizedInterface.html\" title=\"interface in typeannos\">"
-                + "ParameterizedInterface</a>&lt;<a href=\"../typeannos/ClassExtA.html\" "
+                + "ParameterizedInterface</a>&lt;<a href=\"ClassExtA.html\" "
                 + "title=\"annotation in typeannos\">@ClassExtA</a> java.lang.String&gt;, "
-                + "<a href=\"../typeannos/ClassExtB.html\" title=\"annotation in "
+                + "<a href=\"ClassExtB.html\" title=\"annotation in "
                 + "typeannos\">@ClassExtB</a> java.lang.CharSequence</pre>");
 
         // Test for type annotations on Class Parameters (ClassParameters.java).
         checkOutput("typeannos/ExtendsBound.html", true,
                 "class <span class=\"typeNameLabel\">ExtendsBound&lt;K extends <a "
-                + "href=\"../typeannos/ClassParamA.html\" title=\"annotation in "
+                + "href=\"ClassParamA.html\" title=\"annotation in "
                 + "typeannos\">@ClassParamA</a> java.lang.String&gt;</span>");
 
         checkOutput("typeannos/ExtendsGeneric.html", true,
                 "<pre>class <span class=\"typeNameLabel\">ExtendsGeneric&lt;K extends "
-                + "<a href=\"../typeannos/ClassParamA.html\" title=\"annotation in "
-                + "typeannos\">@ClassParamA</a> <a href=\"../typeannos/Unannotated.html\" "
+                + "<a href=\"ClassParamA.html\" title=\"annotation in "
+                + "typeannos\">@ClassParamA</a> <a href=\"Unannotated.html\" "
                 + "title=\"class in typeannos\">Unannotated</a>&lt;<a href=\""
-                + "../typeannos/ClassParamB.html\" title=\"annotation in typeannos\">"
+                + "ClassParamB.html\" title=\"annotation in typeannos\">"
                 + "@ClassParamB</a> java.lang.String&gt;&gt;</span>");
 
         checkOutput("typeannos/TwoBounds.html", true,
                 "<pre>class <span class=\"typeNameLabel\">TwoBounds&lt;K extends <a href=\""
-                + "../typeannos/ClassParamA.html\" title=\"annotation in typeannos\">"
-                + "@ClassParamA</a> java.lang.String,V extends <a href=\"../typeannos/"
+                + "ClassParamA.html\" title=\"annotation in typeannos\">"
+                + "@ClassParamA</a> java.lang.String,V extends <a href=\""
                 + "ClassParamB.html\" title=\"annotation in typeannos\">@ClassParamB"
                 + "</a> java.lang.String&gt;</span>");
 
         checkOutput("typeannos/Complex1.html", true,
-                "class <span class=\"typeNameLabel\">Complex1&lt;K extends <a href=\"../"
-                + "typeannos/ClassParamA.html\" title=\"annotation in typeannos\">"
+                "class <span class=\"typeNameLabel\">Complex1&lt;K extends <a href=\""
+                + "ClassParamA.html\" title=\"annotation in typeannos\">"
                 + "@ClassParamA</a> java.lang.String &amp; java.lang.Runnable&gt;</span>");
 
         checkOutput("typeannos/Complex2.html", true,
                 "class <span class=\"typeNameLabel\">Complex2&lt;K extends java.lang."
-                + "String &amp; <a href=\"../typeannos/ClassParamB.html\" title=\""
+                + "String &amp; <a href=\"ClassParamB.html\" title=\""
                 + "annotation in typeannos\">@ClassParamB</a> java.lang.Runnable&gt;</span>");
 
         checkOutput("typeannos/ComplexBoth.html", true,
                 "class <span class=\"typeNameLabel\">ComplexBoth&lt;K extends <a href=\""
-                + "../typeannos/ClassParamA.html\" title=\"annotation in typeannos\""
-                + ">@ClassParamA</a> java.lang.String &amp; <a href=\"../typeannos/"
+                + "ClassParamA.html\" title=\"annotation in typeannos\""
+                + ">@ClassParamA</a> java.lang.String &amp; <a href=\""
                 + "ClassParamA.html\" title=\"annotation in typeannos\">@ClassParamA"
                 + "</a> java.lang.Runnable&gt;</span>");
 
         // Test for type annotations on fields (Fields.java).
         checkOutput("typeannos/DefaultScope.html", true,
-                "<pre><a href=\"../typeannos/Parameterized.html\" title=\"class in "
-                + "typeannos\">Parameterized</a>&lt;<a href=\"../typeannos/FldA.html\" "
+                "<pre><a href=\"Parameterized.html\" title=\"class in "
+                + "typeannos\">Parameterized</a>&lt;<a href=\"FldA.html\" "
                 + "title=\"annotation in typeannos\">@FldA</a> java.lang.String,<a "
-                + "href=\"../typeannos/FldB.html\" title=\"annotation in typeannos\">"
+                + "href=\"FldB.html\" title=\"annotation in typeannos\">"
                 + "@FldB</a> java.lang.String&gt; bothTypeArgs</pre>",
 
-                "<pre><a href=\"../typeannos/FldA.html\" title=\"annotation in "
-                + "typeannos\">@FldA</a> java.lang.String <a href=\"../typeannos/"
+                "<pre><a href=\"FldA.html\" title=\"annotation in "
+                + "typeannos\">@FldA</a> java.lang.String <a href=\""
                 + "FldB.html\" title=\"annotation in typeannos\">@FldB</a> [] "
                 + "array1Deep</pre>",
 
-                "<pre>java.lang.String <a href=\"../typeannos/FldB.html\" "
+                "<pre>java.lang.String <a href=\"FldB.html\" "
                 + "title=\"annotation in typeannos\">@FldB</a> [][] array2SecondOld</pre>",
 
                 // When JDK-8068737, we should change the order
-                "<pre><a href=\"../typeannos/FldD.html\" title=\"annotation in typeannos\">"
+                "<pre><a href=\"FldD.html\" title=\"annotation in typeannos\">"
                 + "@FldD</a> java.lang.String "
-                + "<a href=\"../typeannos/FldC.html\" title=\"annotation in typeannos\">@FldC</a> "
-                + "<a href=\"../typeannos/FldB.html\" title=\"annotation in typeannos\">@FldB</a> [] "
-                + "<a href=\"../typeannos/FldC.html\" title=\"annotation in typeannos\">@FldC</a> "
-                + "<a href=\"../typeannos/FldA.html\" title=\"annotation in typeannos\">@FldA</a> [] "
+                + "<a href=\"FldC.html\" title=\"annotation in typeannos\">@FldC</a> "
+                + "<a href=\"FldB.html\" title=\"annotation in typeannos\">@FldB</a> [] "
+                + "<a href=\"FldC.html\" title=\"annotation in typeannos\">@FldC</a> "
+                + "<a href=\"FldA.html\" title=\"annotation in typeannos\">@FldA</a> [] "
                 + "array2Deep</pre>");
 
         checkOutput("typeannos/ModifiedScoped.html", true,
-                "<pre>public final&nbsp;<a href=\"../typeannos/Parameterized.html\" "
-                + "title=\"class in typeannos\">Parameterized</a>&lt;<a href=\"../"
-                + "typeannos/FldA.html\" title=\"annotation in typeannos\">@FldA</a> "
-                + "<a href=\"../typeannos/Parameterized.html\" title=\"class in "
-                + "typeannos\">Parameterized</a>&lt;<a href=\"../typeannos/FldA.html\" "
+                "<pre>public final&nbsp;<a href=\"Parameterized.html\" "
+                + "title=\"class in typeannos\">Parameterized</a>&lt;<a href=\""
+                + "FldA.html\" title=\"annotation in typeannos\">@FldA</a> "
+                + "<a href=\"Parameterized.html\" title=\"class in "
+                + "typeannos\">Parameterized</a>&lt;<a href=\"FldA.html\" "
                 + "title=\"annotation in typeannos\">@FldA</a> java.lang.String,<a "
-                + "href=\"../typeannos/FldB.html\" title=\"annotation in typeannos\">"
-                + "@FldB</a> java.lang.String&gt;,<a href=\"../typeannos/FldB.html\" "
+                + "href=\"FldB.html\" title=\"annotation in typeannos\">"
+                + "@FldB</a> java.lang.String&gt;,<a href=\"FldB.html\" "
                 + "title=\"annotation in typeannos\">@FldB</a> java.lang.String&gt; "
                 + "nestedParameterized</pre>",
 
-                "<pre>public final&nbsp;<a href=\"../typeannos/FldA.html\" "
+                "<pre>public final&nbsp;<a href=\"FldA.html\" "
                 + "title=\"annotation in typeannos\">@FldA</a> java.lang.String[][] "
                 + "array2</pre>");
 
         // Test for type annotations on method return types (MethodReturnType.java).
         checkOutput("typeannos/MtdDefaultScope.html", true,
-                "<pre>public&nbsp;&lt;T&gt;&nbsp;<a href=\"../typeannos/MRtnA.html\" "
+                "<pre>public&nbsp;&lt;T&gt;&nbsp;<a href=\"MRtnA.html\" "
                 + "title=\"annotation in typeannos\">@MRtnA</a> java.lang.String"
                 + "&nbsp;method()</pre>",
 
                 // When JDK-8068737 is fixed, we should change the order
-                "<pre><a href=\"../typeannos/MRtnA.html\" title=\"annotation in typeannos\">"
+                "<pre><a href=\"MRtnA.html\" title=\"annotation in typeannos\">"
                 + "@MRtnA</a> java.lang.String "
-                + "<a href=\"../typeannos/MRtnB.html\" title=\"annotation in typeannos\">@MRtnB</a> [] "
-                + "<a href=\"../typeannos/MRtnA.html\" title=\"annotation in typeannos\">@MRtnA</a> []"
+                + "<a href=\"MRtnB.html\" title=\"annotation in typeannos\">@MRtnB</a> [] "
+                + "<a href=\"MRtnA.html\" title=\"annotation in typeannos\">@MRtnA</a> []"
                 + "&nbsp;array2Deep()</pre>",
 
-                "<pre><a href=\"../typeannos/MRtnA.html\" title=\"annotation in "
+                "<pre><a href=\"MRtnA.html\" title=\"annotation in "
                 + "typeannos\">@MRtnA</a> java.lang.String[][]&nbsp;array2()</pre>");
 
         checkOutput("typeannos/MtdModifiedScoped.html", true,
-                "<pre>public final&nbsp;<a href=\"../typeannos/MtdParameterized.html\" "
-                + "title=\"class in typeannos\">MtdParameterized</a>&lt;<a href=\"../"
-                + "typeannos/MRtnA.html\" title=\"annotation in typeannos\">@MRtnA</a> "
-                + "<a href=\"../typeannos/MtdParameterized.html\" title=\"class in "
-                + "typeannos\">MtdParameterized</a>&lt;<a href=\"../typeannos/MRtnA."
+                "<pre>public final&nbsp;<a href=\"MtdParameterized.html\" "
+                + "title=\"class in typeannos\">MtdParameterized</a>&lt;<a href=\""
+                + "MRtnA.html\" title=\"annotation in typeannos\">@MRtnA</a> "
+                + "<a href=\"MtdParameterized.html\" title=\"class in "
+                + "typeannos\">MtdParameterized</a>&lt;<a href=\"MRtnA."
                 + "html\" title=\"annotation in typeannos\">@MRtnA</a> java.lang."
-                + "String,<a href=\"../typeannos/MRtnB.html\" title=\"annotation in "
-                + "typeannos\">@MRtnB</a> java.lang.String&gt;,<a href=\"../typeannos/"
+                + "String,<a href=\"MRtnB.html\" title=\"annotation in "
+                + "typeannos\">@MRtnB</a> java.lang.String&gt;,<a href=\""
                 + "MRtnB.html\" title=\"annotation in typeannos\">@MRtnB</a> java."
                 + "lang.String&gt;&nbsp;nestedMtdParameterized()</pre>");
 
         // Test for type annotations on method type parameters (MethodTypeParameters.java).
         checkOutput("typeannos/UnscopedUnmodified.html", true,
-                "<pre>&lt;K extends <a href=\"../typeannos/MTyParamA.html\" title=\""
+                "<pre>&lt;K extends <a href=\"MTyParamA.html\" title=\""
                 + "annotation in typeannos\">@MTyParamA</a> java.lang.String&gt;"
                 + "&nbsp;void&nbsp;methodExtends()</pre>",
 
-                "<pre>&lt;K extends <a href=\"../typeannos/MTyParamA.html\" title=\""
-                + "annotation in typeannos\">@MTyParamA</a> <a href=\"../typeannos/"
+                "<pre>&lt;K extends <a href=\"MTyParamA.html\" title=\""
+                + "annotation in typeannos\">@MTyParamA</a> <a href=\""
                 + "MtdTyParameterized.html\" title=\"class in typeannos\">"
-                + "MtdTyParameterized</a>&lt;<a href=\"../typeannos/MTyParamB.html\" "
+                + "MtdTyParameterized</a>&lt;<a href=\"MTyParamB.html\" "
                 + "title=\"annotation in typeannos\">@MTyParamB</a> java.lang.String"
                 + "&gt;&gt;&nbsp;void&nbsp;nestedExtends()</pre>");
 
         checkOutput("typeannos/PublicModifiedMethods.html", true,
-                "<pre>public final&nbsp;&lt;K extends <a href=\"../typeannos/"
+                "<pre>public final&nbsp;&lt;K extends <a href=\""
                 + "MTyParamA.html\" title=\"annotation in typeannos\">@MTyParamA</a> "
                 + "java.lang.String&gt;&nbsp;void&nbsp;methodExtends()</pre>",
 
-                "<pre>public final&nbsp;&lt;K extends <a href=\"../typeannos/"
+                "<pre>public final&nbsp;&lt;K extends <a href=\""
                 + "MTyParamA.html\" title=\"annotation in typeannos\">@MTyParamA</a> "
-                + "java.lang.String,V extends <a href=\"../typeannos/MTyParamA.html\" "
-                + "title=\"annotation in typeannos\">@MTyParamA</a> <a href=\"../"
-                + "typeannos/MtdTyParameterized.html\" title=\"class in typeannos\">"
-                + "MtdTyParameterized</a>&lt;<a href=\"../typeannos/MTyParamB.html\" "
+                + "java.lang.String,V extends <a href=\"MTyParamA.html\" "
+                + "title=\"annotation in typeannos\">@MTyParamA</a> <a href=\""
+                + "MtdTyParameterized.html\" title=\"class in typeannos\">"
+                + "MtdTyParameterized</a>&lt;<a href=\"MTyParamB.html\" "
                 + "title=\"annotation in typeannos\">@MTyParamB</a> java.lang.String"
                 + "&gt;&gt;&nbsp;void&nbsp;dual()</pre>");
 
         // Test for type annotations on parameters (Parameters.java).
         checkOutput("typeannos/Parameters.html", true,
-                "<pre>void&nbsp;unannotated&#8203;(<a href=\"../typeannos/"
+                "<pre>void&nbsp;unannotated&#8203;(<a href=\""
                 + "ParaParameterized.html\" title=\"class in typeannos\">"
                 + "ParaParameterized</a>&lt;java.lang.String,java.lang.String&gt;"
                 + "&nbsp;a)</pre>",
 
-                "<pre>void&nbsp;nestedParaParameterized&#8203;(<a href=\"../typeannos/"
+                "<pre>void&nbsp;nestedParaParameterized&#8203;(<a href=\""
+                + "ParaParameterized.html\" title=\"class in typeannos\">"
+                + "ParaParameterized</a>&lt;<a href=\"ParamA.html\" "
+                + "title=\"annotation in typeannos\">@ParamA</a> <a href=\""
                 + "ParaParameterized.html\" title=\"class in typeannos\">"
-                + "ParaParameterized</a>&lt;<a href=\"../typeannos/ParamA.html\" "
-                + "title=\"annotation in typeannos\">@ParamA</a> <a href=\"../"
-                + "typeannos/ParaParameterized.html\" title=\"class in typeannos\">"
-                + "ParaParameterized</a>&lt;<a href=\"../typeannos/ParamA.html\" "
+                + "ParaParameterized</a>&lt;<a href=\"ParamA.html\" "
                 + "title=\"annotation in typeannos\">@ParamA</a> java.lang.String,"
-                + "<a href=\"../typeannos/ParamB.html\" title=\"annotation in "
-                + "typeannos\">@ParamB</a> java.lang.String&gt;,<a href=\"../"
-                + "typeannos/ParamB.html\" title=\"annotation in typeannos\">@ParamB"
+                + "<a href=\"ParamB.html\" title=\"annotation in "
+                + "typeannos\">@ParamB</a> java.lang.String&gt;,<a href=\""
+                + "ParamB.html\" title=\"annotation in typeannos\">@ParamB"
                 + "</a> java.lang.String&gt;&nbsp;a)</pre>",
 
                 // When JDK-8068737 is fixed, we should change the order
-                "<pre>void&nbsp;array2Deep&#8203;(<a href=\"../typeannos/ParamA.html\" "
+                "<pre>void&nbsp;array2Deep&#8203;(<a href=\"ParamA.html\" "
                 + "title=\"annotation in typeannos\">@ParamA</a> java.lang.String "
-                + "<a href=\"../typeannos/ParamB.html\" title=\"annotation in typeannos\">"
+                + "<a href=\"ParamB.html\" title=\"annotation in typeannos\">"
                 + "@ParamB</a> [] "
-                + "<a href=\"../typeannos/ParamA.html\" title=\"annotation in typeannos\">"
+                + "<a href=\"ParamA.html\" title=\"annotation in typeannos\">"
                 + "@ParamA</a> []"
                 + "&nbsp;a)</pre>");
 
         // Test for type annotations on throws (Throws.java).
         checkOutput("typeannos/ThrDefaultUnmodified.html", true,
                 "<pre>void&nbsp;oneException()\n"
-                + "           throws <a href=\"../typeannos/ThrA.html\" title=\""
+                + "           throws <a href=\"ThrA.html\" title=\""
                 + "annotation in typeannos\">@ThrA</a> java.lang.Exception</pre>",
 
                 "<pre>void&nbsp;twoExceptions()\n"
-                + "            throws <a href=\"../typeannos/ThrA.html\" title=\""
+                + "            throws <a href=\"ThrA.html\" title=\""
                 + "annotation in typeannos\">@ThrA</a> java.lang.RuntimeException,\n"
-                + "                   <a href=\"../typeannos/ThrA.html\" title=\""
+                + "                   <a href=\"ThrA.html\" title=\""
                 + "annotation in typeannos\">@ThrA</a> java.lang.Exception</pre>");
 
         checkOutput("typeannos/ThrPublicModified.html", true,
                 "<pre>public final&nbsp;void&nbsp;oneException&#8203;(java.lang.String&nbsp;a)\n"
-                + "                        throws <a href=\"../typeannos/ThrA.html\" "
+                + "                        throws <a href=\"ThrA.html\" "
                 + "title=\"annotation in typeannos\">@ThrA</a> java.lang.Exception</pre>",
 
                 "<pre>public final&nbsp;void&nbsp;twoExceptions&#8203;(java.lang.String&nbsp;a)\n"
-                + "                         throws <a href=\"../typeannos/ThrA.html\" "
+                + "                         throws <a href=\"ThrA.html\" "
                 + "title=\"annotation in typeannos\">@ThrA</a> java.lang.RuntimeException,\n"
-                + "                                <a href=\"../typeannos/ThrA.html\" "
+                + "                                <a href=\"ThrA.html\" "
                 + "title=\"annotation in typeannos\">@ThrA</a> java.lang.Exception</pre>");
 
         checkOutput("typeannos/ThrWithValue.html", true,
                 "<pre>void&nbsp;oneException()\n"
-                + "           throws <a href=\"../typeannos/ThrB.html\" title=\""
+                + "           throws <a href=\"ThrB.html\" title=\""
                 + "annotation in typeannos\">@ThrB</a>("
                 + "\"m\") java.lang.Exception</pre>",
 
                 "<pre>void&nbsp;twoExceptions()\n"
-                + "            throws <a href=\"../typeannos/ThrB.html\" title=\""
+                + "            throws <a href=\"ThrB.html\" title=\""
                 + "annotation in typeannos\">@ThrB</a>("
                 + "\"m\") java.lang.RuntimeException,\n"
-                + "                   <a href=\"../typeannos/ThrA.html\" title=\""
+                + "                   <a href=\"ThrA.html\" title=\""
                 + "annotation in typeannos\">@ThrA</a> java.lang.Exception</pre>");
 
         // Test for type annotations on type parameters (TypeParameters.java).
         checkOutput("typeannos/TestMethods.html", true,
-                "<pre>&lt;K,<a href=\"../typeannos/TyParaA.html\" title=\"annotation in typeannos\">"
-                + "@TyParaA</a> V extends <a href=\"../typeannos/TyParaA.html\" "
+                "<pre>&lt;K,<a href=\"TyParaA.html\" title=\"annotation in typeannos\">"
+                + "@TyParaA</a> V extends <a href=\"TyParaA.html\" "
                 + "title=\"annotation in typeannos\">@TyParaA</a> "
                 + "java.lang.String&gt;&nbsp;void&nbsp;secondAnnotated()</pre>"
         );
 
         // Test for type annotations on wildcard type (Wildcards.java).
         checkOutput("typeannos/BoundTest.html", true,
-                "<pre>void&nbsp;wcExtends&#8203;(<a href=\"../typeannos/MyList.html\" "
+                "<pre>void&nbsp;wcExtends&#8203;(<a href=\"MyList.html\" "
                 + "title=\"class in typeannos\">MyList</a>&lt;? extends <a href=\""
-                + "../typeannos/WldA.html\" title=\"annotation in typeannos\">@WldA"
+                + "WldA.html\" title=\"annotation in typeannos\">@WldA"
                 + "</a> java.lang.String&gt;&nbsp;l)</pre>",
 
-                "<pre><a href=\"../typeannos/MyList.html\" title=\"class in "
-                + "typeannos\">MyList</a>&lt;? super <a href=\"../typeannos/WldA.html\" "
+                "<pre><a href=\"MyList.html\" title=\"class in "
+                + "typeannos\">MyList</a>&lt;? super <a href=\"WldA.html\" "
                 + "title=\"annotation in typeannos\">@WldA</a> java.lang.String&gt;"
                 + "&nbsp;returnWcSuper()</pre>");
 
         checkOutput("typeannos/BoundWithValue.html", true,
-                "<pre>void&nbsp;wcSuper&#8203;(<a href=\"../typeannos/MyList.html\" title=\""
-                + "class in typeannos\">MyList</a>&lt;? super <a href=\"../typeannos/"
+                "<pre>void&nbsp;wcSuper&#8203;(<a href=\"MyList.html\" title=\""
+                + "class in typeannos\">MyList</a>&lt;? super <a href=\""
                 + "WldB.html\" title=\"annotation in typeannos\">@WldB</a>("
                 + "\"m\") java.lang."
                 + "String&gt;&nbsp;l)</pre>",
 
-                "<pre><a href=\"../typeannos/MyList.html\" title=\"class in "
-                + "typeannos\">MyList</a>&lt;? extends <a href=\"../typeannos/WldB."
+                "<pre><a href=\"MyList.html\" title=\"class in "
+                + "typeannos\">MyList</a>&lt;? extends <a href=\"WldB."
                 + "html\" title=\"annotation in typeannos\">@WldB</a>("
                 + "\"m\") java.lang.String"
                 + "&gt;&nbsp;returnWcExtends()</pre>");
 
         // Test for receiver annotations (Receivers.java).
         checkOutput("typeannos/DefaultUnmodified.html", true,
-                "<pre>void&nbsp;withException&#8203;(<a href=\"../typeannos/RcvrA.html\" "
+                "<pre>void&nbsp;withException&#8203;(<a href=\"RcvrA.html\" "
                 + "title=\"annotation in typeannos\">@RcvrA</a>&nbsp;"
                 + "DefaultUnmodified&nbsp;this)\n"
                 + "            throws java."
                 + "lang.Exception</pre>",
 
-                "<pre>java.lang.String&nbsp;nonVoid&#8203;(<a href=\"../typeannos/RcvrA."
-                + "html\" title=\"annotation in typeannos\">@RcvrA</a> <a href=\"../"
-                + "typeannos/RcvrB.html\" title=\"annotation in typeannos\">@RcvrB"
+                "<pre>java.lang.String&nbsp;nonVoid&#8203;(<a href=\"RcvrA."
+                + "html\" title=\"annotation in typeannos\">@RcvrA</a> <a href=\""
+                + "RcvrB.html\" title=\"annotation in typeannos\">@RcvrB"
                 + "</a>(\"m\")"
                 + "&nbsp;DefaultUnmodified&nbsp;this)</pre>",
 
                 "<pre>&lt;T extends java.lang.Runnable&gt;&nbsp;void&nbsp;accept&#8203;("
-                + "<a href=\"../typeannos/RcvrA.html\" title=\"annotation in "
+                + "<a href=\"RcvrA.html\" title=\"annotation in "
                 + "typeannos\">@RcvrA</a>&nbsp;DefaultUnmodified&nbsp;this,\n"
                 + "                                           T&nbsp;r)\n"
                 + "                                    throws java.lang.Exception</pre>");
 
         checkOutput("typeannos/PublicModified.html", true,
                 "<pre>public final&nbsp;java.lang.String&nbsp;nonVoid&#8203;(<a href=\""
-                + "../typeannos/RcvrA.html\" title=\"annotation in typeannos\">"
+                + "RcvrA.html\" title=\"annotation in typeannos\">"
                 + "@RcvrA</a>&nbsp;PublicModified&nbsp;this)</pre>",
 
                 "<pre>public final&nbsp;&lt;T extends java.lang.Runnable&gt;&nbsp;"
-                + "void&nbsp;accept&#8203;(<a href=\"../typeannos/RcvrA.html\" title=\""
+                + "void&nbsp;accept&#8203;(<a href=\"RcvrA.html\" title=\""
                 + "annotation in typeannos\">@RcvrA</a>&nbsp;PublicModified&nbsp;this,\n"
                 + "                                                        T&nbsp;r)\n"
                 + "                                                 throws java.lang.Exception</pre>");
 
         checkOutput("typeannos/WithValue.html", true,
                 "<pre>&lt;T extends java.lang.Runnable&gt;&nbsp;void&nbsp;accept&#8203;("
-                + "<a href=\"../typeannos/RcvrB.html\" title=\"annotation in "
+                + "<a href=\"RcvrB.html\" title=\"annotation in "
                 + "typeannos\">@RcvrB</a>("
                 + "\"m\")&nbsp;WithValue&nbsp;this,\n"
                 + "                                           T&nbsp;r)\n"
                 + "                                    throws java.lang.Exception</pre>");
 
         checkOutput("typeannos/WithFinal.html", true,
-                "<pre>java.lang.String&nbsp;nonVoid&#8203;(<a href=\"../typeannos/RcvrB.html\" "
+                "<pre>java.lang.String&nbsp;nonVoid&#8203;(<a href=\"RcvrB.html\" "
                 + "title=\"annotation in typeannos\">@RcvrB</a>(\"m\") "
-                + "<a href=\"../typeannos/WithFinal.html\" title=\"class in typeannos\">"
+                + "<a href=\"WithFinal.html\" title=\"class in typeannos\">"
                 + "WithFinal</a>&nbsp;afield)</pre>");
 
         checkOutput("typeannos/WithBody.html", true,
-                "<pre>void&nbsp;field&#8203;(<a href=\"../typeannos/RcvrA.html\" title=\""
+                "<pre>void&nbsp;field&#8203;(<a href=\"RcvrA.html\" title=\""
                 + "annotation in typeannos\">@RcvrA</a>&nbsp;WithBody&nbsp;this)</pre>");
 
         checkOutput("typeannos/Generic2.html", true,
-                "<pre>void&nbsp;test2&#8203;(<a href=\"../typeannos/RcvrA.html\" title=\""
+                "<pre>void&nbsp;test2&#8203;(<a href=\"RcvrA.html\" title=\""
                 + "annotation in typeannos\">@RcvrA</a>&nbsp;Generic2&lt;X&gt;&nbsp;this)</pre>");
 
 
         // Test for repeated type annotations (RepeatedAnnotations.java).
         checkOutput("typeannos/RepeatingAtClassLevel.html", true,
-                "<pre><a href=\"../typeannos/RepTypeA.html\" title=\"annotation in "
-                + "typeannos\">@RepTypeA</a> <a href=\"../typeannos/RepTypeA.html\" "
+                "<pre><a href=\"RepTypeA.html\" title=\"annotation in "
+                + "typeannos\">@RepTypeA</a> <a href=\"RepTypeA.html\" "
                 + "title=\"annotation in typeannos\">@RepTypeA</a>\n<a href="
-                + "\"../typeannos/RepTypeB.html\" title=\"annotation in typeannos\">"
-                + "@RepTypeB</a> <a href=\"../typeannos/RepTypeB.html\" title="
+                + "\"RepTypeB.html\" title=\"annotation in typeannos\">"
+                + "@RepTypeB</a> <a href=\"RepTypeB.html\" title="
                 + "\"annotation in typeannos\">@RepTypeB</a>\nclass <span class="
                 + "\"typeNameLabel\">RepeatingAtClassLevel</span>\nextends "
                 + "java.lang.Object</pre>");
 
 // @ignore 8146008
 //        checkOutput("typeannos/RepeatingAtClassLevel2.html", true,
-//                "<pre><a href=\"../typeannos/RepTypeUseA.html\" title=\"annotation "
-//                + "in typeannos\">@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseA.html"
+//                "<pre><a href=\"RepTypeUseA.html\" title=\"annotation "
+//                + "in typeannos\">@RepTypeUseA</a> <a href=\"RepTypeUseA.html"
 //                + "\" title=\"annotation in typeannos\">@RepTypeUseA</a>\n<a href="
-//                + "\"../typeannos/RepTypeUseB.html\" title=\"annotation in typeannos"
-//                + "\">@RepTypeUseB</a> <a href=\"../typeannos/RepTypeUseB.html\" "
+//                + "\"RepTypeUseB.html\" title=\"annotation in typeannos"
+//                + "\">@RepTypeUseB</a> <a href=\"RepTypeUseB.html\" "
 //                + "title=\"annotation in typeannos\">@RepTypeUseB</a>\nclass <span "
 //                + "class=\"typeNameLabel\">RepeatingAtClassLevel2</span>\nextends "
 //                + "java.lang.Object</pre>");
 //
 //        checkOutput("typeannos/RepeatingAtClassLevel2.html", true,
-//                "<pre><a href=\"../typeannos/RepAllContextsA.html\" title=\"annotation"
-//                + " in typeannos\">@RepAllContextsA</a> <a href=\"../typeannos/RepAllContextsA.html"
+//                "<pre><a href=\"RepAllContextsA.html\" title=\"annotation"
+//                + " in typeannos\">@RepAllContextsA</a> <a href=\"RepAllContextsA.html"
 //                + "\" title=\"annotation in typeannos\">@RepAllContextsA</a>\n<a href="
-//                + "\"../typeannos/RepAllContextsB.html\" title=\"annotation in typeannos"
-//                + "\">@RepAllContextsB</a> <a href=\"../typeannos/RepAllContextsB.html"
+//                + "\"RepAllContextsB.html\" title=\"annotation in typeannos"
+//                + "\">@RepAllContextsB</a> <a href=\"RepAllContextsB.html"
 //                + "\" title=\"annotation in typeannos\">@RepAllContextsB</a>\n"
 //                + "class <span class=\"typeNameLabel\">RepeatingAtClassLevel3</span>\n"
 //                + "extends java.lang.Object</pre>");
 
         checkOutput("typeannos/RepeatingOnConstructor.html", true,
-                "<pre><a href=\"../typeannos/RepConstructorA.html\" title=\"annotation "
-                + "in typeannos\">@RepConstructorA</a> <a href=\"../typeannos/RepConstructorA.html"
+                "<pre><a href=\"RepConstructorA.html\" title=\"annotation "
+                + "in typeannos\">@RepConstructorA</a> <a href=\"RepConstructorA.html"
                 + "\" title=\"annotation in typeannos\">@RepConstructorA</a>\n<a href="
-                + "\"../typeannos/RepConstructorB.html\" title=\"annotation in typeannos"
-                + "\">@RepConstructorB</a> <a href=\"../typeannos/RepConstructorB.html"
+                + "\"RepConstructorB.html\" title=\"annotation in typeannos"
+                + "\">@RepConstructorB</a> <a href=\"RepConstructorB.html"
                 + "\" title=\"annotation in typeannos\">@RepConstructorB</a>\n"
                 + "RepeatingOnConstructor()</pre>",
 
-                "<pre><a href=\"../typeannos/RepConstructorA.html\" title=\"annotation in typeannos"
-                + "\">@RepConstructorA</a> <a href=\"../typeannos/RepConstructorA.html"
+                "<pre><a href=\"RepConstructorA.html\" title=\"annotation in typeannos"
+                + "\">@RepConstructorA</a> <a href=\"RepConstructorA.html"
                 + "\" title=\"annotation in typeannos\">@RepConstructorA</a>\n<a href="
-                + "\"../typeannos/RepConstructorB.html\" title=\"annotation in typeannos"
-                + "\">@RepConstructorB</a> <a href=\"../typeannos/RepConstructorB.html"
+                + "\"RepConstructorB.html\" title=\"annotation in typeannos"
+                + "\">@RepConstructorB</a> <a href=\"RepConstructorB.html"
                 + "\" title=\"annotation in typeannos\">@RepConstructorB</a>\n"
                 + "RepeatingOnConstructor&#8203;(int&nbsp;i,\n                       int&nbsp;j)</pre>",
 
-                "<pre><a href=\"../typeannos/RepAllContextsA.html\" title=\"annotation in typeannos"
-                + "\">@RepAllContextsA</a> <a href=\"../typeannos/RepAllContextsA.html"
+                "<pre><a href=\"RepAllContextsA.html\" title=\"annotation in typeannos"
+                + "\">@RepAllContextsA</a> <a href=\"RepAllContextsA.html"
                 + "\" title=\"annotation in typeannos\">@RepAllContextsA</a>\n"
-                + "<a href=\"../typeannos/RepAllContextsB.html\" title=\"annotation in typeannos"
-                + "\">@RepAllContextsB</a> <a href=\"../typeannos/RepAllContextsB.html"
+                + "<a href=\"RepAllContextsB.html\" title=\"annotation in typeannos"
+                + "\">@RepAllContextsB</a> <a href=\"RepAllContextsB.html"
                 + "\" title=\"annotation in typeannos\">@RepAllContextsB</a>\n"
                 + "RepeatingOnConstructor&#8203;(int&nbsp;i,\n                       int&nbsp;j,\n"
                 + "                       int&nbsp;k)</pre>",
 
-                "<pre>RepeatingOnConstructor&#8203;(<a href=\"../typeannos/RepParameterA.html"
+                "<pre>RepeatingOnConstructor&#8203;(<a href=\"RepParameterA.html"
                 + "\" title=\"annotation in typeannos\">@RepParameterA</a> <a href="
-                + "\"../typeannos/RepParameterA.html\" title=\"annotation in typeannos"
-                + "\">@RepParameterA</a> <a href=\"../typeannos/RepParameterB.html"
+                + "\"RepParameterA.html\" title=\"annotation in typeannos"
+                + "\">@RepParameterA</a> <a href=\"RepParameterB.html"
                 + "\" title=\"annotation in typeannos\">@RepParameterB</a> "
-                + "<a href=\"../typeannos/RepParameterB.html\" title=\"annotation in typeannos"
+                + "<a href=\"RepParameterB.html\" title=\"annotation in typeannos"
                 + "\">@RepParameterB</a>\n                       java.lang.String&nbsp;parameter,\n"
-                + "                       <a href=\"../typeannos/RepParameterA.html\" "
+                + "                       <a href=\"RepParameterA.html\" "
                 + "title=\"annotation in typeannos\">@RepParameterA</a> <a href="
-                + "\"../typeannos/RepParameterA.html\" title=\"annotation in typeannos\">"
-                + "@RepParameterA</a> <a href=\"../typeannos/RepParameterB.html\" "
+                + "\"RepParameterA.html\" title=\"annotation in typeannos\">"
+                + "@RepParameterA</a> <a href=\"RepParameterB.html\" "
                 + "title=\"annotation in typeannos\">@RepParameterB</a> <a href="
-                + "\"../typeannos/RepParameterB.html\" title=\"annotation in typeannos\">"
+                + "\"RepParameterB.html\" title=\"annotation in typeannos\">"
                 + "@RepParameterB</a>\n                       java.lang.String "
-                + "<a href=\"../typeannos/RepTypeUseA.html\" title=\"annotation in typeannos\">"
-                + "@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseA.html\" "
+                + "<a href=\"RepTypeUseA.html\" title=\"annotation in typeannos\">"
+                + "@RepTypeUseA</a> <a href=\"RepTypeUseA.html\" "
                 + "title=\"annotation in typeannos\">@RepTypeUseA</a> <a href="
-                + "\"../typeannos/RepTypeUseB.html\" title=\"annotation in typeannos\">@RepTypeUseB</a> "
-                + "<a href=\"../typeannos/RepTypeUseB.html\" title=\"annotation in typeannos\">"
+                + "\"RepTypeUseB.html\" title=\"annotation in typeannos\">@RepTypeUseB</a> "
+                + "<a href=\"RepTypeUseB.html\" title=\"annotation in typeannos\">"
                 + "@RepTypeUseB</a> ...&nbsp;vararg)</pre>"
         );
 
         checkOutput("typeannos/RepeatingOnConstructor.Inner.html", true,
-                "<code><span class=\"memberNameLink\"><a href=\"../typeannos/RepeatingOnConstructor.Inner.html"
+                "<code><span class=\"memberNameLink\"><a href=\""
                 + "#Inner-java.lang.String-java.lang.String...-\">Inner</a></span>"
                 + "&#8203;(java.lang.String&nbsp;parameter,\n     java.lang.String <a href="
-                + "\"../typeannos/RepTypeUseA.html\" title=\"annotation in typeannos\">"
-                + "@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseA.html\" title="
-                + "\"annotation in typeannos\">@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseB.html"
+                + "\"RepTypeUseA.html\" title=\"annotation in typeannos\">"
+                + "@RepTypeUseA</a> <a href=\"RepTypeUseA.html\" title="
+                + "\"annotation in typeannos\">@RepTypeUseA</a> <a href=\"RepTypeUseB.html"
                 + "\" title=\"annotation in typeannos\">@RepTypeUseB</a> <a href="
-                + "\"../typeannos/RepTypeUseB.html\" title=\"annotation in typeannos\">"
+                + "\"RepTypeUseB.html\" title=\"annotation in typeannos\">"
                 + "@RepTypeUseB</a> ...&nbsp;vararg)</code>",
 
-                "Inner&#8203;(<a href=\"../typeannos/RepTypeUseA.html\" title=\"annotation in typeannos\">"
-                + "@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseA.html\" title="
-                + "\"annotation in typeannos\">@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseB.html"
+                "Inner&#8203;(<a href=\"RepTypeUseA.html\" title=\"annotation in typeannos\">"
+                + "@RepTypeUseA</a> <a href=\"RepTypeUseA.html\" title="
+                + "\"annotation in typeannos\">@RepTypeUseA</a> <a href=\"RepTypeUseB.html"
                 + "\" title=\"annotation in typeannos\">@RepTypeUseB</a> <a href="
-                + "\"../typeannos/RepTypeUseB.html\" title=\"annotation in typeannos\">"
+                + "\"RepTypeUseB.html\" title=\"annotation in typeannos\">"
                 + "@RepTypeUseB</a>&nbsp;RepeatingOnConstructor&nbsp;this,\n      <a href="
-                + "\"../typeannos/RepParameterA.html\" title=\"annotation in typeannos\">"
-                + "@RepParameterA</a> <a href=\"../typeannos/RepParameterA.html\" title="
-                + "\"annotation in typeannos\">@RepParameterA</a> <a href=\"../typeannos/RepParameterB.html"
+                + "\"RepParameterA.html\" title=\"annotation in typeannos\">"
+                + "@RepParameterA</a> <a href=\"RepParameterA.html\" title="
+                + "\"annotation in typeannos\">@RepParameterA</a> <a href=\"RepParameterB.html"
                 + "\" title=\"annotation in typeannos\">@RepParameterB</a> <a href="
-                + "\"../typeannos/RepParameterB.html\" title=\"annotation in typeannos\">"
+                + "\"RepParameterB.html\" title=\"annotation in typeannos\">"
                 + "@RepParameterB</a>\n      java.lang.String&nbsp;parameter,\n"
-                + "      <a href=\"../typeannos/RepParameterA.html\" title=\"annotation in typeannos\">"
-                + "@RepParameterA</a> <a href=\"../typeannos/RepParameterA.html\" title="
-                + "\"annotation in typeannos\">@RepParameterA</a> <a href=\"../typeannos/RepParameterB.html"
+                + "      <a href=\"RepParameterA.html\" title=\"annotation in typeannos\">"
+                + "@RepParameterA</a> <a href=\"RepParameterA.html\" title="
+                + "\"annotation in typeannos\">@RepParameterA</a> <a href=\"RepParameterB.html"
                 + "\" title=\"annotation in typeannos\">@RepParameterB</a> <a href="
-                + "\"../typeannos/RepParameterB.html\" title=\"annotation in typeannos\">"
-                + "@RepParameterB</a>\n      java.lang.String <a href=\"../typeannos/RepTypeUseA.html"
+                + "\"RepParameterB.html\" title=\"annotation in typeannos\">"
+                + "@RepParameterB</a>\n      java.lang.String <a href=\"RepTypeUseA.html"
                 + "\" title=\"annotation in typeannos\">@RepTypeUseA</a> <a href="
-                + "\"../typeannos/RepTypeUseA.html\" title=\"annotation in typeannos\">"
-                + "@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseB.html\" title="
-                + "\"annotation in typeannos\">@RepTypeUseB</a> <a href=\"../typeannos/RepTypeUseB.html"
+                + "\"RepTypeUseA.html\" title=\"annotation in typeannos\">"
+                + "@RepTypeUseA</a> <a href=\"RepTypeUseB.html\" title="
+                + "\"annotation in typeannos\">@RepTypeUseB</a> <a href=\"RepTypeUseB.html"
                 + "\" title=\"annotation in typeannos\">@RepTypeUseB</a> ...&nbsp;vararg)");
 
         checkOutput("typeannos/RepeatingOnField.html", true,
                 "<code>(package private) java.lang.Integer</code></td>\n<th class=\"colSecond\" scope=\"row\">"
-                + "<code><span class=\"memberNameLink\"><a href=\"../typeannos/RepeatingOnField.html#i1"
+                + "<code><span class=\"memberNameLink\"><a href=\"#i1"
                 + "\">i1</a></span></code>",
 
-                "<code>(package private) <a href=\"../typeannos/RepTypeUseA.html\" "
+                "<code>(package private) <a href=\"RepTypeUseA.html\" "
                 + "title=\"annotation in typeannos\">@RepTypeUseA</a> <a href=\""
-                + "../typeannos/RepTypeUseA.html\" title=\"annotation in typeannos\">"
-                + "@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseB.html\" title="
-                + "\"annotation in typeannos\">@RepTypeUseB</a> <a href=\"../typeannos/RepTypeUseB.html"
+                + "RepTypeUseA.html\" title=\"annotation in typeannos\">"
+                + "@RepTypeUseA</a> <a href=\"RepTypeUseB.html\" title="
+                + "\"annotation in typeannos\">@RepTypeUseB</a> <a href=\"RepTypeUseB.html"
                 + "\" title=\"annotation in typeannos\">@RepTypeUseB</a> java.lang.Integer</code></td>\n"
                 + "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\"><a href="
-                + "\"../typeannos/RepeatingOnField.html#i2\">i2</a></span></code>",
+                + "\"#i2\">i2</a></span></code>",
 
-                "<code>(package private) <a href=\"../typeannos/RepTypeUseA.html\" title="
-                + "\"annotation in typeannos\">@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseA.html\" "
+                "<code>(package private) <a href=\"RepTypeUseA.html\" title="
+                + "\"annotation in typeannos\">@RepTypeUseA</a> <a href=\"RepTypeUseA.html\" "
                 + "title=\"annotation in typeannos\">@RepTypeUseA</a> <a href="
-                + "\"../typeannos/RepTypeUseB.html\" title=\"annotation in typeannos\">"
-                + "@RepTypeUseB</a> <a href=\"../typeannos/RepTypeUseB.html\" title="
+                + "\"RepTypeUseB.html\" title=\"annotation in typeannos\">"
+                + "@RepTypeUseB</a> <a href=\"RepTypeUseB.html\" title="
                 + "\"annotation in typeannos\">@RepTypeUseB</a> java.lang.Integer</code>"
                 + "</td>\n<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\">"
-                + "<a href=\"../typeannos/RepeatingOnField.html#i3\">i3</a></span></code>",
+                + "<a href=\"#i3\">i3</a></span></code>",
 
-                "<code>(package private) <a href=\"../typeannos/RepAllContextsA.html\" title=\""
-                + "annotation in typeannos\">@RepAllContextsA</a> <a href=\"../typeannos/RepAllContextsA.html"
+                "<code>(package private) <a href=\"RepAllContextsA.html\" title=\""
+                + "annotation in typeannos\">@RepAllContextsA</a> <a href=\"RepAllContextsA.html"
                 + "\" title=\"annotation in typeannos\">@RepAllContextsA</a> <a href="
-                + "\"../typeannos/RepAllContextsB.html\" title=\"annotation in typeannos\">"
-                + "@RepAllContextsB</a> <a href=\"../typeannos/RepAllContextsB.html\" title="
+                + "\"RepAllContextsB.html\" title=\"annotation in typeannos\">"
+                + "@RepAllContextsB</a> <a href=\"RepAllContextsB.html\" title="
                 + "\"annotation in typeannos\">@RepAllContextsB</a> java.lang.Integer</code>"
                 + "</td>\n<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\">"
-                + "<a href=\"../typeannos/RepeatingOnField.html#i4\">i4</a></span></code>",
+                + "<a href=\"#i4\">i4</a></span></code>",
 
-                "<code>(package private) java.lang.String <a href=\"../typeannos/RepTypeUseA.html"
+                "<code>(package private) java.lang.String <a href=\"RepTypeUseA.html"
                 + "\" title=\"annotation in typeannos\">@RepTypeUseA</a> <a href="
-                + "\"../typeannos/RepTypeUseA.html\" title=\"annotation in typeannos\">"
-                + "@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseB.html\" title="
-                + "\"annotation in typeannos\">@RepTypeUseB</a> <a href=\"../typeannos/RepTypeUseB.html"
+                + "\"RepTypeUseA.html\" title=\"annotation in typeannos\">"
+                + "@RepTypeUseA</a> <a href=\"RepTypeUseB.html\" title="
+                + "\"annotation in typeannos\">@RepTypeUseB</a> <a href=\"RepTypeUseB.html"
                 + "\" title=\"annotation in typeannos\">@RepTypeUseB</a> [] <a href="
-                + "\"../typeannos/RepTypeUseA.html\" title=\"annotation in typeannos\">"
-                + "@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseA.html\" title="
-                + "\"annotation in typeannos\">@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseB.html"
+                + "\"RepTypeUseA.html\" title=\"annotation in typeannos\">"
+                + "@RepTypeUseA</a> <a href=\"RepTypeUseA.html\" title="
+                + "\"annotation in typeannos\">@RepTypeUseA</a> <a href=\"RepTypeUseB.html"
                 + "\" title=\"annotation in typeannos\">@RepTypeUseB</a> <a href="
-                + "\"../typeannos/RepTypeUseB.html\" title=\"annotation in typeannos\">"
+                + "\"RepTypeUseB.html\" title=\"annotation in typeannos\">"
                 + "@RepTypeUseB</a> []</code></td>\n<th class=\"colSecond\" scope=\"row\"><code><span class="
-                + "\"memberNameLink\"><a href=\"../typeannos/RepeatingOnField.html#sa"
+                + "\"memberNameLink\"><a href=\"#sa"
                 + "\">sa</a></span></code>",
 
-                "<pre><a href=\"../typeannos/RepFieldA.html\" title=\"annotation in typeannos\">"
-                + "@RepFieldA</a> <a href=\"../typeannos/RepFieldA.html\" title="
-                + "\"annotation in typeannos\">@RepFieldA</a>\n<a href=\"../typeannos/RepFieldB.html"
+                "<pre><a href=\"RepFieldA.html\" title=\"annotation in typeannos\">"
+                + "@RepFieldA</a> <a href=\"RepFieldA.html\" title="
+                + "\"annotation in typeannos\">@RepFieldA</a>\n<a href=\"RepFieldB.html"
                 + "\" title=\"annotation in typeannos\">@RepFieldB</a> <a href="
-                + "\"../typeannos/RepFieldB.html\" title=\"annotation in typeannos\">"
+                + "\"RepFieldB.html\" title=\"annotation in typeannos\">"
                 + "@RepFieldB</a>\njava.lang.Integer i1</pre>",
 
-                "<pre><a href=\"../typeannos/RepTypeUseA.html\" title=\"annotation in typeannos"
-                + "\">@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseA.html"
+                "<pre><a href=\"RepTypeUseA.html\" title=\"annotation in typeannos"
+                + "\">@RepTypeUseA</a> <a href=\"RepTypeUseA.html"
                 + "\" title=\"annotation in typeannos\">@RepTypeUseA</a> "
-                + "<a href=\"../typeannos/RepTypeUseB.html\" title=\"annotation in typeannos\">"
-                + "@RepTypeUseB</a> <a href=\"../typeannos/RepTypeUseB.html\" title="
+                + "<a href=\"RepTypeUseB.html\" title=\"annotation in typeannos\">"
+                + "@RepTypeUseB</a> <a href=\"RepTypeUseB.html\" title="
                 + "\"annotation in typeannos\">@RepTypeUseB</a> java.lang.Integer i2</pre>",
 
-                "<pre><a href=\"../typeannos/RepFieldA.html\" title=\"annotation in typeannos\">"
-                + "@RepFieldA</a> <a href=\"../typeannos/RepFieldA.html\" title="
-                + "\"annotation in typeannos\">@RepFieldA</a>\n<a href=\"../typeannos/RepFieldB.html"
+                "<pre><a href=\"RepFieldA.html\" title=\"annotation in typeannos\">"
+                + "@RepFieldA</a> <a href=\"RepFieldA.html\" title="
+                + "\"annotation in typeannos\">@RepFieldA</a>\n<a href=\"RepFieldB.html"
                 + "\" title=\"annotation in typeannos\">@RepFieldB</a> <a href="
-                + "\"../typeannos/RepFieldB.html\" title=\"annotation in typeannos\">"
-                + "@RepFieldB</a>\n<a href=\"../typeannos/RepTypeUseA.html\" title="
-                + "\"annotation in typeannos\">@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseA.html"
+                + "\"RepFieldB.html\" title=\"annotation in typeannos\">"
+                + "@RepFieldB</a>\n<a href=\"RepTypeUseA.html\" title="
+                + "\"annotation in typeannos\">@RepTypeUseA</a> <a href=\"RepTypeUseA.html"
                 + "\" title=\"annotation in typeannos\">@RepTypeUseA</a> <a href="
-                + "\"../typeannos/RepTypeUseB.html\" title=\"annotation in typeannos\">"
-                + "@RepTypeUseB</a> <a href=\"../typeannos/RepTypeUseB.html\" title="
+                + "\"RepTypeUseB.html\" title=\"annotation in typeannos\">"
+                + "@RepTypeUseB</a> <a href=\"RepTypeUseB.html\" title="
                 + "\"annotation in typeannos\">@RepTypeUseB</a> java.lang.Integer i3</pre>",
 
-                "<pre><a href=\"../typeannos/RepAllContextsA.html\" title=\"annotation in typeannos\">"
-                + "@RepAllContextsA</a> <a href=\"../typeannos/RepAllContextsA.html"
+                "<pre><a href=\"RepAllContextsA.html\" title=\"annotation in typeannos\">"
+                + "@RepAllContextsA</a> <a href=\"RepAllContextsA.html"
                 + "\" title=\"annotation in typeannos\">@RepAllContextsA</a>\n<a href="
-                + "\"../typeannos/RepAllContextsB.html\" title=\"annotation in typeannos\">"
-                + "@RepAllContextsB</a> <a href=\"../typeannos/RepAllContextsB.html"
+                + "\"RepAllContextsB.html\" title=\"annotation in typeannos\">"
+                + "@RepAllContextsB</a> <a href=\"RepAllContextsB.html"
                 + "\" title=\"annotation in typeannos\">@RepAllContextsB</a>\n"
-                + "<a href=\"../typeannos/RepAllContextsA.html\" title=\"annotation in typeannos\">"
-                + "@RepAllContextsA</a> <a href=\"../typeannos/RepAllContextsA.html\" "
+                + "<a href=\"RepAllContextsA.html\" title=\"annotation in typeannos\">"
+                + "@RepAllContextsA</a> <a href=\"RepAllContextsA.html\" "
                 + "title=\"annotation in typeannos\">@RepAllContextsA</a> <a href="
-                + "\"../typeannos/RepAllContextsB.html\" title=\"annotation in typeannos\">"
-                + "@RepAllContextsB</a> <a href=\"../typeannos/RepAllContextsB.html"
+                + "\"RepAllContextsB.html\" title=\"annotation in typeannos\">"
+                + "@RepAllContextsB</a> <a href=\"RepAllContextsB.html"
                 + "\" title=\"annotation in typeannos\">@RepAllContextsB</a> java.lang.Integer i4</pre>",
 
-                "<pre>java.lang.String <a href=\"../typeannos/RepTypeUseA.html\" title="
-                + "\"annotation in typeannos\">@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseA.html"
+                "<pre>java.lang.String <a href=\"RepTypeUseA.html\" title="
+                + "\"annotation in typeannos\">@RepTypeUseA</a> <a href=\"RepTypeUseA.html"
                 + "\" title=\"annotation in typeannos\">@RepTypeUseA</a> <a href="
-                + "\"../typeannos/RepTypeUseB.html\" title=\"annotation in typeannos\">"
-                + "@RepTypeUseB</a> <a href=\"../typeannos/RepTypeUseB.html\" title="
+                + "\"RepTypeUseB.html\" title=\"annotation in typeannos\">"
+                + "@RepTypeUseB</a> <a href=\"RepTypeUseB.html\" title="
                 + "\"annotation in typeannos\">@RepTypeUseB</a> [] <a href="
-                + "\"../typeannos/RepTypeUseA.html\" title=\"annotation in typeannos\">"
-                + "@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseA.html\" title="
-                + "\"annotation in typeannos\">@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseB.html\" "
+                + "\"RepTypeUseA.html\" title=\"annotation in typeannos\">"
+                + "@RepTypeUseA</a> <a href=\"RepTypeUseA.html\" title="
+                + "\"annotation in typeannos\">@RepTypeUseA</a> <a href=\"RepTypeUseB.html\" "
                 + "title=\"annotation in typeannos\">@RepTypeUseB</a> <a href="
-                + "\"../typeannos/RepTypeUseB.html\" title=\"annotation in typeannos\">"
+                + "\"RepTypeUseB.html\" title=\"annotation in typeannos\">"
                 + "@RepTypeUseB</a> [] sa</pre>");
 
         checkOutput("typeannos/RepeatingOnMethod.html", true,
                 "<code>(package private) java.lang.String</code></td>\n<th class=\"colSecond\" scope=\"row\">"
                 + "<code><span class=\"memberNameLink\"><a href="
-                + "\"../typeannos/RepeatingOnMethod.html#test1--\">test1</a></span>()</code>",
+                + "\"#test1--\">test1</a></span>()</code>",
 
-                "<code>(package private) <a href=\"../typeannos/RepTypeUseA.html\" "
+                "<code>(package private) <a href=\"RepTypeUseA.html\" "
                 + "title=\"annotation in typeannos\">@RepTypeUseA</a> <a href="
-                + "\"../typeannos/RepTypeUseA.html\" title=\"annotation in typeannos\">"
-                + "@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseB.html\" title="
-                + "\"annotation in typeannos\">@RepTypeUseB</a> <a href=\"../typeannos/RepTypeUseB.html"
+                + "\"RepTypeUseA.html\" title=\"annotation in typeannos\">"
+                + "@RepTypeUseA</a> <a href=\"RepTypeUseB.html\" title="
+                + "\"annotation in typeannos\">@RepTypeUseB</a> <a href=\"RepTypeUseB.html"
                 + "\" title=\"annotation in typeannos\">@RepTypeUseB</a> java.lang.String</code>"
                 + "</td>\n<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\">"
-                + "<a href=\"../typeannos/RepeatingOnMethod.html#test2--\">test2</a>"
+                + "<a href=\"#test2--\">test2</a>"
                 + "</span>()</code>",
 
-                "<code>(package private) <a href=\"../typeannos/RepTypeUseA.html\" "
+                "<code>(package private) <a href=\"RepTypeUseA.html\" "
                 + "title=\"annotation in typeannos\">@RepTypeUseA</a> <a href="
-                + "\"../typeannos/RepTypeUseA.html\" title=\"annotation in typeannos\">"
-                + "@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseB.html\" title="
-                + "\"annotation in typeannos\">@RepTypeUseB</a> <a href=\"../typeannos/RepTypeUseB.html\" "
+                + "\"RepTypeUseA.html\" title=\"annotation in typeannos\">"
+                + "@RepTypeUseA</a> <a href=\"RepTypeUseB.html\" title="
+                + "\"annotation in typeannos\">@RepTypeUseB</a> <a href=\"RepTypeUseB.html\" "
                 + "title=\"annotation in typeannos\">@RepTypeUseB</a> java.lang.String</code>"
                 + "</td>\n<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\">"
-                + "<a href=\"../typeannos/RepeatingOnMethod.html#test3--\">test3</a>"
+                + "<a href=\"#test3--\">test3</a>"
                 + "</span>()</code>",
 
-                "<code>(package private) <a href=\"../typeannos/RepAllContextsA.html\" "
+                "<code>(package private) <a href=\"RepAllContextsA.html\" "
                 + "title=\"annotation in typeannos\">@RepAllContextsA</a> <a href="
-                + "\"../typeannos/RepAllContextsA.html\" title=\"annotation in typeannos\">"
-                + "@RepAllContextsA</a> <a href=\"../typeannos/RepAllContextsB.html\" "
+                + "\"RepAllContextsA.html\" title=\"annotation in typeannos\">"
+                + "@RepAllContextsA</a> <a href=\"RepAllContextsB.html\" "
                 + "title=\"annotation in typeannos\">@RepAllContextsB</a> <a href="
-                + "\"../typeannos/RepAllContextsB.html\" title=\"annotation in typeannos\">"
+                + "\"RepAllContextsB.html\" title=\"annotation in typeannos\">"
                 + "@RepAllContextsB</a> java.lang.String</code></td>\n<th class=\"colSecond\" scope=\"row\">"
-                + "<code><span class=\"memberNameLink\"><a href=\"../typeannos/RepeatingOnMethod.html"
+                + "<code><span class=\"memberNameLink\"><a href=\""
                 + "#test4--\">test4</a></span>()</code>",
 
-                "<code><span class=\"memberNameLink\"><a href=\"../typeannos/RepeatingOnMethod.html"
+                "<code><span class=\"memberNameLink\"><a href=\""
                 + "#test5-java.lang.String-java.lang.String...-\">test5</a></span>"
                 + "&#8203;(java.lang.String&nbsp;parameter,\n     java.lang.String <a href="
-                + "\"../typeannos/RepTypeUseA.html\" title=\"annotation in typeannos\">"
-                + "@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseA.html\" title="
-                + "\"annotation in typeannos\">@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseB.html"
+                + "\"RepTypeUseA.html\" title=\"annotation in typeannos\">"
+                + "@RepTypeUseA</a> <a href=\"RepTypeUseA.html\" title="
+                + "\"annotation in typeannos\">@RepTypeUseA</a> <a href=\"RepTypeUseB.html"
                 + "\" title=\"annotation in typeannos\">@RepTypeUseB</a> <a href="
-                + "\"../typeannos/RepTypeUseB.html\" title=\"annotation in typeannos\">"
+                + "\"RepTypeUseB.html\" title=\"annotation in typeannos\">"
                 + "@RepTypeUseB</a> ...&nbsp;vararg)</code>",
 
-                "<a href=\"../typeannos/RepMethodA.html\" title=\"annotation in typeannos\">"
-                + "@RepMethodA</a> <a href=\"../typeannos/RepMethodA.html\" title="
-                + "\"annotation in typeannos\">@RepMethodA</a>\n<a href=\"../typeannos/RepMethodB.html\""
+                "<a href=\"RepMethodA.html\" title=\"annotation in typeannos\">"
+                + "@RepMethodA</a> <a href=\"RepMethodA.html\" title="
+                + "\"annotation in typeannos\">@RepMethodA</a>\n<a href=\"RepMethodB.html\""
                 + " title=\"annotation in typeannos\">@RepMethodB</a> <a href="
-                + "\"../typeannos/RepMethodB.html\" title=\"annotation in typeannos\">"
+                + "\"RepMethodB.html\" title=\"annotation in typeannos\">"
                 + "@RepMethodB</a>\njava.lang.String&nbsp;test1()",
 
-                "<a href=\"../typeannos/RepTypeUseA.html\" title=\"annotation in typeannos\">"
-                + "@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseA.html\" title="
-                + "\"annotation in typeannos\">@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseB.html\" "
-                + "title=\"annotation in typeannos\">@RepTypeUseB</a> <a href=\"../typeannos/RepTypeUseB.html\" "
+                "<a href=\"RepTypeUseA.html\" title=\"annotation in typeannos\">"
+                + "@RepTypeUseA</a> <a href=\"RepTypeUseA.html\" title="
+                + "\"annotation in typeannos\">@RepTypeUseA</a> <a href=\"RepTypeUseB.html\" "
+                + "title=\"annotation in typeannos\">@RepTypeUseB</a> <a href=\"RepTypeUseB.html\" "
                 + "title=\"annotation in typeannos\">@RepTypeUseB</a> java.lang.String&nbsp;test2()",
 
-                "<a href=\"../typeannos/RepMethodA.html\" title=\"annotation in typeannos\">"
-                + "@RepMethodA</a> <a href=\"../typeannos/RepMethodA.html\" title="
-                + "\"annotation in typeannos\">@RepMethodA</a>\n<a href=\"../typeannos/RepMethodB.html\" "
+                "<a href=\"RepMethodA.html\" title=\"annotation in typeannos\">"
+                + "@RepMethodA</a> <a href=\"RepMethodA.html\" title="
+                + "\"annotation in typeannos\">@RepMethodA</a>\n<a href=\"RepMethodB.html\" "
                 + "title=\"annotation in typeannos\">@RepMethodB</a> <a href="
-                + "\"../typeannos/RepMethodB.html\" title=\"annotation in typeannos\">"
-                + "@RepMethodB</a>\n<a href=\"../typeannos/RepTypeUseA.html\" title="
-                + "\"annotation in typeannos\">@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseA.html\" "
+                + "\"RepMethodB.html\" title=\"annotation in typeannos\">"
+                + "@RepMethodB</a>\n<a href=\"RepTypeUseA.html\" title="
+                + "\"annotation in typeannos\">@RepTypeUseA</a> <a href=\"RepTypeUseA.html\" "
                 + "title=\"annotation in typeannos\">@RepTypeUseA</a> <a href="
-                + "\"../typeannos/RepTypeUseB.html\" title=\"annotation in typeannos\">"
-                + "@RepTypeUseB</a> <a href=\"../typeannos/RepTypeUseB.html\" title="
+                + "\"RepTypeUseB.html\" title=\"annotation in typeannos\">"
+                + "@RepTypeUseB</a> <a href=\"RepTypeUseB.html\" title="
                 + "\"annotation in typeannos\">@RepTypeUseB</a> java.lang.String&nbsp;test3()",
 
-                "<a href=\"../typeannos/RepAllContextsA.html\" title=\"annotation in typeannos\">"
-                + "@RepAllContextsA</a> <a href=\"../typeannos/RepAllContextsA.html\" "
+                "<a href=\"RepAllContextsA.html\" title=\"annotation in typeannos\">"
+                + "@RepAllContextsA</a> <a href=\"RepAllContextsA.html\" "
                 + "title=\"annotation in typeannos\">@RepAllContextsA</a>\n<a href="
-                + "\"../typeannos/RepAllContextsB.html\" title=\"annotation in typeannos\">"
-                + "@RepAllContextsB</a> <a href=\"../typeannos/RepAllContextsB.html\" "
+                + "\"RepAllContextsB.html\" title=\"annotation in typeannos\">"
+                + "@RepAllContextsB</a> <a href=\"RepAllContextsB.html\" "
                 + "title=\"annotation in typeannos\">@RepAllContextsB</a>\n<a href="
-                + "\"../typeannos/RepAllContextsA.html\" title=\"annotation in typeannos\">"
-                + "@RepAllContextsA</a> <a href=\"../typeannos/RepAllContextsA.html\" "
+                + "\"RepAllContextsA.html\" title=\"annotation in typeannos\">"
+                + "@RepAllContextsA</a> <a href=\"RepAllContextsA.html\" "
                 + "title=\"annotation in typeannos\">@RepAllContextsA</a> <a href="
-                + "\"../typeannos/RepAllContextsB.html\" title=\"annotation in typeannos\">"
-                + "@RepAllContextsB</a> <a href=\"../typeannos/RepAllContextsB.html\" "
+                + "\"RepAllContextsB.html\" title=\"annotation in typeannos\">"
+                + "@RepAllContextsB</a> <a href=\"RepAllContextsB.html\" "
                 + "title=\"annotation in typeannos\">@RepAllContextsB</a> java.lang.String&nbsp;test4()",
 
-                "java.lang.String&nbsp;test5&#8203;(<a href=\"../typeannos/RepTypeUseA.html\" "
+                "java.lang.String&nbsp;test5&#8203;(<a href=\"RepTypeUseA.html\" "
                 + "title=\"annotation in typeannos\">@RepTypeUseA</a> <a href="
-                + "\"../typeannos/RepTypeUseA.html\" title=\"annotation in typeannos\">"
-                + "@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseB.html\" title="
-                + "\"annotation in typeannos\">@RepTypeUseB</a> <a href=\"../typeannos/RepTypeUseB.html\" "
+                + "\"RepTypeUseA.html\" title=\"annotation in typeannos\">"
+                + "@RepTypeUseA</a> <a href=\"RepTypeUseB.html\" title="
+                + "\"annotation in typeannos\">@RepTypeUseB</a> <a href=\"RepTypeUseB.html\" "
                 + "title=\"annotation in typeannos\">@RepTypeUseB</a>&nbsp;RepeatingOnMethod&nbsp;"
-                + "this,\n                       <a href=\"../typeannos/RepParameterA.html\" "
+                + "this,\n                       <a href=\"RepParameterA.html\" "
                 + "title=\"annotation in typeannos\">@RepParameterA</a> <a href="
-                + "\"../typeannos/RepParameterA.html\" title=\"annotation in typeannos\">"
-                + "@RepParameterA</a> <a href=\"../typeannos/RepParameterB.html\" "
+                + "\"RepParameterA.html\" title=\"annotation in typeannos\">"
+                + "@RepParameterA</a> <a href=\"RepParameterB.html\" "
                 + "title=\"annotation in typeannos\">@RepParameterB</a> <a href="
-                + "\"../typeannos/RepParameterB.html\" title=\"annotation in typeannos\">"
+                + "\"RepParameterB.html\" title=\"annotation in typeannos\">"
                 + "@RepParameterB</a>\n                       java.lang.String&nbsp;parameter,\n"
-                + "                       <a href=\"../typeannos/RepParameterA.html\" title="
-                + "\"annotation in typeannos\">@RepParameterA</a> <a href=\"../typeannos/RepParameterA.html\""
+                + "                       <a href=\"RepParameterA.html\" title="
+                + "\"annotation in typeannos\">@RepParameterA</a> <a href=\"RepParameterA.html\""
                 + " title=\"annotation in typeannos\">@RepParameterA</a> <a href="
-                + "\"../typeannos/RepParameterB.html\" title=\"annotation in typeannos\">"
-                + "@RepParameterB</a> <a href=\"../typeannos/RepParameterB.html\" title="
+                + "\"RepParameterB.html\" title=\"annotation in typeannos\">"
+                + "@RepParameterB</a> <a href=\"RepParameterB.html\" title="
                 + "\"annotation in typeannos\">@RepParameterB</a>\n                       "
-                + "java.lang.String <a href=\"../typeannos/RepTypeUseA.html\" title="
-                + "\"annotation in typeannos\">@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseA.html\" "
+                + "java.lang.String <a href=\"RepTypeUseA.html\" title="
+                + "\"annotation in typeannos\">@RepTypeUseA</a> <a href=\"RepTypeUseA.html\" "
                 + "title=\"annotation in typeannos\">@RepTypeUseA</a> <a href="
-                + "\"../typeannos/RepTypeUseB.html\" title=\"annotation in typeannos\">"
-                + "@RepTypeUseB</a> <a href=\"../typeannos/RepTypeUseB.html\" title="
+                + "\"RepTypeUseB.html\" title=\"annotation in typeannos\">"
+                + "@RepTypeUseB</a> <a href=\"RepTypeUseB.html\" title="
                 + "\"annotation in typeannos\">@RepTypeUseB</a> ...&nbsp;vararg)");
 
         checkOutput("typeannos/RepeatingOnTypeParametersBoundsTypeArgumentsOnMethod.html", true,
                 "<code>(package private) &lt;T&gt;&nbsp;java.lang.String</code></td>\n"
                 + "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\"><a href="
-                + "\"../typeannos/RepeatingOnTypeParametersBoundsTypeArgumentsOnMethod.html#"
+                + "\"#"
                 + "genericMethod-T-\">genericMethod</a></span>&#8203;(T&nbsp;t)</code>",
 
                 "<code>(package private) &lt;T&gt;&nbsp;java.lang.String</code></td>\n"
                 + "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\"><a href="
-                + "\"../typeannos/RepeatingOnTypeParametersBoundsTypeArgumentsOnMethod.html#"
-                + "genericMethod2-T-\">genericMethod2</a></span>&#8203;(<a href=\"../typeannos/RepTypeUseA.html"
-                + "\" title=\"annotation in typeannos\">@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseA.html"
-                + "\" title=\"annotation in typeannos\">@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseB.html"
-                + "\" title=\"annotation in typeannos\">@RepTypeUseB</a> <a href=\"../typeannos/RepTypeUseB.html"
+                + "\"#"
+                + "genericMethod2-T-\">genericMethod2</a></span>&#8203;(<a href=\"RepTypeUseA.html"
+                + "\" title=\"annotation in typeannos\">@RepTypeUseA</a> <a href=\"RepTypeUseA.html"
+                + "\" title=\"annotation in typeannos\">@RepTypeUseA</a> <a href=\"RepTypeUseB.html"
+                + "\" title=\"annotation in typeannos\">@RepTypeUseB</a> <a href=\"RepTypeUseB.html"
                 + "\" title=\"annotation in typeannos\">@RepTypeUseB</a> T&nbsp;t)</code>",
 
                 "<code>(package private) java.lang.String</code></td>\n<th class=\"colSecond\" scope=\"row\"><code>"
-                + "<span class=\"memberNameLink\"><a href=\"../typeannos/RepeatingOnTypeParametersBoundsTypeArgumentsOnMethod.html#"
+                + "<span class=\"memberNameLink\"><a href=\"#"
                 + "test--\">test</a></span>()</code>",
 
-                "java.lang.String&nbsp;test&#8203;(<a href=\"../typeannos/RepTypeUseA.html\" "
+                "java.lang.String&nbsp;test&#8203;(<a href=\"RepTypeUseA.html\" "
                 + "title=\"annotation in typeannos\">@RepTypeUseA</a> <a href="
-                + "\"../typeannos/RepTypeUseA.html\" title=\"annotation in typeannos\">"
-                + "@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseB.html\" title="
-                + "\"annotation in typeannos\">@RepTypeUseB</a> <a href=\"../typeannos/RepTypeUseB.html\" "
+                + "\"RepTypeUseA.html\" title=\"annotation in typeannos\">"
+                + "@RepTypeUseA</a> <a href=\"RepTypeUseB.html\" title="
+                + "\"annotation in typeannos\">@RepTypeUseB</a> <a href=\"RepTypeUseB.html\" "
                 + "title=\"annotation in typeannos\">@RepTypeUseB</a>&nbsp;"
                 + "RepeatingOnTypeParametersBoundsTypeArgumentsOnMethod&lt;<a href="
-                + "\"../typeannos/RepTypeUseA.html\" title=\"annotation in typeannos\">"
-                + "@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseA.html\" title="
-                + "\"annotation in typeannos\">@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseB.html"
-                + "\" title=\"annotation in typeannos\">@RepTypeUseB</a> <a href=\"../typeannos/RepTypeUseB.html\" "
+                + "\"RepTypeUseA.html\" title=\"annotation in typeannos\">"
+                + "@RepTypeUseA</a> <a href=\"RepTypeUseA.html\" title="
+                + "\"annotation in typeannos\">@RepTypeUseA</a> <a href=\"RepTypeUseB.html"
+                + "\" title=\"annotation in typeannos\">@RepTypeUseB</a> <a href=\"RepTypeUseB.html\" "
                 + "title=\"annotation in typeannos\">@RepTypeUseB</a> T&gt;&nbsp;this)");
 
         checkOutput("typeannos/RepeatingOnVoidMethodDeclaration.html", true,
-                "<a href=\"../typeannos/RepMethodA.html\" title=\"annotation in typeannos\">"
-                + "@RepMethodA</a> <a href=\"../typeannos/RepMethodA.html\" title="
-                + "\"annotation in typeannos\">@RepMethodA</a>\n<a href=\"../typeannos/RepMethodB.html"
+                "<a href=\"RepMethodA.html\" title=\"annotation in typeannos\">"
+                + "@RepMethodA</a> <a href=\"RepMethodA.html\" title="
+                + "\"annotation in typeannos\">@RepMethodA</a>\n<a href=\"RepMethodB.html"
                 + "\" title=\"annotation in typeannos\">@RepMethodB</a> <a href="
-                + "\"../typeannos/RepMethodB.html\" title=\"annotation in typeannos\">"
+                + "\"RepMethodB.html\" title=\"annotation in typeannos\">"
                 + "@RepMethodB</a>\nvoid&nbsp;test()");
     }
 }
--- a/test/langtools/jdk/javadoc/doclet/testTypeParams/TestTypeParameters.java	Mon Jan 22 20:31:19 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testTypeParams/TestTypeParameters.java	Mon Jan 22 11:15:51 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, 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
@@ -57,14 +57,14 @@
                 "<code>&lt;T&gt;&nbsp;java.lang.Object</code>");
 
         checkOutput("pkg/package-summary.html", true,
-                "C</a>&lt;E extends <a href=\"../pkg/Parent.html\" "
+                "C</a>&lt;E extends <a href=\"Parent.html\" "
                 + "title=\"class in pkg\">Parent</a>&gt;");
 
         checkOutput("pkg/class-use/Foo4.html", true,
-                "<a href=\"../../pkg/ClassUseTest3.html\" title=\"class in pkg\">"
-                + "ClassUseTest3</a>&lt;T extends <a href=\"../../pkg/ParamTest2.html\" "
+                "<a href=\"../ClassUseTest3.html\" title=\"class in pkg\">"
+                + "ClassUseTest3</a>&lt;T extends <a href=\"../ParamTest2.html\" "
                 + "title=\"class in pkg\">ParamTest2</a>&lt;java.util.List&lt;? extends "
-                + "<a href=\"../../pkg/Foo4.html\" title=\"class in pkg\">Foo4</a>&gt;&gt;&gt;");
+                + "<a href=\"../Foo4.html\" title=\"class in pkg\">Foo4</a>&gt;&gt;&gt;");
 
         // Nested type parameters
         checkOutput("pkg/C.html", true,
@@ -84,8 +84,8 @@
 
         checkOutput("pkg/ClassUseTest3.html", true,
             "public class <a href=\"../src-html/pkg/ClassUseTest3.html#line.28\">" +
-            "ClassUseTest3</a>&lt;T extends <a href=\"../pkg/ParamTest2.html\" " +
+            "ClassUseTest3</a>&lt;T extends <a href=\"ParamTest2.html\" " +
             "title=\"class in pkg\">ParamTest2</a>&lt;java.util.List&lt;? extends " +
-            "<a href=\"../pkg/Foo4.html\" title=\"class in pkg\">Foo4</a>&gt;&gt;&gt;");
+            "<a href=\"Foo4.html\" title=\"class in pkg\">Foo4</a>&gt;&gt;&gt;");
     }
 }
--- a/test/langtools/jdk/javadoc/doclet/testTypeVariableLinks/TestTypeVariableLinks.java	Mon Jan 22 20:31:19 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testTypeVariableLinks/TestTypeVariableLinks.java	Mon Jan 22 11:15:51 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2018, 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
@@ -48,8 +48,8 @@
         checkOutput("pkg1/C.html", true,
                 "<div class=\"block\">Linking to List.clear() <code>List.clear()</code></div>");
         checkOutput("pkg1/C.html", true,
-                "<div class=\"block\">Linking to Additional.doAction() <a href=\"../pkg1/Additional.html#doAction--\"><code>Additional.doAction()</code></a></div>");
+                "<div class=\"block\">Linking to Additional.doAction() <a href=\"Additional.html#doAction--\"><code>Additional.doAction()</code></a></div>");
         checkOutput("pkg1/C.html", true,
-                "<div class=\"block\">Linking to I.abstractAction() <a href=\"../pkg1/I.html#abstractAction--\"><code>I.abstractAction()</code></a></div>");
+                "<div class=\"block\">Linking to I.abstractAction() <a href=\"I.html#abstractAction--\"><code>I.abstractAction()</code></a></div>");
     }
 }
--- a/test/langtools/jdk/javadoc/doclet/testUseOption/TestUseOption.java	Mon Jan 22 20:31:19 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testUseOption/TestUseOption.java	Mon Jan 22 11:15:51 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2018, 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
@@ -84,56 +84,56 @@
           "that return types with arguments of type"
         );
         checkOutput("pkg1/class-use/UsedClass.html", true,
-          "<a href=\"../../pkg1/C1.html#methodInC1ReturningType--\">methodInC1ReturningType</a>"
+          "<a href=\"../C1.html#methodInC1ReturningType--\">methodInC1ReturningType</a>"
         );
         checkOutput("pkg1/class-use/UsedInterface.html", true,
-          "Classes in <a href=\"../../pkg1/package-summary.html\">pkg1</a> that implement " +
-          "<a href=\"../../pkg1/UsedInterface.html\" title=\"interface in pkg1\">UsedInterface</a>"
+          "Classes in <a href=\"../package-summary.html\">pkg1</a> that implement " +
+          "<a href=\"../UsedInterface.html\" title=\"interface in pkg1\">UsedInterface</a>"
         );
         checkOutput("pkg1/class-use/UsedInterfaceA.html", true,
-          "Classes in <a href=\"../../pkg1/package-summary.html\">pkg1</a> that implement " +
-          "<a href=\"../../pkg1/UsedInterfaceA.html\" title=\"interface in pkg1\">UsedInterfaceA</a>"
+          "Classes in <a href=\"../package-summary.html\">pkg1</a> that implement " +
+          "<a href=\"../UsedInterfaceA.html\" title=\"interface in pkg1\">UsedInterfaceA</a>"
         );
         checkOutput("pkg1/class-use/UsedClass.html", false,
            "methodInC1Protected"
         );
         checkOutput("pkg1/class-use/UsedInterface.html", true,
-           "<a href=\"../../pkg1/AnAbstract.html\" title=\"class in pkg1\">AnAbstract</a>"
+           "<a href=\"../AnAbstract.html\" title=\"class in pkg1\">AnAbstract</a>"
         );
         checkOutput("pkg1/class-use/UsedInterface.html", true,
-            "../../pkg1/C10.html#withReturningTypeParameters--"
+            "../C10.html#withReturningTypeParameters--"
         );
         checkOutput("pkg1/class-use/UsedInterface.html", true,
-            "../../pkg1/C10.html#withTypeParametersOfType-java.lang.Class-"
+            "../C10.html#withTypeParametersOfType-java.lang.Class-"
         );
         checkOutput("pkg1/class-use/UsedInterface.html", true,
-            "\"../../pkg1/package-summary.html\">pkg1</a> that return " +
-            "<a href=\"../../pkg1/UsedInterface.html\" title=\"interface in pkg1\""
+            "\"../package-summary.html\">pkg1</a> that return " +
+            "<a href=\"../UsedInterface.html\" title=\"interface in pkg1\""
         );
         checkOutput("pkg1/class-use/UsedInterface.html", true,
-            "<a href=\"../../pkg1/C10.html#addAll-pkg1.UsedInterface...-\">addAll</a>"
+            "<a href=\"../C10.html#addAll-pkg1.UsedInterface...-\">addAll</a>"
         );
         checkOutput("pkg1/class-use/UsedInterface.html", true,
-            "<a href=\"../../pkg1/C10.html#create-pkg1.UsedInterfaceA-pkg1." +
+            "<a href=\"../C10.html#create-pkg1.UsedInterfaceA-pkg1." +
             "UsedInterface-java.lang.String-\">"
         );
         checkOutput("pkg1/class-use/UsedInterface.html", true,
-            "<a href=\"../../pkg1/C10.html#withTypeParametersOfType-java.lang.Class-\">" +
+            "<a href=\"../C10.html#withTypeParametersOfType-java.lang.Class-\">" +
             "withTypeParametersOfType</a>"
         );
         checkOutput("pkg1/class-use/UsedInterface.html", true,
-            "Subinterfaces of <a href=\"../../pkg1/UsedInterface.html\" title=\"interface in pkg1\">"
-            + "UsedInterface</a> in <a href=\"../../pkg1/package-summary.html\">pkg1",
+            "Subinterfaces of <a href=\"../UsedInterface.html\" title=\"interface in pkg1\">"
+            + "UsedInterface</a> in <a href=\"../package-summary.html\">pkg1",
             "<td class=\"colFirst\"><code>interface&nbsp;</code></td>\n<th class=\"colSecond\" scope=\"row\">"
-            + "<code><span class=\"memberNameLink\"><a href=\"../../pkg1/SubInterface.html\" "
+            + "<code><span class=\"memberNameLink\"><a href=\"../SubInterface.html\" "
             + "title=\"interface in pkg1\">SubInterface</a>&lt;T&gt;</span></code></th>"
         );
         checkOutput("pkg1/class-use/UsedThrowable.html", true,
-            "Methods in <a href=\"../../pkg1/package-summary.html\">pkg1</a> that throw "
-            + "<a href=\"../../pkg1/UsedThrowable.html\" title=\"class in pkg1\">UsedThrowable</a>",
+            "Methods in <a href=\"../package-summary.html\">pkg1</a> that throw "
+            + "<a href=\"../UsedThrowable.html\" title=\"class in pkg1\">UsedThrowable</a>",
             "<td class=\"colFirst\"><code>void</code></td>\n<th class=\"colSecond\" scope=\"row\"><span class="
             + "\"typeNameLabel\">C1.</span><code><span class=\"memberNameLink\">"
-            + "<a href=\"../../pkg1/C1.html#methodInC1ThrowsThrowable--\">methodInC1ThrowsThrowable"
+            + "<a href=\"../C1.html#methodInC1ThrowsThrowable--\">methodInC1ThrowsThrowable"
             + "</a></span>()</code></th>"
         );
     }
@@ -169,9 +169,9 @@
                 "-package", "unique");
         checkExit(Exit.OK);
         checkUnique("unique/class-use/UseMe.html",
-                "<a href=\"../../unique/C1.html#umethod1-unique.UseMe-unique.UseMe:A-\">",
-                "<a href=\"../../unique/C1.html#umethod2-unique.UseMe-unique.UseMe-\">",
-                "<a href=\"../../unique/C1.html#umethod3-unique.UseMe-unique.UseMe-\">",
-                "<a href=\"../../unique/C1.html#C1-unique.UseMe-unique.UseMe-\">");
+                "<a href=\"../C1.html#umethod1-unique.UseMe-unique.UseMe:A-\">",
+                "<a href=\"../C1.html#umethod2-unique.UseMe-unique.UseMe-\">",
+                "<a href=\"../C1.html#umethod3-unique.UseMe-unique.UseMe-\">",
+                "<a href=\"../C1.html#C1-unique.UseMe-unique.UseMe-\">");
     }
 }
--- a/test/langtools/jdk/javadoc/doclet/testValueTag/TestValueTag.java	Mon Jan 22 20:31:19 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testValueTag/TestValueTag.java	Mon Jan 22 11:15:51 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, 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,19 +52,19 @@
                 // Base case:  using @value on a constant.
                 "Result:  \"Test 1 passes\"",
                 // Retrieve value of constant in same class.
-                "Result:  <a href=\"../pkg1/Class1.html#TEST_2_PASSES\">\"Test 2 passes\"</a>",
-                "Result:  <a href=\"../pkg1/Class1.html#TEST_3_PASSES\">\"Test 3 passes\"</a>",
-                "Result:  <a href=\"../pkg1/Class1.html#TEST_4_PASSES\">\"Test 4 passes\"</a>",
-                "Result:  <a href=\"../pkg1/Class1.html#TEST_5_PASSES\">\"Test 5 passes\"</a>",
-                "Result:  <a href=\"../pkg1/Class1.html#TEST_6_PASSES\">\"Test 6 passes\"</a>");
+                "Result:  <a href=\"#TEST_2_PASSES\">\"Test 2 passes\"</a>",
+                "Result:  <a href=\"#TEST_3_PASSES\">\"Test 3 passes\"</a>",
+                "Result:  <a href=\"#TEST_4_PASSES\">\"Test 4 passes\"</a>",
+                "Result:  <a href=\"#TEST_5_PASSES\">\"Test 5 passes\"</a>",
+                "Result:  <a href=\"#TEST_6_PASSES\">\"Test 6 passes\"</a>");
 
         checkOutput("pkg1/Class2.html", true,
                 // Retrieve value of constant in different class.
-                "Result:  <a href=\"../pkg1/Class1.html#TEST_7_PASSES\">\"Test 7 passes\"</a>",
-                "Result:  <a href=\"../pkg1/Class1.html#TEST_8_PASSES\">\"Test 8 passes\"</a>",
-                "Result:  <a href=\"../pkg1/Class1.html#TEST_9_PASSES\">\"Test 9 passes\"</a>",
-                "Result:  <a href=\"../pkg1/Class1.html#TEST_10_PASSES\">\"Test 10 passes\"</a>",
-                "Result:  <a href=\"../pkg1/Class1.html#TEST_11_PASSES\">\"Test 11 passes\"</a>",
+                "Result:  <a href=\"Class1.html#TEST_7_PASSES\">\"Test 7 passes\"</a>",
+                "Result:  <a href=\"Class1.html#TEST_8_PASSES\">\"Test 8 passes\"</a>",
+                "Result:  <a href=\"Class1.html#TEST_9_PASSES\">\"Test 9 passes\"</a>",
+                "Result:  <a href=\"Class1.html#TEST_10_PASSES\">\"Test 10 passes\"</a>",
+                "Result:  <a href=\"Class1.html#TEST_11_PASSES\">\"Test 11 passes\"</a>",
                 // Retrieve value of constant in different package
                 "Result:  <a href=\"../pkg2/Class3.html#TEST_12_PASSES\">\"Test 12 passes\"</a>",
                 "Result:  <a href=\"../pkg2/Class3.html#TEST_13_PASSES\">\"Test 13 passes\"</a>",
@@ -74,7 +74,7 @@
 
         checkOutput("pkg2/package-summary.html", true,
                 // Retrieve value of constant from a package page
-                "Result: <a href=\"../pkg2/Class3.html#TEST_17_PASSES\">\"Test 17 passes\"</a>");
+                "Result: <a href=\"Class3.html#TEST_17_PASSES\">\"Test 17 passes\"</a>");
 
         checkOutput("pkg1/CustomTagUsage.html", true,
                 // Test @value tag used with custom tag.
@@ -104,7 +104,7 @@
 
         checkOutput("pkg1/Class1.html", false,
                 // Base case:  using @value on a constant.
-                "Result:  <a href=\"../pkg1/Class1.html#TEST_12_ERROR\">\"Test 12 "
+                "Result:  <a href=\"#TEST_12_ERROR\">\"Test 12 "
                 + "generates an error message\"</a>");
 
         checkForException();
@@ -141,9 +141,9 @@
         checkExit(Exit.OK);
 
         checkOrder("pkg3/RT.html",
-                "The value is <a href=\"../pkg3/RT.html#CONSTANT\">\"constant\"</a>.",
-                "The value1 is <a href=\"../pkg3/RT.html#CONSTANT\">\"constant\"</a>.",
-                "The value2 is <a href=\"../pkg3/RT.html#CONSTANT\">\"constant\"</a>.",
+                "The value is <a href=\"#CONSTANT\">\"constant\"</a>.",
+                "The value1 is <a href=\"#CONSTANT\">\"constant\"</a>.",
+                "The value2 is <a href=\"#CONSTANT\">\"constant\"</a>.",
                 "The value3 is <a href=\"../pkg2/Class3.html#TEST_12_PASSES\">"
                 + "\"Test 12 passes\"</a>.");
     }
--- a/test/langtools/jdk/javadoc/doclet/testWarnings/TestWarnings.java	Mon Jan 22 20:31:19 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testWarnings/TestWarnings.java	Mon Jan 22 11:15:51 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2018, 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
@@ -78,8 +78,8 @@
         checkExit(Exit.ERROR);
 
         checkOutput("pkg/X.html", true,
-            "<a href=\"../pkg/X.html#m--\"><code>m()</code></a><br/>",
-            "<a href=\"../pkg/X.html#X--\"><code>X()</code></a><br/>",
-            "<a href=\"../pkg/X.html#f\"><code>f</code></a><br/>");
+            "<a href=\"#m--\"><code>m()</code></a><br/>",
+            "<a href=\"#X--\"><code>X()</code></a><br/>",
+            "<a href=\"#f\"><code>f</code></a><br/>");
     }
 }