Merge from default JDK-8215445-branch
authorerikj
Wed, 02 Jan 2019 10:21:54 +0100
branchJDK-8215445-branch
changeset 57093 031640f92352
parent 57090 465c82e2d4c1 (current diff)
parent 53109 b99b41325d89 (diff)
child 57094 ffb618022ec7
Merge from default
make/autoconf/basics.m4
make/autoconf/spec.gmk.in
src/hotspot/share/runtime/arguments_ext.hpp
src/hotspot/share/services/diagnosticCommand_ext.hpp
test/langtools/jdk/javadoc/doclet/lib/JavadocTester.java
--- a/.hgtags	Fri Dec 21 01:29:51 2018 -0800
+++ b/.hgtags	Wed Jan 02 10:21:54 2019 +0100
@@ -529,3 +529,4 @@
 cc4098b3bc10d1c390384289025fea7b0d4b9e93 jdk-13+0
 7d4397b43fa305806160785a4c7210600d59581a jdk-12+24
 11033c4ada542f9c9a873314b6ecf60af19e8256 jdk-13+1
+7496df94b3b79f3da53925d2d137317715f11d97 jdk-12+25
--- a/make/Docs.gmk	Fri Dec 21 01:29:51 2018 -0800
+++ b/make/Docs.gmk	Wed Jan 02 10:21:54 2019 +0100
@@ -517,7 +517,7 @@
   ) \
 )
 
-ifneq ($(PANDOC), )
+ifeq ($(ENABLE_PANDOC), true)
   # For all markdown files in $module/share/specs directories, convert them to
   # html, if we have pandoc (otherwise we'll just skip this).
 
--- a/make/autoconf/basics.m4	Fri Dec 21 01:29:51 2018 -0800
+++ b/make/autoconf/basics.m4	Wed Jan 02 10:21:54 2019 +0100
@@ -615,9 +615,16 @@
   BASIC_PATH_PROGS(DF, df)
   BASIC_PATH_PROGS(CPIO, [cpio bsdcpio])
   BASIC_PATH_PROGS(NICE, nice)
+
   BASIC_PATH_PROGS(PANDOC, pandoc)
+  if test -n "$PANDOC"; then
+    ENABLE_PANDOC="true"
+  else
+    ENABLE_PANDOC="false"
+  fi
+  AC_SUBST(ENABLE_PANDOC)
+
   BASIC_PATH_PROGS(LSB_RELEASE, lsb_release)
-
   BASIC_PATH_PROGS(CMD, [cmd.exe /mnt/c/Windows/System32/cmd.exe])
 ])
 
--- a/make/autoconf/spec.gmk.in	Fri Dec 21 01:29:51 2018 -0800
+++ b/make/autoconf/spec.gmk.in	Wed Jan 02 10:21:54 2019 +0100
@@ -766,6 +766,7 @@
 MSVCP_DLL:=@MSVCP_DLL@
 UCRT_DLL_DIR:=@UCRT_DLL_DIR@
 STLPORT_LIB:=@STLPORT_LIB@
+ENABLE_PANDOC:=@ENABLE_PANDOC@
 
 ####################################################
 #
--- a/make/launcher/LauncherCommon.gmk	Fri Dec 21 01:29:51 2018 -0800
+++ b/make/launcher/LauncherCommon.gmk	Wed Jan 02 10:21:54 2019 +0100
@@ -203,7 +203,7 @@
 
   ifneq ($(MAN_FILES_MD), )
     # If we got markdown files, ignore the troff files
-    ifeq ($(PANDOC), )
+    ifeq ($(ENABLE_PANDOC), false)
       $(info Warning: pandoc not found. Not generating man pages)
     else
       # Create dynamic man pages from markdown using pandoc. We need
--- a/make/nb_native/nbproject/configurations.xml	Fri Dec 21 01:29:51 2018 -0800
+++ b/make/nb_native/nbproject/configurations.xml	Wed Jan 02 10:21:54 2019 +0100
@@ -2538,7 +2538,6 @@
               <in>arguments.cpp</in>
               <in>arguments.hpp</in>
               <in>arguments_ext.cpp</in>
-              <in>arguments_ext.hpp</in>
               <in>atomic.hpp</in>
               <in>basicLock.cpp</in>
               <in>basicLock.hpp</in>
@@ -2702,7 +2701,6 @@
               <in>diagnosticArgument.hpp</in>
               <in>diagnosticCommand.cpp</in>
               <in>diagnosticCommand.hpp</in>
-              <in>diagnosticCommand_ext.hpp</in>
               <in>diagnosticFramework.cpp</in>
               <in>diagnosticFramework.hpp</in>
               <in>dtraceAttacher.cpp</in>
@@ -13687,11 +13685,6 @@
             tool="1"
             flavor2="0">
       </item>
-      <item path="../../src/hotspot/share/runtime/arguments_ext.hpp"
-            ex="false"
-            tool="3"
-            flavor2="0">
-      </item>
       <item path="../../src/hotspot/share/runtime/atomic.hpp"
             ex="false"
             tool="3"
@@ -14497,11 +14490,6 @@
             tool="3"
             flavor2="0">
       </item>
-      <item path="../../src/hotspot/share/services/diagnosticCommand_ext.hpp"
-            ex="false"
-            tool="3"
-            flavor2="0">
-      </item>
       <item path="../../src/hotspot/share/services/diagnosticFramework.cpp"
             ex="false"
             tool="1"
@@ -27454,11 +27442,6 @@
             tool="1"
             flavor2="0">
       </item>
-      <item path="../../src/hotspot/share/runtime/arguments_ext.hpp"
-            ex="false"
-            tool="3"
-            flavor2="0">
-      </item>
       <item path="../../src/hotspot/share/runtime/atomic.hpp"
             ex="false"
             tool="3"
@@ -28264,11 +28247,6 @@
             tool="3"
             flavor2="0">
       </item>
-      <item path="../../src/hotspot/share/services/diagnosticCommand_ext.hpp"
-            ex="false"
-            tool="3"
-            flavor2="0">
-      </item>
       <item path="../../src/hotspot/share/services/diagnosticFramework.cpp"
             ex="false"
             tool="1"
--- a/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp	Fri Dec 21 01:29:51 2018 -0800
+++ b/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp	Wed Jan 02 10:21:54 2019 +0100
@@ -4896,7 +4896,7 @@
 
   // A very short string
   cmpw(cnt2, minCharsInWord);
-  br(Assembler::LT, SHORT_STRING);
+  br(Assembler::LE, SHORT_STRING);
 
   // Compare longwords
   // load first parts of strings and finish initialization while loading
@@ -4920,8 +4920,7 @@
       ldr(tmp2, Address(str2));
       cmp(cnt2, STUB_THRESHOLD);
       br(GE, STUB);
-      subsw(cnt2, cnt2, 4);
-      br(EQ, TAIL_CHECK);
+      subw(cnt2, cnt2, 4);
       eor(vtmpZ, T16B, vtmpZ, vtmpZ);
       lea(str1, Address(str1, cnt2, Address::uxtw(str1_chr_shift)));
       lea(str2, Address(str2, cnt2, Address::uxtw(str2_chr_shift)));
@@ -4937,8 +4936,7 @@
       ldrs(vtmp, Address(str2));
       cmp(cnt2, STUB_THRESHOLD);
       br(GE, STUB);
-      subsw(cnt2, cnt2, 4);
-      br(EQ, TAIL_CHECK);
+      subw(cnt2, cnt2, 4);
       lea(str1, Address(str1, cnt2, Address::uxtw(str1_chr_shift)));
       eor(vtmpZ, T16B, vtmpZ, vtmpZ);
       lea(str2, Address(str2, cnt2, Address::uxtw(str2_chr_shift)));
--- a/src/hotspot/cpu/x86/templateTable_x86.cpp	Fri Dec 21 01:29:51 2018 -0800
+++ b/src/hotspot/cpu/x86/templateTable_x86.cpp	Wed Jan 02 10:21:54 2019 +0100
@@ -582,8 +582,9 @@
       __ cmpl(flags, ltos);
       __ jcc(Assembler::notEqual, notLong);
       // ltos
+      // Loading high word first because movptr clobbers rax
+      NOT_LP64(__ movptr(rdx, field.plus_disp(4)));
       __ movptr(rax, field);
-      NOT_LP64(__ movptr(rdx, field.plus_disp(4)));
       __ push(ltos);
       __ jmp(Done);
 
--- a/src/hotspot/cpu/x86/x86_64.ad	Fri Dec 21 01:29:51 2018 -0800
+++ b/src/hotspot/cpu/x86/x86_64.ad	Wed Jan 02 10:21:54 2019 +0100
@@ -4265,132 +4265,196 @@
 
 // Operands for bound floating pointer register arguments
 operand rxmm0() %{
-  constraint(ALLOC_IN_RC(xmm0_reg));  match(VecX);
-  predicate((UseSSE > 0) && (UseAVX<= 2));  format%{%}  interface(REG_INTER);
+  constraint(ALLOC_IN_RC(xmm0_reg));
+  match(VecX);
+  format%{%}
+  interface(REG_INTER);
 %}
 operand rxmm1() %{
-  constraint(ALLOC_IN_RC(xmm1_reg));  match(VecX);
-  predicate((UseSSE > 0) && (UseAVX <= 2));  format%{%}  interface(REG_INTER);
+  constraint(ALLOC_IN_RC(xmm1_reg));
+  match(VecX);
+  format%{%}
+  interface(REG_INTER);
 %}
 operand rxmm2() %{
-  constraint(ALLOC_IN_RC(xmm2_reg));  match(VecX);
-  predicate((UseSSE > 0) && (UseAVX <= 2));  format%{%}  interface(REG_INTER);
+  constraint(ALLOC_IN_RC(xmm2_reg));
+  match(VecX);
+  format%{%}
+  interface(REG_INTER);
 %}
 operand rxmm3() %{
-  constraint(ALLOC_IN_RC(xmm3_reg));  match(VecX);
-  predicate((UseSSE > 0) && (UseAVX <= 2));  format%{%}  interface(REG_INTER);
+  constraint(ALLOC_IN_RC(xmm3_reg));
+  match(VecX);
+  format%{%}
+  interface(REG_INTER);
 %}
 operand rxmm4() %{
-  constraint(ALLOC_IN_RC(xmm4_reg));  match(VecX);
-  predicate((UseSSE > 0) && (UseAVX <= 2));  format%{%}  interface(REG_INTER);
+  constraint(ALLOC_IN_RC(xmm4_reg));
+  match(VecX);
+  format%{%}
+  interface(REG_INTER);
 %}
 operand rxmm5() %{
-  constraint(ALLOC_IN_RC(xmm5_reg));  match(VecX);
-  predicate((UseSSE > 0) && (UseAVX <= 2));  format%{%}  interface(REG_INTER);
+  constraint(ALLOC_IN_RC(xmm5_reg));
+  match(VecX);
+  format%{%}
+  interface(REG_INTER);
 %}
 operand rxmm6() %{
-  constraint(ALLOC_IN_RC(xmm6_reg));  match(VecX);
-  predicate((UseSSE > 0) && (UseAVX <= 2));  format%{%}  interface(REG_INTER);
+  constraint(ALLOC_IN_RC(xmm6_reg));
+  match(VecX);
+  format%{%}
+  interface(REG_INTER);
 %}
 operand rxmm7() %{
-  constraint(ALLOC_IN_RC(xmm7_reg));  match(VecX);
-  predicate((UseSSE > 0) && (UseAVX <= 2));  format%{%}  interface(REG_INTER);
+  constraint(ALLOC_IN_RC(xmm7_reg));
+  match(VecX);
+  format%{%}
+  interface(REG_INTER);
 %}
 operand rxmm8() %{
-  constraint(ALLOC_IN_RC(xmm8_reg));  match(VecX);
-  predicate((UseSSE > 0) && (UseAVX <= 2));  format%{%}  interface(REG_INTER);
+  constraint(ALLOC_IN_RC(xmm8_reg));
+  match(VecX);
+  format%{%}
+  interface(REG_INTER);
 %}
 operand rxmm9() %{
-  constraint(ALLOC_IN_RC(xmm9_reg));  match(VecX);
-  predicate((UseSSE > 0) && (UseAVX <= 2));  format%{%}  interface(REG_INTER);
+  constraint(ALLOC_IN_RC(xmm9_reg));
+  match(VecX);
+  format%{%}
+  interface(REG_INTER);
 %}
 operand rxmm10() %{
-  constraint(ALLOC_IN_RC(xmm10_reg));  match(VecX);
-  predicate((UseSSE > 0) && (UseAVX <= 2));  format%{%}  interface(REG_INTER);
+  constraint(ALLOC_IN_RC(xmm10_reg));
+  match(VecX);
+  format%{%}
+  interface(REG_INTER);
 %}
 operand rxmm11() %{
-  constraint(ALLOC_IN_RC(xmm11_reg));  match(VecX);
-  predicate((UseSSE > 0) && (UseAVX <= 2));  format%{%}  interface(REG_INTER);
+  constraint(ALLOC_IN_RC(xmm11_reg));
+  match(VecX);
+  format%{%}
+  interface(REG_INTER);
 %}
 operand rxmm12() %{
-  constraint(ALLOC_IN_RC(xmm12_reg));  match(VecX);
-  predicate((UseSSE > 0) && (UseAVX <= 2));  format%{%}  interface(REG_INTER);
+  constraint(ALLOC_IN_RC(xmm12_reg));
+  match(VecX);
+  format%{%}
+  interface(REG_INTER);
 %}
 operand rxmm13() %{
-  constraint(ALLOC_IN_RC(xmm13_reg));  match(VecX);
-  predicate((UseSSE > 0) && (UseAVX <= 2));  format%{%}  interface(REG_INTER);
+  constraint(ALLOC_IN_RC(xmm13_reg));
+  match(VecX);
+  format%{%}
+  interface(REG_INTER);
 %}
 operand rxmm14() %{
-  constraint(ALLOC_IN_RC(xmm14_reg));  match(VecX);
-  predicate((UseSSE > 0) && (UseAVX <= 2));  format%{%}  interface(REG_INTER);
+  constraint(ALLOC_IN_RC(xmm14_reg));
+  match(VecX);
+  format%{%}
+  interface(REG_INTER);
 %}
 operand rxmm15() %{
-  constraint(ALLOC_IN_RC(xmm15_reg));  match(VecX);
-  predicate((UseSSE > 0) && (UseAVX <= 2));  format%{%}  interface(REG_INTER);
+  constraint(ALLOC_IN_RC(xmm15_reg));
+  match(VecX);
+  format%{%}
+  interface(REG_INTER);
 %}
 operand rxmm16() %{
-  constraint(ALLOC_IN_RC(xmm16_reg));  match(VecX);
-  predicate(UseAVX == 3);  format%{%}  interface(REG_INTER);
+  constraint(ALLOC_IN_RC(xmm16_reg));
+  match(VecX);
+  format%{%}
+  interface(REG_INTER);
 %}
 operand rxmm17() %{
-  constraint(ALLOC_IN_RC(xmm17_reg));  match(VecX);
-  predicate(UseAVX == 3);  format%{%}  interface(REG_INTER);
+  constraint(ALLOC_IN_RC(xmm17_reg));
+  match(VecX);
+  format%{%}
+  interface(REG_INTER);
 %}
 operand rxmm18() %{
-  constraint(ALLOC_IN_RC(xmm18_reg));  match(VecX);
-  predicate(UseAVX == 3);  format%{%}  interface(REG_INTER);
+  constraint(ALLOC_IN_RC(xmm18_reg));
+  match(VecX);
+  format%{%}
+  interface(REG_INTER);
 %}
 operand rxmm19() %{
-  constraint(ALLOC_IN_RC(xmm19_reg));  match(VecX);
-  predicate(UseAVX == 3);  format%{%}  interface(REG_INTER);
+  constraint(ALLOC_IN_RC(xmm19_reg));
+  match(VecX);
+  format%{%}
+  interface(REG_INTER);
 %}
 operand rxmm20() %{
-  constraint(ALLOC_IN_RC(xmm20_reg));  match(VecX);
-  predicate(UseAVX == 3);  format%{%}  interface(REG_INTER);
+  constraint(ALLOC_IN_RC(xmm20_reg));
+  match(VecX);
+  format%{%}
+  interface(REG_INTER);
 %}
 operand rxmm21() %{
-  constraint(ALLOC_IN_RC(xmm21_reg));  match(VecX);
-  predicate(UseAVX == 3);  format%{%}  interface(REG_INTER);
+  constraint(ALLOC_IN_RC(xmm21_reg));
+  match(VecX);
+  format%{%}
+  interface(REG_INTER);
 %}
 operand rxmm22() %{
-  constraint(ALLOC_IN_RC(xmm22_reg));  match(VecX);
-  predicate(UseAVX == 3);  format%{%}  interface(REG_INTER);
+  constraint(ALLOC_IN_RC(xmm22_reg));
+  match(VecX);
+  format%{%}
+  interface(REG_INTER);
 %}
 operand rxmm23() %{
-  constraint(ALLOC_IN_RC(xmm23_reg));  match(VecX);
-  predicate(UseAVX == 3);  format%{%}  interface(REG_INTER);
+  constraint(ALLOC_IN_RC(xmm23_reg));
+  match(VecX);
+  format%{%}
+  interface(REG_INTER);
 %}
 operand rxmm24() %{
-  constraint(ALLOC_IN_RC(xmm24_reg));  match(VecX);
-  predicate(UseAVX == 3);  format%{%}  interface(REG_INTER);
+  constraint(ALLOC_IN_RC(xmm24_reg));
+  match(VecX);
+  format%{%}
+  interface(REG_INTER);
 %}
 operand rxmm25() %{
-  constraint(ALLOC_IN_RC(xmm25_reg));  match(VecX);
-  predicate(UseAVX == 3);  format%{%}  interface(REG_INTER);
+  constraint(ALLOC_IN_RC(xmm25_reg));
+  match(VecX);
+  format%{%}
+  interface(REG_INTER);
 %}
 operand rxmm26() %{
-  constraint(ALLOC_IN_RC(xmm26_reg));  match(VecX);
-  predicate(UseAVX == 3);  format%{%}  interface(REG_INTER);
+  constraint(ALLOC_IN_RC(xmm26_reg));
+  match(VecX);
+  format%{%}
+  interface(REG_INTER);
 %}
 operand rxmm27() %{
-  constraint(ALLOC_IN_RC(xmm27_reg));  match(VecX);
-  predicate(UseAVX == 3);  format%{%}  interface(REG_INTER);
+  constraint(ALLOC_IN_RC(xmm27_reg));
+  match(VecX);
+  format%{%}
+  interface(REG_INTER);
 %}
 operand rxmm28() %{
-  constraint(ALLOC_IN_RC(xmm28_reg));  match(VecX);
-  predicate(UseAVX == 3);  format%{%}  interface(REG_INTER);
+  constraint(ALLOC_IN_RC(xmm28_reg));
+  match(VecX);
+  format%{%}
+  interface(REG_INTER);
 %}
 operand rxmm29() %{
-  constraint(ALLOC_IN_RC(xmm29_reg));  match(VecX);
-  predicate(UseAVX == 3);  format%{%}  interface(REG_INTER);
+  constraint(ALLOC_IN_RC(xmm29_reg));
+  match(VecX);
+  format%{%}
+  interface(REG_INTER);
 %}
 operand rxmm30() %{
-  constraint(ALLOC_IN_RC(xmm30_reg));  match(VecX);
-  predicate(UseAVX == 3);  format%{%}  interface(REG_INTER);
+  constraint(ALLOC_IN_RC(xmm30_reg));
+  match(VecX);
+  format%{%}
+  interface(REG_INTER);
 %}
 operand rxmm31() %{
-  constraint(ALLOC_IN_RC(xmm31_reg));  match(VecX);
-  predicate(UseAVX == 3);  format%{%}  interface(REG_INTER);
+  constraint(ALLOC_IN_RC(xmm31_reg));
+  match(VecX);
+  format%{%}
+  interface(REG_INTER);
 %}
 
 //----------OPERAND CLASSES----------------------------------------------------
@@ -12651,33 +12715,6 @@
 // Execute ZGC load barrier (strong) slow path
 //
 
-// When running without XMM regs
-instruct loadBarrierSlowRegNoVec(rRegP dst, memory mem, rFlagsReg cr) %{
-
-  match(Set dst (LoadBarrierSlowReg mem));
-  predicate(MaxVectorSize < 16);
-
-  effect(DEF dst, KILL cr);
-
-  format %{"LoadBarrierSlowRegNoVec $dst, $mem" %}
-  ins_encode %{
-#if INCLUDE_ZGC
-    Register d = $dst$$Register;
-    ZBarrierSetAssembler* bs = (ZBarrierSetAssembler*)BarrierSet::barrier_set()->barrier_set_assembler();
-
-    assert(d != r12, "Can't be R12!");
-    assert(d != r15, "Can't be R15!");
-    assert(d != rsp, "Can't be RSP!");
-
-    __ lea(d, $mem$$Address);
-    __ call(RuntimeAddress(bs->load_barrier_slow_stub(d)));
-#else
-    ShouldNotReachHere();
-#endif
-  %}
-  ins_pipe(pipe_slow);
-%}
-
 // For XMM and YMM enabled processors
 instruct loadBarrierSlowRegXmmAndYmm(rRegP dst, memory mem, rFlagsReg cr,
                                      rxmm0 x0, rxmm1 x1, rxmm2 x2,rxmm3 x3,
@@ -12686,7 +12723,7 @@
                                      rxmm12 x12, rxmm13 x13, rxmm14 x14, rxmm15 x15) %{
 
   match(Set dst (LoadBarrierSlowReg mem));
-  predicate((UseSSE > 0) && (UseAVX <= 2) && (MaxVectorSize >= 16));
+  predicate(UseAVX <= 2);
 
   effect(DEF dst, KILL cr,
          KILL x0, KILL x1, KILL x2, KILL x3,
@@ -12694,7 +12731,7 @@
          KILL x8, KILL x9, KILL x10, KILL x11,
          KILL x12, KILL x13, KILL x14, KILL x15);
 
-  format %{"LoadBarrierSlowRegXmm $dst, $mem" %}
+  format %{"LoadBarrierSlowRegXmmAndYmm $dst, $mem" %}
   ins_encode %{
 #if INCLUDE_ZGC
     Register d = $dst$$Register;
@@ -12725,7 +12762,7 @@
                                rxmm28 x28, rxmm29 x29, rxmm30 x30, rxmm31 x31) %{
 
   match(Set dst (LoadBarrierSlowReg mem));
-  predicate((UseAVX == 3) && (MaxVectorSize >= 16));
+  predicate(UseAVX == 3);
 
   effect(DEF dst, KILL cr,
          KILL x0, KILL x1, KILL x2, KILL x3,
@@ -12760,33 +12797,6 @@
 // Execute ZGC load barrier (weak) slow path
 //
 
-// When running without XMM regs
-instruct loadBarrierWeakSlowRegNoVec(rRegP dst, memory mem, rFlagsReg cr) %{
-
-  match(Set dst (LoadBarrierSlowReg mem));
-  predicate(MaxVectorSize < 16);
-
-  effect(DEF dst, KILL cr);
-
-  format %{"LoadBarrierSlowRegNoVec $dst, $mem" %}
-  ins_encode %{
-#if INCLUDE_ZGC
-    Register d = $dst$$Register;
-    ZBarrierSetAssembler* bs = (ZBarrierSetAssembler*)BarrierSet::barrier_set()->barrier_set_assembler();
-
-    assert(d != r12, "Can't be R12!");
-    assert(d != r15, "Can't be R15!");
-    assert(d != rsp, "Can't be RSP!");
-
-    __ lea(d, $mem$$Address);
-    __ call(RuntimeAddress(bs->load_barrier_weak_slow_stub(d)));
-#else
-    ShouldNotReachHere();
-#endif
-  %}
-  ins_pipe(pipe_slow);
-%}
-
 // For XMM and YMM enabled processors
 instruct loadBarrierWeakSlowRegXmmAndYmm(rRegP dst, memory mem, rFlagsReg cr,
                                          rxmm0 x0, rxmm1 x1, rxmm2 x2,rxmm3 x3,
@@ -12795,7 +12805,7 @@
                                          rxmm12 x12, rxmm13 x13, rxmm14 x14, rxmm15 x15) %{
 
   match(Set dst (LoadBarrierWeakSlowReg mem));
-  predicate((UseSSE > 0) && (UseAVX <= 2) && (MaxVectorSize >= 16));
+  predicate(UseAVX <= 2);
 
   effect(DEF dst, KILL cr,
          KILL x0, KILL x1, KILL x2, KILL x3,
@@ -12803,7 +12813,7 @@
          KILL x8, KILL x9, KILL x10, KILL x11,
          KILL x12, KILL x13, KILL x14, KILL x15);
 
-  format %{"LoadBarrierWeakSlowRegXmm $dst, $mem" %}
+  format %{"LoadBarrierWeakSlowRegXmmAndYmm $dst, $mem" %}
   ins_encode %{
 #if INCLUDE_ZGC
     Register d = $dst$$Register;
@@ -12834,7 +12844,7 @@
                                    rxmm28 x28, rxmm29 x29, rxmm30 x30, rxmm31 x31) %{
 
   match(Set dst (LoadBarrierWeakSlowReg mem));
-  predicate((UseAVX == 3) && (MaxVectorSize >= 16));
+  predicate(UseAVX == 3);
 
   effect(DEF dst, KILL cr,
          KILL x0, KILL x1, KILL x2, KILL x3,
--- a/src/hotspot/os/bsd/os_bsd.cpp	Fri Dec 21 01:29:51 2018 -0800
+++ b/src/hotspot/os/bsd/os_bsd.cpp	Wed Jan 02 10:21:54 2019 +0100
@@ -2330,14 +2330,13 @@
 #elif defined(__APPLE__) || defined(__NetBSD__)
   struct sched_param sp;
   int policy;
-  pthread_t self = pthread_self();
-
-  if (pthread_getschedparam(self, &policy, &sp) != 0) {
+
+  if (pthread_getschedparam(thread->osthread()->pthread_id(), &policy, &sp) != 0) {
     return OS_ERR;
   }
 
   sp.sched_priority = newpri;
-  if (pthread_setschedparam(self, policy, &sp) != 0) {
+  if (pthread_setschedparam(thread->osthread()->pthread_id(), policy, &sp) != 0) {
     return OS_ERR;
   }
 
@@ -2361,8 +2360,14 @@
   int policy;
   struct sched_param sp;
 
-  pthread_getschedparam(pthread_self(), &policy, &sp);
-  *priority_ptr = sp.sched_priority;
+  int res = pthread_getschedparam(thread->osthread()->pthread_id(), &policy, &sp);
+  if (res != 0) {
+    *priority_ptr = -1;
+    return OS_ERR;
+  } else {
+    *priority_ptr = sp.sched_priority;
+    return OS_OK;
+  }
 #else
   *priority_ptr = getpriority(PRIO_PROCESS, thread->osthread()->thread_id());
 #endif
--- a/src/hotspot/os/linux/os_linux.cpp	Fri Dec 21 01:29:51 2018 -0800
+++ b/src/hotspot/os/linux/os_linux.cpp	Wed Jan 02 10:21:54 2019 +0100
@@ -705,6 +705,8 @@
     }
   }
 
+  assert(osthread->pthread_id() != 0, "pthread_id was not set as expected");
+
   // call one more level start routine
   thread->call_run();
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/hotspot/os_cpu/linux_x86/gc/z/zArguments_linux_x86.cpp	Wed Jan 02 10:21:54 2019 +0100
@@ -0,0 +1,40 @@
+/*
+ * 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.
+ */
+
+#include "precompiled.hpp"
+#include "gc/z/zArguments.hpp"
+#include "runtime/globals.hpp"
+#include "runtime/globals_extension.hpp"
+#include "utilities/debug.hpp"
+
+void ZArguments::initialize_platform() {
+  // The C2 barrier slow path expects vector registers to be least
+  // 16 bytes wide, which is the minimum width available on all
+  // x86-64 systems. However, the user could have speficied a lower
+  // number on the command-line, in which case we print a warning
+  // and raise it to 16.
+  if (MaxVectorSize < 16) {
+    warning("ZGC requires MaxVectorSize to be at least 16");
+    FLAG_SET_DEFAULT(MaxVectorSize, 16);
+  }
+}
--- a/src/hotspot/share/classfile/stackMapFrame.hpp	Fri Dec 21 01:29:51 2018 -0800
+++ b/src/hotspot/share/classfile/stackMapFrame.hpp	Wed Jan 02 10:21:54 2019 +0100
@@ -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
@@ -63,6 +63,7 @@
   ClassVerifier* _verifier;  // the verifier verifying this method
 
   StackMapFrame(const StackMapFrame& cp) :
+      ResourceObj(cp),
       _offset(cp._offset), _locals_size(cp._locals_size),
       _stack_size(cp._stack_size), _stack_mark(cp._stack_mark),
       _max_locals(cp._max_locals), _max_stack(cp._max_stack),
--- a/src/hotspot/share/classfile/systemDictionary.cpp	Fri Dec 21 01:29:51 2018 -0800
+++ b/src/hotspot/share/classfile/systemDictionary.cpp	Wed Jan 02 10:21:54 2019 +0100
@@ -71,7 +71,6 @@
 #include "prims/resolvedMethodTable.hpp"
 #include "prims/methodHandles.hpp"
 #include "runtime/arguments.hpp"
-#include "runtime/arguments_ext.hpp"
 #include "runtime/biasedLocking.hpp"
 #include "runtime/fieldType.hpp"
 #include "runtime/handles.inline.hpp"
--- a/src/hotspot/share/code/icBuffer.cpp	Fri Dec 21 01:29:51 2018 -0800
+++ b/src/hotspot/share/code/icBuffer.cpp	Wed Jan 02 10:21:54 2019 +0100
@@ -53,29 +53,29 @@
     _refill_remembered(false)
 {
   Thread* thread = Thread::current();
-  assert(thread->missed_ic_stub_refill_mark() == NULL, "nesting not supported");
-  thread->set_missed_ic_stub_refill_mark(this);
+  assert(thread->missed_ic_stub_refill_verifier() == NULL, "nesting not supported");
+  thread->set_missed_ic_stub_refill_verifier(this);
 }
 
 ICRefillVerifier::~ICRefillVerifier() {
   assert(!_refill_requested || _refill_remembered,
          "Forgot to refill IC stubs after failed IC transition");
-  Thread::current()->set_missed_ic_stub_refill_mark(NULL);
+  Thread::current()->set_missed_ic_stub_refill_verifier(NULL);
 }
 
 ICRefillVerifierMark::ICRefillVerifierMark(ICRefillVerifier* verifier) {
   Thread* thread = Thread::current();
-  assert(thread->missed_ic_stub_refill_mark() == NULL, "nesting not supported");
-  thread->set_missed_ic_stub_refill_mark(this);
+  assert(thread->missed_ic_stub_refill_verifier() == NULL, "nesting not supported");
+  thread->set_missed_ic_stub_refill_verifier(verifier);
 }
 
 ICRefillVerifierMark::~ICRefillVerifierMark() {
-  Thread::current()->set_missed_ic_stub_refill_mark(NULL);
+  Thread::current()->set_missed_ic_stub_refill_verifier(NULL);
 }
 
 static ICRefillVerifier* current_ic_refill_verifier() {
   Thread* current = Thread::current();
-  ICRefillVerifier* verifier = reinterpret_cast<ICRefillVerifier*>(current->missed_ic_stub_refill_mark());
+  ICRefillVerifier* verifier = current->missed_ic_stub_refill_verifier();
   assert(verifier != NULL, "need a verifier for safety");
   return verifier;
 }
--- a/src/hotspot/share/code/nmethod.cpp	Fri Dec 21 01:29:51 2018 -0800
+++ b/src/hotspot/share/code/nmethod.cpp	Wed Jan 02 10:21:54 2019 +0100
@@ -1283,6 +1283,13 @@
       flush_dependencies(/*delete_immediately*/true);
     }
 
+    // Clear ICStubs to prevent back patching stubs of zombie or flushed
+    // nmethods during the next safepoint (see ICStub::finalize).
+    {
+      CompiledICLocker ml(this);
+      clear_ic_stubs();
+    }
+
     // zombie only - if a JVMTI agent has enabled the CompiledMethodUnload
     // event and it hasn't already been reported for this nmethod then
     // report it now. The event may have been reported earlier if the GC
@@ -2533,6 +2540,7 @@
         case relocInfo::section_word_type:     return "section_word";
         case relocInfo::poll_type:             return "poll";
         case relocInfo::poll_return_type:      return "poll_return";
+        case relocInfo::trampoline_stub_type:  return "trampoline_stub";
         case relocInfo::type_mask:             return "type_bit_mask";
 
         default:
--- a/src/hotspot/share/gc/g1/dirtyCardQueue.cpp	Fri Dec 21 01:29:51 2018 -0800
+++ b/src/hotspot/share/gc/g1/dirtyCardQueue.cpp	Wed Jan 02 10:21:54 2019 +0100
@@ -156,7 +156,7 @@
   PtrQueueSet::initialize(cbl_mon, allocator);
   _shared_dirty_card_queue.set_lock(lock);
   if (init_free_ids) {
-    _free_ids = new FreeIdSet(num_par_ids(), _cbl_mon);
+    _free_ids = new FreeIdSet(num_par_ids(), cbl_mon);
   }
 }
 
@@ -217,29 +217,6 @@
   return result;
 }
 
-
-BufferNode* DirtyCardQueueSet::get_completed_buffer(size_t stop_at) {
-  MutexLockerEx x(_cbl_mon, Mutex::_no_safepoint_check_flag);
-
-  if (_n_completed_buffers <= stop_at) {
-    return NULL;
-  }
-
-  assert(_n_completed_buffers > 0, "invariant");
-  assert(_completed_buffers_head != NULL, "invariant");
-  assert(_completed_buffers_tail != NULL, "invariant");
-
-  BufferNode* nd = _completed_buffers_head;
-  _completed_buffers_head = nd->next();
-  _n_completed_buffers--;
-  if (_completed_buffers_head == NULL) {
-    assert(_n_completed_buffers == 0, "Invariant");
-    _completed_buffers_tail = NULL;
-  }
-  DEBUG_ONLY(assert_completed_buffer_list_len_correct_locked());
-  return nd;
-}
-
 bool DirtyCardQueueSet::refine_completed_buffer_concurrently(uint worker_i, size_t stop_at) {
   G1RefineCardConcurrentlyClosure cl;
   return apply_closure_to_completed_buffer(&cl, worker_i, stop_at, false);
@@ -267,7 +244,7 @@
     } else {
       // Return partially processed buffer to the queue.
       guarantee(!during_pause, "Should never stop early");
-      enqueue_complete_buffer(nd);
+      enqueue_completed_buffer(nd);
     }
     return true;
   }
@@ -288,32 +265,9 @@
   }
 }
 
-// Deallocates any completed log buffers
-void DirtyCardQueueSet::clear() {
-  BufferNode* buffers_to_delete = NULL;
-  {
-    MutexLockerEx x(_cbl_mon, Mutex::_no_safepoint_check_flag);
-    while (_completed_buffers_head != NULL) {
-      BufferNode* nd = _completed_buffers_head;
-      _completed_buffers_head = nd->next();
-      nd->set_next(buffers_to_delete);
-      buffers_to_delete = nd;
-    }
-    _n_completed_buffers = 0;
-    _completed_buffers_tail = NULL;
-    DEBUG_ONLY(assert_completed_buffer_list_len_correct_locked());
-  }
-  while (buffers_to_delete != NULL) {
-    BufferNode* nd = buffers_to_delete;
-    buffers_to_delete = nd->next();
-    deallocate_buffer(nd);
-  }
-
-}
-
 void DirtyCardQueueSet::abandon_logs() {
   assert(SafepointSynchronize::is_at_safepoint(), "Must be at safepoint.");
-  clear();
+  abandon_completed_buffers();
   // Since abandon is done only at safepoints, we can safely manipulate
   // these queues.
   for (JavaThreadIteratorWithHandle jtiwh; JavaThread *t = jtiwh.next(); ) {
@@ -333,10 +287,11 @@
   // the global list of logs.  Temporarily turn off the limit on the number
   // of outstanding buffers.
   assert(SafepointSynchronize::is_at_safepoint(), "Must be at safepoint.");
-  SizeTFlagSetting local_max(_max_completed_buffers,
-                             MaxCompletedBuffersUnlimited);
+  size_t old_limit = max_completed_buffers();
+  set_max_completed_buffers(MaxCompletedBuffersUnlimited);
   for (JavaThreadIteratorWithHandle jtiwh; JavaThread *t = jtiwh.next(); ) {
     concatenate_log(G1ThreadLocalData::dirty_card_queue(t));
   }
   concatenate_log(_shared_dirty_card_queue);
+  set_max_completed_buffers(old_limit);
 }
--- a/src/hotspot/share/gc/g1/dirtyCardQueue.hpp	Fri Dec 21 01:29:51 2018 -0800
+++ b/src/hotspot/share/gc/g1/dirtyCardQueue.hpp	Wed Jan 02 10:21:54 2019 +0100
@@ -136,9 +136,7 @@
   // must never return false. Must only be called during GC.
   bool apply_closure_during_gc(CardTableEntryClosure* cl, uint worker_i);
 
-  BufferNode* get_completed_buffer(size_t stop_at);
-
-  void reset_for_par_iteration() { _cur_par_buffer_node = _completed_buffers_head; }
+  void reset_for_par_iteration() { _cur_par_buffer_node = completed_buffers_head(); }
   // Applies the current closure to all completed buffers, non-consumptively.
   // Can be used in parallel, all callers using the iteration state initialized
   // by reset_for_par_iteration.
@@ -148,16 +146,12 @@
     return &_shared_dirty_card_queue;
   }
 
-  // Deallocate any completed log buffers
-  void clear();
-
   // If a full collection is happening, reset partial logs, and ignore
   // completed ones: the full collection will make them all irrelevant.
   void abandon_logs();
 
   // If any threads have partial logs, add them to the global list of logs.
   void concatenate_logs();
-  void clear_n_completed_buffers() { _n_completed_buffers = 0;}
 
   jint processed_buffers_mut() {
     return _processed_buffers_mut;
--- a/src/hotspot/share/gc/g1/g1CollectedHeap.cpp	Fri Dec 21 01:29:51 2018 -0800
+++ b/src/hotspot/share/gc/g1/g1CollectedHeap.cpp	Wed Jan 02 10:21:54 2019 +0100
@@ -1949,9 +1949,8 @@
   while (dcqs.apply_closure_during_gc(cl, worker_i)) {
     n_completed_buffers++;
   }
+  assert(dcqs.completed_buffers_num() == 0, "Completed buffers exist!");
   g1_policy()->phase_times()->record_thread_work_item(G1GCPhaseTimes::UpdateRS, worker_i, n_completed_buffers, G1GCPhaseTimes::UpdateRSProcessedBuffers);
-  dcqs.clear_n_completed_buffers();
-  assert(!dcqs.completed_buffers_exist_dirty(), "Completed buffers exist!");
 }
 
 // Computes the sum of the storage used by the various regions.
--- a/src/hotspot/share/gc/g1/g1ConcurrentRefineThread.cpp	Fri Dec 21 01:29:51 2018 -0800
+++ b/src/hotspot/share/gc/g1/g1ConcurrentRefineThread.cpp	Wed Jan 02 10:21:54 2019 +0100
@@ -75,7 +75,7 @@
     set_active(true);
   } else {
     DirtyCardQueueSet& dcqs = G1BarrierSet::dirty_card_queue_set();
-    dcqs.set_process_completed(true);
+    dcqs.set_process_completed_buffers(true);
   }
   _monitor->notify();
 }
@@ -86,7 +86,7 @@
     set_active(false);
   } else {
     DirtyCardQueueSet& dcqs = G1BarrierSet::dirty_card_queue_set();
-    dcqs.set_process_completed(false);
+    dcqs.set_process_completed_buffers(false);
   }
 }
 
--- a/src/hotspot/share/gc/g1/g1YoungRemSetSamplingThread.cpp	Fri Dec 21 01:29:51 2018 -0800
+++ b/src/hotspot/share/gc/g1/g1YoungRemSetSamplingThread.cpp	Wed Jan 02 10:21:54 2019 +0100
@@ -72,9 +72,9 @@
 
   // Check if load is lower than max.
   double recent_load;
-  if ((G1PeriodicGCSystemLoadThreshold > 0) &&
+  if ((G1PeriodicGCSystemLoadThreshold > 0.0f) &&
       (os::loadavg(&recent_load, 1) == -1 || recent_load > G1PeriodicGCSystemLoadThreshold)) {
-    log_debug(gc, periodic)("Load %1.2f is higher than threshold " UINTX_FORMAT ". Skipping.",
+    log_debug(gc, periodic)("Load %1.2f is higher than threshold %1.2f. Skipping.",
                             recent_load, G1PeriodicGCSystemLoadThreshold);
     return false;
   }
--- a/src/hotspot/share/gc/g1/g1_globals.hpp	Fri Dec 21 01:29:51 2018 -0800
+++ b/src/hotspot/share/gc/g1/g1_globals.hpp	Wed Jan 02 10:21:54 2019 +0100
@@ -311,10 +311,11 @@
           "perform a concurrent GC as periodic GC, otherwise use a STW "    \
           "Full GC.")                                                       \
                                                                             \
-  manageable(uintx, G1PeriodicGCSystemLoadThreshold, 0,                     \
-          "Maximum recent system wide system load as returned by the 1m "   \
-          "value of getloadavg() at which G1 triggers a periodic GC. A "    \
-          "load above this value cancels a given periodic GC. A value of "  \
-          "zero disables this check.")                                      \
+  manageable(double, G1PeriodicGCSystemLoadThreshold, 0.0,                  \
+          "Maximum recent system wide load as returned by the 1m value "    \
+          "of getloadavg() at which G1 triggers a periodic GC. A load "     \
+          "above this value cancels a given periodic GC. A value of zero "  \
+          "disables this check.")                                           \
+          range(0.0, (double)max_uintx)                                     \
 
 #endif // SHARE_VM_GC_G1_G1_GLOBALS_HPP
--- a/src/hotspot/share/gc/parallel/gcTaskThread.cpp	Fri Dec 21 01:29:51 2018 -0800
+++ b/src/hotspot/share/gc/parallel/gcTaskThread.cpp	Wed Jan 02 10:21:54 2019 +0100
@@ -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
@@ -114,7 +114,6 @@
 // for tasks to be enqueued for execution.
 
 void GCTaskThread::run() {
-  this->initialize_named_thread();
   // Bind yourself to your processor.
   if (processor_id() != GCTaskManager::sentinel_worker()) {
     log_trace(gc, task, thread)("GCTaskThread::run: binding to processor %u", processor_id());
--- a/src/hotspot/share/gc/shared/concurrentGCThread.cpp	Fri Dec 21 01:29:51 2018 -0800
+++ b/src/hotspot/share/gc/shared/concurrentGCThread.cpp	Wed Jan 02 10:21:54 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2016, 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
@@ -49,7 +49,6 @@
 }
 
 void ConcurrentGCThread::initialize_in_thread() {
-  this->initialize_named_thread();
   this->set_active_handles(JNIHandleBlock::allocate_block());
   // From this time Thread::current() should be working.
   assert(this == Thread::current(), "just checking");
--- a/src/hotspot/share/gc/shared/ptrQueue.cpp	Fri Dec 21 01:29:51 2018 -0800
+++ b/src/hotspot/share/gc/shared/ptrQueue.cpp	Wed Jan 02 10:21:54 2019 +0100
@@ -54,7 +54,7 @@
       // No work to do.
       qset()->deallocate_buffer(node);
     } else {
-      qset()->enqueue_complete_buffer(node);
+      qset()->enqueue_completed_buffer(node);
     }
     _buf = NULL;
     set_index(0);
@@ -165,11 +165,11 @@
   _completed_buffers_tail(NULL),
   _n_completed_buffers(0),
   _process_completed_buffers_threshold(ProcessCompletedBuffersThresholdNever),
-  _process_completed(false),
-  _all_active(false),
+  _process_completed_buffers(false),
   _notify_when_complete(notify_when_complete),
   _max_completed_buffers(MaxCompletedBuffersUnlimited),
-  _completed_buffers_padding(0)
+  _completed_buffers_padding(0),
+  _all_active(false)
 {}
 
 PtrQueueSet::~PtrQueueSet() {
@@ -211,11 +211,11 @@
       BufferNode* node = BufferNode::make_node_from_buffer(_buf, index());
       _buf = NULL;         // clear shared _buf field
 
-      qset()->enqueue_complete_buffer(node);
+      qset()->enqueue_completed_buffer(node);
       assert(_buf == NULL, "multiple enqueuers appear to be racing");
     } else {
       BufferNode* node = BufferNode::make_node_from_buffer(_buf, index());
-      if (qset()->process_or_enqueue_complete_buffer(node)) {
+      if (qset()->process_or_enqueue_completed_buffer(node)) {
         // Recycle the buffer. No allocation.
         assert(_buf == BufferNode::make_buffer_from_node(node), "invariant");
         assert(capacity() == qset()->buffer_size(), "invariant");
@@ -231,7 +231,7 @@
   reset();
 }
 
-bool PtrQueueSet::process_or_enqueue_complete_buffer(BufferNode* node) {
+bool PtrQueueSet::process_or_enqueue_completed_buffer(BufferNode* node) {
   if (Thread::current()->is_Java_thread()) {
     // If the number of buffers exceeds the limit, make this Java
     // thread do the processing itself.  We don't lock to access
@@ -246,11 +246,11 @@
     }
   }
   // The buffer will be enqueued. The caller will have to get a new one.
-  enqueue_complete_buffer(node);
+  enqueue_completed_buffer(node);
   return false;
 }
 
-void PtrQueueSet::enqueue_complete_buffer(BufferNode* cbn) {
+void PtrQueueSet::enqueue_completed_buffer(BufferNode* cbn) {
   MutexLockerEx x(_cbl_mon, Mutex::_no_safepoint_check_flag);
   cbn->set_next(NULL);
   if (_completed_buffers_tail == NULL) {
@@ -263,35 +263,72 @@
   }
   _n_completed_buffers++;
 
-  if (!_process_completed &&
+  if (!_process_completed_buffers &&
       (_n_completed_buffers > _process_completed_buffers_threshold)) {
-    _process_completed = true;
+    _process_completed_buffers = true;
     if (_notify_when_complete) {
       _cbl_mon->notify();
     }
   }
-  DEBUG_ONLY(assert_completed_buffer_list_len_correct_locked());
+  assert_completed_buffers_list_len_correct_locked();
+}
+
+BufferNode* PtrQueueSet::get_completed_buffer(size_t stop_at) {
+  MutexLockerEx x(_cbl_mon, Mutex::_no_safepoint_check_flag);
+
+  if (_n_completed_buffers <= stop_at) {
+    return NULL;
+  }
+
+  assert(_n_completed_buffers > 0, "invariant");
+  assert(_completed_buffers_head != NULL, "invariant");
+  assert(_completed_buffers_tail != NULL, "invariant");
+
+  BufferNode* bn = _completed_buffers_head;
+  _n_completed_buffers--;
+  _completed_buffers_head = bn->next();
+  if (_completed_buffers_head == NULL) {
+    assert(_n_completed_buffers == 0, "invariant");
+    _completed_buffers_tail = NULL;
+    _process_completed_buffers = false;
+  }
+  assert_completed_buffers_list_len_correct_locked();
+  bn->set_next(NULL);
+  return bn;
 }
 
-size_t PtrQueueSet::completed_buffers_list_length() {
-  size_t n = 0;
-  BufferNode* cbn = _completed_buffers_head;
-  while (cbn != NULL) {
-    n++;
-    cbn = cbn->next();
+void PtrQueueSet::abandon_completed_buffers() {
+  BufferNode* buffers_to_delete = NULL;
+  {
+    MutexLockerEx x(_cbl_mon, Mutex::_no_safepoint_check_flag);
+    buffers_to_delete = _completed_buffers_head;
+    _completed_buffers_head = NULL;
+    _completed_buffers_tail = NULL;
+    _n_completed_buffers = 0;
+    _process_completed_buffers = false;
   }
-  return n;
+  while (buffers_to_delete != NULL) {
+    BufferNode* bn = buffers_to_delete;
+    buffers_to_delete = bn->next();
+    bn->set_next(NULL);
+    deallocate_buffer(bn);
+  }
 }
 
-void PtrQueueSet::assert_completed_buffer_list_len_correct() {
-  MutexLockerEx x(_cbl_mon, Mutex::_no_safepoint_check_flag);
-  assert_completed_buffer_list_len_correct_locked();
+#ifdef ASSERT
+
+void PtrQueueSet::assert_completed_buffers_list_len_correct_locked() {
+  assert_lock_strong(_cbl_mon);
+  size_t n = 0;
+  for (BufferNode* bn = _completed_buffers_head; bn != NULL; bn = bn->next()) {
+    ++n;
+  }
+  assert(n == _n_completed_buffers,
+         "Completed buffer length is wrong: counted: " SIZE_FORMAT
+         ", expected: " SIZE_FORMAT, n, _n_completed_buffers);
 }
 
-void PtrQueueSet::assert_completed_buffer_list_len_correct_locked() {
-  guarantee(completed_buffers_list_length() ==  _n_completed_buffers,
-            "Completed buffer length is wrong.");
-}
+#endif // ASSERT
 
 // Merge lists of buffers. Notify the processing threads.
 // The source queue is emptied as a result. The queues
@@ -315,16 +352,18 @@
   src->_n_completed_buffers = 0;
   src->_completed_buffers_head = NULL;
   src->_completed_buffers_tail = NULL;
+  src->_process_completed_buffers = false;
 
   assert(_completed_buffers_head == NULL && _completed_buffers_tail == NULL ||
          _completed_buffers_head != NULL && _completed_buffers_tail != NULL,
          "Sanity");
+  assert_completed_buffers_list_len_correct_locked();
 }
 
 void PtrQueueSet::notify_if_necessary() {
   MutexLockerEx x(_cbl_mon, Mutex::_no_safepoint_check_flag);
   if (_n_completed_buffers > _process_completed_buffers_threshold) {
-    _process_completed = true;
+    _process_completed_buffers = true;
     if (_notify_when_complete)
       _cbl_mon->notify();
   }
--- a/src/hotspot/share/gc/shared/ptrQueue.hpp	Fri Dec 21 01:29:51 2018 -0800
+++ b/src/hotspot/share/gc/shared/ptrQueue.hpp	Wed Jan 02 10:21:54 2019 +0100
@@ -275,19 +275,16 @@
 // A PtrQueueSet represents resources common to a set of pointer queues.
 // In particular, the individual queues allocate buffers from this shared
 // set, and return completed buffers to the set.
-// All these variables are are protected by the TLOQ_CBL_mon. XXX ???
 class PtrQueueSet {
   BufferNode::Allocator* _allocator;
 
-protected:
   Monitor* _cbl_mon;  // Protects the fields below.
   BufferNode* _completed_buffers_head;
   BufferNode* _completed_buffers_tail;
   size_t _n_completed_buffers;
+
   size_t _process_completed_buffers_threshold;
-  volatile bool _process_completed;
-
-  bool _all_active;
+  volatile bool _process_completed_buffers;
 
   // If true, notify_all on _cbl_mon when the threshold is reached.
   bool _notify_when_complete;
@@ -297,11 +294,11 @@
   size_t _max_completed_buffers;
   size_t _completed_buffers_padding;
 
-  size_t completed_buffers_list_length();
-  void assert_completed_buffer_list_len_correct_locked();
-  void assert_completed_buffer_list_len_correct();
+  void assert_completed_buffers_list_len_correct_locked() NOT_DEBUG_RETURN;
 
 protected:
+  bool _all_active;
+
   // A mutator thread does the the work of processing a buffer.
   // Returns "true" iff the work is complete (and the buffer may be
   // deallocated).
@@ -318,6 +315,12 @@
   // arguments.
   void initialize(Monitor* cbl_mon, BufferNode::Allocator* allocator);
 
+  // For (unlocked!) iteration over the completed buffers.
+  BufferNode* completed_buffers_head() const { return _completed_buffers_head; }
+
+  // Deallocate all of the completed buffers.
+  void abandon_completed_buffers();
+
 public:
 
   // Return the buffer for a BufferNode of size buffer_size().
@@ -327,18 +330,21 @@
   // to have been allocated with a size of buffer_size().
   void deallocate_buffer(BufferNode* node);
 
-  // Declares that "buf" is a complete buffer.
-  void enqueue_complete_buffer(BufferNode* node);
+  // A completed buffer is a buffer the mutator is finished with, and
+  // is ready to be processed by the collector.  It need not be full.
+
+  // Adds node to the completed buffer list.
+  void enqueue_completed_buffer(BufferNode* node);
+
+  // If the number of completed buffers is > stop_at, then remove and
+  // return a completed buffer from the list.  Otherwise, return NULL.
+  BufferNode* get_completed_buffer(size_t stop_at = 0);
 
   // To be invoked by the mutator.
-  bool process_or_enqueue_complete_buffer(BufferNode* node);
+  bool process_or_enqueue_completed_buffer(BufferNode* node);
 
-  bool completed_buffers_exist_dirty() {
-    return _n_completed_buffers > 0;
-  }
-
-  bool process_completed_buffers() { return _process_completed; }
-  void set_process_completed(bool x) { _process_completed = x; }
+  bool process_completed_buffers() { return _process_completed_buffers; }
+  void set_process_completed_buffers(bool x) { _process_completed_buffers = x; }
 
   bool is_active() { return _all_active; }
 
--- a/src/hotspot/share/gc/shared/satbMarkQueue.cpp	Fri Dec 21 01:29:51 2018 -0800
+++ b/src/hotspot/share/gc/shared/satbMarkQueue.cpp	Wed Jan 02 10:21:54 2019 +0100
@@ -180,17 +180,7 @@
 }
 
 bool SATBMarkQueueSet::apply_closure_to_completed_buffer(SATBBufferClosure* cl) {
-  BufferNode* nd = NULL;
-  {
-    MutexLockerEx x(_cbl_mon, Mutex::_no_safepoint_check_flag);
-    if (_completed_buffers_head != NULL) {
-      nd = _completed_buffers_head;
-      _completed_buffers_head = nd->next();
-      if (_completed_buffers_head == NULL) _completed_buffers_tail = NULL;
-      _n_completed_buffers--;
-      if (_n_completed_buffers == 0) _process_completed = false;
-    }
-  }
+  BufferNode* nd = get_completed_buffer();
   if (nd != NULL) {
     void **buf = BufferNode::make_buffer_from_node(nd);
     size_t index = nd->index();
@@ -216,7 +206,7 @@
   tty->cr();
   tty->print_cr("SATB BUFFERS [%s]", msg);
 
-  BufferNode* nd = _completed_buffers_head;
+  BufferNode* nd = completed_buffers_head();
   int i = 0;
   while (nd != NULL) {
     void** buf = BufferNode::make_buffer_from_node(nd);
@@ -238,24 +228,7 @@
 #endif // PRODUCT
 
 void SATBMarkQueueSet::abandon_partial_marking() {
-  BufferNode* buffers_to_delete = NULL;
-  {
-    MutexLockerEx x(_cbl_mon, Mutex::_no_safepoint_check_flag);
-    while (_completed_buffers_head != NULL) {
-      BufferNode* nd = _completed_buffers_head;
-      _completed_buffers_head = nd->next();
-      nd->set_next(buffers_to_delete);
-      buffers_to_delete = nd;
-    }
-    _completed_buffers_tail = NULL;
-    _n_completed_buffers = 0;
-    DEBUG_ONLY(assert_completed_buffer_list_len_correct_locked());
-  }
-  while (buffers_to_delete != NULL) {
-    BufferNode* nd = buffers_to_delete;
-    buffers_to_delete = nd->next();
-    deallocate_buffer(nd);
-  }
+  abandon_completed_buffers();
   assert(SafepointSynchronize::is_at_safepoint(), "Must be at safepoint.");
   // So we can safely manipulate these queues.
   for (JavaThreadIteratorWithHandle jtiwh; JavaThread *t = jtiwh.next(); ) {
--- a/src/hotspot/share/gc/shared/workgroup.cpp	Fri Dec 21 01:29:51 2018 -0800
+++ b/src/hotspot/share/gc/shared/workgroup.cpp	Wed Jan 02 10:21:54 2019 +0100
@@ -297,7 +297,6 @@
 }
 
 void AbstractGangWorker::initialize() {
-  this->initialize_named_thread();
   assert(_gang != NULL, "No gang to run in");
   os::set_priority(this, NearMaxPriority);
   log_develop_trace(gc, workgang)("Running gang worker for gang %s id %u", gang()->name(), id());
--- a/src/hotspot/share/gc/z/zArguments.cpp	Fri Dec 21 01:29:51 2018 -0800
+++ b/src/hotspot/share/gc/z/zArguments.cpp	Wed Jan 02 10:21:54 2019 +0100
@@ -19,7 +19,6 @@
  * 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.
- *
  */
 
 #include "precompiled.hpp"
@@ -91,6 +90,9 @@
   // Verification of stacks not (yet) supported, for the same reason
   // we need fixup_partial_loads
   DEBUG_ONLY(FLAG_SET_DEFAULT(VerifyStack, false));
+
+  // Initialize platform specific arguments
+  initialize_platform();
 }
 
 CollectedHeap* ZArguments::create_heap() {
--- a/src/hotspot/share/gc/z/zArguments.hpp	Fri Dec 21 01:29:51 2018 -0800
+++ b/src/hotspot/share/gc/z/zArguments.hpp	Wed Jan 02 10:21:54 2019 +0100
@@ -29,6 +29,9 @@
 class CollectedHeap;
 
 class ZArguments : public GCArguments {
+private:
+  void initialize_platform();
+
 public:
   virtual void initialize();
   virtual size_t conservative_max_heap_alignment();
--- a/src/hotspot/share/jfr/periodic/sampling/jfrThreadSampler.cpp	Fri Dec 21 01:29:51 2018 -0800
+++ b/src/hotspot/share/jfr/periodic/sampling/jfrThreadSampler.cpp	Wed Jan 02 10:21:54 2019 +0100
@@ -287,13 +287,13 @@
 
 void JfrThreadSampleClosure::commit_events(JfrSampleType type) {
   if (JAVA_SAMPLE == type) {
-    assert(_added_java <= MAX_NR_OF_JAVA_SAMPLES, "invariant");
+    assert(_added_java > 0 && _added_java <= MAX_NR_OF_JAVA_SAMPLES, "invariant");
     for (uint i = 0; i < _added_java; ++i) {
       _events[i].commit();
     }
   } else {
     assert(NATIVE_SAMPLE == type, "invariant");
-    assert(_added_native <= MAX_NR_OF_NATIVE_SAMPLES, "invariant");
+    assert(_added_native > 0 && _added_native <= MAX_NR_OF_NATIVE_SAMPLES, "invariant");
     for (uint i = 0; i < _added_native; ++i) {
       _events_native[i].commit();
     }
@@ -335,7 +335,8 @@
   void set_native_interval(size_t interval) { _interval_native = interval; };
   size_t get_java_interval() { return _interval_java; };
   size_t get_native_interval() { return _interval_native; };
-
+ protected:
+  virtual void post_run();
  public:
   void run();
   static Monitor* transition_block() { return JfrThreadSampler_lock; }
@@ -484,6 +485,10 @@
       last_native_ms = get_monotonic_ms();
     }
   }
+}
+
+void JfrThreadSampler::post_run() {
+  this->NonJavaThread::post_run();
   delete this;
 }
 
@@ -495,7 +500,7 @@
   JfrThreadSampleClosure sample_task(samples, samples_native);
 
   const uint sample_limit = JAVA_SAMPLE == type ? MAX_NR_OF_JAVA_SAMPLES : MAX_NR_OF_NATIVE_SAMPLES;
-  uint num_sample_attempts = 0;
+  uint num_samples = 0;
   JavaThread* start = NULL;
 
   {
@@ -509,7 +514,7 @@
       _cur_index = tlh.list()->find_index_of_JavaThread(*last_thread);
       JavaThread* current = _cur_index != -1 ? *last_thread : NULL;
 
-      while (num_sample_attempts < sample_limit) {
+      while (num_samples < sample_limit) {
         current = next_thread(tlh.list(), start, current);
         if (current == NULL) {
           break;
@@ -520,8 +525,9 @@
         if (current->is_Compiler_thread()) {
           continue;
         }
-        sample_task.do_sample_thread(current, _frames, _max_frames, type);
-        num_sample_attempts++;
+        if (sample_task.do_sample_thread(current, _frames, _max_frames, type)) {
+          num_samples++;
+        }
       }
       *last_thread = current;  // remember the thread we last attempted to sample
     }
@@ -529,7 +535,7 @@
     log_trace(jfr)("JFR thread sampling done in %3.7f secs with %d java %d native samples",
                    sample_time.seconds(), sample_task.java_entries(), sample_task.native_entries());
   }
-  if (num_sample_attempts > 0) {
+  if (num_samples > 0) {
     sample_task.commit_events(type);
   }
 }
--- a/src/hotspot/share/libadt/dict.cpp	Fri Dec 21 01:29:51 2018 -0800
+++ b/src/hotspot/share/libadt/dict.cpp	Wed Jan 02 10:21:54 2019 +0100
@@ -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
@@ -161,7 +161,7 @@
 
 //------------------------------Dict-----------------------------------------
 // Deep copy a dictionary.
-Dict::Dict( const Dict &d ) : _arena(d._arena), _size(d._size), _cnt(d._cnt), _hash(d._hash), _cmp(d._cmp) {
+Dict::Dict( const Dict &d ) : ResourceObj(d), _arena(d._arena), _size(d._size), _cnt(d._cnt), _hash(d._hash), _cmp(d._cmp) {
   _bin = (bucket*)_arena->Amalloc_4(sizeof(bucket)*_size);
   memcpy( (void*)_bin, (void*)d._bin, sizeof(bucket)*_size );
   for( uint i=0; i<_size; i++ ) {
--- a/src/hotspot/share/libadt/set.hpp	Fri Dec 21 01:29:51 2018 -0800
+++ b/src/hotspot/share/libadt/set.hpp	Wed Jan 02 10:21:54 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2010, 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
@@ -112,16 +112,15 @@
 
 //------------------------------Set--------------------------------------------
 class Set : public ResourceObj {
- public:
+ protected:
 
   // Creates a new, empty set.
-  // DO NOT CONSTRUCT A Set.  THIS IS AN ABSTRACT CLASS, FOR INHERITENCE ONLY
   Set(Arena *arena) : _set_arena(arena) {};
 
   // Creates a new set from an existing set
-  // DO NOT CONSTRUCT A Set.  THIS IS AN ABSTRACT CLASS, FOR INHERITENCE ONLY
-  Set(const Set &) {};
+  Set(const Set & s) : ResourceObj(s) {};
 
+ public:
   // Set assignment; deep-copy guts
   virtual Set &operator =(const Set &s)=0;
   virtual Set &clone(void) const=0;
--- a/src/hotspot/share/memory/allocation.cpp	Fri Dec 21 01:29:51 2018 -0800
+++ b/src/hotspot/share/memory/allocation.cpp	Wed Jan 02 10:21:54 2019 +0100
@@ -162,78 +162,81 @@
 
 #ifdef ASSERT
 void ResourceObj::set_allocation_type(address res, allocation_type type) {
-    // Set allocation type in the resource object
-    uintptr_t allocation = (uintptr_t)res;
-    assert((allocation & allocation_mask) == 0, "address should be aligned to 4 bytes at least: " INTPTR_FORMAT, p2i(res));
-    assert(type <= allocation_mask, "incorrect allocation type");
-    ResourceObj* resobj = (ResourceObj *)res;
-    resobj->_allocation_t[0] = ~(allocation + type);
-    if (type != STACK_OR_EMBEDDED) {
-      // Called from operator new() and CollectionSetChooser(),
-      // set verification value.
-      resobj->_allocation_t[1] = (uintptr_t)&(resobj->_allocation_t[1]) + type;
-    }
+  // Set allocation type in the resource object
+  uintptr_t allocation = (uintptr_t)res;
+  assert((allocation & allocation_mask) == 0, "address should be aligned to 4 bytes at least: " INTPTR_FORMAT, p2i(res));
+  assert(type <= allocation_mask, "incorrect allocation type");
+  ResourceObj* resobj = (ResourceObj *)res;
+  resobj->_allocation_t[0] = ~(allocation + type);
+  if (type != STACK_OR_EMBEDDED) {
+    // Called from operator new() and CollectionSetChooser(),
+    // set verification value.
+    resobj->_allocation_t[1] = (uintptr_t)&(resobj->_allocation_t[1]) + type;
+  }
 }
 
 ResourceObj::allocation_type ResourceObj::get_allocation_type() const {
-    assert(~(_allocation_t[0] | allocation_mask) == (uintptr_t)this, "lost resource object");
-    return (allocation_type)((~_allocation_t[0]) & allocation_mask);
+  assert(~(_allocation_t[0] | allocation_mask) == (uintptr_t)this, "lost resource object");
+  return (allocation_type)((~_allocation_t[0]) & allocation_mask);
 }
 
 bool ResourceObj::is_type_set() const {
-    allocation_type type = (allocation_type)(_allocation_t[1] & allocation_mask);
-    return get_allocation_type()  == type &&
-           (_allocation_t[1] - type) == (uintptr_t)(&_allocation_t[1]);
+  allocation_type type = (allocation_type)(_allocation_t[1] & allocation_mask);
+  return get_allocation_type()  == type &&
+         (_allocation_t[1] - type) == (uintptr_t)(&_allocation_t[1]);
 }
 
-ResourceObj::ResourceObj() { // default constructor
-    if (~(_allocation_t[0] | allocation_mask) != (uintptr_t)this) {
-      // Operator new() is not called for allocations
-      // on stack and for embedded objects.
-      set_allocation_type((address)this, STACK_OR_EMBEDDED);
-    } else if (allocated_on_stack()) { // STACK_OR_EMBEDDED
-      // For some reason we got a value which resembles
-      // an embedded or stack object (operator new() does not
-      // set such type). Keep it since it is valid value
-      // (even if it was garbage).
-      // Ignore garbage in other fields.
-    } else if (is_type_set()) {
-      // Operator new() was called and type was set.
-      assert(!allocated_on_stack(),
-             "not embedded or stack, this(" PTR_FORMAT ") type %d a[0]=(" PTR_FORMAT ") a[1]=(" PTR_FORMAT ")",
-             p2i(this), get_allocation_type(), _allocation_t[0], _allocation_t[1]);
-    } else {
-      // Operator new() was not called.
-      // Assume that it is embedded or stack object.
-      set_allocation_type((address)this, STACK_OR_EMBEDDED);
-    }
-    _allocation_t[1] = 0; // Zap verification value
+// This whole business of passing information from ResourceObj::operator new
+// to the ResourceObj constructor via fields in the "object" is technically UB.
+// But it seems to work within the limitations of HotSpot usage (such as no
+// multiple inheritance) with the compilers and compiler options we're using.
+// And it gives some possibly useful checking for misuse of ResourceObj.
+void ResourceObj::initialize_allocation_info() {
+  if (~(_allocation_t[0] | allocation_mask) != (uintptr_t)this) {
+    // Operator new() is not called for allocations
+    // on stack and for embedded objects.
+    set_allocation_type((address)this, STACK_OR_EMBEDDED);
+  } else if (allocated_on_stack()) { // STACK_OR_EMBEDDED
+    // For some reason we got a value which resembles
+    // an embedded or stack object (operator new() does not
+    // set such type). Keep it since it is valid value
+    // (even if it was garbage).
+    // Ignore garbage in other fields.
+  } else if (is_type_set()) {
+    // Operator new() was called and type was set.
+    assert(!allocated_on_stack(),
+           "not embedded or stack, this(" PTR_FORMAT ") type %d a[0]=(" PTR_FORMAT ") a[1]=(" PTR_FORMAT ")",
+           p2i(this), get_allocation_type(), _allocation_t[0], _allocation_t[1]);
+  } else {
+    // Operator new() was not called.
+    // Assume that it is embedded or stack object.
+    set_allocation_type((address)this, STACK_OR_EMBEDDED);
+  }
+  _allocation_t[1] = 0; // Zap verification value
 }
 
-ResourceObj::ResourceObj(const ResourceObj& r) { // default copy constructor
-    // Used in ClassFileParser::parse_constant_pool_entries() for ClassFileStream.
-    // Note: garbage may resembles valid value.
-    assert(~(_allocation_t[0] | allocation_mask) != (uintptr_t)this || !is_type_set(),
-           "embedded or stack only, this(" PTR_FORMAT ") type %d a[0]=(" PTR_FORMAT ") a[1]=(" PTR_FORMAT ")",
-           p2i(this), get_allocation_type(), _allocation_t[0], _allocation_t[1]);
-    set_allocation_type((address)this, STACK_OR_EMBEDDED);
-    _allocation_t[1] = 0; // Zap verification value
+ResourceObj::ResourceObj() {
+  initialize_allocation_info();
 }
 
-ResourceObj& ResourceObj::operator=(const ResourceObj& r) { // default copy assignment
-    // Used in InlineTree::ok_to_inline() for WarmCallInfo.
-    assert(allocated_on_stack(),
-           "copy only into local, this(" PTR_FORMAT ") type %d a[0]=(" PTR_FORMAT ") a[1]=(" PTR_FORMAT ")",
-           p2i(this), get_allocation_type(), _allocation_t[0], _allocation_t[1]);
-    // Keep current _allocation_t value;
-    return *this;
+ResourceObj::ResourceObj(const ResourceObj&) {
+  // Initialize _allocation_t as a new object, ignoring object being copied.
+  initialize_allocation_info();
+}
+
+ResourceObj& ResourceObj::operator=(const ResourceObj& r) {
+  assert(allocated_on_stack(),
+         "copy only into local, this(" PTR_FORMAT ") type %d a[0]=(" PTR_FORMAT ") a[1]=(" PTR_FORMAT ")",
+         p2i(this), get_allocation_type(), _allocation_t[0], _allocation_t[1]);
+  // Keep current _allocation_t value;
+  return *this;
 }
 
 ResourceObj::~ResourceObj() {
-    // allocated_on_C_heap() also checks that encoded (in _allocation) address == this.
-    if (!allocated_on_C_heap()) { // ResourceObj::delete() will zap _allocation for C_heap.
-      _allocation_t[0] = (uintptr_t)badHeapOopVal; // zap type
-    }
+  // allocated_on_C_heap() also checks that encoded (in _allocation) address == this.
+  if (!allocated_on_C_heap()) { // ResourceObj::delete() will zap _allocation for C_heap.
+    _allocation_t[0] = (uintptr_t)badHeapOopVal; // zap type
+  }
 }
 #endif // ASSERT
 
--- a/src/hotspot/share/memory/allocation.hpp	Fri Dec 21 01:29:51 2018 -0800
+++ b/src/hotspot/share/memory/allocation.hpp	Wed Jan 02 10:21:54 2019 +0100
@@ -365,12 +365,14 @@
   // Use second array's element for verification value to distinguish garbage.
   uintptr_t _allocation_t[2];
   bool is_type_set() const;
+  void initialize_allocation_info();
  public:
   allocation_type get_allocation_type() const;
   bool allocated_on_stack()    const { return get_allocation_type() == STACK_OR_EMBEDDED; }
   bool allocated_on_res_area() const { return get_allocation_type() == RESOURCE_AREA; }
   bool allocated_on_C_heap()   const { return get_allocation_type() == C_HEAP; }
   bool allocated_on_arena()    const { return get_allocation_type() == ARENA; }
+protected:
   ResourceObj(); // default constructor
   ResourceObj(const ResourceObj& r); // default copy constructor
   ResourceObj& operator=(const ResourceObj& r); // default copy assignment
--- a/src/hotspot/share/runtime/arguments.cpp	Fri Dec 21 01:29:51 2018 -0800
+++ b/src/hotspot/share/runtime/arguments.cpp	Wed Jan 02 10:21:54 2019 +0100
@@ -41,7 +41,6 @@
 #include "oops/oop.inline.hpp"
 #include "prims/jvmtiExport.hpp"
 #include "runtime/arguments.hpp"
-#include "runtime/arguments_ext.hpp"
 #include "runtime/flags/jvmFlag.hpp"
 #include "runtime/flags/jvmFlagConstraintList.hpp"
 #include "runtime/flags/jvmFlagWriteableList.hpp"
@@ -3544,9 +3543,6 @@
 
   for (int index = 0; index < args->nOptions; index++) {
     const JavaVMOption* option = args->options + index;
-    if (ArgumentsExt::process_options(option)) {
-      continue;
-    }
     if (match_option(option, "-XX:Flags=", &tail)) {
       Arguments::set_jvm_flags_file(tail);
       continue;
@@ -3813,8 +3809,6 @@
   UNSUPPORTED_OPTION(AllocateHeapAt);
 #endif
 
-  ArgumentsExt::report_unsupported_options();
-
 #ifndef PRODUCT
   if (TraceBytecodesAt != 0) {
     TraceBytecodes = true;
--- a/src/hotspot/share/runtime/arguments_ext.hpp	Fri Dec 21 01:29:51 2018 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-/*
- * Copyright (c) 2014, 2017, 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.
- *
- */
-
-#ifndef SHARE_VM_RUNTIME_ARGUMENTS_EXT_HPP
-#define SHARE_VM_RUNTIME_ARGUMENTS_EXT_HPP
-
-#include "memory/allocation.hpp"
-#include "runtime/arguments.hpp"
-
-class ArgumentsExt: AllStatic {
-public:
-  // The argument processing extension. Returns true if there is
-  // no additional parsing needed in Arguments::parse() for the option.
-  // Otherwise returns false.
-  static inline bool process_options(const JavaVMOption *option) { return false; }
-  static inline void report_unsupported_options() { }
-};
-
-#endif // SHARE_VM_RUNTIME_ARGUMENTS_EXT_HPP
--- a/src/hotspot/share/runtime/sweeper.cpp	Fri Dec 21 01:29:51 2018 -0800
+++ b/src/hotspot/share/runtime/sweeper.cpp	Wed Jan 02 10:21:54 2019 +0100
@@ -149,7 +149,7 @@
 long     NMethodSweeper::_last_sweep                   = 0;    // Value of _time_counter when the last sweep happened
 int      NMethodSweeper::_seen                         = 0;    // Nof. nmethod we have currently processed in current pass of CodeCache
 
-volatile bool NMethodSweeper::_should_sweep            = true; // Indicates if we should invoke the sweeper
+volatile bool NMethodSweeper::_should_sweep            = false;// Indicates if we should invoke the sweeper
 volatile bool NMethodSweeper::_force_sweep             = false;// Indicates if we should force a sweep
 volatile int  NMethodSweeper::_bytes_changed           = 0;    // Counts the total nmethod size if the nmethod changed from:
                                                                //   1) alive       -> not_entrant
@@ -717,12 +717,6 @@
     // stack we can safely convert it to a zombie method
     OrderAccess::loadload(); // _stack_traversal_mark and _state
     if (cm->can_convert_to_zombie()) {
-      // Clear ICStubs to prevent back patching stubs of zombie or flushed
-      // nmethods during the next safepoint (see ICStub::finalize).
-      {
-        CompiledICLocker ml(cm);
-        cm->clear_ic_stubs();
-      }
       // Code cache state change is tracked in make_zombie()
       cm->make_zombie();
       SWEEP(cm);
--- a/src/hotspot/share/runtime/thread.cpp	Fri Dec 21 01:29:51 2018 -0800
+++ b/src/hotspot/share/runtime/thread.cpp	Wed Jan 02 10:21:54 2019 +0100
@@ -213,8 +213,12 @@
 // Base class for all threads: VMThread, WatcherThread, ConcurrentMarkSweepThread,
 // JavaThread
 
+DEBUG_ONLY(Thread* Thread::_starting_thread = NULL;)
 
 Thread::Thread() {
+
+  DEBUG_ONLY(_run_state = PRE_CALL_RUN;)
+
   // stack and get_thread
   set_stack_base(NULL);
   set_stack_size(0);
@@ -231,7 +235,7 @@
   set_active_handles(NULL);
   set_free_handle_block(NULL);
   set_last_handle_mark(NULL);
-  DEBUG_ONLY(_missed_ic_stub_refill_mark = NULL);
+  DEBUG_ONLY(_missed_ic_stub_refill_verifier = NULL);
 
   // This initial value ==> never claimed.
   _oops_do_parity = 0;
@@ -314,11 +318,11 @@
   if (barrier_set != NULL) {
     barrier_set->on_thread_create(this);
   } else {
-#ifdef ASSERT
-    static bool initial_thread_created = false;
-    assert(!initial_thread_created, "creating thread before barrier set");
-    initial_thread_created = true;
-#endif // ASSERT
+    // Only the main thread should be created before the barrier set
+    // and that happens just before Thread::current is set. No other thread
+    // can attach as the VM is not created yet, so they can't execute this code.
+    // If the main thread creates other threads before the barrier set that is an error.
+    assert(Thread::current_or_null() == NULL, "creating thread before barrier set");
   }
 }
 
@@ -368,9 +372,16 @@
 #endif // INCLUDE_NMT
 
 void Thread::call_run() {
+  DEBUG_ONLY(_run_state = CALL_RUN;)
+
   // At this point, Thread object should be fully initialized and
   // Thread::current() should be set.
 
+  assert(Thread::current_or_null() != NULL, "current thread is unset");
+  assert(Thread::current_or_null() == this, "current thread is wrong");
+
+  // Perform common initialization actions
+
   register_thread_stack_with_NMT();
 
   JFR_ONLY(Jfr::on_thread_start(this);)
@@ -380,25 +391,42 @@
     os::current_thread_id(), p2i(stack_base() - stack_size()),
     p2i(stack_base()), stack_size()/1024);
 
+  // Perform <ChildClass> initialization actions
+  DEBUG_ONLY(_run_state = PRE_RUN;)
+  this->pre_run();
+
   // Invoke <ChildClass>::run()
+  DEBUG_ONLY(_run_state = RUN;)
   this->run();
   // Returned from <ChildClass>::run(). Thread finished.
 
-  // Note: at this point the thread object may already have deleted itself.
-  // So from here on do not dereference *this*.
-
-  // If a thread has not deleted itself ("delete this") as part of its
-  // termination sequence, we have to ensure thread-local-storage is
-  // cleared before we actually terminate. No threads should ever be
-  // deleted asynchronously with respect to their termination.
-  if (Thread::current_or_null_safe() != NULL) {
-    assert(Thread::current_or_null_safe() == this, "current thread is wrong");
-    Thread::clear_thread_current();
-  }
-
+  // Perform common tear-down actions
+
+  assert(Thread::current_or_null() != NULL, "current thread is unset");
+  assert(Thread::current_or_null() == this, "current thread is wrong");
+
+  // Perform <ChildClass> tear-down actions
+  DEBUG_ONLY(_run_state = POST_RUN;)
+  this->post_run();
+
+  // Note: at this point the thread object may already have deleted itself,
+  // so from here on do not dereference *this*. Not all thread types currently
+  // delete themselves when they terminate. But no thread should ever be deleted
+  // asynchronously with respect to its termination - that is what _run_state can
+  // be used to check.
+
+  assert(Thread::current_or_null() == NULL, "current thread still present");
 }
 
 Thread::~Thread() {
+
+  // Attached threads will remain in PRE_CALL_RUN, as will threads that don't actually
+  // get started due to errors etc. Any active thread should at least reach post_run
+  // before it is deleted (usually in post_run()).
+  assert(_run_state == PRE_CALL_RUN ||
+         _run_state == POST_RUN, "Active Thread deleted before post_run(): "
+         "_run_state=%d", (int)_run_state);
+
   // Notify the barrier set that a thread is being destroyed. Note that a barrier
   // set might not be available if we encountered errors during bootstrapping.
   BarrierSet* const barrier_set = BarrierSet::barrier_set();
@@ -445,9 +473,10 @@
   // osthread() can be NULL, if creation of thread failed.
   if (osthread() != NULL) os::free_thread(osthread());
 
-  // clear Thread::current if thread is deleting itself.
+  // Clear Thread::current if thread is deleting itself and it has not
+  // already been done. This must be done before the memory is deallocated.
   // Needed to ensure JNI correctly detects non-attached threads.
-  if (this == Thread::current()) {
+  if (this == Thread::current_or_null()) {
     Thread::clear_thread_current();
   }
 
@@ -1051,7 +1080,10 @@
 }
 
 bool Thread::set_as_starting_thread() {
+  assert(_starting_thread == NULL, "already initialized: "
+         "_starting_thread=" INTPTR_FORMAT, p2i(_starting_thread));
   // NOTE: this must be called inside the main thread.
+  DEBUG_ONLY(_starting_thread = this;)
   return os::create_main_thread((JavaThread*)this);
 }
 
@@ -1254,27 +1286,48 @@
 }
 
 NonJavaThread::NonJavaThread() : Thread(), _next(NULL) {
-  // Add this thread to _the_list.
+  assert(BarrierSet::barrier_set() != NULL, "NonJavaThread created too soon!");
+}
+
+NonJavaThread::~NonJavaThread() { }
+
+void NonJavaThread::add_to_the_list() {
   MutexLockerEx lock(NonJavaThreadsList_lock, Mutex::_no_safepoint_check_flag);
   _next = _the_list._head;
   OrderAccess::release_store(&_the_list._head, this);
 }
 
-NonJavaThread::~NonJavaThread() {
-  JFR_ONLY(Jfr::on_thread_exit(this);)
-  // Remove this thread from _the_list.
+void NonJavaThread::remove_from_the_list() {
   MutexLockerEx lock(NonJavaThreadsList_lock, Mutex::_no_safepoint_check_flag);
   NonJavaThread* volatile* p = &_the_list._head;
   for (NonJavaThread* t = *p; t != NULL; p = &t->_next, t = *p) {
     if (t == this) {
       *p = this->_next;
-      // Wait for any in-progress iterators.
+      // Wait for any in-progress iterators.  Concurrent synchronize is
+      // not allowed, so do it while holding the list lock.
       _the_list._protect.synchronize();
       break;
     }
   }
 }
 
+void NonJavaThread::pre_run() {
+  assert(BarrierSet::barrier_set() != NULL, "invariant");
+  add_to_the_list();
+
+  // This is slightly odd in that NamedThread is a subclass, but
+  // in fact name() is defined in Thread
+  assert(this->name() != NULL, "thread name was not set before it was started");
+  this->set_native_thread_name(this->name());
+}
+
+void NonJavaThread::post_run() {
+  JFR_ONLY(Jfr::on_thread_exit(this);)
+  remove_from_the_list();
+  // Ensure thread-local-storage is cleared before termination.
+  Thread::clear_thread_current();
+}
+
 // NamedThread --  non-JavaThread subclasses with multiple
 // uniquely named instances should derive from this.
 NamedThread::NamedThread() :
@@ -1301,10 +1354,6 @@
   va_end(ap);
 }
 
-void NamedThread::initialize_named_thread() {
-  set_native_thread_name(name());
-}
-
 void NamedThread::print_on(outputStream* st) const {
   st->print("\"%s\" ", name());
   Thread::print_on(st);
@@ -1401,7 +1450,6 @@
 void WatcherThread::run() {
   assert(this == watcher_thread(), "just checking");
 
-  this->set_native_thread_name(this->name());
   this->set_active_handles(JNIHandleBlock::allocate_block());
   while (true) {
     assert(watcher_thread() == Thread::current(), "thread consistency check");
@@ -1757,19 +1805,30 @@
 }
 
 
-// The first routine called by a new Java thread
+// First JavaThread specific code executed by a new Java thread.
+void JavaThread::pre_run() {
+  // empty - see comments in run()
+}
+
+// The main routine called by a new Java thread. This isn't overridden
+// by subclasses, instead different subclasses define a different "entry_point"
+// which defines the actual logic for that kind of thread.
 void JavaThread::run() {
   // initialize thread-local alloc buffer related fields
   this->initialize_tlab();
 
-  // used to test validity of stack trace backs
+  // Used to test validity of stack trace backs.
+  // This can't be moved into pre_run() else we invalidate
+  // the requirement that thread_main_inner is lower on
+  // the stack. Consequently all the initialization logic
+  // stays here in run() rather than pre_run().
   this->record_base_of_stack_pointer();
 
   this->create_stack_guard_pages();
 
   this->cache_global_variables();
 
-  // Thread is now sufficient initialized to be handled by the safepoint code as being
+  // Thread is now sufficiently initialized to be handled by the safepoint code as being
   // in the VM. Change thread state from _thread_new to _thread_in_vm
   ThreadStateTransition::transition_and_fence(this, _thread_new, _thread_in_vm);
 
@@ -1788,13 +1847,10 @@
   }
 
   // We call another function to do the rest so we are sure that the stack addresses used
-  // from there will be lower than the stack base just computed
+  // from there will be lower than the stack base just computed.
   thread_main_inner();
-
-  // Note, thread is no longer valid at this point!
 }
 
-
 void JavaThread::thread_main_inner() {
   assert(JavaThread::current() == this, "sanity check");
   assert(this->threadObj() != NULL, "just checking");
@@ -1814,11 +1870,17 @@
 
   DTRACE_THREAD_PROBE(stop, this);
 
+  // Cleanup is handled in post_run()
+}
+
+// Shared teardown for all JavaThreads
+void JavaThread::post_run() {
   this->exit(false);
+  // Defer deletion to here to ensure 'this' is still referenceable in call_run
+  // for any shared tear-down.
   this->smr_delete();
 }
 
-
 static void ensure_join(JavaThread* thread) {
   // We do not need to grab the Threads_lock, since we are operating on ourself.
   Handle threadObj(thread, thread->threadObj());
--- a/src/hotspot/share/runtime/thread.hpp	Fri Dec 21 01:29:51 2018 -0800
+++ b/src/hotspot/share/runtime/thread.hpp	Wed Jan 02 10:21:54 2019 +0100
@@ -81,6 +81,7 @@
 
 class GCTaskQueue;
 class ThreadClosure;
+class ICRefillVerifier;
 class IdealGraphPrinter;
 
 class Metadata;
@@ -109,6 +110,27 @@
 // This means !t->is_Java_thread() iff t is a NonJavaThread, or t is
 // a partially constructed/destroyed Thread.
 
+// Thread execution sequence and actions:
+// All threads:
+//  - thread_native_entry  // per-OS native entry point
+//    - stack initialization
+//    - other OS-level initialization (signal masks etc)
+//    - handshake with creating thread (if not started suspended)
+//    - this->call_run()  // common shared entry point
+//      - shared common initialization
+//      - this->pre_run()  // virtual per-thread-type initialization
+//      - this->run()      // virtual per-thread-type "main" logic
+//      - shared common tear-down
+//      - this->post_run()  // virtual per-thread-type tear-down
+//      - // 'this' no longer referenceable
+//    - OS-level tear-down (minimal)
+//    - final logging
+//
+// For JavaThread:
+//   - this->run()  // virtual but not normally overridden
+//     - this->thread_main_inner()  // extra call level to ensure correct stack calculations
+//       - this->entry_point()  // set differently for each kind of JavaThread
+
 class Thread: public ThreadShadow {
   friend class VMStructs;
   friend class JVMCIVMStructs;
@@ -119,7 +141,6 @@
   static THREAD_LOCAL_DECL Thread* _thr_current;
 #endif
 
- private:
   // Thread local data area available to the GC. The internal
   // structure and contents of this data area is GC-specific.
   // Only GC and GC barrier code should access this data area.
@@ -141,6 +162,9 @@
   // const char* _exception_file;                   // file information for exception (debugging only)
   // int         _exception_line;                   // line information for exception (debugging only)
  protected:
+
+  DEBUG_ONLY(static Thread* _starting_thread;)
+
   // Support for forcing alignment of thread objects for biased locking
   void*       _real_malloc_address;
 
@@ -329,15 +353,15 @@
  private:
 
 #ifdef ASSERT
-  void* _missed_ic_stub_refill_mark;
+  ICRefillVerifier* _missed_ic_stub_refill_verifier;
 
  public:
-  void* missed_ic_stub_refill_mark() {
-    return _missed_ic_stub_refill_mark;
+  ICRefillVerifier* missed_ic_stub_refill_verifier() {
+    return _missed_ic_stub_refill_verifier;
   }
 
-  void set_missed_ic_stub_refill_mark(void* mark) {
-    _missed_ic_stub_refill_mark = mark;
+  void set_missed_ic_stub_refill_verifier(ICRefillVerifier* verifier) {
+    _missed_ic_stub_refill_verifier = verifier;
   }
 #endif
 
@@ -417,6 +441,21 @@
  protected:
   // To be implemented by children.
   virtual void run() = 0;
+  virtual void pre_run() = 0;
+  virtual void post_run() = 0;  // Note: Thread must not be deleted prior to calling this!
+
+#ifdef ASSERT
+  enum RunState {
+    PRE_CALL_RUN,
+    CALL_RUN,
+    PRE_RUN,
+    RUN,
+    POST_RUN
+    // POST_CALL_RUN - can't define this one as 'this' may be deleted when we want to set it
+  };
+  RunState _run_state;  // for lifecycle checks
+#endif
+
 
  public:
   // invokes <ChildThreadClass>::run(), with common preparations and cleanups.
@@ -795,6 +834,13 @@
   class List;
   static List _the_list;
 
+  void add_to_the_list();
+  void remove_from_the_list();
+
+ protected:
+  virtual void pre_run();
+  virtual void post_run();
+
  public:
   NonJavaThread();
   ~NonJavaThread();
@@ -802,12 +848,12 @@
   class Iterator;
 };
 
-// Provides iteration over the list of NonJavaThreads.  Because list
-// management occurs in the NonJavaThread constructor and destructor,
-// entries in the list may not be fully constructed instances of a
-// derived class.  Threads created after an iterator is constructed
-// will not be visited by the iterator.  The scope of an iterator is a
-// critical section; there must be no safepoint checks in that scope.
+// Provides iteration over the list of NonJavaThreads.
+// List addition occurs in pre_run(), and removal occurs in post_run(),
+// so that only live fully-initialized threads can be found in the list.
+// Threads created after an iterator is constructed will not be visited
+// by the iterator. The scope of an iterator is a critical section; there
+// must be no safepoint checks in that scope.
 class NonJavaThread::Iterator : public StackObj {
   uint _protect_enter;
   NonJavaThread* _current;
@@ -843,7 +889,6 @@
   ~NamedThread();
   // May only be called once per thread.
   void set_name(const char* format, ...)  ATTRIBUTE_PRINTF(2, 3);
-  void initialize_named_thread();
   virtual bool is_Named_thread() const { return true; }
   virtual char* name() const { return _name == NULL ? (char*)"Unknown Thread" : _name; }
   JavaThread *processed_thread() { return _processed_thread; }
@@ -874,7 +919,7 @@
 // A single WatcherThread is used for simulating timer interrupts.
 class WatcherThread: public NonJavaThread {
   friend class VMStructs;
- public:
+ protected:
   virtual void run();
 
  private:
@@ -1831,9 +1876,9 @@
   void print_name_on_error(outputStream* st, char* buf, int buflen) const;
   void verify();
   const char* get_thread_name() const;
- private:
+ protected:
   // factor out low-level mechanics for use in both normal and error cases
-  const char* get_thread_name_string(char* buf = NULL, int buflen = 0) const;
+  virtual const char* get_thread_name_string(char* buf = NULL, int buflen = 0) const;
  public:
   const char* get_threadgroup_name() const;
   const char* get_parent_name() const;
@@ -1886,9 +1931,12 @@
 
   inline CompilerThread* as_CompilerThread();
 
- public:
+ protected:
+  virtual void pre_run();
   virtual void run();
   void thread_main_inner();
+  virtual void post_run();
+
 
  private:
   GrowableArray<oop>* _array_for_gc;
--- a/src/hotspot/share/runtime/vmThread.cpp	Fri Dec 21 01:29:51 2018 -0800
+++ b/src/hotspot/share/runtime/vmThread.cpp	Wed Jan 02 10:21:54 2019 +0100
@@ -285,8 +285,6 @@
 void VMThread::run() {
   assert(this == vm_thread(), "check");
 
-  this->initialize_named_thread();
-
   // Notify_lock wait checks on active_handles() to rewait in
   // case of spurious wakeup, it should wait on the last
   // value set prior to the notify
--- a/src/hotspot/share/services/diagnosticCommand.hpp	Fri Dec 21 01:29:51 2018 -0800
+++ b/src/hotspot/share/services/diagnosticCommand.hpp	Wed Jan 02 10:21:54 2019 +0100
@@ -34,7 +34,6 @@
 #include "runtime/vmThread.hpp"
 #include "services/diagnosticArgument.hpp"
 #include "services/diagnosticCommand.hpp"
-#include "services/diagnosticCommand_ext.hpp"
 #include "services/diagnosticFramework.hpp"
 #include "utilities/macros.hpp"
 #include "utilities/ostream.hpp"
--- a/src/hotspot/share/services/diagnosticCommand_ext.hpp	Fri Dec 21 01:29:51 2018 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-/*
- * Copyright (c) 2012, 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.
- *
- */
-
-#ifndef SHARE_VM_SERVICES_DIAGNOSTICCOMMAND_EXT_HPP
-#define SHARE_VM_SERVICES_DIAGNOSTICCOMMAND_EXT_HPP
-
-#undef HAVE_EXTRA_DCMD
-
-#endif // SHARE_VM_SERVICES_DIAGNOSTICCOMMAND_HPP
--- a/src/hotspot/share/services/management.cpp	Fri Dec 21 01:29:51 2018 -0800
+++ b/src/hotspot/share/services/management.cpp	Wed Jan 02 10:21:54 2019 +0100
@@ -1645,12 +1645,6 @@
     return;
   }
 
-  // NonJavaThread instances may not be fully initialized yet, so we need to
-  // skip any that aren't - check for zero stack_size()
-  if (!thread->is_Java_thread() && thread->stack_size() == 0) {
-    return;
-  }
-
   if (_count >= _names_len || _count >= _times_len) {
     // skip if the result array is not big enough
     return;
--- a/src/java.base/share/classes/java/util/Collections.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/src/java.base/share/classes/java/util/Collections.java	Wed Jan 02 10:21:54 2019 +0100
@@ -459,7 +459,7 @@
             for (int i=size; i>1; i--)
                 swap(list, i-1, rnd.nextInt(i));
         } else {
-            Object arr[] = list.toArray();
+            Object[] arr = list.toArray();
 
             // Shuffle array
             for (int i=size; i>1; i--)
@@ -5101,6 +5101,53 @@
             return new CopiesList<>(toIndex - fromIndex, element);
         }
 
+        @Override
+        public int hashCode() {
+            if (n == 0) return 1;
+            // hashCode of n repeating elements is 31^n + elementHash * Sum(31^k, k = 0..n-1)
+            // this implementation completes in O(log(n)) steps taking advantage of
+            // 31^(2*n) = (31^n)^2 and Sum(31^k, k = 0..(2*n-1)) = Sum(31^k, k = 0..n-1) * (31^n + 1)
+            int pow = 31;
+            int sum = 1;
+            for (int i = Integer.numberOfLeadingZeros(n) + 1; i < Integer.SIZE; i++) {
+                sum *= pow + 1;
+                pow *= pow;
+                if ((n << i) < 0) {
+                    pow *= 31;
+                    sum = sum * 31 + 1;
+                }
+            }
+            return pow + sum * (element == null ? 0 : element.hashCode());
+        }
+
+        @Override
+        public boolean equals(Object o) {
+            if (o == this)
+                return true;
+            if (o instanceof CopiesList) {
+                CopiesList<?> other = (CopiesList<?>) o;
+                return n == other.n && (n == 0 || eq(element, other.element));
+            }
+            if (!(o instanceof List))
+                return false;
+
+            int remaining = n;
+            E e = element;
+            Iterator<?> itr = ((List<?>) o).iterator();
+            if (e == null) {
+                while (itr.hasNext() && remaining-- > 0) {
+                    if (itr.next() != null)
+                        return false;
+                }
+            } else {
+                while (itr.hasNext() && remaining-- > 0) {
+                    if (!e.equals(itr.next()))
+                        return false;
+                }
+            }
+            return remaining == 0 && !itr.hasNext();
+        }
+
         // Override default methods in Collection
         @Override
         public Stream<E> stream() {
--- a/src/java.base/share/classes/java/util/jar/Attributes.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/src/java.base/share/classes/java/util/jar/Attributes.java	Wed Jan 02 10:21:54 2019 +0100
@@ -36,6 +36,8 @@
 
 import sun.util.logging.PlatformLogger;
 
+import static java.nio.charset.StandardCharsets.UTF_8;
+
 /**
  * The Attributes class maps Manifest attribute names to associated string
  * values. Valid attribute names are case-insensitive, are restricted to
@@ -298,25 +300,16 @@
      * Writes the current attributes to the specified data output stream.
      * XXX Need to handle UTF8 values and break up lines longer than 72 bytes
      */
-     @SuppressWarnings("deprecation")
-     void write(DataOutputStream os) throws IOException {
-         for (Entry<Object, Object> e : entrySet()) {
-             StringBuffer buffer = new StringBuffer(
-                                         ((Name) e.getKey()).toString());
-             buffer.append(": ");
-
-             String value = (String) e.getValue();
-             if (value != null) {
-                 byte[] vb = value.getBytes("UTF8");
-                 value = new String(vb, 0, 0, vb.length);
-             }
-             buffer.append(value);
-
-             Manifest.make72Safe(buffer);
-             buffer.append("\r\n");
-             os.writeBytes(buffer.toString());
-         }
-        os.writeBytes("\r\n");
+    void write(DataOutputStream out) throws IOException {
+        StringBuilder buffer = new StringBuilder(72);
+        for (Entry<Object, Object> e : entrySet()) {
+            buffer.setLength(0);
+            buffer.append(e.getKey().toString());
+            buffer.append(": ");
+            buffer.append(e.getValue());
+            Manifest.println72(out, buffer.toString());
+        }
+        Manifest.println(out); // empty line after individual section
     }
 
     /*
@@ -326,9 +319,9 @@
      *
      * XXX Need to handle UTF8 values and break up lines longer than 72 bytes
      */
-    @SuppressWarnings("deprecation")
-    void writeMain(DataOutputStream out) throws IOException
-    {
+    void writeMain(DataOutputStream out) throws IOException {
+        StringBuilder buffer = new StringBuilder(72);
+
         // write out the *-Version header first, if it exists
         String vername = Name.MANIFEST_VERSION.toString();
         String version = getValue(vername);
@@ -338,7 +331,11 @@
         }
 
         if (version != null) {
-            out.writeBytes(vername+": "+version+"\r\n");
+            buffer.append(vername);
+            buffer.append(": ");
+            buffer.append(version);
+            out.write(buffer.toString().getBytes(UTF_8));
+            Manifest.println(out);
         }
 
         // write out all attributes except for the version
@@ -346,34 +343,24 @@
         for (Entry<Object, Object> e : entrySet()) {
             String name = ((Name) e.getKey()).toString();
             if ((version != null) && !(name.equalsIgnoreCase(vername))) {
-
-                StringBuffer buffer = new StringBuffer(name);
+                buffer.setLength(0);
+                buffer.append(name);
                 buffer.append(": ");
-
-                String value = (String) e.getValue();
-                if (value != null) {
-                    byte[] vb = value.getBytes("UTF8");
-                    value = new String(vb, 0, 0, vb.length);
-                }
-                buffer.append(value);
-
-                Manifest.make72Safe(buffer);
-                buffer.append("\r\n");
-                out.writeBytes(buffer.toString());
+                buffer.append(e.getValue());
+                Manifest.println72(out, buffer.toString());
             }
         }
-        out.writeBytes("\r\n");
+
+        Manifest.println(out); // empty line after main attributes section
     }
 
     /*
      * Reads attributes from the specified input stream.
-     * XXX Need to handle UTF8 values.
      */
     void read(Manifest.FastInputStream is, byte[] lbuf) throws IOException {
         read(is, lbuf, null, 0);
     }
 
-    @SuppressWarnings("deprecation")
     int read(Manifest.FastInputStream is, byte[] lbuf, String filename, int lineNumber) throws IOException {
         String name = null, value;
         byte[] lastline = null;
@@ -409,7 +396,7 @@
                     lastline = buf;
                     continue;
                 }
-                value = new String(buf, 0, buf.length, "UTF8");
+                value = new String(buf, 0, buf.length, UTF_8);
                 lastline = null;
             } else {
                 while (lbuf[i++] != ':') {
@@ -422,13 +409,13 @@
                     throw new IOException("invalid header field ("
                                 + Manifest.getErrorPosition(filename, lineNumber) + ")");
                 }
-                name = new String(lbuf, 0, 0, i - 2);
+                name = new String(lbuf, 0, i - 2, UTF_8);
                 if (is.peek() == ' ') {
                     lastline = new byte[len - i];
                     System.arraycopy(lbuf, i, lastline, 0, len - i);
                     continue;
                 }
-                value = new String(lbuf, i, len - i, "UTF8");
+                value = new String(lbuf, i, len - i, UTF_8);
             }
             try {
                 if ((putValue(name, value) != null) && (!lineContinued)) {
--- a/src/java.base/share/classes/java/util/jar/Manifest.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/src/java.base/share/classes/java/util/jar/Manifest.java	Wed Jan 02 10:21:54 2019 +0100
@@ -35,6 +35,8 @@
 
 import sun.security.util.SecurityProperties;
 
+import static java.nio.charset.StandardCharsets.UTF_8;
+
 /**
  * The Manifest class is used to maintain Manifest entry names and their
  * associated Attributes. There are main Manifest Attributes as well as
@@ -197,31 +199,28 @@
      * @exception IOException if an I/O error has occurred
      * @see #getMainAttributes
      */
-    @SuppressWarnings("deprecation")
     public void write(OutputStream out) throws IOException {
         DataOutputStream dos = new DataOutputStream(out);
         // Write out the main attributes for the manifest
         attr.writeMain(dos);
         // Now write out the per-entry attributes
+        StringBuilder buffer = entries.isEmpty() ? null : new StringBuilder(72);
         for (Map.Entry<String, Attributes> e : entries.entrySet()) {
-            StringBuffer buffer = new StringBuffer("Name: ");
-            String value = e.getKey();
-            if (value != null) {
-                byte[] vb = value.getBytes("UTF8");
-                value = new String(vb, 0, 0, vb.length);
-            }
-            buffer.append(value);
-            make72Safe(buffer);
-            buffer.append("\r\n");
-            dos.writeBytes(buffer.toString());
+            buffer.setLength(0);
+            buffer.append("Name: ");
+            buffer.append(e.getKey());
+            println72(dos, buffer.toString());
             e.getValue().write(dos);
         }
         dos.flush();
     }
 
     /**
-     * Adds line breaks to enforce a maximum 72 bytes per line.
+     * Adds line breaks to enforce a maximum of 72 bytes per line.
+     *
+     * @deprecation Replaced with {@link #println72}.
      */
+    @Deprecated(since = "13")
     static void make72Safe(StringBuffer line) {
         int length = line.length();
         int index = 72;
@@ -230,7 +229,38 @@
             index += 74; // + line width + line break ("\r\n")
             length += 3; // + line break ("\r\n") and space
         }
-        return;
+    }
+
+    /**
+     * Writes {@code line} to {@code out} with line breaks and continuation
+     * spaces within the limits of 72 bytes of contents per line followed
+     * by a line break.
+     */
+    static void println72(OutputStream out, String line) throws IOException {
+        if (!line.isEmpty()) {
+            byte[] lineBytes = line.getBytes(UTF_8);
+            int length = lineBytes.length;
+            // first line can hold one byte more than subsequent lines which
+            // start with a continuation line break space
+            out.write(lineBytes[0]);
+            int pos = 1;
+            while (length - pos > 71) {
+                out.write(lineBytes, pos, 71);
+                pos += 71;
+                println(out);
+                out.write(' ');
+            }
+            out.write(lineBytes, pos, length - pos);
+        }
+        println(out);
+    }
+
+    /**
+     * Writes a line break to {@code out}.
+     */
+    static void println(OutputStream out) throws IOException {
+        out.write('\r');
+        out.write('\n');
     }
 
     static String getErrorPosition(String filename, final int lineNumber) {
@@ -304,7 +334,7 @@
                     lastline = buf;
                     continue;
                 }
-                name = new String(buf, 0, buf.length, "UTF8");
+                name = new String(buf, 0, buf.length, UTF_8);
                 lastline = null;
             }
             Attributes attr = getAttributes(name);
@@ -330,7 +360,7 @@
             toLower(lbuf[2]) == 'm' && toLower(lbuf[3]) == 'e' &&
             lbuf[4] == ':' && lbuf[5] == ' ') {
             try {
-                return new String(lbuf, 6, len - 6, "UTF8");
+                return new String(lbuf, 6, len - 6, UTF_8);
             }
             catch (Exception e) {
             }
--- a/src/java.base/share/classes/sun/reflect/annotation/AnnotatedTypeFactory.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/src/java.base/share/classes/sun/reflect/annotation/AnnotatedTypeFactory.java	Wed Jan 02 10:21:54 2019 +0100
@@ -100,12 +100,15 @@
             if (clz.getEnclosingClass() == null)
                 return addTo;
             if (Modifier.isStatic(clz.getModifiers()))
-                return nestingForType(clz.getEnclosingClass(), addTo);
+                return addTo;
             return nestingForType(clz.getEnclosingClass(), addTo.pushInner());
         } else if (type instanceof ParameterizedType) {
             ParameterizedType t = (ParameterizedType)type;
             if (t.getOwnerType() == null)
                 return addTo;
+            if (t.getRawType() instanceof Class
+                    && Modifier.isStatic(((Class) t.getRawType()).getModifiers()))
+                return addTo;
             return nestingForType(t.getOwnerType(), addTo.pushInner());
         }
         return addTo;
@@ -193,14 +196,18 @@
             if (!(type instanceof Class<?>))
                 throw new IllegalStateException("Can't compute owner");
 
-            Class<?> inner = (Class<?>)type;
-            Class<?> owner = inner.getDeclaringClass();
+            Class<?> nested = (Class<?>)type;
+            Class<?> owner = nested.getDeclaringClass();
             if (owner == null) // top-level, local or anonymous
                 return null;
-            if (inner.isPrimitive() || inner == Void.TYPE)
+            if (nested.isPrimitive() || nested == Void.TYPE)
                 return null;
 
-            LocationInfo outerLoc = nestingForType(owner, getLocation().popAllLocations((byte)1));
+            LocationInfo outerLoc = getLocation().popLocation((byte)1);
+            if (outerLoc == null) {
+              return buildAnnotatedType(owner, LocationInfo.BASE_LOCATION,
+                      EMPTY_TYPE_ANNOTATION_ARRAY, EMPTY_TYPE_ANNOTATION_ARRAY, getDecl());
+            }
             TypeAnnotation[]all = getTypeAnnotations();
             List<TypeAnnotation> l = new ArrayList<>(all.length);
 
@@ -445,7 +452,12 @@
             Type owner = getParameterizedType().getOwnerType();
             if (owner == null)
                 return null;
-            LocationInfo outerLoc = nestingForType(owner, getLocation().popAllLocations((byte)1));
+
+            LocationInfo outerLoc = getLocation().popLocation((byte)1);
+            if (outerLoc == null) {
+              return buildAnnotatedType(owner, LocationInfo.BASE_LOCATION,
+                      EMPTY_TYPE_ANNOTATION_ARRAY, EMPTY_TYPE_ANNOTATION_ARRAY, getDecl());
+            }
             TypeAnnotation[]all = getTypeAnnotations();
             List<TypeAnnotation> l = new ArrayList<>(all.length);
 
--- a/src/java.base/share/classes/sun/reflect/annotation/TypeAnnotation.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/src/java.base/share/classes/sun/reflect/annotation/TypeAnnotation.java	Wed Jan 02 10:21:54 2019 +0100
@@ -187,19 +187,17 @@
             return new LocationInfo(newDepth, res);
         }
 
-        /** Pop a series of locations matching {@code tag}. Stop poping as soon as a non-matching tag is found. */
-        public LocationInfo popAllLocations(byte tag) {
-            LocationInfo l = this;
-            int newDepth = l.depth;
-            while(newDepth > 0 && l.locations[newDepth - 1].tag == tag) {
-                newDepth--;
+        /**
+         * Pops a location matching {@code tag}, or returns {@code null}
+         * if no matching location was found.
+         */
+        public LocationInfo popLocation(byte tag) {
+            if (depth == 0 || locations[depth - 1].tag != tag) {
+                return null;
             }
-            if (newDepth != l.depth) {
-                Location[] res = new Location[newDepth];
-                System.arraycopy(this.locations, 0, res, 0, newDepth);
-                return new LocationInfo(newDepth, res);
-            } else
-                return l;
+            Location[] res = new Location[depth - 1];
+            System.arraycopy(locations, 0, res, 0, depth - 1);
+            return new LocationInfo(depth - 1, res);
         }
 
         public TypeAnnotation[] filter(TypeAnnotation[] ta) {
--- a/src/java.base/share/classes/sun/security/pkcs12/PKCS12KeyStore.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/src/java.base/share/classes/sun/security/pkcs12/PKCS12KeyStore.java	Wed Jan 02 10:21:54 2019 +0100
@@ -2525,6 +2525,7 @@
     /*
      * PKCS12 permitted first 24 bytes:
      *
+     * 30 80 02 01 03 30 80 06 09 2A 86 48 86 F7 0D 01 07 01 A0 80 24 80 04 --
      * 30 82 -- -- 02 01 03 30 82 -- -- 06 09 2A 86 48 86 F7 0D 01 07 01 A0 8-
      * 30 -- 02 01 03 30 -- 06 09 2A 86 48 86 F7 0D 01 07 01 A0 -- 04 -- -- --
      * 30 81 -- 02 01 03 30 81 -- 06 09 2A 86 48 86 F7 0D 01 07 01 A0 81 -- 04
@@ -2536,6 +2537,7 @@
      */
 
     private static final long[][] PKCS12_HEADER_PATTERNS = {
+        { 0x3080020103308006L, 0x092A864886F70D01L, 0x0701A08024800400L },
         { 0x3082000002010330L, 0x82000006092A8648L, 0x86F70D010701A080L },
         { 0x3000020103300006L, 0x092A864886F70D01L, 0x0701A00004000000L },
         { 0x3081000201033081L, 0x0006092A864886F7L, 0x0D010701A0810004L },
@@ -2547,6 +2549,7 @@
     };
 
     private static final long[][] PKCS12_HEADER_MASKS = {
+        { 0xFFFFFFFFFFFFFFFFL, 0xFFFFFFFFFFFFFFFFL, 0xFFFFFFFFFFFFFF00L },
         { 0xFFFF0000FFFFFFFFL, 0xFF0000FFFFFFFFFFL, 0xFFFFFFFFFFFFFFF0L },
         { 0xFF00FFFFFFFF00FFL, 0xFFFFFFFFFFFFFFFFL, 0xFFFFFF00FF000000L },
         { 0xFFFF00FFFFFFFFFFL, 0x00FFFFFFFFFFFFFFL, 0xFFFFFFFFFFFF00FFL },
--- a/src/java.base/share/classes/sun/security/provider/certpath/DistributionPointFetcher.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/src/java.base/share/classes/sun/security/provider/certpath/DistributionPointFetcher.java	Wed Jan 02 10:21:54 2019 +0100
@@ -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
@@ -770,7 +770,7 @@
          *
          * In practice, conforming CAs MUST use the key identifier method,
          * and MUST include authority key identifier extension in all CRLs
-         * issued. [section 5.2.1, RFC 2459]
+         * issued. [section 5.2.1, RFC 5280]
          */
         AuthorityKeyIdentifierExtension crlAKID = crl.getAuthKeyIdExtension();
         issuerSelector.setSkiAndSerialNumber(crlAKID);
--- a/src/java.base/share/classes/sun/security/provider/certpath/ForwardBuilder.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/src/java.base/share/classes/sun/security/provider/certpath/ForwardBuilder.java	Wed Jan 02 10:21:54 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -668,7 +668,7 @@
      * Verifies a matching certificate.
      *
      * This method executes the validation steps in the PKIX path
-     * validation algorithm <draft-ietf-pkix-new-part1-08.txt> which were
+     * validation algorithm, RFC 5280, which were
      * not satisfied by the selection criteria used by getCertificates()
      * to find the certs and only the steps that can be executed in a
      * forward direction (target to trust anchor). Those steps that can
--- a/src/java.base/share/classes/sun/security/x509/AVA.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/src/java.base/share/classes/sun/security/x509/AVA.java	Wed Jan 02 10:21:54 2019 +0100
@@ -1045,7 +1045,7 @@
 
             if (valStr == null) {
 
-                // rfc1779 specifies that attribute values associated
+                // RFC 1779 specifies that attribute values associated
                 // with non-standard keyword attributes may be represented
                 // using the hex format below.  This will be used only
                 // when the value is not a string type
--- a/src/java.base/share/classes/sun/security/x509/AlgorithmId.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/src/java.base/share/classes/sun/security/x509/AlgorithmId.java	Wed Jan 02 10:21:54 2019 +0100
@@ -166,15 +166,15 @@
 
             // Several AlgorithmId should omit the whole parameter part when
             // it's NULL. They are ---
-            // rfc3370 2.1: Implementations SHOULD generate SHA-1
+            // RFC 3370 2.1: Implementations SHOULD generate SHA-1
             // AlgorithmIdentifiers with absent parameters.
-            // rfc3447 C1: When id-sha1, id-sha224, id-sha256, id-sha384 and
+            // RFC 3447 C1: When id-sha1, id-sha224, id-sha256, id-sha384 and
             // id-sha512 are used in an AlgorithmIdentifier the parameters
             // (which are optional) SHOULD be omitted.
-            // rfc3279 2.3.2: The id-dsa algorithm syntax includes optional
+            // RFC 3279 2.3.2: The id-dsa algorithm syntax includes optional
             // domain parameters... When omitted, the parameters component
             // MUST be omitted entirely
-            // rfc3370 3.1: When the id-dsa-with-sha1 algorithm identifier
+            // RFC 3370 3.1: When the id-dsa-with-sha1 algorithm identifier
             // is used, the AlgorithmIdentifier parameters field MUST be absent.
             /*if (
                 algid.equals((Object)SHA_oid) ||
--- a/src/java.base/share/classes/sun/security/x509/CertificatePoliciesExtension.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/src/java.base/share/classes/sun/security/x509/CertificatePoliciesExtension.java	Wed Jan 02 10:21:54 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -45,7 +45,7 @@
  * certificate.
  * <p>
  * Optional qualifiers are not supported in this implementation, as they are
- * not recommended by RFC2459.
+ * not recommended by RFC 5280.
  *
  * The ASN.1 syntax for this is (IMPLICIT tagging is defined in the
  * module definition):
--- a/src/java.base/share/classes/sun/security/x509/DNSName.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/src/java.base/share/classes/sun/security/x509/DNSName.java	Wed Jan 02 10:21:54 2019 +0100
@@ -181,7 +181,7 @@
      * For example, www.host.example.com would satisfy the constraint but
      * host1.example.com would not.
      * <p>
-     * draft-ietf-pkix-new-part1-00.txt:  DNSName restrictions are expressed as foo.bar.com.
+     * RFC 5280:  DNSName restrictions are expressed as foo.bar.com.
      * Any DNSName that
      * can be constructed by simply adding to the left hand side of the name
      * satisfies the name constraint. For example, www.foo.bar.com would
--- a/src/java.base/share/classes/sun/security/x509/IPAddressName.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/src/java.base/share/classes/sun/security/x509/IPAddressName.java	Wed Jan 02 10:21:54 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2002, 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
@@ -37,27 +37,27 @@
 /**
  * This class implements the IPAddressName as required by the GeneralNames
  * ASN.1 object.  Both IPv4 and IPv6 addresses are supported using the
- * formats specified in IETF PKIX RFC2459.
+ * formats specified in IETF PKIX RFC 5280.
  * <p>
- * [RFC2459 4.2.1.7 Subject Alternative Name]
- * When the subjectAltName extension contains a iPAddress, the address
- * MUST be stored in the octet string in "network byte order," as
- * specified in RFC 791. The least significant bit (LSB) of
- * each octet is the LSB of the corresponding byte in the network
- * address. For IP Version 4, as specified in RFC 791, the octet string
- * MUST contain exactly four octets.  For IP Version 6, as specified in
- * RFC 1883, the octet string MUST contain exactly sixteen octets.
+ * [RFC 5280 4.2.1.6 Subject Alternative Name]
+ * When the subjectAltName extension contains an iPAddress, the address
+ * MUST be stored in the octet string in "network byte order", as
+ * specified in [RFC791].  The least significant bit (LSB) of each octet
+ * is the LSB of the corresponding byte in the network address.  For IP
+ * version 4, as specified in [RFC791], the octet string MUST contain
+ * exactly four octets.  For IP version 6, as specified in
+ * [RFC 2460], the octet string MUST contain exactly sixteen octets.
  * <p>
- * [RFC2459 4.2.1.11 Name Constraints]
- * The syntax of iPAddress MUST be as described in section 4.2.1.7 with
- * the following additions specifically for Name Constraints.  For IPv4
- * addresses, the ipAddress field of generalName MUST contain eight (8)
- * octets, encoded in the style of RFC 1519 (CIDR) to represent an
- * address range.[RFC 1519]  For IPv6 addresses, the ipAddress field
+ * [RFC 5280 4.2.1.10 Name Constraints]
+ * The syntax of iPAddress MUST be as described in Section 4.2.1.6 with
+ * the following additions specifically for name constraints.  For IPv4
+ * addresses, the iPAddress field of GeneralName MUST contain eight (8)
+ * octets, encoded in the style of RFC 4632 (CIDR) to represent an
+ * address range [RFC 4632].  For IPv6 addresses, the iPAddress field
  * MUST contain 32 octets similarly encoded.  For example, a name
- * constraint for "class C" subnet 10.9.8.0 shall be represented as the
- * octets 0A 09 08 00 FF FF FF 00, representing the CIDR notation
- * 10.9.8.0/255.255.255.0.
+ * constraint for "class C" subnet 192.0.2.0 is represented as the
+ * octets C0 00 02 00 FF FF FF 00, representing the CIDR notation
+ * 192.0.2.0/24 (mask 255.255.255.0).
  * <p>
  * @see GeneralName
  * @see GeneralNameInterface
@@ -376,15 +376,16 @@
      * </ul>.  These results are used in checking NameConstraints during
      * certification path verification.
      * <p>
-     * [RFC2459] The syntax of iPAddress MUST be as described in section
-     * 4.2.1.7 with the following additions specifically for Name Constraints.
-     * For IPv4 addresses, the ipAddress field of generalName MUST contain
-     * eight (8) octets, encoded in the style of RFC 1519 (CIDR) to represent an
-     * address range.[RFC 1519]  For IPv6 addresses, the ipAddress field
+     * [RFC 5280 4.2.1.10 Name Constraints]
+     * The syntax of iPAddress MUST be as described in Section 4.2.1.6 with
+     * the following additions specifically for name constraints.  For IPv4
+     * addresses, the iPAddress field of GeneralName MUST contain eight (8)
+     * octets, encoded in the style of RFC 4632 (CIDR) to represent an
+     * address range [RFC 4632].  For IPv6 addresses, the iPAddress field
      * MUST contain 32 octets similarly encoded.  For example, a name
-     * constraint for "class C" subnet 10.9.8.0 shall be represented as the
-     * octets 0A 09 08 00 FF FF FF 00, representing the CIDR notation
-     * 10.9.8.0/255.255.255.0.
+     * constraint for "class C" subnet 192.0.2.0 is represented as the
+     * octets C0 00 02 00 FF FF FF 00, representing the CIDR notation
+     * 192.0.2.0/24 (mask 255.255.255.0).
      *
      * @param inputName to be checked for being constrained
      * @return constraint type above
--- a/src/java.base/share/classes/sun/security/x509/KeyIdentifier.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/src/java.base/share/classes/sun/security/x509/KeyIdentifier.java	Wed Jan 02 10:21:54 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 1999, 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
@@ -63,7 +63,7 @@
     /**
      * Creates a KeyIdentifier from a public-key value.
      *
-     * <p>From RFC2459: Two common methods for generating key identifiers from
+     * <p>From RFC 5280: Two common methods for generating key identifiers from
      * the public key are:
      * <ol>
      * <li>The keyIdentifier is composed of the 160-bit SHA-1 hash of the
--- a/src/java.base/share/classes/sun/security/x509/NameConstraintsExtension.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/src/java.base/share/classes/sun/security/x509/NameConstraintsExtension.java	Wed Jan 02 10:21:54 2019 +0100
@@ -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
@@ -326,7 +326,7 @@
      * expanded by a merge, just remain constant or become more
      * limiting.
      * <p>
-     * IETF RFC2459 specifies the processing of Name Constraints as
+     * IETF RFC 5280 specifies the processing of Name Constraints as
      * follows:
      * <p>
      * (j)  If permittedSubtrees is present in the certificate, set the
--- a/src/java.base/share/classes/sun/security/x509/OIDName.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/src/java.base/share/classes/sun/security/x509/OIDName.java	Wed Jan 02 10:21:54 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2015, 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
@@ -156,7 +156,7 @@
         else if (this.equals((OIDName)inputName))
             constraintType = NAME_MATCH;
         else
-            //widens and narrows not defined in RFC2459 for OIDName (aka registeredID)
+            //widens and narrows not defined in RFC 5280 for OIDName (aka registeredID)
             throw new UnsupportedOperationException("Narrowing and widening are not supported for OIDNames");
         return constraintType;
     }
--- a/src/java.base/share/classes/sun/security/x509/RFC822Name.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/src/java.base/share/classes/sun/security/x509/RFC822Name.java	Wed Jan 02 10:21:54 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2011, 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
@@ -68,7 +68,7 @@
 
     /**
      * Parse an RFC822Name string to see if it is a valid
-     * addr-spec according to IETF RFC822 and RFC2459:
+     * addr-spec according to IETF RFC 822 and RFC 5280:
      * [local-part@]domain
      * <p>
      * local-part@ could be empty for an RFC822Name NameConstraint,
@@ -131,7 +131,7 @@
      * Compares this name with another, for equality.
      *
      * @return true iff the names are equivalent
-     * according to RFC2459.
+     * according to RFC 5280.
      */
     public boolean equals(Object obj) {
         if (this == obj)
@@ -142,7 +142,7 @@
 
         RFC822Name other = (RFC822Name)obj;
 
-        // RFC2459 mandates that these names are
+        // RFC 5280 mandates that these names are
         // not case-sensitive
         return name.equalsIgnoreCase(other.name);
     }
@@ -166,14 +166,15 @@
      * </ul>.  These results are used in checking NameConstraints during
      * certification path verification.
      * <p>
-     * [RFC2459]    When the subjectAltName extension contains an Internet mail address,
-     * the address MUST be included as an rfc822Name. The format of an
-     * rfc822Name is an "addr-spec" as defined in RFC 822 [RFC 822]. An
-     * addr-spec has the form "local-part@domain". Note that an addr-spec
-     * has no phrase (such as a common name) before it, has no comment (text
+     *
+     * [RFC 5280]:
+     * When the subjectAltName extension contains an Internet mail address,
+     * the address MUST be stored in the rfc822Name.  The format of an
+     * rfc822Name is a "Mailbox" as defined in Section 4.1.2 of [RFC2821].
+     * A Mailbox has the form "Local-part@Domain".  Note that a Mailbox has
+     * no phrase (such as a common name) before it, has no comment (text
      * surrounded in parentheses) after it, and is not surrounded by "&lt;" and
-     * "&gt;". Note that while upper and lower case letters are allowed in an
-     * RFC 822 addr-spec, no significance is attached to the case.
+     * "&gt;".
      *
      * @param inputName to be checked for being constrained
      * @return constraint type above
@@ -187,7 +188,7 @@
         else if (inputName.getType() != (GeneralNameInterface.NAME_RFC822)) {
             constraintType = NAME_DIFF_TYPE;
         } else {
-            //RFC2459 specifies that case is not significant in RFC822Names
+            //RFC 5280 specifies that case is not significant in RFC822Names
             String inName =
                 (((RFC822Name)inputName).getName()).toLowerCase(Locale.ENGLISH);
             String thisName = name.toLowerCase(Locale.ENGLISH);
--- a/src/java.base/share/classes/sun/security/x509/URIName.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/src/java.base/share/classes/sun/security/x509/URIName.java	Wed Jan 02 10:21:54 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, 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 @@
     /**
      * Compares this name with another, for equality.
      *
-     * @return true iff the names are equivalent according to RFC2459.
+     * @return true iff the names are equivalent according to RFC 5280.
      */
     public boolean equals(Object obj) {
         if (this == obj) {
--- a/src/java.base/share/classes/sun/security/x509/X400Address.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/src/java.base/share/classes/sun/security/x509/X400Address.java	Wed Jan 02 10:21:54 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -403,7 +403,7 @@
         else if (inputName.getType() != NAME_X400)
             constraintType = NAME_DIFF_TYPE;
         else
-            //Narrowing, widening, and match constraints not defined in rfc2459 for X400Address
+            //Narrowing, widening, and match constraints not defined in RFC 5280 for X400Address
             throw new UnsupportedOperationException("Narrowing, widening, and match are not supported for X400Address.");
         return constraintType;
     }
--- a/src/java.base/share/classes/sun/security/x509/X509CertImpl.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/src/java.base/share/classes/sun/security/x509/X509CertImpl.java	Wed Jan 02 10:21:54 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 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
@@ -63,14 +63,8 @@
  * direct knowledge of each other.  CA certificates are either signed by
  * themselves, or by some other CA such as a "root" CA.
  *
- * <P>RFC 1422 is very informative, though it does not describe much
- * of the recent work being done with X.509 certificates.  That includes
- * a 1996 version (X.509v3) and a variety of enhancements being made to
- * facilitate an explosion of personal certificates used as "Internet
- * Drivers' Licences", or with SET for credit card transactions.
- *
- * <P>More recent work includes the IETF PKIX Working Group efforts,
- * especially RFC2459.
+ * <P> Standards relating to X.509 Public Key Infrastructure for the Internet
+ * can be referenced in RFC 5280.
  *
  * @author Dave Brownell
  * @author Amit Kapoor
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Modules.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Modules.java	Wed Jan 02 10:21:54 2019 +0100
@@ -450,7 +450,12 @@
                 String moduleOverride = singleModuleOverride(trees);
                 switch (rootModules.size()) {
                     case 0:
-                        defaultModule = moduleFinder.findSingleModule();
+                        try {
+                            defaultModule = moduleFinder.findSingleModule();
+                        } catch (CompletionFailure cf) {
+                            chk.completionError(null, cf);
+                            defaultModule = syms.unnamedModule;
+                        }
                         if (defaultModule == syms.unnamedModule) {
                             if (moduleOverride != null) {
                                 checkNoAllModulePath();
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/main/JavaCompiler.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/main/JavaCompiler.java	Wed Jan 02 10:21:54 2019 +0100
@@ -1761,6 +1761,7 @@
     private Name parseAndGetName(JavaFileObject fo,
                                  Function<JCTree.JCCompilationUnit, Name> tree2Name) {
         DiagnosticHandler dh = new DiscardDiagnosticHandler(log);
+        JavaFileObject prevSource = log.useSource(fo);
         try {
             JCTree.JCCompilationUnit t = parse(fo, fo.getCharContent(false));
             return tree2Name.apply(t);
@@ -1768,6 +1769,7 @@
             return null;
         } finally {
             log.popDiagnosticHandler(dh);
+            log.useSource(prevSource);
         }
     }
 
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/CheckGraalIntrinsics.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/CheckGraalIntrinsics.java	Wed Jan 02 10:21:54 2019 +0100
@@ -382,6 +382,14 @@
                             "java/lang/CharacterDataLatin1.isWhitespace(I)Z");
         }
 
+        if (isJDK13OrHigher()) {
+            add(toBeInvestigated,
+                            "java/lang/Math.max(DD)D",
+                            "java/lang/Math.max(FF)F",
+                            "java/lang/Math.min(DD)D",
+                            "java/lang/Math.min(FF)F");
+        }
+
         if (!config.inlineNotify()) {
             add(ignore, "java/lang/Object.notify()V");
         }
@@ -542,6 +550,10 @@
         return GraalServices.JAVA_SPECIFICATION_VERSION >= 12;
     }
 
+    private static boolean isJDK13OrHigher() {
+        return GraalServices.JAVA_SPECIFICATION_VERSION >= 13;
+    }
+
     public interface Refiner {
         void refine(CheckGraalIntrinsics checker);
     }
--- a/src/jdk.jdi/share/classes/com/sun/tools/example/debug/tty/Env.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/src/jdk.jdi/share/classes/com/sun/tools/example/debug/tty/Env.java	Wed Jan 02 10:21:54 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2011, 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
@@ -108,7 +108,7 @@
 
     static private List<String> excludes() {
         if (excludes == null) {
-            setExcludes("java.*, javax.*, sun.*, com.sun.*");
+            setExcludes("java.*, javax.*, sun.*, com.sun.*, jdk.*");
         }
         return excludes;
     }
--- a/src/utils/hsdis/README	Fri Dec 21 01:29:51 2018 -0800
+++ b/src/utils/hsdis/README	Wed Jan 02 10:21:54 2019 +0100
@@ -1,4 +1,4 @@
-Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved.
+Copyright (c) 2008, 2019, Oracle and/or its affiliates. All rights reserved.
 DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   
 The Universal Permissive License (UPL), Version 1.0
@@ -114,18 +114,15 @@
 
 * Installing
 
-Products are named like build/$OS-$LIBARCH/hsdis-$LIBARCH.so.  You can
-install them on your LD_LIBRARY_PATH, or inside of your JRE/JDK.  The
-search path in the JVM is:
+Products are named like build/$OS-$LIBARCH/hsdis-$LIBARCH.so. You can
+install them next to your libjvm.so inside your JRE/JDK or alternatively
+put it anywhere on your LD_LIBRARY_PATH. The search path in the JVM is:
 
-1. <home>/jre/lib/<arch>/<vm>/libhsdis-<arch>.so
-2. <home>/jre/lib/<arch>/<vm>/hsdis-<arch>.so
-3. <home>/jre/lib/<arch>/hsdis-<arch>.so
+1. <home>/lib/<vm>/libhsdis-<arch>.so
+2. <home>/lib/<vm>/hsdis-<arch>.so
+3. <home>/lib/hsdis-<arch>.so
 4. hsdis-<arch>.so  (using LD_LIBRARY_PATH)
 
-Note that there's a bug in hotspot versions prior to hs22 that causes
-steps 2 and 3 to fail when used with JDK7.
-
 Now test:
 
   export LD_LIBRARY_PATH .../hsdis/build/$OS-$LIBARCH:$LD_LIBRARY_PATH
--- a/test/hotspot/gtest/threadHelper.inline.hpp	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/hotspot/gtest/threadHelper.inline.hpp	Wed Jan 02 10:21:54 2019 +0100
@@ -50,6 +50,9 @@
   Semaphore _unblock;
   VMThreadBlocker() {}
   virtual ~VMThreadBlocker() {}
+  const char* get_thread_name_string(char* buf, int buflen) const {
+    return "VMThreadBlocker";
+  }
   void run() {
     this->set_thread_state(_thread_in_vm);
     {
@@ -58,9 +61,15 @@
     }
     VM_StopSafepoint ss(&_ready, &_unblock);
     VMThread::execute(&ss);
+  }
+
+  // Override as JavaThread::post_run() calls JavaThread::exit which
+  // expects a valid thread object oop.
+  virtual void post_run() {
     Threads::remove(this);
     this->smr_delete();
   }
+
   void doit() {
     if (os::create_thread(this, os::os_thread)) {
       os::start_thread(this);
@@ -85,7 +94,11 @@
   }
   virtual ~JavaTestThread() {}
 
-  void prerun() {
+  const char* get_thread_name_string(char* buf, int buflen) const {
+    return "JavaTestThread";
+  }
+
+  void pre_run() {
     this->set_thread_state(_thread_in_vm);
     {
       MutexLocker ml(Threads_lock);
@@ -99,12 +112,12 @@
   virtual void main_run() = 0;
 
   void run() {
-    prerun();
     main_run();
-    postrun();
   }
 
-  void postrun() {
+  // Override as JavaThread::post_run() calls JavaThread::exit which
+  // expects a valid thread object oop. And we need to call signal.
+  void post_run() {
     Threads::remove(this);
     _post->signal();
     this->smr_delete();
--- a/test/hotspot/jtreg/compiler/intrinsics/string/TestStringIntrinsics2.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/hotspot/jtreg/compiler/intrinsics/string/TestStringIntrinsics2.java	Wed Jan 02 10:21:54 2019 +0100
@@ -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.
  * Copyright (c) 2016 SAP SE. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -642,6 +642,12 @@
             assertEquals(-3, asmStringCompareTo(a2, b2),
                          "TestOther.asmStringCompareTo(very_very_long_strings_2)");
         }
+
+        // See bug 8215100
+        {
+            assertEquals(-20, asmStringCompareTo("e.\u0259.", "y.e."));
+            assertEquals(20, asmStringCompareTo("y.e.", "e.\u0259."));
+        }
     }
 
 
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/PopFrame/popframe004.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/PopFrame/popframe004.java	Wed Jan 02 10:21:54 2019 +0100
@@ -147,8 +147,8 @@
             boolean compl = true;
 
             try {
+                out.println("popFrameCls (" + this + "): inside activeMethod()");
                 pipeOut.write(123); // notify the main thread
-                out.println("popFrameCls (" + this + "): inside activeMethod()");
                 // pause here until the main thread suspends us
                 synchronized (popframe004.barrier) {
                     while (true) {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/java/lang/annotation/typeAnnotations/GetAnnotatedNestedSuperclass.java	Wed Jan 02 10:21:54 2019 +0100
@@ -0,0 +1,96 @@
+/*
+ * Copyright (c) 2018, Google LLC. 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 8066967 8198526
+ * @summary Class.getAnnotatedSuperclass() does not correctly extract annotations
+ */
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+import java.lang.reflect.AnnotatedParameterizedType;
+import java.lang.reflect.AnnotatedType;
+import java.util.Arrays;
+import java.util.Objects;
+
+public class GetAnnotatedNestedSuperclass {
+
+    @Target(ElementType.TYPE_USE)
+    @Retention(RetentionPolicy.RUNTIME)
+    @interface A {}
+
+    @Target(ElementType.TYPE_USE)
+    @Retention(RetentionPolicy.RUNTIME)
+    @interface B {}
+
+    @Target(ElementType.TYPE_USE)
+    @Retention(RetentionPolicy.RUNTIME)
+    @interface C {}
+
+    @Target(ElementType.TYPE_USE)
+    @Retention(RetentionPolicy.RUNTIME)
+    @interface D {}
+
+    @Target(ElementType.TYPE_USE)
+    @Retention(RetentionPolicy.RUNTIME)
+    @interface E {}
+
+    static class X<P1, P2, P3> {}
+
+    static class Y<P1, P2> extends @A X<@B P1, @C P2, @D Class<@E P1>> {}
+
+    public static void main(String[] args) throws Exception {
+        AnnotatedType x = Y.class.getAnnotatedSuperclass();
+        assertEquals(Arrays.toString(x.getAnnotations()), "[@GetAnnotatedNestedSuperclass$A()]");
+        AnnotatedParameterizedType xpt = (AnnotatedParameterizedType) x;
+        {
+            AnnotatedType arg = xpt.getAnnotatedActualTypeArguments()[0];
+            assertEquals(
+                    Arrays.toString(arg.getAnnotations()), "[@GetAnnotatedNestedSuperclass$B()]");
+        }
+        {
+            AnnotatedType arg = xpt.getAnnotatedActualTypeArguments()[1];
+            assertEquals(
+                    Arrays.toString(arg.getAnnotations()), "[@GetAnnotatedNestedSuperclass$C()]");
+        }
+        {
+            AnnotatedType arg = xpt.getAnnotatedActualTypeArguments()[2];
+            assertEquals(
+                    Arrays.toString(arg.getAnnotations()), "[@GetAnnotatedNestedSuperclass$D()]");
+            AnnotatedType nestedArg =
+                    ((AnnotatedParameterizedType) arg).getAnnotatedActualTypeArguments()[0];
+            assertEquals(
+                    Arrays.toString(nestedArg.getAnnotations()),
+                    "[@GetAnnotatedNestedSuperclass$E()]");
+        }
+    }
+
+    private static void assertEquals(Object expected, Object actual) {
+        if (!Objects.equals(expected, actual)) {
+            throw new AssertionError("expected: " + expected + "; actual=" + actual);
+        }
+    }
+}
--- a/test/jdk/java/lang/annotation/typeAnnotations/GetAnnotatedOwnerType.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/jdk/java/lang/annotation/typeAnnotations/GetAnnotatedOwnerType.java	Wed Jan 02 10:21:54 2019 +0100
@@ -42,6 +42,9 @@
     public @TA("non-generic") GetAnnotatedOwnerTypeAuxilliary . @TB("non-generic") Inner nonGeneric;
     public @TA("non-generic") GetAnnotatedOwnerTypeAuxilliary . @TB("generic") InnerGeneric<String> innerGeneric;
     public @TA("non-generic") GetAnnotatedOwnerTypeAuxilliary . @TB("raw") InnerGeneric innerRaw;
+    public GetAnnotatedOwnerTypeAuxilliary . @TB("non-generic") Nested nestedNonGeneric;
+    public GetAnnotatedOwnerTypeAuxilliary . @TB("generic") NestedGeneric<String> nestedGeneric;
+    public GetAnnotatedOwnerTypeAuxilliary . @TB("raw") NestedGeneric nestedRaw;
     public Object anonymous = new Object() {};
     public @TA("array") Dummy[] dummy;
     public @TA("wildcard") GetAnnotatedOwnerType<?> wildcard;
@@ -58,6 +61,9 @@
         testNonGeneric();
         testInnerGeneric();
         testInnerRaw();
+        testNestedNonGeneric();
+        testNestedGeneric();
+        testNestedRaw();
 
         testLocalClass();
         testAnonymousClass();
@@ -155,6 +161,54 @@
                 + outer.getAnnotations().length);
     }
 
+    public static void testNestedNonGeneric() throws Exception {
+        Field f = GetAnnotatedOwnerType.class.getField("nestedNonGeneric");
+
+        // make sure inner is correctly annotated
+        AnnotatedType inner = f.getAnnotatedType();
+        Asserts.assertEquals(inner.getAnnotation(TB.class).value(), "non-generic");
+        Asserts.assertTrue(inner.getAnnotations().length == 1, "expecting one (1) annotation, got: "
+                + inner.getAnnotations().length);
+
+        // make sure owner is correctly annotated, on the correct type
+        AnnotatedType outer = inner.getAnnotatedOwnerType();
+        Asserts.assertEquals(outer.getType(), ((Class<?>)f.getGenericType()).getEnclosingClass());
+        Asserts.assertTrue(outer.getAnnotations().length == 0, "expecting no annotations, got: "
+                + outer.getAnnotations().length);
+    }
+
+    public static void testNestedGeneric() throws Exception {
+        Field f = GetAnnotatedOwnerType.class.getField("nestedGeneric");
+
+        // make sure inner is correctly annotated
+        AnnotatedType inner = f.getAnnotatedType();
+        Asserts.assertEquals(inner.getAnnotation(TB.class).value(), "generic");
+        Asserts.assertTrue(inner.getAnnotations().length == 1, "expecting one (1) annotation, got: "
+                + inner.getAnnotations().length);
+
+        // make sure owner is correctly annotated, on the correct type
+        AnnotatedType outer = inner.getAnnotatedOwnerType();
+        Asserts.assertEquals(outer.getType(), ((ParameterizedType) f.getGenericType()).getOwnerType());
+        Asserts.assertTrue(outer.getAnnotations().length == 0, "expecting no annotations, got: "
+                + outer.getAnnotations().length);
+    }
+
+    public static void testNestedRaw() throws Exception {
+        Field f = GetAnnotatedOwnerType.class.getField("nestedRaw");
+
+        // make sure inner is correctly annotated
+        AnnotatedType inner = f.getAnnotatedType();
+        Asserts.assertEquals(inner.getAnnotation(TB.class).value(), "raw");
+        Asserts.assertTrue(inner.getAnnotations().length == 1, "expecting one (1) annotation, got: "
+                + inner.getAnnotations().length);
+
+        // make sure owner is correctly annotated, on the correct type
+        AnnotatedType outer = inner.getAnnotatedOwnerType();
+        Asserts.assertEquals(outer.getType(), ((Class<?>)f.getGenericType()).getEnclosingClass());
+        Asserts.assertTrue(outer.getAnnotations().length == 0, "expecting no annotations, got: "
+                + outer.getAnnotations().length);
+    }
+
     public static void testLocalClass() throws Exception {
         class ALocalClass {}
         class OneMore {
@@ -279,4 +333,8 @@
     class Inner {}
 
     class InnerGeneric<Dummy> {}
+
+    static class Nested {}
+
+    static class NestedGeneric<Dummy> {}
 }
--- a/test/jdk/java/math/BigInteger/ModPow.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/jdk/java/math/BigInteger/ModPow.java	Wed Jan 02 10:21:54 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 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
@@ -22,18 +22,25 @@
  */
 
 /* @test
- * @bug 4181191
- * @summary test BigInteger modPow method
+ * @bug 4181191 8215759
+ * @summary test BigInteger modPow method (use -Dseed=X to set PRNG seed)
+ * @library /test/lib
+ * @build jdk.test.lib.RandomFactory
+ * @run main ModPow
+ * @key randomness
  */
 import java.math.BigInteger;
 import java.util.Random;
+import jdk.test.lib.RandomFactory;
 
 public class ModPow {
     public static void main(String[] args) {
-        Random rnd = new Random(1234);
+        Random rnd = RandomFactory.getRandom();
 
         for (int i=0; i<2000; i++) {
-            BigInteger m = new BigInteger(800, rnd);
+            // Clamp random modulus to a positive value or modPow() will
+            // throw an ArithmeticException.
+            BigInteger m = new BigInteger(800, rnd).max(BigInteger.ONE);
             BigInteger base = new BigInteger(16, rnd);
             if (rnd.nextInt() % 1 == 0)
                 base = base.negate();
--- a/test/jdk/java/util/Collections/NCopies.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/jdk/java/util/Collections/NCopies.java	Wed Jan 02 10:21:54 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -28,8 +28,11 @@
  * @author  Martin Buchholz
  */
 
+import java.util.ArrayList;
 import java.util.Collections;
+import java.util.AbstractList;
 import java.util.List;
+import java.util.Objects;
 
 public class NCopies {
     static volatile int passed = 0, failed = 0;
@@ -82,6 +85,56 @@
             checkEmpty(x.subList(x.size()/2, x.size()/2));
     }
 
+    private static <T> List<T> referenceNCopies(int n, T o) {
+        // A simplest correct implementation of nCopies to compare with the actual optimized implementation
+        return new AbstractList<>() {
+            public int size() { return n; }
+
+            public T get(int index) {
+                Objects.checkIndex(index, n);
+                return o;
+            }
+        };
+    }
+
+    private static void checkHashCode() {
+        int[] sizes = {0, 1, 2, 3, 5, 10, 31, 32, 100, 1000};
+        String[] elements = {null, "non-null"};
+        for (int size : sizes) {
+            for (String element : elements) {
+                int expectedHashCode = referenceNCopies(size, element).hashCode();
+                int actualHashCode = Collections.nCopies(size, element).hashCode();
+                check(expectedHashCode == actualHashCode,
+                        "Collections.nCopies(" + size + ", " + element + ").hashCode()");
+            }
+        }
+    }
+
+    private static void checkEquals() {
+        int[][] sizePairs = {{0, 0}, {0, 1}, {1, 0}, {1, 1}, {1, 2}, {2, 1}};
+        String[] elements = {null, "non-null"};
+        for (int[] pair : sizePairs) {
+            for (String element : elements) {
+                boolean equal = pair[0] == pair[1];
+                String msg = "[" + pair[0] + ", " + element + "] <=> [" + pair[1] + ", " + element + "]";
+                check(equal == Collections.nCopies(pair[0], element).equals(Collections.nCopies(pair[1], element)), msg);
+                check(equal == Collections.nCopies(pair[0], element).equals(referenceNCopies(pair[1], element)), msg);
+                check(equal == referenceNCopies(pair[0], element).equals(Collections.nCopies(pair[1], element)), msg);
+            }
+        }
+        List<String> nulls = Collections.nCopies(10, null);
+        List<String> nonNulls = Collections.nCopies(10, "non-null");
+        List<String> nullsButOne = new ArrayList<>(nulls);
+        nullsButOne.set(9, "non-null");
+        List<String> nonNullsButOne = new ArrayList<>(nonNulls);
+        nonNullsButOne.set(9, null);
+        check(!nulls.equals(nonNulls));
+        check(!nulls.equals(nullsButOne));
+        check(!nulls.equals(nonNullsButOne));
+        check(!nonNulls.equals(nonNullsButOne));
+        check(Collections.nCopies(0, null).equals(Collections.nCopies(0, "non-null")));
+    }
+
     public static void main(String[] args) {
         try {
             List<String> empty = Collections.nCopies(0, "foo");
@@ -92,6 +145,10 @@
             check(foos.size() == 42);
             checkFoos(foos.subList(foos.size()/2, foos.size()-1));
 
+            checkHashCode();
+
+            checkEquals();
+
         } catch (Throwable t) { unexpected(t); }
 
         System.out.printf("%nPassed = %d, failed = %d%n%n", passed, failed);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/java/util/jar/Attributes/NullAndEmptyKeysAndValues.java	Wed Jan 02 10:21:54 2019 +0100
@@ -0,0 +1,201 @@
+/*
+ * 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.
+ */
+
+import static java.nio.charset.StandardCharsets.UTF_8;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.util.jar.Attributes;
+import java.util.jar.Manifest;
+import java.util.jar.Attributes.Name;
+import java.lang.reflect.Field;
+
+import org.testng.annotations.Test;
+import static org.testng.Assert.*;
+
+/**
+ * @test
+ * @bug 8066619
+ * @modules java.base/java.util.jar:+open
+ * @run testng/othervm NullAndEmptyKeysAndValues
+ * @summary Tests manifests with {@code null} and empty string {@code ""}
+ * values as section name, header name, or value in both main and named
+ * attributes sections.
+ */
+/*
+ * Note to future maintainer:
+ * In order to actually being able to test all the cases where key and values
+ * are null normal manifest and attributes manipulation through their public
+ * api is not sufficient but then there were these null checks there before
+ * which may or may not have had their reason and this way it's ensured that
+ * the behavior does not change with that respect.
+ * Once module isolation is enforced some test cases will not any longer be
+ * possible and those now tested situations will be guaranteed not to occur
+ * any longer at all at which point the corresponding tests can be removed
+ * safely without replacement unless of course another way is found inject the
+ * tested null values.
+ * Another trick to access package private class members could be to use
+ * deserialization or adding a new class to the same package on the classpath.
+ * Here is not important how the values are set to null because it shows that
+ * the behavior remains unchanged.
+ */
+public class NullAndEmptyKeysAndValues {
+
+    static final String SOME_KEY = "some-key";
+    static final String SOME_VALUE = "some value";
+    static final String NULL_TEXT = "null";
+    static final String EMPTY_STR = "";
+    static final Name EMPTY_NAME = new Name("tmp") {{
+        try {
+            Field name = Name.class.getDeclaredField("name");
+            name.setAccessible(true);
+            name.set(this, EMPTY_STR);
+        } catch (Exception e) {
+            throw new RuntimeException(e.getMessage(), e);
+        }
+    }};
+
+    @Test
+    public void testMainAttributesHeaderNameNull() throws Exception {
+        Manifest mf = new Manifest();
+        Field attr = mf.getClass().getDeclaredField("attr");
+        attr.setAccessible(true);
+        Attributes mainAtts = new Attributes() {{
+            super.put(null, SOME_VALUE);
+        }};
+        attr.set(mf, mainAtts);
+        mf.getMainAttributes().put(Name.MANIFEST_VERSION, "1.0");
+        assertThrows(NullPointerException.class, () -> writeAndRead(mf));
+    }
+
+    @Test
+    public void testMainAttributesHeaderNameEmpty() throws Exception {
+        Manifest mf = new Manifest();
+        mf.getMainAttributes().put(Name.MANIFEST_VERSION, "1.0");
+        mf.getMainAttributes().put(EMPTY_NAME, SOME_VALUE);
+        assertThrows(IOException.class, () -> writeAndRead(mf));
+    }
+
+    @Test
+    public void testMainAttributesHeaderValueNull() throws Exception {
+        Manifest mf = new Manifest();
+        Field attr = mf.getClass().getDeclaredField("attr");
+        attr.setAccessible(true);
+        Attributes mainAtts = new Attributes() {{
+            map.put(new Name(SOME_KEY), null);
+        }};
+        attr.set(mf, mainAtts);
+        mf.getMainAttributes().put(Name.MANIFEST_VERSION, "1.0");
+        mf = writeAndRead(mf);
+        assertEquals(mf.getMainAttributes().getValue(SOME_KEY), NULL_TEXT);
+    }
+
+    @Test
+    public void testMainAttributesHeaderValueEmpty() throws Exception {
+        Manifest mf = new Manifest();
+        Field attr = mf.getClass().getDeclaredField("attr");
+        attr.setAccessible(true);
+        Attributes mainAtts = new Attributes() {{
+            map.put(new Name(SOME_KEY), EMPTY_STR);
+        }};
+        attr.set(mf, mainAtts);
+        mf.getMainAttributes().put(Name.MANIFEST_VERSION, "1.0");
+        mf = writeAndRead(mf);
+        assertEquals(mf.getMainAttributes().getValue(SOME_KEY), EMPTY_STR);
+    }
+
+    @Test
+    public void testSectionNameNull() throws IOException {
+        Manifest mf = new Manifest();
+        mf.getMainAttributes().put(Name.MANIFEST_VERSION, "1.0");
+        mf.getEntries().put(null, new Attributes());
+        mf = writeAndRead(mf);
+        assertNotNull(mf.getEntries().get(NULL_TEXT));
+    }
+
+    @Test
+    public void testSectionNameEmpty() throws IOException {
+        Manifest mf = new Manifest();
+        mf.getMainAttributes().put(Name.MANIFEST_VERSION, "1.0");
+        mf.getEntries().put(EMPTY_STR, new Attributes());
+        mf = writeAndRead(mf);
+        assertNotNull(mf.getEntries().get(EMPTY_STR));
+    }
+
+    @Test
+    public void testNamedSectionHeaderNameNull() throws IOException {
+        Manifest mf = new Manifest();
+        mf.getMainAttributes().put(Name.MANIFEST_VERSION, "1.0");
+        mf.getEntries().put(SOME_KEY, new Attributes() {{
+            map.put(null, SOME_VALUE);
+        }});
+        assertThrows(NullPointerException.class, () -> writeAndRead(mf));
+    }
+
+    @Test
+    public void testNamedSectionHeaderNameEmpty() throws IOException {
+        Manifest mf = new Manifest();
+        mf.getMainAttributes().put(Name.MANIFEST_VERSION, "1.0");
+        mf.getEntries().put(SOME_KEY, new Attributes() {{
+            map.put(EMPTY_NAME, SOME_VALUE);
+        }});
+        assertThrows(IOException.class, () -> writeAndRead(mf));
+    }
+
+    @Test
+    public void testNamedSectionHeaderValueNull() throws IOException {
+        Manifest mf = new Manifest();
+        mf.getMainAttributes().put(Name.MANIFEST_VERSION, "1.0");
+        mf.getEntries().put(SOME_KEY, new Attributes() {{
+            map.put(new Name(SOME_KEY), null);
+        }});
+        mf = writeAndRead(mf);
+        assertEquals(mf.getEntries().get(SOME_KEY).getValue(SOME_KEY),
+                NULL_TEXT);
+    }
+
+    @Test
+    public void testNamedSectionHeaderValueEmpty() throws IOException {
+        Manifest mf = new Manifest();
+        mf.getMainAttributes().put(Name.MANIFEST_VERSION, "1.0");
+        mf.getEntries().put(SOME_KEY, new Attributes() {{
+            map.put(new Name(SOME_KEY), EMPTY_STR);
+        }});
+        mf = writeAndRead(mf);
+        assertEquals(mf.getEntries().get(SOME_KEY).getValue(SOME_KEY),
+                EMPTY_STR);
+    }
+
+    static Manifest writeAndRead(Manifest mf) throws IOException {
+        ByteArrayOutputStream out = new ByteArrayOutputStream();
+        mf.write(out);
+        byte[] mfBytes = out.toByteArray();
+        System.out.println("-".repeat(72));
+        System.out.print(new String(mfBytes, UTF_8));
+        System.out.println("-".repeat(72));
+        ByteArrayInputStream in = new ByteArrayInputStream(mfBytes);
+        return new Manifest(in);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/java/util/jar/Manifest/ValueUtf8Coding.java	Wed Jan 02 10:21:54 2019 +0100
@@ -0,0 +1,212 @@
+/*
+ * 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.
+ */
+
+import static java.nio.charset.StandardCharsets.UTF_8;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.util.jar.Attributes;
+import java.util.jar.Attributes.Name;
+import java.util.jar.Manifest;
+import java.util.List;
+import java.util.ArrayList;
+
+import org.testng.annotations.Test;
+import static org.testng.Assert.*;
+
+/**
+ * @test
+ * @bug 8066619
+ * @run testng ValueUtf8Coding
+ * @summary Tests encoding and decoding manifest header values to and from
+ * UTF-8 with the complete Unicode character set.
+ */ /*
+ * see also "../tools/launcher/UnicodeTest.java" for manifest attributes
+ * parsed during launch
+ */
+public class ValueUtf8Coding {
+
+    /**
+     * Maximum number of bytes of UTF-8 encoded characters in one header value.
+     * <p>
+     * There are too many different Unicode code points (more than one million)
+     * to fit all into one manifest value. The specifications state:
+     * <q>Implementations should support 65535-byte (not character) header
+     * values, and 65535 headers per file. They might run out of memory,
+     * but there should not be hard-coded limits below these values.</q>
+     *
+     * @see <a
+     * href="{@docRoot}/../specs/jar/jar.html#Notes_on_Manifest_and_Signature_Files">
+     * Notes on Manifest and Signature Files</a>
+     */
+    static final int SUPPORTED_VALUE_LENGTH = 65535;
+
+    /**
+     * Returns {@code true} if {@code codePoint} is known not to be a supported
+     * character in manifest header values. Explicitly forbidden in manifest
+     * header values are according to a statement from the specifications:
+     * <q>otherchar: any UTF-8 character except NUL, CR and LF</q>.
+     * {@code NUL} ({@code 0x0}), however, works just fine and might have been
+     * used and might still be.
+     *
+     * @see <a href="{@docRoot}/../specs/jar/jar.html#Section-Specification">
+     * Jar File Specification</a>
+     */
+    static boolean isUnsupportedManifestValueCharacter(int codePoint) {
+        return codePoint == '\r' /* CR */ || codePoint == '\n' /* LF */;
+    };
+
+    /**
+     * Produces a list of strings with all Unicode characters except those
+     * explicitly invalid in manifest header values.
+     * Each string is filled with as many characters as fit into
+     * {@link #SUPPORTED_VALUE_LENGTH} bytes with UTF-8 encoding except the
+     * last string which contains the remaining characters. Each of those
+     * strings becomes a header value the number of which 65535 should be
+     * supported per file.
+     *
+     * @see <a
+     * href="{@docRoot}/../specs/jar/jar.html#Notes_on_Manifest_and_Signature_Files">
+     * Notes on Manifest and Signature Files</a>
+     */
+    static List<String> produceValuesWithAllUnicodeCharacters() {
+        ArrayList<String> values = new ArrayList<>();
+        byte[] valueBuf = new byte[SUPPORTED_VALUE_LENGTH];
+        int pos = 0;
+        for (int codePoint = Character.MIN_CODE_POINT;
+                codePoint <= Character.MAX_CODE_POINT; codePoint++) {
+            if (isUnsupportedManifestValueCharacter(codePoint)) {
+                continue;
+            }
+
+            byte[] charBuf = Character.toString(codePoint).getBytes(UTF_8);
+            if (pos + charBuf.length > valueBuf.length) {
+                values.add(new String(valueBuf, 0, pos, UTF_8));
+                pos = 0;
+            }
+            System.arraycopy(charBuf, 0, valueBuf, pos, charBuf.length);
+            pos += charBuf.length;
+        }
+        if (pos > 0) {
+            values.add(new String(valueBuf, 0, pos, UTF_8));
+        }
+        // minimum number of headers supported is the same as the minimum size
+        // of each header value in bytes
+        assertTrue(values.size() <= SUPPORTED_VALUE_LENGTH);
+        return values;
+    }
+
+    /**
+     * Returns simple, valid, short, and distinct manifest header names.
+     * The returned name cannot collide with "{@code Manifest-Version}" because
+     * the returned string does not contain "{@code -}".
+     */
+    static Name azName(int seed) {
+        StringBuffer name = new StringBuffer();
+        do {
+            name.insert(0, (char) (seed % 26 + (seed < 26 ? 'A' : 'a')));
+            seed = seed / 26 - 1;
+        } while (seed >= 0);
+        return new Name(name.toString());
+    }
+
+    /**
+     * Writes and reads a manifest with the complete Unicode character set.
+     * The characters are grouped into manifest header values with about as
+     * many bytes as allowed each, utilizing a single big manifest.
+     * <p>
+     * This test assumes that a manifest is encoded and decoded correctly if
+     * writing and then reading it again results in a manifest with identical
+     * values as the original. The test is not about other aspects of writing
+     * and reading manifests than only that, given the fact and the way it
+     * works for some characters such as the most widely and often used ones,
+     * it also works for the complete Unicode character set just the same.
+     * <p>
+     * Only header values are tested. The set of allowed characters for header
+     * names are much more limited and are a different topic entirely and most
+     * simple ones are used here as necessary just to get valid and different
+     * ones (see {@link #azName}).
+     * <p>
+     * Because the current implementation under test uses different portions
+     * of code depending on where the value occurs to read or write, each
+     * character is tested in each of the three positions:<ul>
+     * <li>main attribute header,</li>
+     * <li>named section name, and</li>
+     * <li>named sections header values</li>
+     * </ul>
+     * Implementation of writing the main section headers in
+     * {@link Attributes#writeMain(java.io.DataOutputStream)} differs from the
+     * one writing named section headers in
+     * {@link Attributes#write(java.io.DataOutputStream)} regarding the special
+     * order of {@link Name#MANIFEST_VERSION} and
+     * {@link Name#SIGNATURE_VERSION} and also
+     * {@link Manifest#read(java.io.InputStream)} at least potentially reads
+     * main sections differently than reading named sections names headers in
+     * {@link Attributes#read(Manifest.FastInputStream, byte[])}.
+     */
+    @Test
+    public void testCompleteUnicodeCharacterSet() throws IOException {
+        Manifest mf = new Manifest();
+        mf.getMainAttributes().put(Name.MANIFEST_VERSION, "1.0");
+
+        List<String> values = produceValuesWithAllUnicodeCharacters();
+        for (int i = 0; i < values.size(); i++) {
+            Name name = azName(i);
+            String value = values.get(i);
+
+            mf.getMainAttributes().put(name, value);
+            Attributes attributes = new Attributes();
+            mf.getEntries().put(value, attributes);
+            attributes.put(name, value);
+        }
+
+        mf = writeAndRead(mf);
+
+        for (int i = 0; i < values.size(); i++) {
+            String value = values.get(i);
+            Name name = azName(i);
+
+            assertEquals(mf.getMainAttributes().getValue(name), value,
+                    "main attributes header value");
+            Attributes attributes = mf.getAttributes(value);
+            assertNotNull(attributes, "named section");
+            assertEquals(attributes.getValue(name), value,
+                    "named section attributes value");
+        }
+    }
+
+    static Manifest writeAndRead(Manifest mf) throws IOException {
+        ByteArrayOutputStream out = new ByteArrayOutputStream();
+        mf.write(out);
+        byte[] mfBytes = out.toByteArray();
+
+        System.out.println("-".repeat(72));
+        System.out.print(new String(mfBytes, UTF_8));
+        System.out.println("-".repeat(72));
+
+        ByteArrayInputStream in = new ByteArrayInputStream(mfBytes);
+        return new Manifest(in);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/java/util/jar/Manifest/WriteBinaryStructure.java	Wed Jan 02 10:21:54 2019 +0100
@@ -0,0 +1,73 @@
+/*
+ * 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.
+ */
+
+import static java.nio.charset.StandardCharsets.UTF_8;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.util.jar.Attributes;
+import java.util.jar.Attributes.Name;
+import java.util.jar.Manifest;
+
+import org.testng.annotations.Test;
+import static org.testng.Assert.*;
+
+/**
+ * @test
+ * @bug 8066619
+ * @run testng WriteBinaryStructure
+ * @summary Tests that jar manifests are written in a particular structure
+ */
+public class WriteBinaryStructure {
+
+    @Test
+    public void testMainAttributes() throws IOException {
+        Manifest mf = new Manifest();
+        mf.getMainAttributes().put(Name.MANIFEST_VERSION, "1.0");
+        mf.getMainAttributes().put(new Name("Key"), "Value");
+        ByteArrayOutputStream buf = new ByteArrayOutputStream();
+        mf.write(buf);
+        assertEquals(buf.toByteArray(), (
+                "Manifest-Version: 1.0\r\n" +
+                "Key: Value\r\n" +
+                "\r\n").getBytes(UTF_8));
+    }
+
+    @Test
+    public void testIndividualSection() throws IOException {
+        Manifest mf = new Manifest();
+        mf.getMainAttributes().put(Name.MANIFEST_VERSION, "1.0");
+        Attributes attributes = new Attributes();
+        mf.getEntries().put("Individual-Section-Name", attributes);
+        attributes.put(new Name("Key"), "Value");
+        ByteArrayOutputStream buf = new ByteArrayOutputStream();
+        mf.write(buf);
+        assertEquals(buf.toByteArray(), (
+                "Manifest-Version: 1.0\r\n" +
+                "\r\n" +
+                "Name: Individual-Section-Name\r\n" +
+                "Key: Value\r\n" +
+                "\r\n").getBytes(UTF_8));
+    }
+
+}
--- a/test/jdk/sun/management/jmxremote/bootstrap/GeneratePropertyPassword.sh	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/jdk/sun/management/jmxremote/bootstrap/GeneratePropertyPassword.sh	Wed Jan 02 10:21:54 2019 +0100
@@ -34,12 +34,13 @@
 OS=`uname -s`
 UMASK=`umask`
 
-if [[ $OS == CYGWIN_NT* ]] ; then
+case $OS in
+CYGWIN_NT*)
     OS="Windows_NT"
     if [ -z "$SystemRoot" ] ;  then
         SystemRoot=`cygpath $SYSTEMROOT`
     fi
-fi
+esac
 
 case $OS in
 SunOS | Linux | Darwin | AIX )
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/sun/security/pkcs12/ProbeBER.java	Wed Jan 02 10:21:54 2019 +0100
@@ -0,0 +1,126 @@
+/*
+ * 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 8215769
+ * @summary Java cannot probe pkcs12 files exported by Firefox
+ */
+
+import java.io.File;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.security.KeyStore;
+
+public class ProbeBER {
+
+    public static final void main(String[] args) throws Exception {
+
+        // This is a PKCS12 file using BER encoding
+        String p12String =
+            "3080020103308006092a864886f70d010701a0802480048208eb308030800609" +
+            "2a864886f70d010701a08024800482054a3082054630820542060b2a864886f7" +
+            "0d010c0a0102a08204f7308204f33025060a2a864886f70d010c010330170410" +
+            "8dbfae75350a0f53d71bce1f8d7544b902030927c0048204c8d72c2675a105cb" +
+            "7403547cce341b58b5c6943e69ae1ca597f5ea1777497adfbba455283524a46d" +
+            "8d8301b2ba4d2304513ef4761e8a65a6e64f6d646a1501fa7f3c282d0f9a5a23" +
+            "71b7fdf251464db00b617ed7017f11ab9286e10f7a5d30a21755c3aaf50473e4" +
+            "41262bf103fa141f9caba66562f2a96aaf12a200c38aba11991ad73d9cee0008" +
+            "2a7077a4a9a597336745895555cb24ca910be68c23ac5c4a5d1e47d387bf031d" +
+            "3833c2cff88d6157da6152731b083ecfca20e3850f3fca4743d7ee0fb773be44" +
+            "4e63b00c1096f34719dfef53912d01e477491bf0b7b01227c8fbbaf48fa399f7" +
+            "f30d1ec0f622f66686d8a8baffdb811c201b408b89d483cc92f2bdcf7771b982" +
+            "d43e821cfa45d789aeed87ca9ec9e3b283dc45395c6503f80e8d9e658e4e9160" +
+            "5b141afec2ab065e1be39c0e67d665bedf2049561c583e3fd825688798bcbdb6" +
+            "73cd2109cc20713fb6bab07648883e8f479e4877fc0c43cebdf0fe3a9e81b87a" +
+            "ab4314cc2e8834360b3c9e49bf78fb2175112880191911846764b16eaf361584" +
+            "039325e9c1a054f2c20cf4baf1ddd8f5636c4067cb411d4643031ce7299cc9dc" +
+            "bc175b57e31bf5914c3e3cc490fb0538f34774898d3f5189ddf2261dadc25d89" +
+            "bc3068dea6786023fe8a727e390e8b4a9b0a924490443d38962b57804b646169" +
+            "427a42a36b2a9046e27f805f088516e9d07b0b77fc59650979364fe0cf44debf" +
+            "6748d4b9c7fd54ec35fd51208e089a8b2a2117ee20df2225589595769137de28" +
+            "a058e9a316828bb76499dfb66184e7fe6abb6840f664cf328e99126234a7c15d" +
+            "b9c64acc2645e9e54b8a3888fea85054d9f3cea8586104b9de852bae696cb217" +
+            "fca6e063e2272db81ae9ec9f4c291711c1bce51c72fed98f40a3dd6ba7858be1" +
+            "1eda50f3270bbe753255e46b2dd0aface15a5ff034a2604b10f2afb8db2a74fd" +
+            "9d3bd4b146386fa4b5b850fe857e79fc5e34d2e056c4f2eb9fdbf2922eabc36f" +
+            "c7fe5fcdd5909a440b77e49256edd3ae77d317845d1dbbe7c3d05652540b35b8" +
+            "2df52b7f120ec335fdc3ee52c888fdccdbffd83aae8544be2c6b8e3c9ee2fc05" +
+            "3750833085dbcbd019e9584bec7b80cb95689459e5436819006c02dd844635a8" +
+            "3fc565c8e5ddc1344a9a1cba9c9fcefe684cc75b4483f4e6072cc07eee72b1fe" +
+            "4e93b23843969acdca4359a53a39a01da62ec154ef00491589c8f15a39b01b38" +
+            "58c4dfdb13a939e7fd82228d8b2f99b3d59e595fc7b990ffa6b6fa82af64becd" +
+            "5b9a98a6cca74f6b2f6812678c781bfa7ab0f764c29ca6c22f38bf57bfd9d063" +
+            "0e69d8800b25f9c8aa3008522fbf68a4486cdd7d534cfc21ee5426dc0e5329c0" +
+            "e7967d9b53b90638555f3d662bd539f8f235a35e1ed0546572a7a0395c325d23" +
+            "373eef5b57bb937371947abffa806c8629c2cc32755153ca478ab97b3e76f187" +
+            "5ab59bbcb7c57b5a96d0b26f133b46f0e2eca8471135b6d0f4b1ea3a6d8654d8" +
+            "642a70a8f225fbffb199c051ff45ae91e50384f6b46b4373fa4fdca847dbc71e" +
+            "c077269e7644805cd82c6624de1d1c376d646c6133d1718ad031216690913366" +
+            "fc4eaa831830619d45dcc5335baf90855e5438ad5d2ac2e31cf2cc5a5b2867f4" +
+            "193af8658097226bb4521061b2bef8dd0def00f86175d0b14301516f5a3c7119" +
+            "7423cb327c3dc67efdc34605ab76a12895aba2582b5b4acc4b3dbb3a6d8679d0" +
+            "2b3138301106092a864886f70d01091431041e020061302306092a864886f70d" +
+            "01091531160414e5ae3d63720b42d660fcfb2453ebec069783b7f30000000000" +
+            "00308006092a864886f70d010706a0803080020100308006092a864886f70d01" +
+            "07013025060a2a864886f70d010c0106301704103b377c374d17c41a669fed4c" +
+            "0fe3738a02030927c0a0800482032090c0a55a1c909e56310c3bc92a4b93cca1" +
+            "b9e867c15216ce6bc2d397c30dc4c105d71b3f94dc599707f9d14abfe3d92572" +
+            "e8dda6480879f3aba6b513f6c5db67ce0025c68af51c114a9fac664be2325965" +
+            "7b04e2be92dde84cda6edc3c8e1a18b5c84c33691a5d1a4e3a203c74fe0cab62" +
+            "85312454a0993fb9b30fbae0f20f19f307b4ad74d9501fa517d5d5ccc91903dd" +
+            "3bdf9a438cbbebd5263dfb6605534aa2acc3ee6c0ce341533e5e74b1bf82f57d" +
+            "a9254fc2f91eab013658eb06b6c0302c3bd674ecf30025d546bb1290d732ab8b" +
+            "ba4bcf9c02e5774f7f522856acbef7159be6b7e6a2cb6119e3ac039fc93247d3" +
+            "5f08281c1d50d0ea7275d75095ced1518f7c4ee1c072871139cf6cf6f9c67606" +
+            "0396c430c0cbdae332af42ac3c2458c929644aa4e695a9050b6cf61563f16c0f" +
+            "f552114df5d4ee22e0335413a3b93ec1f0fa43b00f36d4ef7efb849731229c2d" +
+            "0b043d57504dff525383d927dde23c95c3d4e2546e3478220a25e56a37e7904a" +
+            "323a4db9e2d94b268bee66a38490e34c7ed077bf20677b173e98ef3687e89310" +
+            "e46a1b5ead88d0eb1d2b9d729854b002e70164844f50197e97e8b257ad275ee6" +
+            "e127fae23bd6afd9e1fe61e3574380dc371ad7b2bb0e00501bdf543feaf461f6" +
+            "b483154f984441a7c62469ab82da56d942d49773f6d271feacc0421c413f4e47" +
+            "e88863e9ea879af6fda6c31b0a4ea715746234ef2b0e7dffa8aacfc98a9129c8" +
+            "96b86f90655a776e817713828961cbf78b0bf81be29ccc7735203f971be2125a" +
+            "f770bf7b0815c5f610a0a6f45e7455bfde110d41dc621898aa22f0c0391787bb" +
+            "f4a7485a59d6cb3d2558ec5ca210ab45f0ee98abdeea555353d7fd9af80d953d" +
+            "8795bb21b7ac6fb185cffbf8cf6409dc837860a463805658f6c9c6ac50722a94" +
+            "05a7c44e9f71d41031c200c6e1ba2d7d34a7859011feaa9dbbaa26c585c7fea4" +
+            "cf14e432f0d8277d6d4d2d86e25dc280922aa92802915f22236e588136b2ad45" +
+            "df5145dcfb9f3dd5fa92e4353efbd75b90bb320c028abecccd1d31f9e087c094" +
+            "70bae73647367e2bdd874ce19ca15b16fa1c96469518e646be3852e9e65f6035" +
+            "e2ca9a59193c5c4e2edefe739d5cd50408abec9671d9574be800000000000000" +
+            "0000000000000000000000303a3021300906052b0e03021a05000414d9248a44" +
+            "786f0888dc8389bab0a5daa3246031ea0410247e59baa3f6e829425929a052e7" +
+            "6c9a02030927c00000";
+        byte[] p12 = new byte[p12String.length()/2];
+        for (int i=0; i<p12.length; i++) {
+            p12[i] = Integer.valueOf(
+                    p12String.substring(2*i,2*i+2), 16).byteValue();
+        }
+
+        Files.write(Path.of("p12"), p12);
+        KeyStore.getInstance(new File("p12"), "changeit".toCharArray())
+                .getCertificate("a");
+    }
+}
--- a/test/langtools/jdk/javadoc/doclet/5093723/T5093723.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/5093723/T5093723.java	Wed Jan 02 10:21:54 2019 +0100
@@ -25,12 +25,14 @@
  * @test
  * @bug      5093723
  * @summary  REGRESSION: ClassCastException in SingleIndexWriter
- * @library ../lib
- * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build    JavadocTester
+ * @library  ../../lib
+ * @modules  jdk.javadoc/jdk.javadoc.internal.tool
+ * @build    javadoc.tester.*
  * @run main T5093723
  */
 
+import javadoc.tester.JavadocTester;
+
 public class T5093723 extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -39,7 +41,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         setAutomaticCheckLinks(false); // @ignore JDK-8202617
         javadoc("-d", "out",
                 "-Xdoclint:none",
--- a/test/langtools/jdk/javadoc/doclet/AccessAsciiArt/AccessAsciiArt.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/AccessAsciiArt/AccessAsciiArt.java	Wed Jan 02 10:21:54 2019 +0100
@@ -26,12 +26,14 @@
  * @bug 4706779 4956908
  * @summary  Add text equivalent of class tree ASCII art for accessibility
  * @author dkramer
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
  * @run main AccessAsciiArt
  */
 
+import javadoc.tester.JavadocTester;
+
 public class AccessAsciiArt extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -40,7 +42,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         javadoc("-d", "out",
                 "-sourcepath", testSrc,
                 "p1", "p1.subpkg");
--- a/test/langtools/jdk/javadoc/doclet/AccessFrameTitle/AccessFrameTitle.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/AccessFrameTitle/AccessFrameTitle.java	Wed Jan 02 10:21:54 2019 +0100
@@ -26,12 +26,14 @@
  * @bug 4636655 8196202
  * @summary  Add title attribute to <FRAME> tags for accessibility
  * @author dkramer
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
  * @run main AccessFrameTitle
  */
 
+import javadoc.tester.JavadocTester;
+
 public class AccessFrameTitle extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -40,7 +42,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         javadoc("-d", "out",
                 "--frames",
                 "-sourcepath", testSrc,
--- a/test/langtools/jdk/javadoc/doclet/AccessH1/AccessH1.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/AccessH1/AccessH1.java	Wed Jan 02 10:21:54 2019 +0100
@@ -26,13 +26,15 @@
  * @bug 4636667 7052425 8016549 8196202
  * @summary  Use <H1, <H2>, and <H3> in proper sequence for accessibility
  * @author dkramer
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
  * @run main AccessH1
  */
 
 
+import javadoc.tester.JavadocTester;
+
 public class AccessH1 extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -41,7 +43,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         javadoc("-d", "out",
                 "-doctitle", "Document Title",
                 "--frames",
--- a/test/langtools/jdk/javadoc/doclet/AccessSkipNav/AccessSkipNav.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/AccessSkipNav/AccessSkipNav.java	Wed Jan 02 10:21:54 2019 +0100
@@ -26,12 +26,14 @@
  * @bug 4638136 7198273 8025633 8081854 8182765
  * @summary  Add ability to skip over nav bar for accessibility
  * @author dkramer
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
  * @run main AccessSkipNav
  */
 
+import javadoc.tester.JavadocTester;
+
 public class AccessSkipNav extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -40,7 +42,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         javadoc("-d", "out",
                 "-sourcepath", testSrc,
                 "p1", "p2");
@@ -63,7 +65,7 @@
     }
 
     @Test
-    void test_html4() {
+    public void test_html4() {
         javadoc("-d", "out-html4",
                 "-html4",
                 "-sourcepath", testSrc,
--- a/test/langtools/jdk/javadoc/doclet/AccessSummary/AccessSummary.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/AccessSummary/AccessSummary.java	Wed Jan 02 10:21:54 2019 +0100
@@ -26,12 +26,14 @@
  * @bug      4637604 4775148 8183037 8182765 8196202
  * @summary  Test the tables for summary attribute
  * @author   dkramer
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build    JavadocTester
+ * @build    javadoc.tester.*
  * @run main AccessSummary
  */
 
+import javadoc.tester.JavadocTester;
+
 public class AccessSummary extends JavadocTester {
     /**
      * The entry point of the test.
@@ -44,7 +46,7 @@
     }
 
     @Test
-    void testAccessSummary() {
+    public void testAccessSummary() {
         javadoc("-d", "out",
                 "--frames",
                 "-sourcepath", testSrc,
@@ -54,7 +56,7 @@
     }
 
     @Test
-    void testAccessSummary_html4() {
+    public void testAccessSummary_html4() {
         javadoc("-d", "out-html4",
                 "-html4",
                 "--frames",
--- a/test/langtools/jdk/javadoc/doclet/AuthorDD/AuthorDD.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/AuthorDD/AuthorDD.java	Wed Jan 02 10:21:54 2019 +0100
@@ -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
@@ -26,15 +26,17 @@
  * @bug 4651598 8026567
  * @summary Javadoc wrongly inserts </DD> tags when using multiple @author tags
  * @author dkramer
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
  * @run main AuthorDD
  */
 
 /**
  * Runs javadoc and runs regression tests on the resulting HTML.
  */
+import javadoc.tester.JavadocTester;
+
 public class AuthorDD extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -43,7 +45,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         // Test for all cases except the split index page
         javadoc("-d", "out",
                 "-author",
--- a/test/langtools/jdk/javadoc/doclet/DocRootSlash/DocRootSlash.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/DocRootSlash/DocRootSlash.java	Wed Jan 02 10:21:54 2019 +0100
@@ -26,9 +26,9 @@
  * @bug 4524350 4662945 4633447 8196202
  * @summary stddoclet: {@docRoot} inserts an extra trailing "/"
  * @author dkramer
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
  * @run main DocRootSlash
  */
 
@@ -39,6 +39,8 @@
  * It reads each file, complete with newlines, into a string to easily
  * find strings that contain newlines.
  */
+import javadoc.tester.JavadocTester;
+
 public class DocRootSlash extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -47,7 +49,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         // Directory that contains source files that javadoc runs on
         String srcdir = System.getProperty("test.src", ".");
 
--- a/test/langtools/jdk/javadoc/doclet/InheritDocForUserTags/DocTest.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/InheritDocForUserTags/DocTest.java	Wed Jan 02 10:21:54 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2016, 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
@@ -26,9 +26,9 @@
  * @bug 8008768
  * @summary Using {@inheritDoc} in simple tag defined via -tag fails
  * @author Mike Duigou
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
  * @run main DocTest
  */
 
@@ -39,6 +39,8 @@
  * @implSpec DocTest implementation spec.
  * @implNote DocTest implementation note.
  */
+import javadoc.tester.JavadocTester;
+
 public class DocTest extends JavadocTester {
     public static void main(String... args) throws Exception {
         DocTest tester = new DocTest();
@@ -46,7 +48,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         javadoc("-verbose",
                 "-d", "DocTest",
                 "-tag", "apiNote:optcm:<em>API Note</em>",
--- a/test/langtools/jdk/javadoc/doclet/JavascriptWinTitle/JavascriptWinTitle.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/JavascriptWinTitle/JavascriptWinTitle.java	Wed Jan 02 10:21:54 2019 +0100
@@ -27,12 +27,14 @@
  * @summary  Javascript IE load error when linked by -linkoffline
  *           Window title shouldn't change when loading left frames (javascript)
  * @author dkramer
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
  * @run main JavascriptWinTitle
  */
 
+import javadoc.tester.JavadocTester;
+
 public class JavascriptWinTitle extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -41,7 +43,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         javadoc("-d", "out",
                 "-source", "8",
                 "--frames",
--- a/test/langtools/jdk/javadoc/doclet/MetaTag/MetaTag.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/MetaTag/MetaTag.java	Wed Jan 02 10:21:54 2019 +0100
@@ -27,15 +27,17 @@
  * @summary  Add support for HTML keywords via META tag for
  *           class and member names to improve API search
  * @author   dkramer
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build    JavadocTester
+ * @build    javadoc.tester.*
  * @run main MetaTag
  */
 
 import java.text.SimpleDateFormat;
 import java.util.Date;
 
+import javadoc.tester.JavadocTester;
+
 public class MetaTag extends JavadocTester {
 
     /**
@@ -49,7 +51,7 @@
     }
 
     @Test
-    void testStandard() {
+    public void testStandard() {
         javadoc("-d", "out-1",
                 "-sourcepath", testSrc,
                 "-keywords",
@@ -63,7 +65,7 @@
     }
 
     @Test
-    void testNoTimestamp() {
+    public void testNoTimestamp() {
         javadoc("-d", "out-2",
                 "-sourcepath", testSrc,
                 "-notimestamp",
@@ -77,7 +79,7 @@
     }
 
     @Test
-    void testStandard_html4() {
+    public void testStandard_html4() {
         javadoc("-d", "out-1-html4",
                 "-html4",
                 "-sourcepath", testSrc,
@@ -92,7 +94,7 @@
     }
 
     @Test
-    void testNoTimestamp_html4() {
+    public void testNoTimestamp_html4() {
         javadoc("-d", "out-2-html4",
                 "-html4",
                 "-sourcepath", testSrc,
--- a/test/langtools/jdk/javadoc/doclet/PackagesHeader/PackagesHeader.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/PackagesHeader/PackagesHeader.java	Wed Jan 02 10:21:54 2019 +0100
@@ -28,12 +28,14 @@
  *           is present for three sets of options: (1) -header,
  *           (2) -packagesheader, and (3) -header -packagesheader
  * @author   dkramer
- * @library  ../lib
+ * @library  ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build    JavadocTester
+ * @build    javadoc.tester.*
  * @run main PackagesHeader
  */
 
+import javadoc.tester.JavadocTester;
+
 public class PackagesHeader extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -42,7 +44,7 @@
     }
 
     @Test
-    void testHeader() {
+    public void testHeader() {
         // First test with -header only
         javadoc("-d", "out-header",
                 "-header", "Main Frame Header",
@@ -57,7 +59,7 @@
     }
 
     @Test
-    void testPackagesHeader() {
+    public void testPackagesHeader() {
         // Second test with -packagesheader only
         javadoc("-d", "out-packages-header",
                 "-packagesheader", "Packages Frame Header",
@@ -73,7 +75,7 @@
     }
 
     @Test
-    void testBothHeaders() {
+    public void testBothHeaders() {
         // Third test with both -packagesheader and -header
         javadoc("-d", "out-both",
                 "-packagesheader", "Packages Frame Header",
--- a/test/langtools/jdk/javadoc/doclet/T6735320/T6735320.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/T6735320/T6735320.java	Wed Jan 02 10:21:54 2019 +0100
@@ -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
@@ -25,12 +25,14 @@
  * @test
  * @bug 6735320
  * @summary javadoc throws exception if serialField value is missing
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
  * @run main T6735320
  */
 
+import javadoc.tester.JavadocTester;
+
 public class T6735320 extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -39,7 +41,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         javadoc("-d", "out",
                 testSrc("SerialFieldTest.java"));
         checkExit(Exit.ERROR);
--- a/test/langtools/jdk/javadoc/doclet/ValidHtml/ValidHtml.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/ValidHtml/ValidHtml.java	Wed Jan 02 10:21:54 2019 +0100
@@ -29,12 +29,14 @@
  *           Missing whitespace in DOCTYPE declaration
  *           HTML table tags inserted in wrong place in pakcage use page
  * @author dkramer
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
  * @run main ValidHtml
  */
 
+import javadoc.tester.JavadocTester;
+
 public class ValidHtml extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -43,7 +45,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         // Test for all cases except the split index page
         javadoc("-d", "out",
                     "-doctitle", "Document Title",
@@ -66,7 +68,7 @@
     }
 
     @Test
-    void test_html4() {
+    public void test_html4() {
         // Test for all cases except the split index page
         javadoc("-d", "out-html4",
                 "-html4",
--- a/test/langtools/jdk/javadoc/doclet/VersionNumber/VersionNumber.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/VersionNumber/VersionNumber.java	Wed Jan 02 10:21:54 2019 +0100
@@ -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
@@ -26,9 +26,9 @@
  * @bug 4720849
  * @summary  Standard doclet contains hard-coded version number
  * @author dkramer
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
  * @run main VersionNumber
  */
 
@@ -36,6 +36,8 @@
 /**
  * Runs javadoc and runs regression tests on the resulting HTML.
  */
+import javadoc.tester.JavadocTester;
+
 public class VersionNumber extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -44,7 +46,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         javadoc("-d", "out",
                 "p1");
         checkExit(Exit.OK);
--- a/test/langtools/jdk/javadoc/doclet/WindowTitles/WindowTitles.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/WindowTitles/WindowTitles.java	Wed Jan 02 10:21:54 2019 +0100
@@ -26,15 +26,17 @@
  * @bug 4530730 8196202
  * @summary stddoclet: With frames off, window titles have "()" appended
  * @author dkramer
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
  * @run main WindowTitles
  */
 
 /**
  * Runs javadoc and runs regression tests on the resulting HTML.
  */
+import javadoc.tester.JavadocTester;
+
 public class WindowTitles extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -43,7 +45,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         // Test for all cases except the split index page
         javadoc("-d", "out-1",
                 "-use",
@@ -71,7 +73,7 @@
     }
 
     @Test
-    void test2() {
+    public void test2() {
         // Test only for the split-index case (and run on only one package)
         javadoc("-d", "out-2",
                 "-splitindex",
--- a/test/langtools/jdk/javadoc/doclet/_template/Template.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/_template/Template.java	Wed Jan 02 10:21:54 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2014, 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
@@ -31,6 +31,8 @@
  * @ run main <CLASS NAME>
  */
 
+import javadoc.tester.JavadocTester;
+
 public class Template extends JavadocTester {
 
     //Javadoc arguments.
--- a/test/langtools/jdk/javadoc/doclet/_template/TemplateComplete.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/_template/TemplateComplete.java	Wed Jan 02 10:21:54 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2014, 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
@@ -31,6 +31,8 @@
  * @ run main <CLASS NAME>
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TemplateComplete extends JavadocTester {
 
     //Javadoc arguments.
--- a/test/langtools/jdk/javadoc/doclet/constantValues/TestConstantValuesDriver.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/constantValues/TestConstantValuesDriver.java	Wed Jan 02 10:21:54 2019 +0100
@@ -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
@@ -26,11 +26,13 @@
  * @bug 4504730 4526070 5077317 8162363
  * @summary Test the generation of constant-values.html.
  * @author jamieh
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
  * @run main TestConstantValuesDriver
  */
+import javadoc.tester.JavadocTester;
+
 public class TestConstantValuesDriver extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -39,7 +41,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         javadoc("-d", "out",
                 testSrc("TestConstantValues.java"),
                 testSrc("TestConstantValues2.java"),
--- a/test/langtools/jdk/javadoc/doclet/dupThrowsTags/TestDupThrowsTags.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/dupThrowsTags/TestDupThrowsTags.java	Wed Jan 02 10:21:54 2019 +0100
@@ -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
@@ -26,11 +26,13 @@
  * @bug 4525364
  * @summary Determine if duplicate throws tags can be used.
  * @author jamieh
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
  * @run main TestDupThrowsTags
  */
+import javadoc.tester.JavadocTester;
+
 public class TestDupThrowsTags extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -39,7 +41,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         javadoc("-d", "out",
                 testSrc("TestDupThrowsTags.java"));
         checkExit(Exit.ERROR);
--- a/test/langtools/jdk/javadoc/doclet/lib/JavadocTester.java	Fri Dec 21 01:29:51 2018 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1798 +0,0 @@
-/*
- * 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
- * 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.
- */
-
-import java.io.BufferedReader;
-import java.io.BufferedWriter;
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileWriter;
-import java.io.FilenameFilter;
-import java.io.InputStreamReader;
-import java.io.IOException;
-import java.io.PrintStream;
-import java.io.PrintWriter;
-import java.io.StringReader;
-import java.io.StringWriter;
-import java.lang.annotation.Annotation;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.ref.SoftReference;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.nio.charset.Charset;
-import java.nio.charset.CharsetDecoder;
-import java.nio.charset.CodingErrorAction;
-import java.nio.charset.UnsupportedCharsetException;
-import java.nio.file.FileVisitResult;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.nio.file.SimpleFileVisitor;
-import java.nio.file.attribute.BasicFileAttributes;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.EnumMap;
-import java.util.HashMap;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-import java.util.Objects;
-import java.util.Set;
-import java.util.TreeMap;
-import java.util.TreeSet;
-import java.util.function.Function;
-import java.util.regex.Pattern;
-import java.util.stream.Collectors;
-
-
-/**
- * Test framework for running javadoc and performing tests on the resulting output.
- *
- * <p>
- * Tests are typically written as subtypes of JavadocTester, with a main
- * method that creates an instance of the test class and calls the runTests()
- * method. The runTests() methods calls all the test methods declared in the class,
- * and then calls a method to print a summary, and throw an exception if
- * any of the test methods reported a failure.
- *
- * <p>
- * Test methods are identified with a @Test annotation. They have no parameters.
- * The name of the method is not important, but if you have more than one, it is
- * recommended that the names be meaningful and suggestive of the test case
- * contained therein.
- *
- * <p>
- * Typically, a test method will invoke javadoc, and then perform various
- * checks on the results. The standard checks are:
- *
- * <dl>
- * <dt>checkExitCode
- * <dd>Check the exit code returned from javadoc.
- * <dt>checkOutput
- * <dd>Perform a series of checks on the contents on a file or output stream
- *     generated by javadoc.
- *     The checks can be either that a series of strings are found or are not found.
- * <dt>checkFiles
- * <dd>Perform a series of checks on the files generated by javadoc.
- *     The checks can be that a series of files are found or are not found.
- * </dl>
- *
- * <pre><code>
- *  public class MyTester extends JavadocTester {
- *      public static void main(String... args) throws Exception {
- *          MyTester tester = new MyTester();
- *          tester.runTests();
- *      }
- *
- *      // test methods...
- *      @Test
- *      void test() {
- *          javadoc(<i>args</i>);
- *          checkExit(Exit.OK);
- *          checkOutput(<i>file</i>, true,
- *              <i>strings-to-find</i>);
- *          checkOutput(<i>file</i>, false,
- *              <i>strings-to-not-find</i>);
- *      }
- *  }
- * </code></pre>
- *
- * <p>
- * If javadoc is run more than once in a test method, you can compare the
- * results that are generated with the diff method. Since files written by
- * javadoc typically contain a timestamp, you may want to use the -notimestamp
- * option if you are going to compare the results from two runs of javadoc.
- *
- * <p>
- * If you have many calls of checkOutput that are very similar, you can write
- * your own check... method to reduce the amount of duplication. For example,
- * if you want to check that many files contain the same string, you could
- * write a method that takes a varargs list of files and calls checkOutput
- * on each file in turn with the string to be checked.
- *
- * <p>
- * You can also write you own custom check methods, which can use
- * readFile to get the contents of a file generated by javadoc,
- * and then use pass(...) or fail(...) to report whether the check
- * succeeded or not.
- *
- * <p>
- * You can have many separate test methods, each identified with a @Test
- * annotation. However, you should <b>not</b> assume they will be called
- * in the order declared in your source file.  If the order of a series
- * of javadoc invocations is important, do that within a single method.
- * If the invocations are independent, for better clarity, use separate
- * test methods, each with their own set of checks on the results.
- *
- * @author Doug Kramer
- * @author Jamie Ho
- * @author Jonathan Gibbons (rewrite)
- */
-public abstract class JavadocTester {
-
-    public static final String FS = System.getProperty("file.separator");
-    public static final String PS = System.getProperty("path.separator");
-    public static final String NL = System.getProperty("line.separator");
-    public static final Path currDir = Paths.get(".").toAbsolutePath().normalize();
-
-    public enum Output {
-        /** The name of the output stream from javadoc. */
-        OUT,
-        /** The name for any output written to System.out. */
-        STDOUT,
-        /** The name for any output written to System.err. */
-        STDERR
-    }
-
-    /** The output directory used in the most recent call of javadoc. */
-    protected File outputDir;
-
-    /** The output charset used in the most recent call of javadoc. */
-    protected Charset charset = Charset.defaultCharset();
-
-    /** The exit code of the most recent call of javadoc. */
-    private int exitCode;
-
-    /** The output generated by javadoc to the various writers and streams. */
-    private final Map<Output, String> outputMap = new EnumMap<>(Output.class);
-
-    /** A cache of file content, to avoid reading files unnecessarily. */
-    private final Map<File,SoftReference<String>> fileContentCache = new HashMap<>();
-    /** The charset used for files in the fileContentCache. */
-    private Charset fileContentCacheCharset = null;
-
-    /** Stream used for logging messages. */
-    protected final PrintStream out = System.out;
-
-    /** The directory containing the source code for the test. */
-    public static final String testSrc = System.getProperty("test.src");
-
-    /**
-     * Get the path for a source file in the test source directory.
-     * @param path the path of a file or directory in the source directory
-     * @return the full path of the specified file
-     */
-    public static String testSrc(String path) {
-        return new File(testSrc, path).getPath();
-    }
-
-    /**
-     * Alternatives for checking the contents of a directory.
-     */
-    public enum DirectoryCheck {
-        /**
-         * Check that the directory is empty.
-         */
-        EMPTY((file, name) -> true),
-        /**
-         * Check that the directory does not contain any HTML files,
-         * such as may have been generated by a prior run of javadoc
-         * using this directory.
-         * For now, the check is only performed on the top level directory.
-         */
-        NO_HTML_FILES((file, name) -> name.endsWith(".html")),
-        /**
-         * No check is performed on the directory contents.
-         */
-        NONE(null) { @Override void check(File dir) { } };
-
-        /** The filter used to detect that files should <i>not</i> be present. */
-        FilenameFilter filter;
-
-        DirectoryCheck(FilenameFilter f) {
-            filter = f;
-        }
-
-        void check(File dir) {
-            if (dir.isDirectory()) {
-                String[] contents = dir.list(filter);
-                if (contents == null)
-                    throw new Error("cannot list directory: " + dir);
-                if (contents.length > 0) {
-                    System.err.println("Found extraneous files in dir:" + dir.getAbsolutePath());
-                    for (String x : contents) {
-                        System.err.println(x);
-                    }
-                    throw new Error("directory has unexpected content: " + dir);
-                }
-            }
-        }
-    }
-
-    private DirectoryCheck outputDirectoryCheck = DirectoryCheck.EMPTY;
-
-    private boolean automaticCheckLinks = true;
-
-    /** The current subtest number. Incremented when checking(...) is called. */
-    private int numTestsRun = 0;
-
-    /** The number of subtests passed. Incremented when passed(...) is called. */
-    private int numTestsPassed = 0;
-
-    /** The current run of javadoc. Incremented when javadoc is called. */
-    private int javadocRunNum = 0;
-
-    /** The current subtest number for this run of javadoc. Incremented when checking(...) is called. */
-    private int javadocTestNum = 0;
-
-    /** Marker annotation for test methods to be invoked by runTests. */
-    @Retention(RetentionPolicy.RUNTIME)
-    @interface Test { }
-
-    /**
-     * Run all methods annotated with @Test, followed by printSummary.
-     * Typically called on a tester object in main()
-     * @throws Exception if any errors occurred
-     */
-    public void runTests() throws Exception {
-        runTests(m -> new Object[0]);
-    }
-
-    /**
-     * Run all methods annotated with @Test, followed by printSummary.
-     * Typically called on a tester object in main()
-     * @param f a function which will be used to provide arguments to each
-     *          invoked method
-     * @throws Exception if any errors occurred
-     */
-    public void runTests(Function<Method, Object[]> f) throws Exception {
-        for (Method m: getClass().getDeclaredMethods()) {
-            Annotation a = m.getAnnotation(Test.class);
-            if (a != null) {
-                try {
-                    out.println("Running test " + m.getName());
-                    m.invoke(this, f.apply(m));
-                } catch (InvocationTargetException e) {
-                    Throwable cause = e.getCause();
-                    throw (cause instanceof Exception) ? ((Exception) cause) : e;
-                }
-                out.println();
-            }
-        }
-        printSummary();
-    }
-
-    /**
-     * Run javadoc.
-     * The output directory used by this call and the final exit code
-     * will be saved for later use.
-     * To aid the reader, it is recommended that calls to this method
-     * put each option and the arguments it takes on a separate line.
-     *
-     * Example:
-     * <pre><code>
-     *  javadoc("-d", "out",
-     *          "-sourcepath", testSrc,
-     *          "-notimestamp",
-     *          "pkg1", "pkg2", "pkg3/C.java");
-     * </code></pre>
-     *
-     * @param args the arguments to pass to javadoc
-     */
-    public void javadoc(String... args) {
-        outputMap.clear();
-        fileContentCache.clear();
-
-        javadocRunNum++;
-        javadocTestNum = 0; // reset counter for this run of javadoc
-        if (javadocRunNum == 1) {
-            out.println("Running javadoc...");
-        } else {
-            out.println("Running javadoc (run "+ javadocRunNum + ")...");
-        }
-
-        outputDir = new File(".");
-        String charsetArg = null;
-        String docencodingArg = null;
-        String encodingArg = null;
-        for (int i = 0; i < args.length - 2; i++) {
-            switch (args[i]) {
-                case "-d":
-                    outputDir = new File(args[++i]);
-                    break;
-                case "-charset":
-                    charsetArg = args[++i];
-                    break;
-                case "-docencoding":
-                    docencodingArg = args[++i];
-                    break;
-                case "-encoding":
-                    encodingArg = args[++i];
-                    break;
-            }
-        }
-
-        // The following replicates HtmlConfiguration.finishOptionSettings0
-        // and sets up the charset used to read files.
-        String cs;
-        if (docencodingArg == null) {
-            if (charsetArg == null) {
-                cs = (encodingArg == null) ? "UTF-8" : encodingArg;
-            } else {
-                cs = charsetArg;
-            }
-        } else {
-           cs = docencodingArg;
-        }
-        try {
-            charset = Charset.forName(cs);
-        } catch (UnsupportedCharsetException e) {
-            charset = Charset.defaultCharset();
-        }
-
-        out.println("args: " + Arrays.toString(args));
-//        log.setOutDir(outputDir);
-
-        outputDirectoryCheck.check(outputDir);
-
-        // This is the sole stream used by javadoc
-        WriterOutput outOut = new WriterOutput();
-
-        // These are to catch output to System.out and System.err,
-        // in case these are used instead of the primary streams
-        StreamOutput sysOut = new StreamOutput(System.out, System::setOut);
-        StreamOutput sysErr = new StreamOutput(System.err, System::setErr);
-
-        try {
-            exitCode = jdk.javadoc.internal.tool.Main.execute(args, outOut.pw);
-        } finally {
-            outputMap.put(Output.STDOUT, sysOut.close());
-            outputMap.put(Output.STDERR, sysErr.close());
-            outputMap.put(Output.OUT, outOut.close());
-        }
-
-        outputMap.forEach((name, text) -> {
-            if (!text.isEmpty()) {
-                out.println("javadoc " + name + ":");
-                out.println(text);
-            }
-        });
-
-        if (automaticCheckLinks && exitCode == Exit.OK.code && outputDir.exists()) {
-            checkLinks();
-        }
-    }
-
-    /**
-     * Set the kind of check for the initial contents of the output directory
-     * before javadoc is run.
-     * The filter should return true for files that should <b>not</b> appear.
-     * @param c the kind of check to perform
-     */
-    public void setOutputDirectoryCheck(DirectoryCheck c) {
-        outputDirectoryCheck = c;
-    }
-
-    /**
-     * Set whether or not to perform an automatic call of checkLinks.
-     */
-    public void setAutomaticCheckLinks(boolean b) {
-        automaticCheckLinks = b;
-    }
-
-    /**
-     * The exit codes returned by the javadoc tool.
-     * @see jdk.javadoc.internal.tool.Main.Result
-     */
-    public enum Exit {
-        OK(0),        // Javadoc completed with no errors.
-        ERROR(1),     // Completed but reported errors.
-        CMDERR(2),    // Bad command-line arguments
-        SYSERR(3),    // System error or resource exhaustion.
-        ABNORMAL(4);  // Javadoc terminated abnormally
-
-        Exit(int code) {
-            this.code = code;
-        }
-
-        final int code;
-
-        @Override
-        public String toString() {
-            return name() + '(' + code + ')';
-        }
-    }
-
-    /**
-     * Check the exit code of the most recent call of javadoc.
-     *
-     * @param expected the exit code that is required for the test
-     * to pass.
-     */
-    public void checkExit(Exit expected) {
-        checking("check exit code");
-        if (exitCode == expected.code) {
-            passed("return code " + exitCode);
-        } else {
-            failed("return code " + exitCode +"; expected " + expected);
-        }
-    }
-
-    /**
-     * Check for content in (or not in) the generated output.
-     * Within the search strings, the newline character \n
-     * will be translated to the platform newline character sequence.
-     * @param path a path within the most recent output directory
-     *  or the name of one of the output buffers, identifying
-     *  where to look for the search strings.
-     * @param expectedFound true if all of the search strings are expected
-     *  to be found, or false if the file is not expected to be found
-     * @param strings the strings to be searched for
-     */
-    public void checkFileAndOutput(String path, boolean expectedFound, String... strings) {
-        if (expectedFound) {
-            checkOutput(path, true, strings);
-        } else {
-            checkFiles(false, path);
-        }
-    }
-
-    /**
-     * Check for content in (or not in) the generated output.
-     * Within the search strings, the newline character \n
-     * will be translated to the platform newline character sequence.
-     * @param path a path within the most recent output directory, identifying
-     *  where to look for the search strings.
-     * @param expectedFound true if all of the search strings are expected
-     *  to be found, or false if all of the strings are expected to be
-     *  not found
-     * @param strings the strings to be searched for
-     */
-    public void checkOutput(String path, boolean expectedFound, String... strings) {
-        // Read contents of file
-        try {
-            String fileString = readFile(outputDir, path);
-            checkOutput(new File(outputDir, path).getPath(), fileString, expectedFound, strings);
-        } catch (Error e) {
-            checking("Read file");
-            failed("Error reading file: " + e);
-        }
-    }
-
-    /**
-     * Check for content in (or not in) the one of the output streams written by
-     * javadoc. Within the search strings, the newline character \n
-     * will be translated to the platform newline character sequence.
-     * @param output the output stream to check
-     * @param expectedFound true if all of the search strings are expected
-     *  to be found, or false if all of the strings are expected to be
-     *  not found
-     * @param strings the strings to be searched for
-     */
-    public void checkOutput(Output output, boolean expectedFound, String... strings) {
-        checkOutput(output.toString(), outputMap.get(output), expectedFound, strings);
-    }
-
-    // NOTE: path may be the name of an Output stream as well as a file path
-    private void checkOutput(String path, String fileString, boolean expectedFound, String... strings) {
-        for (String stringToFind : strings) {
-//            log.logCheckOutput(path, expectedFound, stringToFind);
-            checking("checkOutput");
-            // Find string in file's contents
-            boolean isFound = findString(fileString, stringToFind);
-            if (isFound == expectedFound) {
-                passed(path + ": following text " + (isFound ? "found:" : "not found:") + "\n"
-                        + stringToFind);
-            } else {
-                failed(path + ": following text " + (isFound ? "found:" : "not found:") + "\n"
-                        + stringToFind + '\n' +
-                        "found \n" +
-                        fileString);
-            }
-        }
-    }
-
-    public void checkLinks() {
-        checking("Check links");
-        LinkChecker c = new LinkChecker(out, this::readFile);
-        try {
-            c.checkDirectory(outputDir.toPath());
-            c.report();
-            int errors = c.getErrorCount();
-            if (errors == 0) {
-                passed("Links are OK");
-            } else {
-                failed(errors + " errors found when checking links");
-            }
-        } catch (IOException e) {
-            failed("exception thrown when reading files: " + e);
-        }
-    }
-
-    /**
-     * Get the content of the one of the output streams written by javadoc.
-     * @param output the name of the output stream
-     * @return the content of the output stream
-     */
-    public String getOutput(Output output) {
-        return outputMap.get(output);
-    }
-
-    /**
-     * Get the content of the one of the output streams written by javadoc.
-     * @param output the name of the output stream
-     * @return the content of the output stream, as a line of lines
-     */
-    public List<String> getOutputLines(Output output) {
-        String text = outputMap.get(output);
-        return (text == null) ? Collections.emptyList() : Arrays.asList(text.split(NL));
-    }
-
-    /**
-     * Check for files in (or not in) the generated output.
-     * @param expectedFound true if all of the files are expected
-     *  to be found, or false if all of the files are expected to be
-     *  not found
-     * @param paths the files to check, within the most recent output directory.
-     * */
-    public void checkFiles(boolean expectedFound, String... paths) {
-        checkFiles(expectedFound, Arrays.asList(paths));
-    }
-
-    /**
-     * Check for files in (or not in) the generated output.
-     * @param expectedFound true if all of the files are expected
-     *  to be found, or false if all of the files are expected to be
-     *  not found
-     * @param paths the files to check, within the most recent output directory.
-     * */
-    public void checkFiles(boolean expectedFound, Collection<String> paths) {
-        for (String path: paths) {
-//            log.logCheckFile(path, expectedFound);
-            checking("checkFile");
-            File file = new File(outputDir, path);
-            boolean isFound = file.exists();
-            if (isFound == expectedFound) {
-                passed(file, "file " + (isFound ? "found:" : "not found:") + "\n");
-            } else {
-                failed(file, "file " + (isFound ? "found:" : "not found:") + "\n");
-            }
-        }
-    }
-
-    /**
-     * Check that a series of strings are found in order in a file in
-     * the generated output.
-     * @param path the file to check
-     * @param strings  the strings whose order to check
-     */
-    public void checkOrder(String path, String... strings) {
-        File file = new File(outputDir, path);
-        String fileString = readOutputFile(path);
-        int prevIndex = -1;
-        for (String s : strings) {
-            s = s.replace("\n", NL); // normalize new lines
-            int currentIndex = fileString.indexOf(s, prevIndex + 1);
-            checking("file: " + file + ": " + s + " at index " + currentIndex);
-            if (currentIndex == -1) {
-                failed(file, s + " not found.");
-                continue;
-            }
-            if (currentIndex > prevIndex) {
-                passed(file, s + " is in the correct order");
-            } else {
-                failed(file, s + " is in the wrong order.");
-            }
-            prevIndex = currentIndex;
-        }
-    }
-
-    /**
-     * Ensures that a series of strings appear only once, in the generated output,
-     * noting that, this test does not exhaustively check for all other possible
-     * duplicates once one is found.
-     * @param path the file to check
-     * @param strings ensure each are unique
-     */
-    public void checkUnique(String path, String... strings) {
-        File file = new File(outputDir, path);
-        String fileString = readOutputFile(path);
-        for (String s : strings) {
-            int currentIndex = fileString.indexOf(s);
-            checking(s + " at index " + currentIndex);
-            if (currentIndex == -1) {
-                failed(file, s + " not found.");
-                continue;
-            }
-            int nextindex = fileString.indexOf(s, currentIndex + s.length());
-            if (nextindex == -1) {
-                passed(file, s + " is unique");
-            } else {
-                failed(file, s + " is not unique, found at " + nextindex);
-            }
-        }
-    }
-
-    /**
-     * Compare a set of files in each of two directories.
-     *
-     * @param baseDir1 the directory containing the first set of files
-     * @param baseDir2 the directory containing the second set of files
-     * @param files the set of files to be compared
-     */
-    public void diff(String baseDir1, String baseDir2, String... files) {
-        File bd1 = new File(baseDir1);
-        File bd2 = new File(baseDir2);
-        for (String file : files) {
-            diff(bd1, bd2, file);
-        }
-    }
-
-    /**
-     * A utility to copy a directory from one place to another.
-     *
-     * @param targetDir the directory to copy.
-     * @param destDir the destination to copy the directory to.
-     */
-    // TODO: convert to using java.nio.Files.walkFileTree
-    public void copyDir(String targetDir, String destDir) {
-        try {
-            File targetDirObj = new File(targetDir);
-            File destDirParentObj = new File(destDir);
-            File destDirObj = new File(destDirParentObj, targetDirObj.getName());
-            if (! destDirParentObj.exists()) {
-                destDirParentObj.mkdir();
-            }
-            if (! destDirObj.exists()) {
-                destDirObj.mkdir();
-            }
-            String[] files = targetDirObj.list();
-            for (String file : files) {
-                File srcFile = new File(targetDirObj, file);
-                File destFile = new File(destDirObj, file);
-                if (srcFile.isFile()) {
-                    out.println("Copying " + srcFile + " to " + destFile);
-                    copyFile(destFile, srcFile);
-                } else if(srcFile.isDirectory()) {
-                    copyDir(srcFile.getAbsolutePath(), destDirObj.getAbsolutePath());
-                }
-            }
-        } catch (IOException exc) {
-            throw new Error("Could not copy " + targetDir + " to " + destDir);
-        }
-    }
-
-    /**
-     * Copy source file to destination file.
-     *
-     * @param destfile the destination file
-     * @param srcfile the source file
-     * @throws IOException
-     */
-    public void copyFile(File destfile, File srcfile) throws IOException {
-        Files.copy(srcfile.toPath(), destfile.toPath());
-    }
-
-    /**
-     * Read a file from the output directory.
-     *
-     * @param fileName  the name of the file to read
-     * @return          the file in string format
-     */
-    public String readOutputFile(String fileName) throws Error {
-        return readFile(outputDir, fileName);
-    }
-
-    protected String readFile(String fileName) throws Error {
-        return readFile(outputDir, fileName);
-    }
-
-    protected String readFile(String baseDir, String fileName) throws Error {
-        return readFile(new File(baseDir), fileName);
-    }
-
-    private String readFile(Path file) {
-        File baseDir;
-        if (file.startsWith(outputDir.toPath())) {
-            baseDir = outputDir;
-        } else if (file.startsWith(currDir)) {
-            baseDir = currDir.toFile();
-        } else {
-            baseDir = file.getParent().toFile();
-        }
-        String fileName = baseDir.toPath().relativize(file).toString();
-        return readFile(baseDir, fileName);
-    }
-
-    /**
-     * Read the file and return it as a string.
-     *
-     * @param baseDir   the directory in which to locate the file
-     * @param fileName  the name of the file to read
-     * @return          the file in string format
-     */
-    private String readFile(File baseDir, String fileName) throws Error {
-        if (!Objects.equals(fileContentCacheCharset, charset)) {
-            fileContentCache.clear();
-            fileContentCacheCharset = charset;
-        }
-        try {
-            File file = new File(baseDir, fileName);
-            SoftReference<String> ref = fileContentCache.get(file);
-            String content = (ref == null) ? null : ref.get();
-            if (content != null)
-                return content;
-
-            // charset defaults to a value inferred from latest javadoc run
-            content = new String(Files.readAllBytes(file.toPath()), charset);
-            fileContentCache.put(file, new SoftReference<>(content));
-            return content;
-        } catch (FileNotFoundException e) {
-            throw new Error("File not found: " + fileName + ": " + e);
-        } catch (IOException e) {
-            throw new Error("Error reading file: " + fileName + ": " + e);
-        }
-    }
-
-    protected void checking(String message) {
-        numTestsRun++;
-        javadocTestNum++;
-        print("Starting subtest " + javadocRunNum + "." + javadocTestNum, message);
-    }
-
-    protected void passed(File file, String message) {
-        passed(file + ": " + message);
-    }
-
-    protected void passed(String message) {
-        numTestsPassed++;
-        print("Passed", message);
-        out.println();
-    }
-
-    protected void failed(File file, String message) {
-        failed(file + ": " + message);
-    }
-
-    protected void failed(String message) {
-        print("FAILED", message);
-        StackWalker.getInstance().walk(s -> {
-            s.dropWhile(f -> f.getMethodName().equals("failed"))
-                    .takeWhile(f -> !f.getMethodName().equals("runTests"))
-                    .forEach(f -> out.println("        at "
-                            + f.getClassName() + "." + f.getMethodName()
-                            + "(" + f.getFileName() + ":" + f.getLineNumber() + ")"));
-            return null;
-        });
-        out.println();
-    }
-
-    private void print(String prefix, String message) {
-        if (message.isEmpty())
-            out.println(prefix);
-        else {
-            out.print(prefix);
-            out.print(": ");
-            out.print(message.replace("\n", NL));
-            if (!(message.endsWith("\n") || message.endsWith(NL))) {
-                out.println();
-            }
-        }
-    }
-
-    /**
-     * Print a summary of the test results.
-     */
-    protected void printSummary() {
-        String javadocRuns = (javadocRunNum <= 1) ? ""
-                : ", in " + javadocRunNum + " runs of javadoc";
-
-        if (numTestsRun != 0 && numTestsPassed == numTestsRun) {
-            // Test passed
-            out.println();
-            out.println("All " + numTestsPassed + " subtests passed" + javadocRuns);
-        } else {
-            // Test failed
-            throw new Error((numTestsRun - numTestsPassed)
-                    + " of " + (numTestsRun)
-                    + " subtests failed"
-                    + javadocRuns);
-        }
-    }
-
-    /**
-     * Search for the string in the given file and return true
-     * if the string was found.
-     *
-     * @param fileString    the contents of the file to search through
-     * @param stringToFind  the string to search for
-     * @return              true if the string was found
-     */
-    private boolean findString(String fileString, String stringToFind) {
-        // javadoc (should) always use the platform newline sequence,
-        // but in the strings to find it is more convenient to use the Java
-        // newline character. So we translate \n to NL before we search.
-        stringToFind = stringToFind.replace("\n", NL);
-        return fileString.contains(stringToFind);
-    }
-
-    /**
-     * Compare the two given files.
-     *
-     * @param baseDir1 the directory in which to locate the first file
-     * @param baseDir2 the directory in which to locate the second file
-     * @param file the file to compare in the two base directories
-     * @param throwErrorIFNoMatch flag to indicate whether or not to throw
-     * an error if the files do not match.
-     * @return true if the files are the same and false otherwise.
-     */
-    private void diff(File baseDir1, File baseDir2, String file) {
-        String file1Contents = readFile(baseDir1, file);
-        String file2Contents = readFile(baseDir2, file);
-        checking("diff " + new File(baseDir1, file) + ", " + new File(baseDir2, file));
-        if (file1Contents.trim().compareTo(file2Contents.trim()) == 0) {
-            passed("files are equal");
-        } else {
-            failed("files differ");
-        }
-    }
-
-    /**
-     * Utility class to simplify the handling of temporarily setting a
-     * new stream for System.out or System.err.
-     */
-    private static class StreamOutput {
-        // functional interface to set a stream.
-        private interface Initializer {
-            void set(PrintStream s);
-        }
-
-        private final ByteArrayOutputStream baos = new ByteArrayOutputStream();
-        private final PrintStream ps = new PrintStream(baos);
-        private final PrintStream prev;
-        private final Initializer init;
-
-        StreamOutput(PrintStream s, Initializer init) {
-            prev = s;
-            init.set(ps);
-            this.init = init;
-        }
-
-        String close() {
-            init.set(prev);
-            ps.close();
-            return baos.toString();
-        }
-    }
-
-    /**
-     * Utility class to simplify the handling of creating an in-memory PrintWriter.
-     */
-    private static class WriterOutput {
-        private final StringWriter sw = new StringWriter();
-        final PrintWriter pw = new PrintWriter(sw);
-        String close() {
-            pw.close();
-            return sw.toString();
-        }
-    }
-
-
-//    private final Logger log = new Logger();
-
-    //--------- Logging --------------------------------------------------------
-    //
-    // This class writes out the details of calls to checkOutput and checkFile
-    // in a canonical way, so that the resulting file can be checked against
-    // similar files from other versions of JavadocTester using the same logging
-    // facilities.
-
-    static class Logger {
-        private static final int PREFIX = 40;
-        private static final int SUFFIX = 20;
-        private static final int MAX = PREFIX + SUFFIX;
-        List<String> tests = new ArrayList<>();
-        String outDir;
-        String rootDir = rootDir();
-
-        static String rootDir() {
-            File f = new File(".").getAbsoluteFile();
-            while (!new File(f, ".hg").exists())
-                f = f.getParentFile();
-            return f.getPath();
-        }
-
-        void setOutDir(File outDir) {
-            this.outDir = outDir.getPath();
-        }
-
-        void logCheckFile(String file, boolean positive) {
-            // Strip the outdir because that will typically not be the same
-            if (file.startsWith(outDir + "/"))
-                file = file.substring(outDir.length() + 1);
-            tests.add(file + " " + positive);
-        }
-
-        void logCheckOutput(String file, boolean positive, String text) {
-            // Compress the string to be displayed in the log file
-            String simpleText = text.replaceAll("\\s+", " ").replace(rootDir, "[ROOT]");
-            if (simpleText.length() > MAX)
-                simpleText = simpleText.substring(0, PREFIX)
-                        + "..." + simpleText.substring(simpleText.length() - SUFFIX);
-            // Strip the outdir because that will typically not be the same
-            if (file.startsWith(outDir + "/"))
-                file = file.substring(outDir.length() + 1);
-            // The use of text.hashCode ensure that all of "text" is taken into account
-            tests.add(file + " " + positive + " " + text.hashCode() + " " + simpleText);
-        }
-
-        void write() {
-            // sort the log entries because the subtests may not be executed in the same order
-            tests.sort((a, b) -> a.compareTo(b));
-            try (BufferedWriter bw = new BufferedWriter(new FileWriter("tester.log"))) {
-                for (String t: tests) {
-                    bw.write(t);
-                    bw.newLine();
-                }
-            } catch (IOException e) {
-                throw new Error("problem writing log: " + e);
-            }
-        }
-    }
-
-    // Support classes for checkLinks
-
-    /**
-     * A basic HTML parser. Override the protected methods as needed to get notified
-     * of significant items in any file that is read.
-     */
-    static abstract class HtmlParser {
-
-        protected final PrintStream out;
-        protected final Function<Path,String> fileReader;
-
-        private Path file;
-        private StringReader in;
-        private int ch;
-        private int lineNumber;
-        private boolean inScript;
-        private boolean xml;
-
-        HtmlParser(PrintStream out, Function<Path,String> fileReader) {
-            this.out = out;
-            this.fileReader = fileReader;
-        }
-
-        /**
-         * Read a file.
-         * @param file the file to be read
-         * @throws IOException if an error occurs while reading the file
-         */
-        void read(Path file) throws IOException {
-            try (StringReader r = new StringReader(fileReader.apply(file))) {
-                this.file = file;
-                this.in = r;
-
-                startFile(file);
-                try {
-                    lineNumber = 1;
-                    xml = false;
-                    nextChar();
-
-                    while (ch != -1) {
-                        switch (ch) {
-
-                            case '<':
-                                html();
-                                break;
-
-                            default:
-                                nextChar();
-                        }
-                    }
-                } finally {
-                    endFile();
-                }
-            } catch (IOException e) {
-                error(file, lineNumber, e);
-            } catch (Throwable t) {
-                error(file, lineNumber, t);
-                t.printStackTrace(out);
-            }
-        }
-
-
-        int getLineNumber() {
-            return lineNumber;
-        }
-
-        /**
-         * Called when a file has been opened, before parsing begins.
-         * This is always the first notification when reading a file.
-         * This implementation does nothing.
-         *
-         * @param file the file
-         */
-        protected void startFile(Path file) { }
-
-        /**
-         * Called when the parser has finished reading a file.
-         * This is always the last notification when reading a file,
-         * unless any errors occur while closing the file.
-         * This implementation does nothing.
-         */
-        protected void endFile() { }
-
-        /**
-         * Called when a doctype declaration is found, at the beginning of the file.
-         * This implementation does nothing.
-         * @param s the doctype declaration
-         */
-        protected void docType(String s) { }
-
-        /**
-         * Called when the opening tag of an HTML element is encountered.
-         * This implementation does nothing.
-         * @param name the name of the tag
-         * @param attrs the attribute
-         * @param selfClosing whether or not this is a self-closing tag
-         */
-        protected void startElement(String name, Map<String,String> attrs, boolean selfClosing) { }
-
-        /**
-         * Called when the closing tag of an HTML tag is encountered.
-         * This implementation does nothing.
-         * @param name the name of the tag
-         */
-        protected void endElement(String name) { }
-
-        /**
-         * Called when an error has been encountered.
-         * @param file the file being read
-         * @param lineNumber the line number of line containing the error
-         * @param message a description of the error
-         */
-        protected void error(Path file, int lineNumber, String message) {
-            out.println(file + ":" + lineNumber + ": " + message);
-        }
-
-        /**
-         * Called when an exception has been encountered.
-         * @param file the file being read
-         * @param lineNumber the line number of the line being read when the exception was found
-         * @param t the exception
-         */
-        protected void error(Path file, int lineNumber, Throwable t) {
-            out.println(file + ":" + lineNumber + ": " + t);
-        }
-
-        private void nextChar() throws IOException {
-            ch = in.read();
-            if (ch == '\n')
-                lineNumber++;
-        }
-
-        /**
-         * Read the start or end of an HTML tag, or an HTML comment
-         * {@literal <identifier attrs> } or {@literal </identifier> }
-         * @throws java.io.IOException if there is a problem reading the file
-         */
-        private void html() throws IOException {
-            nextChar();
-            if (isIdentifierStart((char) ch)) {
-                String name = readIdentifier().toLowerCase(Locale.US);
-                Map<String,String> attrs = htmlAttrs();
-                if (attrs != null) {
-                    boolean selfClosing = false;
-                    if (ch == '/') {
-                        nextChar();
-                        selfClosing = true;
-                    }
-                    if (ch == '>') {
-                        nextChar();
-                        startElement(name, attrs, selfClosing);
-                        if (name.equals("script")) {
-                            inScript = true;
-                        }
-                        return;
-                    }
-                }
-            } else if (ch == '/') {
-                nextChar();
-                if (isIdentifierStart((char) ch)) {
-                    String name = readIdentifier().toLowerCase(Locale.US);
-                    skipWhitespace();
-                    if (ch == '>') {
-                        nextChar();
-                        endElement(name);
-                        if (name.equals("script")) {
-                            inScript = false;
-                        }
-                        return;
-                    }
-                }
-            } else if (ch == '!') {
-                nextChar();
-                if (ch == '-') {
-                    nextChar();
-                    if (ch == '-') {
-                        nextChar();
-                        while (ch != -1) {
-                            int dash = 0;
-                            while (ch == '-') {
-                                dash++;
-                                nextChar();
-                            }
-                            // Strictly speaking, a comment should not contain "--"
-                            // so dash > 2 is an error, dash == 2 implies ch == '>'
-                            // See http://www.w3.org/TR/html-markup/syntax.html#syntax-comments
-                            // for more details.
-                            if (dash >= 2 && ch == '>') {
-                                nextChar();
-                                return;
-                            }
-
-                            nextChar();
-                        }
-                    }
-                } else if (ch == '[') {
-                    nextChar();
-                    if (ch == 'C') {
-                        nextChar();
-                        if (ch == 'D') {
-                            nextChar();
-                            if (ch == 'A') {
-                                nextChar();
-                                if (ch == 'T') {
-                                    nextChar();
-                                    if (ch == 'A') {
-                                        nextChar();
-                                        if (ch == '[') {
-                                            while (true) {
-                                                nextChar();
-                                                if (ch == ']') {
-                                                    nextChar();
-                                                    if (ch == ']') {
-                                                        nextChar();
-                                                        if (ch == '>') {
-                                                            nextChar();
-                                                            return;
-                                                        }
-                                                    }
-                                                }
-                                            }
-
-                                        }
-                                    }
-                                }
-                            }
-                        }
-                    }
-                } else {
-                    StringBuilder sb = new StringBuilder();
-                    while (ch != -1 && ch != '>') {
-                        sb.append((char) ch);
-                        nextChar();
-                    }
-                    Pattern p = Pattern.compile("(?is)doctype\\s+html\\s?.*");
-                    String s = sb.toString();
-                    if (p.matcher(s).matches()) {
-                        docType(s);
-                        return;
-                    }
-                }
-            } else if (ch == '?') {
-                nextChar();
-                if (ch == 'x') {
-                    nextChar();
-                    if (ch == 'm') {
-                        nextChar();
-                        if (ch == 'l') {
-                            Map<String,String> attrs = htmlAttrs();
-                            if (ch == '?') {
-                                nextChar();
-                                if (ch == '>') {
-                                    nextChar();
-                                    xml = true;
-                                    return;
-                                }
-                            }
-                        }
-                    }
-
-                }
-            }
-
-            if (!inScript) {
-                error(file, lineNumber, "bad html");
-            }
-        }
-
-        /**
-         * Read a series of HTML attributes, terminated by {@literal > }.
-         * Each attribute is of the form {@literal identifier[=value] }.
-         * "value" may be unquoted, single-quoted, or double-quoted.
-         */
-        private Map<String,String> htmlAttrs() throws IOException {
-            Map<String, String> map = new LinkedHashMap<>();
-            skipWhitespace();
-
-            loop:
-            while (isIdentifierStart((char) ch)) {
-                String name = readAttributeName().toLowerCase(Locale.US);
-                skipWhitespace();
-                String value = null;
-                if (ch == '=') {
-                    nextChar();
-                    skipWhitespace();
-                    if (ch == '\'' || ch == '"') {
-                        char quote = (char) ch;
-                        nextChar();
-                        StringBuilder sb = new StringBuilder();
-                        while (ch != -1 && ch != quote) {
-                            sb.append((char) ch);
-                            nextChar();
-                        }
-                        value = sb.toString() // hack to replace common entities
-                                .replace("&lt;", "<")
-                                .replace("&gt;", ">")
-                                .replace("&amp;", "&");
-                        nextChar();
-                    } else {
-                        StringBuilder sb = new StringBuilder();
-                        while (ch != -1 && !isUnquotedAttrValueTerminator((char) ch)) {
-                            sb.append((char) ch);
-                            nextChar();
-                        }
-                        value = sb.toString();
-                    }
-                    skipWhitespace();
-                }
-                map.put(name, value);
-            }
-
-            return map;
-        }
-
-        private boolean isIdentifierStart(char ch) {
-            return Character.isUnicodeIdentifierStart(ch);
-        }
-
-        private String readIdentifier() throws IOException {
-            StringBuilder sb = new StringBuilder();
-            sb.append((char) ch);
-            nextChar();
-            while (ch != -1 && Character.isUnicodeIdentifierPart(ch)) {
-                sb.append((char) ch);
-                nextChar();
-            }
-            return sb.toString();
-        }
-
-        private String readAttributeName() throws IOException {
-            StringBuilder sb = new StringBuilder();
-            sb.append((char) ch);
-            nextChar();
-            while (ch != -1 && Character.isUnicodeIdentifierPart(ch)
-                    || ch == '-'
-                    || xml && ch == ':') {
-                sb.append((char) ch);
-                nextChar();
-            }
-            return sb.toString();
-        }
-
-        private boolean isWhitespace(char ch) {
-            return Character.isWhitespace(ch);
-        }
-
-        private void skipWhitespace() throws IOException {
-            while (isWhitespace((char) ch)) {
-                nextChar();
-            }
-        }
-
-        private boolean isUnquotedAttrValueTerminator(char ch) {
-            switch (ch) {
-                case '\f': case '\n': case '\r': case '\t':
-                case ' ':
-                case '"': case '\'': case '`':
-                case '=': case '<': case '>':
-                    return true;
-                default:
-                    return false;
-            }
-        }
-    }
-
-    /**
-     * A class to check the links in a set of HTML files.
-     */
-    static class LinkChecker extends HtmlParser {
-        private final Map<Path, IDTable> allFiles;
-        private final Map<URI, IDTable> allURIs;
-
-        private int files;
-        private int links;
-        private int badSchemes;
-        private int duplicateIds;
-        private int missingIds;
-
-        private Path currFile;
-        private IDTable currTable;
-        private boolean html5;
-        private boolean xml;
-
-        private int errors;
-
-        LinkChecker(PrintStream out, Function<Path,String> fileReader) {
-            super(out, fileReader);
-            allFiles = new HashMap<>();
-            allURIs = new HashMap<>();
-        }
-
-        void checkDirectory(Path dir) throws IOException {
-            checkFiles(List.of(dir), false, Collections.emptySet());
-        }
-
-        void checkFiles(List<Path> files, boolean skipSubdirs, Set<Path> excludeFiles) throws IOException {
-            for (Path file : files) {
-                Files.walkFileTree(file, new SimpleFileVisitor<Path>() {
-                    int depth = 0;
-
-                    @Override
-                    public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) {
-                        if ((skipSubdirs && depth > 0) || excludeFiles.contains(dir)) {
-                            return FileVisitResult.SKIP_SUBTREE;
-                        }
-                        depth++;
-                        return FileVisitResult.CONTINUE;
-                    }
-
-                    @Override
-                    public FileVisitResult visitFile(Path p, BasicFileAttributes attrs) {
-                        if (excludeFiles.contains(p)) {
-                            return FileVisitResult.CONTINUE;
-                        }
-
-                        if (Files.isRegularFile(p) && p.getFileName().toString().endsWith(".html")) {
-                            checkFile(p);
-                        }
-                        return FileVisitResult.CONTINUE;
-                    }
-
-                    @Override
-                    public FileVisitResult postVisitDirectory(Path dir, IOException e) throws IOException {
-                        depth--;
-                        return super.postVisitDirectory(dir, e);
-                    }
-                });
-            }
-        }
-
-        void checkFile(Path file) {
-            try {
-                read(file);
-            } catch (IOException e) {
-                error(file, 0, e);
-            }
-        }
-
-        int getErrorCount() {
-            return errors;
-        }
-
-        public void report() {
-            List<Path> missingFiles = getMissingFiles();
-            if (!missingFiles.isEmpty()) {
-                report("Missing files: (" + missingFiles.size() + ")");
-                missingFiles.stream()
-                        .sorted()
-                        .forEach(this::reportMissingFile);
-
-            }
-
-            if (!allURIs.isEmpty()) {
-                report(false, "External URLs:");
-                allURIs.keySet().stream()
-                        .sorted(new URIComparator())
-                        .forEach(uri -> report(false, "  %s", uri.toString()));
-            }
-
-            int anchors = 0;
-            for (IDTable t : allFiles.values()) {
-                anchors += t.map.values().stream()
-                        .filter(e -> !e.getReferences().isEmpty())
-                        .count();
-            }
-            for (IDTable t : allURIs.values()) {
-                anchors += t.map.values().stream()
-                        .filter(e -> !e.references.isEmpty())
-                        .count();
-            }
-
-            report(false, "Checked " + files + " files.");
-            report(false, "Found " + links + " references to " + anchors + " anchors "
-                    + "in " + allFiles.size() + " files and " + allURIs.size() + " other URIs.");
-            report(!missingFiles.isEmpty(),   "%6d missing files", missingFiles.size());
-            report(duplicateIds > 0, "%6d duplicate ids", duplicateIds);
-            report(missingIds > 0,   "%6d missing ids", missingIds);
-
-            Map<String, Integer> schemeCounts = new TreeMap<>();
-            Map<String, Integer> hostCounts = new TreeMap<>(new HostComparator());
-            for (URI uri : allURIs.keySet()) {
-                String scheme = uri.getScheme();
-                if (scheme != null) {
-                    schemeCounts.put(scheme, schemeCounts.computeIfAbsent(scheme, s -> 0) + 1);
-                }
-                String host = uri.getHost();
-                if (host != null) {
-                    hostCounts.put(host, hostCounts.computeIfAbsent(host, h -> 0) + 1);
-                }
-            }
-
-            if (schemeCounts.size() > 0) {
-                report(false, "Schemes");
-                schemeCounts.forEach((s, n) -> report(!isSchemeOK(s), "%6d %s", n, s));
-            }
-
-            if (hostCounts.size() > 0) {
-                report(false, "Hosts");
-                hostCounts.forEach((h, n) -> report(false, "%6d %s", n, h));
-            }
-        }
-
-        private void report(String message, Object... args) {
-            out.println(String.format(message, args));
-        }
-
-        private void report(boolean highlight, String message, Object... args) {
-            out.print(highlight ? "* " : "  ");
-            out.println(String.format(message, args));
-        }
-
-        private void reportMissingFile(Path file) {
-            report("%s", relativePath(file));
-            IDTable table = allFiles.get(file);
-            Set<Path> refs = new TreeSet<>();
-            for (ID id : table.map.values()) {
-                if (id.references != null) {
-                    for (Position p : id.references) {
-                        refs.add(p.path);
-                    }
-                }
-            }
-            int n = 0;
-            int MAX_REFS = 10;
-            for (Path ref : refs) {
-                report("    in " + relativePath(ref));
-                if (++n == MAX_REFS) {
-                    report("    ... and %d more", refs.size() - n);
-                    break;
-                }
-            }
-        }
-
-        @Override
-        public void startFile(Path path) {
-            currFile = path.toAbsolutePath().normalize();
-            currTable = allFiles.computeIfAbsent(currFile, p -> new IDTable(p));
-            html5 = false;
-            files++;
-        }
-
-        @Override
-        public void endFile() {
-            currTable.check();
-        }
-
-        @Override
-        public void docType(String doctype) {
-            html5 = doctype.matches("(?i)<\\?doctype\\s+html>");
-        }
-
-        @Override @SuppressWarnings("fallthrough")
-        public void startElement(String name, Map<String, String> attrs, boolean selfClosing) {
-            int line = getLineNumber();
-            switch (name) {
-                case "a":
-                    String nameAttr = html5 ? null : attrs.get("name");
-                    if (nameAttr != null) {
-                        foundAnchor(line, nameAttr);
-                    }
-                    // fallthrough
-                case "link":
-                    String href = attrs.get("href");
-                    if (href != null) {
-                        foundReference(line, href);
-                    }
-                    break;
-            }
-
-            String idAttr = attrs.get("id");
-            if (idAttr != null) {
-                foundAnchor(line, idAttr);
-            }
-        }
-
-        @Override
-        public void endElement(String name) { }
-
-        private void foundAnchor(int line, String name) {
-            currTable.addID(line, name);
-        }
-
-        private void foundReference(int line, String ref) {
-            links++;
-            try {
-                URI uri = new URI(ref);
-                if (uri.isAbsolute()) {
-                    foundReference(line, uri);
-                } else {
-                    Path p;
-                    String uriPath = uri.getPath();
-                    if (uriPath == null || uriPath.isEmpty()) {
-                        p = currFile;
-                    } else {
-                        p = currFile.getParent().resolve(uriPath).normalize();
-                    }
-                    foundReference(line, p, uri.getFragment());
-                }
-            } catch (URISyntaxException e) {
-                error(currFile, line, "invalid URI: " + e);
-            }
-        }
-
-        private void foundReference(int line, Path p, String fragment) {
-            IDTable t = allFiles.computeIfAbsent(p, key -> new IDTable(key));
-            t.addReference(fragment, currFile, line);
-        }
-
-        private void foundReference(int line, URI uri) {
-            if (!isSchemeOK(uri.getScheme())) {
-                error(currFile, line, "bad scheme in URI");
-                badSchemes++;
-            }
-
-            String fragment = uri.getFragment();
-            try {
-                URI noFrag = new URI(uri.toString().replaceAll("#\\Q" + fragment + "\\E$", ""));
-                IDTable t = allURIs.computeIfAbsent(noFrag, key -> new IDTable(key.toString()));
-                t.addReference(fragment, currFile, line);
-            } catch (URISyntaxException e) {
-                throw new Error(e);
-            }
-        }
-
-        private boolean isSchemeOK(String uriScheme) {
-            if (uriScheme == null) {
-                return true;
-            }
-
-            switch (uriScheme) {
-                case "file":
-                case "ftp":
-                case "http":
-                case "https":
-                case "javascript":
-                case "mailto":
-                    return true;
-
-                default:
-                    return false;
-            }
-        }
-
-        private List<Path> getMissingFiles() {
-            return allFiles.entrySet().stream()
-                    .filter(e -> !Files.exists(e.getKey()))
-                    .map(e -> e.getKey())
-                    .collect(Collectors.toList());
-        }
-
-        @Override
-        protected void error(Path file, int lineNumber, String message) {
-            super.error(relativePath(file), lineNumber, message);
-            errors++;
-        }
-
-        @Override
-        protected void error(Path file, int lineNumber, Throwable t) {
-            super.error(relativePath(file), lineNumber, t);
-            errors++;
-        }
-
-        private Path relativePath(Path path) {
-            return path.startsWith(currDir) ? currDir.relativize(path) : path;
-        }
-
-        /**
-         * A position in a file, as identified by a file name and line number.
-         */
-        static class Position implements Comparable<Position> {
-            Path path;
-            int line;
-
-            Position(Path path, int line) {
-                this.path = path;
-                this.line = line;
-            }
-
-            @Override
-            public int compareTo(Position o) {
-                int v = path.compareTo(o.path);
-                return v != 0 ? v : Integer.compare(line, o.line);
-            }
-
-            @Override
-            public boolean equals(Object obj) {
-                if (this == obj) {
-                    return true;
-                } else if (obj == null || getClass() != obj.getClass()) {
-                    return false;
-                } else {
-                    final Position other = (Position) obj;
-                    return Objects.equals(this.path, other.path)
-                            && this.line == other.line;
-                }
-            }
-
-            @Override
-            public int hashCode() {
-                return Objects.hashCode(path) * 37 + line;
-            }
-        }
-
-        /**
-         * Infor for an ID within an HTML file, and a set of positions that reference it.
-         */
-        static class ID {
-            boolean declared;
-            Set<Position> references;
-
-            Set<Position> getReferences() {
-                return (references) == null ? Collections.emptySet() : references;
-            }
-        }
-
-        /**
-         * A table for the set of IDs in an HTML file.
-         */
-        class IDTable {
-            private String name;
-            private boolean checked;
-            private final Map<String, ID> map = new HashMap<>();
-
-            IDTable(Path p) {
-                this(relativePath(p).toString());
-            }
-
-            IDTable(String name) {
-                this.name = name;
-            }
-
-            void addID(int line, String name) {
-                if (checked) {
-                    throw new IllegalStateException("Adding ID after file has been read");
-                }
-                Objects.requireNonNull(name);
-                ID id = map.computeIfAbsent(name, x -> new ID());
-                if (id.declared) {
-                    error(currFile, line, "name already declared: " + name);
-                    duplicateIds++;
-                } else {
-                    id.declared = true;
-                }
-            }
-
-            void addReference(String name, Path from, int line) {
-                if (checked) {
-                    if (name != null) {
-                        ID id = map.get(name);
-                        if (id == null || !id.declared) {
-                            error(from, line, "id not found: " + this.name + "#" + name);
-                        }
-                    }
-                } else {
-                    ID id = map.computeIfAbsent(name, x -> new ID());
-                    if (id.references == null) {
-                        id.references = new TreeSet<>();
-                    }
-                    id.references.add(new Position(from, line));
-                }
-            }
-
-            void check() {
-                map.forEach((name, id) -> {
-                    if (name != null && !id.declared) {
-                        //log.error(currFile, 0, "id not declared: " + name);
-                        for (Position ref : id.references) {
-                            error(ref.path, ref.line, "id not found: " + this.name + "#" + name);
-                        }
-                        missingIds++;
-                    }
-                });
-                checked = true;
-            }
-        }
-
-        static class URIComparator implements Comparator<URI> {
-            final HostComparator hostComparator = new HostComparator();
-
-            @Override
-            public int compare(URI o1, URI o2) {
-                if (o1.isOpaque() || o2.isOpaque()) {
-                    return o1.compareTo(o2);
-                }
-                String h1 = o1.getHost();
-                String h2 = o2.getHost();
-                String s1 = o1.getScheme();
-                String s2 = o2.getScheme();
-                if (h1 == null || h1.isEmpty() || s1 == null || s1.isEmpty()
-                        || h2 == null || h2.isEmpty() || s2 == null || s2.isEmpty()) {
-                    return o1.compareTo(o2);
-                }
-                int v = hostComparator.compare(h1, h2);
-                if (v != 0) {
-                    return v;
-                }
-                v = s1.compareTo(s2);
-                if (v != 0) {
-                    return v;
-                }
-                return o1.compareTo(o2);
-            }
-        }
-
-        static class HostComparator implements Comparator<String> {
-            @Override
-            public int compare(String h1, String h2) {
-                List<String> l1 = new ArrayList<>(Arrays.asList(h1.split("\\.")));
-                Collections.reverse(l1);
-                String r1 = String.join(".", l1);
-                List<String> l2 = new ArrayList<>(Arrays.asList(h2.split("\\.")));
-                Collections.reverse(l2);
-                String r2 = String.join(".", l2);
-                return r1.compareTo(r2);
-            }
-        }
-
-    }
-}
--- a/test/langtools/jdk/javadoc/doclet/testAbsLinkPath/TestAbsLinkPath.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testAbsLinkPath/TestAbsLinkPath.java	Wed Jan 02 10:21:54 2019 +0100
@@ -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
@@ -26,12 +26,14 @@
  * @bug 4640745
  * @summary This test verifys that the -link option handles absolute paths.
  * @author jamieh
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
  * @run main TestAbsLinkPath
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestAbsLinkPath extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -40,7 +42,7 @@
     }
 
     @Test
-    void test1() {
+    public void test1() {
         String out1 = "out1";
         javadoc("-d", out1, "-sourcepath", testSrc, "pkg2");
         checkExit(Exit.OK);
--- a/test/langtools/jdk/javadoc/doclet/testAbstractMethod/TestAbstractMethod.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testAbstractMethod/TestAbstractMethod.java	Wed Jan 02 10:21:54 2019 +0100
@@ -27,12 +27,14 @@
  * @summary  Make sure that the abstract method is identified correctly
  *           if the abstract modifier is present explicitly or implicitly.
  * @author   bpatel
- * @library  ../lib
+ * @library  ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build    JavadocTester
+ * @build    javadoc.tester.*
  * @run main TestAbstractMethod
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestAbstractMethod extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -41,7 +43,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         javadoc("-d", "out",
                 "-sourcepath", testSrc,
                 "pkg");
--- a/test/langtools/jdk/javadoc/doclet/testAnchorNames/TestAnchorNames.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testAnchorNames/TestAnchorNames.java	Wed Jan 02 10:21:54 2019 +0100
@@ -26,9 +26,9 @@
  * @bug 8025633 8025524 8081854 8187521 8182765
  * @summary Test for valid name attribute in HTML anchors.
  * @author Bhavesh Patel
- * @library /tools/lib ../lib
+ * @library /tools/lib ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build toolbox.ToolBox JavadocTester
+ * @build toolbox.ToolBox javadoc.tester.*
  * @run main TestAnchorNames
  */
 
@@ -36,7 +36,8 @@
 import java.nio.file.Path;
 import java.nio.file.Paths;
 
-import toolbox.*;
+import javadoc.tester.JavadocTester;
+import toolbox.ToolBox;
 
 public class TestAnchorNames extends JavadocTester {
 
@@ -51,7 +52,7 @@
     }
 
     @Test
-    void testHtml4(Path ignore) {
+    public void testHtml4(Path ignore) {
         setAutomaticCheckLinks(false); // @ignore JDK-8202622
         javadoc("-d", "out-html4",
                 "-html4",
@@ -172,7 +173,7 @@
     }
 
     @Test
-    void testHtml5(Path ignore) {
+    public void testHtml5(Path ignore) {
         javadoc("-d", "out-html5",
                 "-sourcepath", testSrc,
                 "-source", "8", //so that '_' can be used as an identifier
@@ -289,7 +290,7 @@
      * @throws IOException if there is a problem generating the source files
      */
     @Test
-    void testNonAscii(Path base) throws IOException {
+    public void testNonAscii(Path base) throws IOException {
         Path src = base.resolve("src");
         tb.writeJavaFiles(src,
                 "package p; public class Def {\n"
--- a/test/langtools/jdk/javadoc/doclet/testAnnotationOptional/TestAnnotationOptional.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testAnnotationOptional/TestAnnotationOptional.java	Wed Jan 02 10:21:54 2019 +0100
@@ -27,12 +27,14 @@
  * @summary  Make sure that annotations types with optional elements have
  *           element headers
  * @author   Mahmood Ali
- * @library  ../lib
+ * @library  ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build    JavadocTester
+ * @build    javadoc.tester.*
  * @run main TestAnnotationOptional
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestAnnotationOptional extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -41,7 +43,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         javadoc("-d", "out",
                 "-sourcepath", testSrc,
                 "pkg");
@@ -52,7 +54,7 @@
     }
 
     @Test
-    void test_html4() {
+    public void test_html4() {
         javadoc("-d", "out-html4",
                 "-html4",
                 "-sourcepath", testSrc,
--- a/test/langtools/jdk/javadoc/doclet/testAnnotationTypes/TestAnnotationTypes.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testAnnotationTypes/TestAnnotationTypes.java	Wed Jan 02 10:21:54 2019 +0100
@@ -27,12 +27,14 @@
  * @summary  Make sure that annotation types with 0 members does not have
  *           extra HR tags.
  * @author   jamieh
- * @library  ../lib
+ * @library  ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build    JavadocTester
+ * @build    javadoc.tester.*
  * @run main TestAnnotationTypes
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestAnnotationTypes extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -41,7 +43,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         javadoc("-d", "out-1",
                 "-sourcepath", testSrc,
                 "pkg");
@@ -92,7 +94,7 @@
     }
 
     @Test
-    void testLinkSource() {
+    public void testLinkSource() {
         javadoc("-d", "out-2",
                 "-linksource",
                 "-sourcepath", testSrc,
@@ -117,7 +119,7 @@
     }
 
     @Test
-    void test_html4() {
+    public void test_html4() {
         javadoc("-d", "out-html4",
                 "-html4",
                 "-sourcepath", testSrc,
--- a/test/langtools/jdk/javadoc/doclet/testAuthor/TestAuthor.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testAuthor/TestAuthor.java	Wed Jan 02 10:21:54 2019 +0100
@@ -25,9 +25,9 @@
  * @test
  * @bug      8202947
  * @summary  test the at-author tag, and corresponding option
- * @library  /tools/lib ../lib
+ * @library  /tools/lib ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build    toolbox.ToolBox JavadocTester
+ * @build    toolbox.ToolBox javadoc.tester.*
  * @run main TestAuthor
  */
 
@@ -35,6 +35,7 @@
 import java.nio.file.Path;
 import java.nio.file.Paths;
 
+import javadoc.tester.JavadocTester;
 import toolbox.ToolBox;
 
 public class TestAuthor extends JavadocTester {
@@ -58,7 +59,7 @@
     }
 
     @Test
-    void testAuthor() {
+    public void testAuthor() {
         javadoc("-d", "out-author",
                 "-sourcepath", src.toString(),
                 "-author",
@@ -69,7 +70,7 @@
     }
 
     @Test
-    void testNoAuthor() {
+    public void testNoAuthor() {
         javadoc("-d", "out-noauthor",
                 "-sourcepath", src.toString(),
                 "pkg");
--- a/test/langtools/jdk/javadoc/doclet/testBackSlashInLink/TestBackSlashInLink.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testBackSlashInLink/TestBackSlashInLink.java	Wed Jan 02 10:21:54 2019 +0100
@@ -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
@@ -27,12 +27,14 @@
  * @summary Test to make sure that the link to source documentation
  * has a forward slash.  It would be wrong to use a back slash.
  * @author jamieh
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
  * @run main TestBackSlashInLink
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestBackSlashInLink extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -41,7 +43,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         javadoc("-d", "out",
                 "-sourcepath", testSrc,
                 "-linksource",
--- a/test/langtools/jdk/javadoc/doclet/testBadHtml/TestBadHtml.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testBadHtml/TestBadHtml.java	Wed Jan 02 10:21:54 2019 +0100
@@ -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
@@ -25,12 +25,14 @@
  * @test
  * @bug 8176901
  * @summary The doclet should cope with bad HTML form
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
  * @run main TestBadHtml
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestBadHtml extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -39,7 +41,7 @@
     }
 
     @Test
-    void testNegative() {
+    public void testNegative() {
         javadoc("-d", "out1",
                 "-sourcepath", testSrc,
                 "pkg1");
--- a/test/langtools/jdk/javadoc/doclet/testBadPackageFileInJar/TestBadPackageFileInJar.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testBadPackageFileInJar/TestBadPackageFileInJar.java	Wed Jan 02 10:21:54 2019 +0100
@@ -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
@@ -27,9 +27,9 @@
  * @summary Make sure that Javadoc emits a useful warning
  *          when a bad package.html exists in a JAR archive.
  * @author jamieh
- * @library /tools/lib ../lib
+ * @library /tools/lib ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester toolbox.ToolBox toolbox.JarTask
+ * @build javadoc.tester.* toolbox.ToolBox toolbox.JarTask
  * @run main TestBadPackageFileInJar
  */
 
@@ -41,6 +41,8 @@
 import java.nio.file.Path;
 import java.nio.file.Paths;
 
+import javadoc.tester.JavadocTester;
+
 public class TestBadPackageFileInJar extends JavadocTester {
 
     final ToolBox tb = new ToolBox();
@@ -51,7 +53,7 @@
     }
 
     @Test
-    void test() throws IOException {
+    public void test() throws IOException {
         // create the file
         Path pkgDir = Paths.get("pkg");
         tb.createDirectories(pkgDir);
--- a/test/langtools/jdk/javadoc/doclet/testBadSourceFile/TestBadSourceFile.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testBadSourceFile/TestBadSourceFile.java	Wed Jan 02 10:21:54 2019 +0100
@@ -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
@@ -27,12 +27,14 @@
  * @summary  Make sure exception is not thrown if there is a bad source
  *           file in the same directory as the file being documented.
  * @author   jamieh
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build    JavadocTester
+ * @build    javadoc.tester.*
  * @run main TestBadSourceFile
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestBadSourceFile extends JavadocTester {
 
     /**
@@ -46,7 +48,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         javadoc("-Xdoclint:none",
                 "-d", "out",
                 testSrc("C2.java"));
--- a/test/langtools/jdk/javadoc/doclet/testBaseClass/TestBaseClass.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testBaseClass/TestBaseClass.java	Wed Jan 02 10:21:54 2019 +0100
@@ -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
@@ -26,13 +26,15 @@
  * @bug 4197513
  * @summary Javadoc does not process base class.
  * @author jamieh
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
  * @build BaseClass
- * @build JavadocTester
+ * @build javadoc.tester.*
  * @run main TestBaseClass
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestBaseClass extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -41,7 +43,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         javadoc("-sourcepath", testSrc,
                 "-docletpath", System.getProperty("test.classes", "."),
                 "-doclet", "BaseClass",
--- a/test/langtools/jdk/javadoc/doclet/testBreakIterator/TestBreakIterator.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testBreakIterator/TestBreakIterator.java	Wed Jan 02 10:21:54 2019 +0100
@@ -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
@@ -29,12 +29,14 @@
  * Correct Answer: "This is a class (i.e. it is indeed a class)."
  * Wrong Answer: "This is a class (i.e."
  * @author jamieh
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
  * @run main TestBreakIterator
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestBreakIterator extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -43,7 +45,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         javadoc("-d", "out",
                 "-sourcepath", testSrc,
                 "-breakiterator",
--- a/test/langtools/jdk/javadoc/doclet/testCRLineSeparator/TestCRLineSeparator.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testCRLineSeparator/TestCRLineSeparator.java	Wed Jan 02 10:21:54 2019 +0100
@@ -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
@@ -26,15 +26,17 @@
  * @bug      4979486
  * @summary  Make sure tool parses CR line separators properly.
  * @author   jamieh
- * @library  ../lib
+ * @library  ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build    JavadocTester
+ * @build    javadoc.tester.*
  * @run main TestCRLineSeparator
  */
 
 import java.io.*;
 import java.util.*;
 
+import javadoc.tester.JavadocTester;
+
 public class TestCRLineSeparator extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -43,7 +45,7 @@
     }
 
     @Test
-    void test() throws IOException {
+    public void test() throws IOException {
         initFiles(new File(testSrc), new File("src"), "pkg");
         javadoc("-d", "out",
                 "-sourcepath", "src",
--- a/test/langtools/jdk/javadoc/doclet/testCharset/TestCharset.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testCharset/TestCharset.java	Wed Jan 02 10:21:54 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2016, 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,12 +27,14 @@
  * @summary  Run a test on -charset to make sure the charset gets generated as a
  *           part of the meta tag.
  * @author   Bhavesh Patel
- * @library  ../lib
+ * @library  ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build    JavadocTester
+ * @build    javadoc.tester.*
  * @run main TestCharset
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestCharset extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -41,7 +43,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         javadoc("-d", "out",
                 "-charset", "ISO-8859-1",
                 "-sourcepath", testSrc,
@@ -60,7 +62,7 @@
     }
 
     @Test
-    void test1() {
+    public void test1() {
         javadoc("-d", "out-1",
                 "-sourcepath", testSrc,
                 "pkg");
--- a/test/langtools/jdk/javadoc/doclet/testCharsetDocencodingOptions/TestCharsetDocencodingOptions.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testCharsetDocencodingOptions/TestCharsetDocencodingOptions.java	Wed Jan 02 10:21:54 2019 +0100
@@ -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
@@ -25,12 +25,14 @@
  * @test
  * @bug      8183582
  * @summary  Rationalize doclet -docencoding and -charset options.
- * @library  ../lib
+ * @library  ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build    JavadocTester
+ * @build    javadoc.tester.*
  * @run main TestCharsetDocencodingOptions
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestCharsetDocencodingOptions extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -39,7 +41,7 @@
     }
 
     @Test
-    void testWithNoOptions() {
+    public void testWithNoOptions() {
         javadoc("-d", "out",
                 "-sourcepath", testSrc,
                 "pkg");
@@ -49,7 +51,7 @@
     }
 
     @Test
-    void testWithDocencoding() {
+    public void testWithDocencoding() {
         javadoc("-d", "out-1",
                 "-docencoding", "ISO-8859-1",
                 "-sourcepath", testSrc,
@@ -60,7 +62,7 @@
     }
 
     @Test
-    void testWithCharset() {
+    public void testWithCharset() {
         javadoc("-d", "out-2",
                 "-charset", "ISO-8859-1",
                 "-sourcepath", testSrc,
@@ -71,7 +73,7 @@
     }
 
     @Test
-    void testDocencodingWithCharsetSimilar() {
+    public void testDocencodingWithCharsetSimilar() {
         javadoc("-d", "out-3",
                 "-docencoding", "ISO-8859-1",
                 "-charset", "ISO-8859-1",
@@ -83,7 +85,7 @@
     }
 
     @Test
-    void testDocencodingWithCharsetDifferent() {
+    public void testDocencodingWithCharsetDifferent() {
         javadoc("-d", "out-4",
                 "-charset", "UTF-8",
                 "-docencoding", "ISO-8859-1",
@@ -96,7 +98,7 @@
     }
 
     @Test
-    void testWithEncoding() {
+    public void testWithEncoding() {
         javadoc("-d", "out-5",
                 "-sourcepath", testSrc,
                 "-encoding", "ISO-8859-1",
--- a/test/langtools/jdk/javadoc/doclet/testClassCrossReferences/TestClassCrossReferences.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testClassCrossReferences/TestClassCrossReferences.java	Wed Jan 02 10:21:54 2019 +0100
@@ -26,13 +26,15 @@
  * @bug 4652655 4857717 8025633 8026567 8071982 8164407 8182765 8205593
  * @summary This test verifies that class cross references work properly.
  * @author jamieh
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
  * @build TestClassCrossReferences
  * @run main TestClassCrossReferences
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestClassCrossReferences extends JavadocTester {
 
     static final String uri = "http://docs.oracle.com/javase/8/docs/api/";
@@ -43,7 +45,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         javadoc("-d", "out",
                 "-source", "8",
                 "-Xdoclint:none",
@@ -70,7 +72,7 @@
     }
 
     @Test
-    void test_error() {
+    public void test_error() {
         javadoc("-d", "out-error",
                 "-Xdoclint:none",
                 "-sourcepath", testSrc,
@@ -83,7 +85,7 @@
     }
 
     @Test
-    void test_html4() {
+    public void test_html4() {
         javadoc("-d", "out-html4",
                 "-source", "8",
                 "-html4",
--- a/test/langtools/jdk/javadoc/doclet/testClassDocCatalog/TestClassDocCatalog.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testClassDocCatalog/TestClassDocCatalog.java	Wed Jan 02 10:21:54 2019 +0100
@@ -25,12 +25,14 @@
  * @test
  * @bug 8071982 8196202
  * @summary Test for package-frame.html.
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
  * @run main TestClassDocCatalog
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestClassDocCatalog extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -39,7 +41,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         javadoc("-d", "out",
                 "--frames",
                 testSrc("pkg1/EmptyAnnotation.java"),
--- a/test/langtools/jdk/javadoc/doclet/testClassLinks/TestClassLinks.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testClassLinks/TestClassLinks.java	Wed Jan 02 10:21:54 2019 +0100
@@ -25,13 +25,15 @@
  * @test
  * @bug 8163800 8175200 8186332 8182765
  * @summary The fix for JDK-8072052 shows up other minor incorrect use of styles
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
  * @build TestClassLinks
  * @run main TestClassLinks
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestClassLinks extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -40,7 +42,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
 
         javadoc("-d", "out",
                 "-Xdoclint:none",
@@ -85,7 +87,7 @@
     }
 
     @Test
-    void test_html4() {
+    public void test_html4() {
 
         javadoc("-d", "out-html4",
                 "-html4",
--- a/test/langtools/jdk/javadoc/doclet/testClassTree/TestClassTree.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testClassTree/TestClassTree.java	Wed Jan 02 10:21:54 2019 +0100
@@ -29,12 +29,14 @@
  *           Make sure class tree includes heirarchy for enums and annotation
  *           types.
  * @author   jamieh
- * @library  ../lib
+ * @library  ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build    JavadocTester
+ * @build    javadoc.tester.*
  * @run main TestClassTree
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestClassTree extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -43,7 +45,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         javadoc("-d", "out",
                 "-sourcepath", testSrc,
                 "pkg");
--- a/test/langtools/jdk/javadoc/doclet/testCmndLineClass/TestCmndLineClass.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testCmndLineClass/TestCmndLineClass.java	Wed Jan 02 10:21:54 2019 +0100
@@ -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
@@ -28,12 +28,14 @@
  * when specifying packages on the command line and specifying individual
  * classes.
  * @author jamieh
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
  * @run main TestCmndLineClass
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestCmndLineClass extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -42,7 +44,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         String outdir1 = "out-1";
         String outdir2 = "out-2";
 
--- a/test/langtools/jdk/javadoc/doclet/testCompletionFailure/TestCompletionFailure.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testCompletionFailure/TestCompletionFailure.java	Wed Jan 02 10:21:54 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2016, 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
@@ -26,12 +26,14 @@
  * @bug 8027977
  * @summary Test to verify javadoc executes without CompletionFailure exception.
  * @author Bhavesh Patel
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
  * @run main TestCompletionFailure
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestCompletionFailure extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -40,7 +42,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         javadoc("-d", "out",
                 "-sourcepath", testSrc,
                 "pkg1");
--- a/test/langtools/jdk/javadoc/doclet/testConstantValuesPage/TestConstantValuesPage.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testConstantValuesPage/TestConstantValuesPage.java	Wed Jan 02 10:21:54 2019 +0100
@@ -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
@@ -27,12 +27,14 @@
  * @summary Test to make sure that constant values page does not get
  * generated when doclet has nothing to document.
  * @author jamieh
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
  * @run main TestConstantValuesPage
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestConstantValuesPage extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -41,7 +43,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         javadoc("-d", "out",
                 "-sourcepath", testSrc,
                 "foo");
--- a/test/langtools/jdk/javadoc/doclet/testConstructorIndent/TestConstructorIndent.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testConstructorIndent/TestConstructorIndent.java	Wed Jan 02 10:21:54 2019 +0100
@@ -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
@@ -27,12 +27,14 @@
  * @summary  The constructor comments should be surrounded by
  *           <dl></dl>.  Check for this in the output.
  * @author   jamieh
- * @library  ../lib
+ * @library  ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build    JavadocTester
+ * @build    javadoc.tester.*
  * @run main TestConstructorIndent
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestConstructorIndent extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -41,7 +43,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         javadoc("-d", "out",
                 "-sourcepath", testSrc,
                 testSrc("C.java"));
--- a/test/langtools/jdk/javadoc/doclet/testConstructors/TestConstructors.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testConstructors/TestConstructors.java	Wed Jan 02 10:21:54 2019 +0100
@@ -26,12 +26,14 @@
  * @bug 8025524 8031625 8081854 8175200 8186332 8182765
  * @summary Test for constructor name which should be a non-qualified name.
  * @author Bhavesh Patel
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
  * @run main TestConstructors
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestConstructors extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -40,7 +42,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         javadoc("-d", "out",
                 "-sourcepath", testSrc,
                 "pkg1");
@@ -90,7 +92,7 @@
     }
 
     @Test
-    void test_html4() {
+    public void test_html4() {
         javadoc("-d", "out-html4",
                 "-html4",
                 "-sourcepath", testSrc,
--- a/test/langtools/jdk/javadoc/doclet/testCopyFiles/TestCopyFiles.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testCopyFiles/TestCopyFiles.java	Wed Jan 02 10:21:54 2019 +0100
@@ -25,12 +25,14 @@
  * @test
  * @bug  8157349 8185985 8194953
  * @summary  test copy of doc-files, and its contents for HTML meta content.
- * @library  ../lib
+ * @library  ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build    JavadocTester
+ * @build    javadoc.tester.*
  * @run main TestCopyFiles
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestCopyFiles extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -39,7 +41,7 @@
     }
 
     @Test
-    void testDocFilesInModulePackages() {
+    public void testDocFilesInModulePackages() {
         javadoc("-d", "modules-out",
                 "-top", "phi-TOP-phi",
                 "-bottom", "phi-BOTTOM-phi",
@@ -75,7 +77,7 @@
     }
 
     @Test
-    void testDocFilesInMultiModulePackagesWithRecursiveCopy() {
+    public void testDocFilesInMultiModulePackagesWithRecursiveCopy() {
         javadoc("-d", "multi-modules-out-recursive",
                 "-docfilessubdirs",
                 "-top", "phi-TOP-phi",
@@ -134,7 +136,7 @@
     }
 
     @Test
-    void testDocFilesInModulePackagesWithRecursiveCopy() {
+    public void testDocFilesInModulePackagesWithRecursiveCopy() {
         javadoc("-d", "modules-out-recursive",
                 "-docfilessubdirs",
                 "--module-source-path", testSrc("modules"),
@@ -147,7 +149,7 @@
     }
 
     @Test
-    void testDocFilesInModulePackagesWithRecursiveCopyWithExclusion() {
+    public void testDocFilesInModulePackagesWithRecursiveCopyWithExclusion() {
         javadoc("-d", "modules-out-recursive-with-exclusion",
                 "-docfilessubdirs",
                 "-excludedocfilessubdir", "sub-dir",
@@ -161,7 +163,7 @@
     }
 
     @Test
-    void testDocFilesInPackages() {
+    public void testDocFilesInPackages() {
         javadoc("-d", "packages-out",
                 "-sourcepath", testSrc("packages"),
                 "p1");
@@ -172,7 +174,7 @@
     }
 
     @Test
-    void testDocFilesInPackagesWithRecursiveCopy() {
+    public void testDocFilesInPackagesWithRecursiveCopy() {
         javadoc("-d", "packages-out-recursive",
                 "-docfilessubdirs",
                 "-sourcepath", testSrc("packages"),
@@ -190,7 +192,7 @@
     }
 
     @Test
-    void testDocFilesInPackagesWithRecursiveCopyWithExclusion() {
+    public void testDocFilesInPackagesWithRecursiveCopyWithExclusion() {
         javadoc("-d", "packages-out-recursive-with-exclusion",
                 "-docfilessubdirs",
                 "-excludedocfilessubdir", "sub-dir",
@@ -204,7 +206,7 @@
     }
 
     @Test
-    void testDocFilesInUnnamedPackages() {
+    public void testDocFilesInUnnamedPackages() {
         javadoc("-d", "unnamed-out",
                 "-windowtitle", "phi-WINDOW-TITLE-phi",
                 "-sourcepath", testSrc("unnamed"),
@@ -218,7 +220,7 @@
     }
 
     @Test
-    void testDocFilesInUnnamedPackagesWithRecursiveCopy() {
+    public void testDocFilesInUnnamedPackagesWithRecursiveCopy() {
         javadoc("-d", "unnamed-out-recursive",
                 "-docfilessubdirs",
                 "-windowtitle", "phi-WINDOW-TITLE-phi",
@@ -237,7 +239,7 @@
     }
 
     @Test
-    void testDocFilesInPackagesSource7() {
+    public void testDocFilesInPackagesSource7() {
         javadoc("-d", "packages-out-src7",
                 "-source", "7",
                 "-sourcepath", testSrc("packages"),
@@ -249,7 +251,7 @@
     }
 
     @Test
-    void testDocFilesInPackagesSource7UsingClassPath() {
+    public void testDocFilesInPackagesSource7UsingClassPath() {
         javadoc("-d", "packages-out-src7-cp",
                 "-source", "7",
                 "-classpath", testSrc("packages"),
@@ -261,7 +263,7 @@
     }
 
     @Test
-    void testCopyThrough() {
+    public void testCopyThrough() {
         javadoc("-d", "copy",
                 "-sourcepath", testSrc("packages"),
                 "p2");
--- a/test/langtools/jdk/javadoc/doclet/testDeprecatedDocs/TestDeprecatedDocs.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testDeprecatedDocs/TestDeprecatedDocs.java	Wed Jan 02 10:21:54 2019 +0100
@@ -27,12 +27,14 @@
  *           8169819 8074407 8191030 8182765 8184205
  * @summary  test generated docs for deprecated items
  * @author   jamieh
- * @library  ../lib
+ * @library  ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build    JavadocTester
+ * @build    javadoc.tester.*
  * @run main TestDeprecatedDocs
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestDeprecatedDocs extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -41,7 +43,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         javadoc("-d", "out",
                 "-sourcepath", testSrc,
                 "pkg");
@@ -299,7 +301,7 @@
     }
 
     @Test
-    void test_html4() {
+    public void test_html4() {
         javadoc("-d", "out-html4",
                 "-html4",
                 "-sourcepath", testSrc,
--- a/test/langtools/jdk/javadoc/doclet/testDocEncoding/TestDocEncoding.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testDocEncoding/TestDocEncoding.java	Wed Jan 02 10:21:54 2019 +0100
@@ -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
@@ -31,14 +31,16 @@
  * @summary  Run tests on -docencoding to see if the value is
              used for stylesheet as well.
  * @author   jayashree viswanathan
- * @library  ../lib
+ * @library  ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build    JavadocTester
+ * @build    javadoc.tester.*
  * @run main TestDocEncoding
  */
 
 import java.nio.charset.Charset;
 
+import javadoc.tester.JavadocTester;
+
 public class TestDocEncoding extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -47,7 +49,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         javadoc("-d", "out",
                 "-docencoding", "Cp930",
                 "-sourcepath", testSrc,
--- a/test/langtools/jdk/javadoc/doclet/testDocErrorReporter/TestDocErrorReporter.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testDocErrorReporter/TestDocErrorReporter.java	Wed Jan 02 10:21:54 2019 +0100
@@ -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
@@ -27,12 +27,14 @@
  * @summary  Make sure that option validation errors and sent to the
  *           DocErrorReporter.
  * @author   jamieh
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build    JavadocTester
+ * @build    javadoc.tester.*
  * @run main TestDocErrorReporter
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestDocErrorReporter extends JavadocTester {
 
     /**
@@ -46,7 +48,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         javadoc("-d", "out",
                 "-sourcepath", testSrc,
                 "-encoding", "xyz",
--- a/test/langtools/jdk/javadoc/doclet/testDocFileDir/TestDocFileDir.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testDocFileDir/TestDocFileDir.java	Wed Jan 02 10:21:54 2019 +0100
@@ -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
@@ -29,12 +29,14 @@
  *          directory.
  *          Also test that -docfilessubdirs and -excludedocfilessubdir both work.
  * @author jamieh
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
  * @run main TestDocFileDir
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestDocFileDir extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -44,7 +46,7 @@
 
     // Output dir = "", Input dir = ""
     @Test
-    void test1() {
+    public void test1() {
         copyDir(testSrc("pkg"), ".");
         setOutputDirectoryCheck(DirectoryCheck.NO_HTML_FILES);
         javadoc("pkg/C.java");
@@ -55,7 +57,7 @@
 
     // Output dir = Input Dir
     @Test
-    void test2() {
+    public void test2() {
         String outdir = "out2";
         copyDir(testSrc("pkg"), outdir);
         setOutputDirectoryCheck(DirectoryCheck.NO_HTML_FILES);
@@ -69,7 +71,7 @@
 
     // Exercising -docfilessubdirs and -excludedocfilessubdir
     @Test
-    void test3() {
+    public void test3() {
         String outdir = "out3";
         setOutputDirectoryCheck(DirectoryCheck.NONE);
         javadoc("-d", outdir,
--- a/test/langtools/jdk/javadoc/doclet/testDocFiles/TestDocFiles.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testDocFiles/TestDocFiles.java	Wed Jan 02 10:21:54 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2016, 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
@@ -25,12 +25,14 @@
  * @test
  * @bug 8008949
  * @summary verify that doc-files get copied
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
  * @run main TestDocFiles
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestDocFiles extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -39,7 +41,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         javadoc("-d", "out",
                 "-sourcepath", testSrc,
                 "pkg");
--- a/test/langtools/jdk/javadoc/doclet/testDocRootInlineTag/TestDocRootInlineTag.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testDocRootInlineTag/TestDocRootInlineTag.java	Wed Jan 02 10:21:54 2019 +0100
@@ -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
@@ -28,12 +28,14 @@
  * If docRoot performs as documented, the test passes.
  * Make sure that the docRoot tag works with the -bottom option.
  * @author jamieh
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
  * @run main TestDocRootInlineTag
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestDocRootInlineTag extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -42,7 +44,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         String uri = "http://www.java.sun.com/j2se/1.4/docs/api";
 
         javadoc("-bottom", "The value of @docRoot is \"{@docRoot}\"",
--- a/test/langtools/jdk/javadoc/doclet/testDocRootLink/TestDocRootLink.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testDocRootLink/TestDocRootLink.java	Wed Jan 02 10:21:54 2019 +0100
@@ -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
@@ -26,11 +26,13 @@
  * @bug 6553182 8025416 8029504
  * @summary This test verifies the -Xdocrootparent option.
  * @author Bhavesh Patel
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
  * @run main TestDocRootLink
  */
+import javadoc.tester.JavadocTester;
+
 public class TestDocRootLink extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -39,7 +41,7 @@
     }
 
     @Test
-    void test1() {
+    public void test1() {
         javadoc("-d", "out-1",
                 "-sourcepath", testSrc,
                 "pkg1", "pkg2");
@@ -71,7 +73,7 @@
     }
 
     @Test
-    void test2() {
+    public void test2() {
         javadoc("-d", "out-2",
                 "-Xdocrootparent", "http://download.oracle.com/javase/7/docs",
                 "-sourcepath", testSrc,
--- a/test/langtools/jdk/javadoc/doclet/testDupParamWarn/TestDupParamWarn.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testDupParamWarn/TestDupParamWarn.java	Wed Jan 02 10:21:54 2019 +0100
@@ -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
@@ -27,12 +27,14 @@
  * @summary Test to ensure that the doclet does not print out bad
  * warning messages about duplicate param tags.
  * @author jamieh
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
  * @run main TestDupParamWarn
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestDupParamWarn extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -41,7 +43,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         javadoc("-d", "out",
                 "-sourcepath", testSrc,
                 "pkg");
--- a/test/langtools/jdk/javadoc/doclet/testEmptyClass/TestEmptyClass.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testEmptyClass/TestEmptyClass.java	Wed Jan 02 10:21:54 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2016, 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
@@ -27,12 +27,14 @@
  * @summary Test to make sure that Javadoc behaves properly when
  * run on a completely empty class (no comments or members).
  * @author jamieh
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
  * @run main TestEmptyClass
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestEmptyClass extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -41,7 +43,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         javadoc("-classpath", testSrc("src"),
                 "-d", "out",
                 "-sourcepath", testSrc("src"),
--- a/test/langtools/jdk/javadoc/doclet/testEnclosingClass/TestEnclosingClass.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testEnclosingClass/TestEnclosingClass.java	Wed Jan 02 10:21:54 2019 +0100
@@ -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
@@ -26,12 +26,14 @@
  * @bug      5008230
  * @summary  Check the outer class when documenting enclosing class/interface.
  * @author   jamieh
- * @library  ../lib
+ * @library  ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build    JavadocTester
+ * @build    javadoc.tester.*
  * @run main TestEnclosingClass
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestEnclosingClass extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -40,7 +42,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         javadoc("-d", "out",
                 "-sourcepath", testSrc,
                 "pkg");
--- a/test/langtools/jdk/javadoc/doclet/testEncoding/TestEncoding.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testEncoding/TestEncoding.java	Wed Jan 02 10:21:54 2019 +0100
@@ -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
@@ -27,12 +27,14 @@
  * @summary This test determines if the value of the -encoding option is
  * properly passed from Javadoc to the source file parser.
  * @author jamieh
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
  * @run main TestEncoding
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestEncoding extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -41,7 +43,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         javadoc("-d", "out",
                 "-sourcepath", testSrc,
                 "-encoding", "iso-8859-1",
--- a/test/langtools/jdk/javadoc/doclet/testEnumConstructor/TestEnumConstructor.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testEnumConstructor/TestEnumConstructor.java	Wed Jan 02 10:21:54 2019 +0100
@@ -25,9 +25,9 @@
  * @test
  * @bug 8202624
  * @summary javadoc generates references to enum constructors, which are not documented
- * @library /tools/lib ../lib
+ * @library /tools/lib ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
  * @run main TestEnumConstructor
  */
 
@@ -37,6 +37,8 @@
 
 import toolbox.ToolBox;
 
+import javadoc.tester.JavadocTester;
+
 public class TestEnumConstructor extends JavadocTester {
 
     final ToolBox tb;
@@ -51,7 +53,7 @@
     }
 
     @Test
-    void test1(Path base) throws Exception {
+    public void test1(Path base) throws Exception {
         Path srcDir = base.resolve("src");
         createEnum(srcDir);
 
@@ -72,7 +74,7 @@
     }
 
     @Test
-    void test2(Path base) throws Exception {
+    public void test2(Path base) throws Exception {
         Path srcDir = base.resolve("src");
         createEnum(srcDir);
 
--- a/test/langtools/jdk/javadoc/doclet/testExternalOverridenMethod/TestExternalOverridenMethod.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testExternalOverridenMethod/TestExternalOverridenMethod.java	Wed Jan 02 10:21:54 2019 +0100
@@ -28,11 +28,13 @@
  * are documented properly.  The method should still include "implements" or
  * "overrides" documentation even though the method is external.
  * @author jamieh
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester TestExternalOverridenMethod
+ * @build javadoc.tester.* TestExternalOverridenMethod
  * @run main TestExternalOverridenMethod
  */
+import javadoc.tester.JavadocTester;
+
 public class TestExternalOverridenMethod extends JavadocTester {
 
     static final String uri = "http://java.sun.com/j2se/1.4.1/docs/api";
@@ -43,7 +45,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         javadoc("-d", "out",
                 "-source","8",
                 "-sourcepath", testSrc,
@@ -66,7 +68,7 @@
     }
 
     @Test
-    void test_html4() {
+    public void test_html4() {
         javadoc("-d", "out-html4",
                 "-source", "8",
                 "-html4",
--- a/test/langtools/jdk/javadoc/doclet/testFramesNoFrames/TestFramesNoFrames.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testFramesNoFrames/TestFramesNoFrames.java	Wed Jan 02 10:21:54 2019 +0100
@@ -25,13 +25,13 @@
  * @test
  * @bug 8162353 8164747 8173707 8196202 8204303 8184205
  * @summary javadoc should provide a way to disable use of frames
- * @library /tools/lib ../lib
+ * @library /tools/lib ../../lib
  * @modules
  *      jdk.compiler/com.sun.tools.javac.api
  *      jdk.compiler/com.sun.tools.javac.main
  *      jdk.javadoc/jdk.javadoc.internal.tool
  * @build toolbox.ModuleBuilder toolbox.ToolBox
- * @build JavadocTester
+ * @build javadoc.tester.*
  * @run main TestFramesNoFrames
  */
 
@@ -46,6 +46,8 @@
 import toolbox.ModuleBuilder;
 import toolbox.ToolBox;
 
+import javadoc.tester.JavadocTester;
+
 public class TestFramesNoFrames extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -156,7 +158,7 @@
     }
 
     @Test
-    void testClass(Path base, FrameKind fKind, OverviewKind oKind, HtmlKind hKind) throws Exception {
+    public void testClass(Path base, FrameKind fKind, OverviewKind oKind, HtmlKind hKind) throws Exception {
         javadoc(base, fKind, oKind, hKind,
             gensrcPackages.resolve("p1/P1C1.java").toString());
 
@@ -166,7 +168,7 @@
     }
 
     @Test
-    void testClasses(Path base, FrameKind fKind, OverviewKind oKind, HtmlKind hKind) throws IOException {
+    public void testClasses(Path base, FrameKind fKind, OverviewKind oKind, HtmlKind hKind) throws IOException {
         javadoc(base, fKind, oKind, hKind,
             gensrcPackages.resolve("p1/P1C1.java").toString(),
             gensrcPackages.resolve("p1/P1C2.java").toString(),
@@ -178,7 +180,7 @@
     }
 
     @Test
-    void testPackage(Path base, FrameKind fKind, OverviewKind oKind, HtmlKind hKind) throws IOException {
+    public void testPackage(Path base, FrameKind fKind, OverviewKind oKind, HtmlKind hKind) throws IOException {
         javadoc(base, fKind, oKind, hKind,
             "-sourcepath", gensrcPackages.toString(),
             "p1");
@@ -189,7 +191,7 @@
     }
 
     @Test
-    void testPackages(Path base, FrameKind fKind, OverviewKind oKind, HtmlKind hKind) throws IOException {
+    public void testPackages(Path base, FrameKind fKind, OverviewKind oKind, HtmlKind hKind) throws IOException {
         javadoc(base, fKind, oKind, hKind,
             "-sourcepath", gensrcPackages.toString(),
             "p1", "p2", "p3");
@@ -202,7 +204,7 @@
     }
 
     @Test
-    void testModules(Path base, FrameKind fKind, OverviewKind oKind, HtmlKind hKind) throws IOException {
+    public void testModules(Path base, FrameKind fKind, OverviewKind oKind, HtmlKind hKind) throws IOException {
         javadoc(base, fKind, oKind, hKind,
             "--module-source-path", gensrcModules.toString(),
             "--module", "m1,m2,m3");
--- a/test/langtools/jdk/javadoc/doclet/testGeneratedBy/TestGeneratedBy.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testGeneratedBy/TestGeneratedBy.java	Wed Jan 02 10:21:54 2019 +0100
@@ -25,12 +25,14 @@
  * @test
  * @bug 8000418 8024288 8196202
  * @summary Verify that files use a common Generated By string
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
  * @run main TestGeneratedBy
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestGeneratedBy extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -39,7 +41,7 @@
     }
 
     @Test
-    void testTimestamp() {
+    public void testTimestamp() {
         javadoc("-d", "out-timestamp",
                 "--frames",
             "-sourcepath", testSrc,
@@ -51,7 +53,7 @@
     }
 
     @Test
-    void testNoTimestamp() {
+    public void testNoTimestamp() {
         javadoc("-d", "out-notimestamp",
             "-notimestamp",
                 "--frames",
--- a/test/langtools/jdk/javadoc/doclet/testGenericMethodLinkTaglet/TestGenericMethodLinkTaglet.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testGenericMethodLinkTaglet/TestGenericMethodLinkTaglet.java	Wed Jan 02 10:21:54 2019 +0100
@@ -25,9 +25,9 @@
  * @test
  * @bug      8188248
  * @summary  NullPointerException on generic methods
- * @library  /tools/lib ../lib
+ * @library  /tools/lib ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build    JavadocTester toolbox.ToolBox builder.ClassBuilder
+ * @build    javadoc.tester.* toolbox.ToolBox builder.ClassBuilder
  * @run main TestGenericMethodLinkTaglet
  */
 
@@ -38,6 +38,8 @@
 import builder.ClassBuilder.MethodBuilder;
 import toolbox.ToolBox;
 
+import javadoc.tester.JavadocTester;
+
 public class TestGenericMethodLinkTaglet extends JavadocTester {
 
     final ToolBox tb;
@@ -52,7 +54,7 @@
     }
 
     @Test
-    void test(Path base) throws Exception {
+    public void test(Path base) throws Exception {
         Path srcDir = base.resolve("src");
         createTestClass(srcDir);
 
--- a/test/langtools/jdk/javadoc/doclet/testGrandParentTypes/TestGrandParentTypes.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testGrandParentTypes/TestGrandParentTypes.java	Wed Jan 02 10:21:54 2019 +0100
@@ -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
@@ -26,12 +26,14 @@
  * @bug      8182108
  * @summary  Verify that grand parent interface types are correct, and
  *           various interface related sections are correctly generated.
- * @library  ../lib
+ * @library  ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build    JavadocTester
+ * @build    javadoc.tester.*
  * @run main TestGrandParentTypes
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestGrandParentTypes extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -40,7 +42,7 @@
     }
 
     @Test
-    void test1() {
+    public void test1() {
         javadoc("-d", "out-1",
                 "-package",
                 "-sourcepath", testSrc,
--- a/test/langtools/jdk/javadoc/doclet/testGroupName/TestGroupName.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testGroupName/TestGroupName.java	Wed Jan 02 10:21:54 2019 +0100
@@ -25,9 +25,9 @@
  * @test
  * @bug 8190003 8196201 8196202 8184205
  * @summary Special characters in group names should be escaped
- * @library /tools/lib ../lib
+ * @library /tools/lib ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build toolbox.ToolBox JavadocTester
+ * @build toolbox.ToolBox javadoc.tester.*
  * @run main TestGroupName
  */
 
@@ -35,7 +35,8 @@
 import java.nio.file.Path;
 import java.nio.file.Paths;
 
-import toolbox.*;
+import javadoc.tester.JavadocTester;
+import toolbox.ToolBox;
 
 public class TestGroupName extends JavadocTester {
 
--- a/test/langtools/jdk/javadoc/doclet/testGroupOption/TestGroupOption.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testGroupOption/TestGroupOption.java	Wed Jan 02 10:21:54 2019 +0100
@@ -27,12 +27,14 @@
  * @summary  Test to make sure the -group option works correctly
  *           with the given pattern usages.
  * @author   jamieh
- * @library  ../lib
- * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build    JavadocTester
+ * @library  ../../lib
+ * @modules  jdk.javadoc/jdk.javadoc.internal.tool
+ * @build    javadoc.tester.*
  * @run main TestGroupOption
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestGroupOption extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -41,7 +43,7 @@
     }
 
     @Test
-    void test1() {
+    public void test1() {
         // Make sure the warning is not printed when -group is used correctly.
         javadoc("-d", "out-1",
                 "-sourcepath", testSrc,
@@ -58,7 +60,7 @@
      @Test
     // Make sure the "Other packages" section is printed and the header for empty section is not.
     // Make sure that the headers of group that is defined using patterns are printed.
-    void test2() {
+    public void test2() {
         javadoc("-d", "out-2",
                 "--frames",
                 "-sourcepath", testSrc,
@@ -74,7 +76,7 @@
     }
 
     @Test
-    void test3() {
+    public void test3() {
         // Make sure the warning is printed when -group is not used correctly.
         javadoc("-d", "out-3",
                 "-sourcepath", testSrc,
--- a/test/langtools/jdk/javadoc/doclet/testHeadTag/TestHeadTag.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testHeadTag/TestHeadTag.java	Wed Jan 02 10:21:54 2019 +0100
@@ -25,9 +25,9 @@
  * @test
  * @bug 8203792
  * @summary Remove "compatibility" features from Head.java
- * @library /tools/lib ../lib
+ * @library /tools/lib ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester toolbox.ToolBox builder.ClassBuilder
+ * @build javadoc.tester.* toolbox.ToolBox builder.ClassBuilder
  * @run main TestHeadTag
  */
 
@@ -39,6 +39,8 @@
 import builder.ClassBuilder;
 import toolbox.ToolBox;
 
+import javadoc.tester.JavadocTester;
+
 public class TestHeadTag extends JavadocTester {
 
     final ToolBox tb;
@@ -53,7 +55,7 @@
     }
 
     @Test
-    void test(Path base) throws Exception {
+    public void test(Path base) throws Exception {
         Path srcDir = base.resolve("src");
         createTestClass(srcDir);
 
@@ -70,7 +72,7 @@
     }
 
     @Test
-    void testWithNoTimestamp(Path base) throws Exception {
+    public void testWithNoTimestamp(Path base) throws Exception {
         Path srcDir = base.resolve("src");
         createTestClass(srcDir);
 
--- a/test/langtools/jdk/javadoc/doclet/testHeadings/TestHeadings.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testHeadings/TestHeadings.java	Wed Jan 02 10:21:54 2019 +0100
@@ -26,13 +26,15 @@
  * @bug      4905786 6259611 8162363 8196202
  * @summary  Make sure that headings use the TH tag instead of the TD tag.
  * @author   jamieh
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build    JavadocTester
+ * @build    javadoc.tester.*
  * @build    TestHeadings
  * @run main TestHeadings
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestHeadings extends JavadocTester {
 
     private static final String[][] TEST = {
@@ -58,7 +60,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         javadoc("-d", "out",
                 "-sourcepath", testSrc,
                 "-use",
--- a/test/langtools/jdk/javadoc/doclet/testHelpFile/TestHelpFile.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testHelpFile/TestHelpFile.java	Wed Jan 02 10:21:54 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2016, 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
@@ -26,12 +26,14 @@
  * @bug      7132631
  * @summary  Make sure that the help file is generated correctly.
  * @author   Bhavesh Patel
- * @library  ../lib
+ * @library  ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build    JavadocTester
+ * @build    javadoc.tester.*
  * @run main TestHelpFile
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestHelpFile extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -40,7 +42,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         javadoc("-d", "out",
                 "-sourcepath", testSrc,
                 testSrc("TestHelpFile.java"));
--- a/test/langtools/jdk/javadoc/doclet/testHelpOption/TestHelpOption.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testHelpOption/TestHelpOption.java	Wed Jan 02 10:21:54 2019 +0100
@@ -26,15 +26,17 @@
  * @bug      4934778 4777599 6553182 8146427 8146475 8175055 8185371
  * @summary  Make sure that --help, -helpfile and -nohelp options work correctly.
  * @author   jamieh
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build    JavadocTester TestHelpOption
+ * @build    javadoc.tester.* TestHelpOption
  * @run main TestHelpOption
  */
 
 import java.util.*;
 import java.util.stream.*;
 
+import javadoc.tester.JavadocTester;
+
 public class TestHelpOption extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -43,7 +45,7 @@
     }
 
     @Test
-    void testLineLengths() {
+    public void testLineLengths() {
         javadoc("-d", "out1",
                 "-sourcepath", testSrc,
                 "-X",
@@ -63,7 +65,7 @@
     }
 
     @Test
-    void testWithOption() {
+    public void testWithOption() {
         javadoc("-d", "out1",
                 "-sourcepath", testSrc,
                 "--help",
@@ -74,7 +76,7 @@
     }
 
     @Test
-    void testWithoutOption() {
+    public void testWithoutOption() {
         javadoc("-d", "out2",
                 "-sourcepath", testSrc,
                 testSrc("Sample.java"));
@@ -82,7 +84,7 @@
     }
 
     @Test
-    void testNohelpOption() {
+    public void testNohelpOption() {
         javadoc("-d", "out3",
                 "-sourcepath", testSrc,
                 "-nohelp",
@@ -92,7 +94,7 @@
     }
 
     @Test
-    void testHelpfileOption() {
+    public void testHelpfileOption() {
         javadoc("-d", "out4",
                 "-sourcepath", testSrc,
                 "-helpfile", testSrc("test-help.html"),
@@ -105,7 +107,7 @@
     }
 
     @Test
-    void testHelpfileReuseOption() {
+    public void testHelpfileReuseOption() {
         javadoc("-d", "out5",
                 "-sourcepath", testSrc,
                 "-helpfile", testSrc("test-help.html"),
@@ -115,7 +117,7 @@
     }
 
     @Test
-    void testHelpfileNohelpConflict() {
+    public void testHelpfileNohelpConflict() {
         javadoc("-d", "out6",
                 "-sourcepath", testSrc,
                 "-helpfile", testSrc("test-help.html"),
--- a/test/langtools/jdk/javadoc/doclet/testHiddenMembers/TestHiddenMembers.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testHiddenMembers/TestHiddenMembers.java	Wed Jan 02 10:21:54 2019 +0100
@@ -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
@@ -27,12 +27,14 @@
  * @summary Test to make sure that hidden overriden members are not
  * documented as inherited.
  * @author jamieh
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
  * @run main TestHiddenMembers
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestHiddenMembers extends JavadocTester {
 
     private static final String[][] NEGATED_TEST = {
@@ -49,7 +51,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         javadoc("-d", "out",
                 "-sourcepath", testSrc,
                 "pkg");
--- a/test/langtools/jdk/javadoc/doclet/testHiddenTag/TestHiddenTag.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testHiddenTag/TestHiddenTag.java	Wed Jan 02 10:21:54 2019 +0100
@@ -25,12 +25,14 @@
  * @test
  * @bug 8073100 8182765 8196202
  * @summary ensure the hidden tag works as intended
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
  * @run main TestHiddenTag
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestHiddenTag extends JavadocTester {
 
     public static void main(String... args) throws Exception {
--- a/test/langtools/jdk/javadoc/doclet/testHref/TestHref.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testHref/TestHref.java	Wed Jan 02 10:21:54 2019 +0100
@@ -26,12 +26,14 @@
  * @bug      4663254 8016328 8025633 8026567 8081854 8182765 8205593
  * @summary  Verify that spaces do not appear in hrefs and anchors.
  * @author   jamieh
- * @library  ../lib
+ * @library  ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build    JavadocTester
+ * @build    javadoc.tester.*
  * @run main TestHref
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestHref extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -40,7 +42,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         javadoc("-Xdoclint:none",
                 "-d", "out",
                 "-source", "8",
@@ -83,7 +85,7 @@
     }
 
     @Test
-    void test_html4() {
+    public void test_html4() {
         javadoc("-Xdoclint:none",
                 "-d", "out-html4",
                 "-source", "8",
--- a/test/langtools/jdk/javadoc/doclet/testHrefInDocComment/TestHrefInDocComment.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testHrefInDocComment/TestHrefInDocComment.java	Wed Jan 02 10:21:54 2019 +0100
@@ -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
@@ -27,12 +27,14 @@
  * @summary Determine if Hrefs are processed properly when they
  * appear in doc comments.
  * @author jamieh
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
  * @run main TestHrefInDocComment
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestHrefInDocComment extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -41,7 +43,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         javadoc("-d", "out",
                 "-sourcepath", testSrc, "pkg");
         checkExit(Exit.OK);
--- a/test/langtools/jdk/javadoc/doclet/testHtmlComments/TestHtmlComments.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testHtmlComments/TestHtmlComments.java	Wed Jan 02 10:21:54 2019 +0100
@@ -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
@@ -27,12 +27,14 @@
  * @summary  The field detail comment should not show up in the output if there
  *           are no fields to document.
  * @author   jamieh
- * @library  ../lib
+ * @library  ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build    JavadocTester
+ * @build    javadoc.tester.*
  * @run main TestHtmlComments
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestHtmlComments extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -41,7 +43,7 @@
     }
 
     @Test
-    void run() {
+    public void run() {
         javadoc("-d", "out",
                 "-sourcepath", testSrc,
                 testSrc("C.java"));
--- a/test/langtools/jdk/javadoc/doclet/testHtmlDefinitionListTag/TestHtmlDefinitionListTag.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testHtmlDefinitionListTag/TestHtmlDefinitionListTag.java	Wed Jan 02 10:21:54 2019 +0100
@@ -26,9 +26,9 @@
  * @bug 6786690 6820360 8025633 8026567 8175200 8183511 8186332 8074407 8182765
  * @summary This test verifies the nesting of definition list tags.
  * @author Bhavesh Patel
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
  * @run main TestHtmlDefinitionListTag
  */
 
@@ -36,6 +36,8 @@
 import java.util.Arrays;
 import java.util.List;
 
+import javadoc.tester.JavadocTester;
+
 public class TestHtmlDefinitionListTag extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -44,7 +46,7 @@
     }
 
     @Test
-    void test_Comment_Deprecated() {
+    public void test_Comment_Deprecated() {
 //        tester.run(ARGS1, TEST_ALL, NEGATED_TEST_NO_C5);
 //        tester.runTestsOnHTML(NO_TEST,  NEGATED_TEST_C5);
 //        tester.runTestsOnHTML(TEST_CMNT_DEPR, NO_TEST);
@@ -58,7 +60,7 @@
     }
 
     @Test
-    void test_Comment_Deprecated_html4() {
+    public void test_Comment_Deprecated_html4() {
         javadoc("-Xdoclint:none",
                 "-d", "out-1-html4",
                 "-html4",
@@ -69,7 +71,7 @@
     }
 
     @Test
-    void test_NoComment_Deprecated() {
+    public void test_NoComment_Deprecated() {
 //        tester.run(ARGS2, TEST_ALL, NEGATED_TEST_NO_C5);
 //        tester.runTestsOnHTML(NO_TEST,  NEGATED_TEST_C5);
 //        tester.runTestsOnHTML(NO_TEST, TEST_CMNT_DEPR);
@@ -84,7 +86,7 @@
     }
 
     @Test
-    void test_NoComment_Deprecated_html4() {
+    public void test_NoComment_Deprecated_html4() {
         javadoc("-Xdoclint:none",
                 "-d", "out-2-html4",
                 "-html4",
@@ -96,7 +98,7 @@
     }
 
     @Test
-    void test_Comment_NoDeprecated() {
+    public void test_Comment_NoDeprecated() {
 //        tester.run(ARGS3, TEST_ALL, NEGATED_TEST_NO_C5);
 //        tester.runTestsOnHTML(TEST_NODEPR, TEST_NOCMNT_NODEPR);
         javadoc("-Xdoclint:none",
@@ -111,7 +113,7 @@
     }
 
     @Test
-    void test_Comment_NoDeprecated_html4() {
+    public void test_Comment_NoDeprecated_html4() {
         javadoc("-Xdoclint:none",
                 "-d", "out-3-html4",
                 "-html4",
@@ -124,7 +126,7 @@
     }
 
     @Test
-    void testNoCommentNoDeprecated() {
+    public void testNoCommentNoDeprecated() {
 //        tester.run(ARGS4, TEST_ALL, NEGATED_TEST_NO_C5);
 //        tester.runTestsOnHTML(TEST_NOCMNT_NODEPR, TEST_CMNT_DEPR);
         javadoc("-Xdoclint:none",
@@ -140,7 +142,7 @@
     }
 
     @Test
-    void testNoCommentNoDeprecated_html4() {
+    public void testNoCommentNoDeprecated_html4() {
         javadoc("-Xdoclint:none",
                 "-d", "out-4-html4",
                 "-html4",
--- a/test/langtools/jdk/javadoc/doclet/testHtmlDocument/TestHtmlDocument.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testHtmlDocument/TestHtmlDocument.java	Wed Jan 02 10:21:54 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 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,11 +25,11 @@
  * @test
  * @bug 6851834
  * @summary This test verifies the HTML document generation for javadoc output.
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.doclets.formats.html.markup
  *          jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.util
  *          jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
  * @author Bhavesh Patel
  * @run main TestHtmlDocument
  */
@@ -43,6 +43,8 @@
  * The class reads each file, complete with newlines, into a string to easily
  * compare the existing markup with the generated markup.
  */
+import javadoc.tester.JavadocTester;
+
 public class TestHtmlDocument extends JavadocTester {
 
     // Entry point
@@ -52,7 +54,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         checking("markup");
         // Check whether the generated markup is same as the existing markup.
         String expected = readFile(testSrc, "testMarkup.html").replace("\n", NL);
--- a/test/langtools/jdk/javadoc/doclet/testHtmlLandmarkRegions/TestHtmlLankmarkRegions.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testHtmlLandmarkRegions/TestHtmlLankmarkRegions.java	Wed Jan 02 10:21:54 2019 +0100
@@ -25,12 +25,12 @@
  * @test
  * @bug 8210047
  * @summary some pages contains content outside of landmark region
- * @library /tools/lib ../lib
+ * @library /tools/lib ../../lib
  * @modules
  *      jdk.javadoc/jdk.javadoc.internal.tool
  *      jdk.compiler/com.sun.tools.javac.api
  *      jdk.compiler/com.sun.tools.javac.main
- * @build JavadocTester
+ * @build javadoc.tester.*
  * @run main TestHtmlLankmarkRegions
  */
 
@@ -42,6 +42,8 @@
 import toolbox.ModuleBuilder;
 import toolbox.ToolBox;
 
+import javadoc.tester.JavadocTester;
+
 public class TestHtmlLankmarkRegions extends JavadocTester {
 
     final ToolBox tb;
@@ -56,7 +58,7 @@
     }
 
     @Test
-    void testModules(Path base) throws Exception {
+    public void testModules(Path base) throws Exception {
         Path srcDir = base.resolve("src");
         createModules(srcDir);
 
@@ -100,7 +102,7 @@
     }
 
     @Test
-    void testModulesHtml4(Path base) throws Exception {
+    public void testModulesHtml4(Path base) throws Exception {
         Path srcDir = base.resolve("src");
         createModules(srcDir);
 
@@ -136,7 +138,7 @@
     }
 
     @Test
-    void testPackages(Path base) throws Exception {
+    public void testPackages(Path base) throws Exception {
         Path srcDir = base.resolve("src");
         createPackages(srcDir);
 
@@ -170,7 +172,7 @@
     }
 
     @Test
-    void testPackagesHtml4(Path base) throws Exception {
+    public void testPackagesHtml4(Path base) throws Exception {
         Path srcDir = base.resolve("src");
         createPackages(srcDir);
 
--- a/test/langtools/jdk/javadoc/doclet/testHtmlStrongTag/TestHtmlStrongTag.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testHtmlStrongTag/TestHtmlStrongTag.java	Wed Jan 02 10:21:54 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -26,12 +26,14 @@
  * @bug 6786028 8026567
  * @summary This test verifies the use of <strong> HTML tag instead of <B> by Javadoc std doclet.
  * @author Bhavesh Patel
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
  * @run main TestHtmlStrongTag
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestHtmlStrongTag extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -40,7 +42,7 @@
     }
 
     @Test
-    void test1() {
+    public void test1() {
         javadoc("-d", "out-1",
                 "-sourcepath", testSrc,
                 "pkg1");
@@ -58,7 +60,7 @@
     }
 
     @Test
-    void test2() {
+    public void test2() {
         javadoc("-d", "out-2",
                 "-sourcepath", testSrc,
                 "pkg2");
--- a/test/langtools/jdk/javadoc/doclet/testHtmlTableStyles/TestHtmlTableStyles.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testHtmlTableStyles/TestHtmlTableStyles.java	Wed Jan 02 10:21:54 2019 +0100
@@ -26,12 +26,14 @@
  * @bug 8008164 8169819 8183037 8182765 8196202 8184205
  * @summary Test styles on HTML tables generated by javadoc.
  * @author Bhavesh Patel
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
  * @run main TestHtmlTableStyles
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestHtmlTableStyles extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -40,7 +42,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         javadoc("-d", "out",
                 "-sourcepath", testSrc,
                 "-use",
@@ -77,7 +79,7 @@
     }
 
     @Test
-    void test_html4() {
+    public void test_html4() {
         javadoc("-d", "out-html4",
                 "-html4",
                 "-sourcepath", testSrc,
--- a/test/langtools/jdk/javadoc/doclet/testHtmlTableTags/TestHtmlTableTags.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testHtmlTableTags/TestHtmlTableTags.java	Wed Jan 02 10:21:54 2019 +0100
@@ -26,12 +26,14 @@
  * @bug      6786688 8008164 8162363 8169819 8183037 8182765 8184205
  * @summary  HTML tables should have table summary, caption and table headers.
  * @author   Bhavesh Patel
- * @library  ../lib
+ * @library  ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build    JavadocTester
+ * @build    javadoc.tester.*
  * @run main TestHtmlTableTags
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestHtmlTableTags extends JavadocTester {
 
     //Javadoc arguments.
@@ -46,7 +48,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         javadoc("-d", "out",
                 "-sourcepath", testSrc,
                 "-use",
@@ -60,7 +62,7 @@
     }
 
     @Test
-    void test_html4() {
+    public void test_html4() {
         javadoc("-d", "out-html4",
                 "-html4",
                 "-sourcepath", testSrc,
--- a/test/langtools/jdk/javadoc/doclet/testHtmlTag/TestHtmlTag.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testHtmlTag/TestHtmlTag.java	Wed Jan 02 10:21:54 2019 +0100
@@ -26,14 +26,16 @@
  * @bug 6786682 4649116 8182765
  * @summary This test verifies the use of lang attribute by <HTML>.
  * @author Bhavesh Patel
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
  * @run main TestHtmlTag
  */
 
 import java.util.Locale;
 
+import javadoc.tester.JavadocTester;
+
 public class TestHtmlTag extends JavadocTester {
     private static final String defaultLanguage = Locale.getDefault().getLanguage();
     public static void main(String... args) throws Exception {
@@ -41,7 +43,7 @@
         tester.runTests();
     }
     @Test
-    void test_default() {
+    public void test_default() {
         javadoc("-locale", defaultLanguage,
                 "-d", "out-default",
                 "-sourcepath", testSrc,
@@ -60,7 +62,7 @@
     }
 
     @Test
-    void test_ja() {
+    public void test_ja() {
         // TODO: why does this test need/use pkg2; why can't it use pkg1
         // like the other two tests, so that we can share the check methods?
         javadoc("-locale", "ja",
@@ -80,7 +82,7 @@
     }
 
     @Test
-    void test_en_US() {
+    public void test_en_US() {
         javadoc("-locale", "en_US",
                 "-d", "out-en_US",
                 "-sourcepath", testSrc,
@@ -98,7 +100,7 @@
     }
 
     @Test
-    void test_other() {
+    public void test_other() {
         javadoc("-locale", "en_US",
                 "-d", "out-other",
                 "-sourcepath", testSrc,
@@ -195,7 +197,7 @@
     }
 
     @Test
-    void test_other_html4() {
+    public void test_other_html4() {
         javadoc("-locale", "en_US",
                 "-d", "out-other-html4",
                 "-html4",
--- a/test/langtools/jdk/javadoc/doclet/testHtmlVersion/TestHtmlVersion.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testHtmlVersion/TestHtmlVersion.java	Wed Jan 02 10:21:54 2019 +0100
@@ -27,12 +27,14 @@
  *      8202624 8210047 8184205
  * @summary Test the version of HTML generated by the javadoc tool.
  * @author bpatel
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
  * @run main TestHtmlVersion
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestHtmlVersion extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -41,7 +43,7 @@
     }
 
     @Test
-    void test1() {
+    public void test1() {
         javadoc("-d", "out-1",
                 "-private",
                 "-linksource",
@@ -56,7 +58,7 @@
     }
 
     @Test
-    void test2() {
+    public void test2() {
         javadoc("-d", "out-2",
                 "-html4",
                 "-private",
@@ -72,7 +74,7 @@
     }
 
     @Test
-    void test3() {
+    public void test3() {
         javadoc("-d", "out-3",
                 "-html4",
                 "-private",
@@ -88,7 +90,7 @@
     }
 
     @Test
-    void test4() {
+    public void test4() {
         javadoc("-d", "out-4",
                 "-private",
                 "-linksource",
--- a/test/langtools/jdk/javadoc/doclet/testHtmlWarning/TestHtmlWarning.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testHtmlWarning/TestHtmlWarning.java	Wed Jan 02 10:21:54 2019 +0100
@@ -25,9 +25,9 @@
  * @test
  * @bug 8194955 8182765
  * @summary Warn when default HTML version is used.
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
  * @run main TestHtmlWarning
  */
 
@@ -36,6 +36,8 @@
 import java.nio.file.Paths;
 import java.util.List;
 
+import javadoc.tester.JavadocTester;
+
 public class TestHtmlWarning extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -54,7 +56,7 @@
             + "in your comments are valid in HTML5, and remove the -html4 option.";
 
     @Test
-    void testHtml4() {
+    public void testHtml4() {
         javadoc("-d", "out-4",
                 "-html4",
                 testFile.toString());
@@ -64,7 +66,7 @@
     }
 
     @Test
-    void testHtml5() {
+    public void testHtml5() {
         javadoc("-d", "out-5",
                 "-html5",
                 testFile.toString());
@@ -74,7 +76,7 @@
     }
 
     @Test
-    void testDefault() {
+    public void testDefault() {
         javadoc("-d", "out-default",
                 testFile.toString());
         checkExit(Exit.OK);
--- a/test/langtools/jdk/javadoc/doclet/testIOException/TestIOException.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testIOException/TestIOException.java	Wed Jan 02 10:21:54 2019 +0100
@@ -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
@@ -25,15 +25,17 @@
  * @test
  * @bug 8164130
  * @summary test IOException handling
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
  * @run main TestIOException
  */
 
 import java.io.File;
 import java.io.FileWriter;
 
+import javadoc.tester.JavadocTester;
+
 public class TestIOException extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -42,7 +44,7 @@
     }
 
     @Test
-    void testReadOnlyDirectory() {
+    public void testReadOnlyDirectory() {
         File outDir = new File("out1");
         if (!outDir.mkdir()) {
             throw new Error("Cannot create directory");
@@ -66,7 +68,7 @@
     }
 
     @Test
-    void testReadOnlyFile() throws Exception {
+    public void testReadOnlyFile() throws Exception {
         File outDir = new File("out2");
         if (!outDir.mkdir()) {
             throw new Error("Cannot create directory");
@@ -95,7 +97,7 @@
     }
 
     @Test
-    void testReadOnlySubdirectory() throws Exception {
+    public void testReadOnlySubdirectory() throws Exception {
         // init source file
         File srcDir = new File("src4");
         File src_p = new File(srcDir, "p");
@@ -133,7 +135,7 @@
     }
 
     @Test
-    void testReadOnlyDocFilesDir() throws Exception {
+    public void testReadOnlyDocFilesDir() throws Exception {
         // init source files
         File srcDir = new File("src4");
         File src_p = new File(srcDir, "p");
--- a/test/langtools/jdk/javadoc/doclet/testIncluded/TestIncluded.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testIncluded/TestIncluded.java	Wed Jan 02 10:21:54 2019 +0100
@@ -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
@@ -25,12 +25,14 @@
  * @test
  * @bug      8149842
  * @summary  Verify that non included classes are not inspected.
- * @library  ../lib
+ * @library  ../../lib
  * @modules  jdk.javadoc/jdk.javadoc.internal.tool
- * @build    JavadocTester
+ * @build    javadoc.tester.*
  * @run main TestIncluded
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestIncluded extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -44,7 +46,7 @@
      * an error, if doc comments are inspected.
      */
     @Test
-    void test() {
+    public void test() {
         javadoc("-d", "out",
                 "-Xdoclint:all",
                 "-sourcepath", testSrc,
--- a/test/langtools/jdk/javadoc/doclet/testIndentation/TestIndentation.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testIndentation/TestIndentation.java	Wed Jan 02 10:21:54 2019 +0100
@@ -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
@@ -25,12 +25,14 @@
  * @test
  * @bug      8011288 8062647 8175200
  * @summary  Erratic/inconsistent indentation of signatures
- * @library  ../lib
+ * @library  ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build    JavadocTester
+ * @build    javadoc.tester.*
  * @run main TestIndentation
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestIndentation extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -39,7 +41,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         javadoc("-d", "out",
                 "-sourcepath", testSrc,
                 "p");
--- a/test/langtools/jdk/javadoc/doclet/testIndex/TestIndex.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testIndex/TestIndex.java	Wed Jan 02 10:21:54 2019 +0100
@@ -28,12 +28,14 @@
  *           Also test that index-all.html has the appropriate output.
  *           Test for unnamed package in index.
  * @author   jamieh
- * @library  ../lib
+ * @library  ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build    JavadocTester
+ * @build    javadoc.tester.*
  * @run main TestIndex
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestIndex extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -42,7 +44,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         javadoc("-d", "out",
                 "--frames",
                 "-sourcepath", testSrc,
--- a/test/langtools/jdk/javadoc/doclet/testIndexFiles/TestIndexFiles.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testIndexFiles/TestIndexFiles.java	Wed Jan 02 10:21:54 2019 +0100
@@ -26,12 +26,14 @@
  * @bug      8170825 8196027
  * @summary  Perform tests on index files generated by javadoc.
  * @author   bpatel
- * @library  ../lib
+ * @library  ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build    JavadocTester
+ * @build    javadoc.tester.*
  * @run main TestIndexFiles
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestIndexFiles extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -40,7 +42,7 @@
     }
 
     @Test
-    void testIndexFiles() {
+    public void testIndexFiles() {
         javadoc("-d", "out", "-splitindex", "-Xdoclint:none", "-sourcepath", testSrc,
                 "-use", "pkg");
         checkExit(Exit.OK);
--- a/test/langtools/jdk/javadoc/doclet/testIndexInPackageFiles/TestIndexInPackageFiles.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testIndexInPackageFiles/TestIndexInPackageFiles.java	Wed Jan 02 10:21:54 2019 +0100
@@ -25,14 +25,16 @@
  * @test
  * @bug 8213957 8213958
  * @summary Test use of at-index in package-iinfo and doc-files
- * @library /tools/lib ../lib
+ * @library /tools/lib ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build toolbox.ToolBox JavadocTester
+ * @build toolbox.ToolBox javadoc.tester.*
  * @run main TestIndexInPackageFiles
  */
 
 import java.io.IOException;
 import java.nio.file.Path;
+
+import javadoc.tester.JavadocTester;
 import toolbox.ToolBox;
 
 public class TestIndexInPackageFiles extends JavadocTester {
--- a/test/langtools/jdk/javadoc/doclet/testIndexTaglet/TestIndexTaglet.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testIndexTaglet/TestIndexTaglet.java	Wed Jan 02 10:21:54 2019 +0100
@@ -25,9 +25,9 @@
  * @test
  * @bug 8202462
  * @summary {@index} may cause duplicate labels
- * @library /tools/lib ../lib
+ * @library /tools/lib ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester toolbox.ToolBox builder.ClassBuilder
+ * @build javadoc.tester.* toolbox.ToolBox builder.ClassBuilder
  * @run main TestIndexTaglet
  */
 
@@ -39,6 +39,8 @@
 import builder.ClassBuilder.MethodBuilder;
 import toolbox.ToolBox;
 
+import javadoc.tester.JavadocTester;
+
 public class TestIndexTaglet extends JavadocTester {
 
     final ToolBox tb;
@@ -53,7 +55,7 @@
     }
 
     @Test
-    void test(Path base) throws Exception {
+    public void test(Path base) throws Exception {
         Path srcDir = base.resolve("src");
         Path outDir = base.resolve("out");
 
@@ -83,7 +85,7 @@
     }
 
     @Test
-    void testIndexWithinATag(Path base) throws Exception {
+    public void testIndexWithinATag(Path base) throws Exception {
         Path srcDir = base.resolve("src");
         Path outDir = base.resolve("out");
 
--- a/test/langtools/jdk/javadoc/doclet/testIndexWithModules/TestIndexWithModules.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testIndexWithModules/TestIndexWithModules.java	Wed Jan 02 10:21:54 2019 +0100
@@ -25,12 +25,12 @@
  * @test
  * @bug 8190875
  * @summary modules not listed in overview/index page
- * @library /tools/lib ../lib
+ * @library /tools/lib ../../lib
  * @modules
  *      jdk.javadoc/jdk.javadoc.internal.tool
  *      jdk.compiler/com.sun.tools.javac.api
  *      jdk.compiler/com.sun.tools.javac.main
- * @build JavadocTester
+ * @build javadoc.tester.*
  * @run main TestIndexWithModules
  */
 
@@ -42,6 +42,8 @@
 import toolbox.ToolBox;
 
 
+import javadoc.tester.JavadocTester;
+
 public class TestIndexWithModules extends JavadocTester {
 
     final ToolBox tb;
@@ -59,7 +61,7 @@
     }
 
     @Test
-    void testIndexWithOverviewPath(Path base) throws Exception {
+    public void testIndexWithOverviewPath(Path base) throws Exception {
         Path out = base.resolve("out");
 
         tb.writeFile("overview.html",
@@ -80,7 +82,7 @@
 
     //multiple modules with frames
     @Test
-    void testIndexWithMultipleModules1(Path base) throws Exception {
+    public void testIndexWithMultipleModules1(Path base) throws Exception {
         Path out = base.resolve("out");
         javadoc("-d", out.toString(),
                 "--module-source-path", src.toString(),
@@ -100,7 +102,7 @@
 
     //multiple modules with out frames
     @Test
-    void testIndexWithMultipleModules2(Path base) throws Exception {
+    public void testIndexWithMultipleModules2(Path base) throws Exception {
         Path out = base.resolve("out");
         javadoc("-d", out.toString(),
                 "--module-source-path", src.toString(),
@@ -116,7 +118,7 @@
     }
 
     @Test
-    void testIndexWithSingleModule(Path base) throws Exception {
+    public void testIndexWithSingleModule(Path base) throws Exception {
         Path out = base.resolve("out");
         javadoc("-d", out.toString(),
                 "--module-source-path", src.toString(),
@@ -129,7 +131,7 @@
 
     //no modules and multiple packages
     @Test
-    void testIndexWithNoModules1(Path base) throws Exception{
+    public void testIndexWithNoModules1(Path base) throws Exception{
         Path out = base.resolve("out");
         new ClassBuilder(tb, "P1.A1")
                 .setModifiers("public","class")
@@ -154,7 +156,7 @@
 
     //no modules and one package
     @Test
-    void testIndexWithNoModules2(Path base) throws Exception{
+    public void testIndexWithNoModules2(Path base) throws Exception{
         Path out = base.resolve("out");
         new ClassBuilder(tb, "P1.A1")
                 .setModifiers("public","class")
--- a/test/langtools/jdk/javadoc/doclet/testInlineLinkLabel/TestInlineLinkLabel.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testInlineLinkLabel/TestInlineLinkLabel.java	Wed Jan 02 10:21:54 2019 +0100
@@ -26,12 +26,14 @@
  * @bug 4524136
  * @summary Test to make sure label is used for inline links.
  * @author jamieh
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
  * @run main TestInlineLinkLabel
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestInlineLinkLabel extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -40,7 +42,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         javadoc("-d", "out",
                 "-sourcepath", testSrc,
                 "pkg");
--- a/test/langtools/jdk/javadoc/doclet/testInterface/TestInterface.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testInterface/TestInterface.java	Wed Jan 02 10:21:54 2019 +0100
@@ -30,9 +30,9 @@
  *           If A implements I and B extends A, B should be in the list of
  *           implementing classes in the documentation for I.
  * @author   jamieh
- * @library  ../lib
+ * @library  ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build    JavadocTester
+ * @build    javadoc.tester.*
  * @run main TestInterface
  */
 
@@ -50,6 +50,8 @@
    and Child<CE>
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestInterface extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -58,7 +60,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         javadoc("-d", "out",
                 "-sourcepath", testSrc,
                 "pkg");
@@ -156,7 +158,7 @@
     }
 
     @Test
-    void test_html4() {
+    public void test_html4() {
         javadoc("-d", "out-html4",
                 "-html4",
                 "-sourcepath", testSrc,
@@ -199,7 +201,7 @@
     }
 
     @Test
-    void test1() {
+    public void test1() {
         javadoc("-d", "out-1",
                 "-sourcepath", testSrc,
                 "pkg1");
@@ -215,7 +217,7 @@
     }
 
     @Test
-    void test1_html4() {
+    public void test1_html4() {
         javadoc("-d", "out-1-html4",
                 "-html4",
                 "-sourcepath", testSrc,
@@ -232,7 +234,7 @@
     }
 
     @Test
-    void test2() {
+    public void test2() {
         javadoc("-d", "out-2",
                 "-sourcepath", testSrc,
                 "pkg2");
--- a/test/langtools/jdk/javadoc/doclet/testJavaFX/TestFxProperties.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testJavaFX/TestFxProperties.java	Wed Jan 02 10:21:54 2019 +0100
@@ -26,9 +26,9 @@
  * @bug 8025091
  * @summary Tests the basic selection of FX related property methods, fields,
  *          setters and getters, by executing this test in the strict mode.
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester propgen.PropGen
+ * @build javadoc.tester.* propgen.PropGen
  * @run main TestFxProperties
  */
 
@@ -36,6 +36,8 @@
 import java.nio.file.Path;
 import java.nio.file.Paths;
 
+import javadoc.tester.JavadocTester;
+
 public class TestFxProperties extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -59,7 +61,7 @@
     }
 
     @Test
-    void test1() throws Exception {
+    public void test1() throws Exception {
         Path srcdir = Paths.get("src-propgen");
         Files.createDirectory(srcdir);
         new propgen.PropGen(srcdir).run();
--- a/test/langtools/jdk/javadoc/doclet/testJavaFX/TestJavaFX.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testJavaFX/TestJavaFX.java	Wed Jan 02 10:21:54 2019 +0100
@@ -28,12 +28,14 @@
  *      8203791 8184205
  * @summary Test of the JavaFX doclet features.
  * @author jvalenta
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
  * @run main TestJavaFX
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestJavaFX extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -42,7 +44,7 @@
     }
 
     @Test
-    void test1() {
+    public void test1() {
         javadoc("-d", "out1",
                 "-sourcepath", testSrc,
                 "-javafx",
@@ -175,7 +177,7 @@
     }
 
     @Test
-    void test1_html4() {
+    public void test1_html4() {
         javadoc("-d", "out1-html4",
                 "-html4",
                 "-sourcepath", testSrc,
@@ -203,7 +205,7 @@
      * are treated correctly.
      */
     @Test
-    void test2() {
+    public void test2() {
         javadoc("-d", "out2a",
                 "-sourcepath", testSrc,
                 "-javafx",
@@ -262,7 +264,7 @@
     }
 
     @Test
-    void test2_html4() {
+    public void test2_html4() {
         javadoc("-d", "out2a-html4",
                 "-html4",
                 "-sourcepath", testSrc,
@@ -313,7 +315,7 @@
      * are treated just like any other java method.
      */
     @Test
-    void test3() {
+    public void test3() {
         javadoc("-d", "out2b",
                 "-sourcepath", testSrc,
                 "-package",
@@ -355,7 +357,7 @@
     }
 
     @Test
-    void test3_html4() {
+    public void test3_html4() {
         javadoc("-d", "out2b-html4",
                 "-html4",
                 "-sourcepath", testSrc,
@@ -402,7 +404,7 @@
      * --javafx flag.
      */
     @Test
-    void test4() {
+    public void test4() {
         javadoc("-d", "out4",
                 "--javafx",
                 "--disable-javafx-strict-checks",
--- a/test/langtools/jdk/javadoc/doclet/testJavaFX/TestJavaFxMode.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testJavaFX/TestJavaFxMode.java	Wed Jan 02 10:21:54 2019 +0100
@@ -25,9 +25,9 @@
  * @test
  * @bug 8208531
  * @summary -javafx mode should be on by default when JavaFX is available.
- * @library /tools/lib ../lib
+ * @library /tools/lib ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
  * @run main TestJavaFxMode
  */
 
@@ -36,6 +36,8 @@
 import java.nio.file.Path;
 import java.nio.file.Paths;
 
+import javadoc.tester.JavadocTester;
+
 public class TestJavaFxMode extends JavadocTester {
 
     final ToolBox tb;
@@ -63,7 +65,7 @@
     }
 
     @Test
-    void test(Path base) throws Exception {
+    public void test(Path base) throws Exception {
         Path src = base.resolve("src");
         createTestClass(src);
         Path outDir = base.resolve("out");
--- a/test/langtools/jdk/javadoc/doclet/testJavascript/TestJavascript.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testJavascript/TestJavascript.java	Wed Jan 02 10:21:54 2019 +0100
@@ -26,12 +26,14 @@
  * @bug      4665566 4855876 7025314 8012375 8015997 8016328 8024756 8148985 8151921 8151743 8196202
  * @summary  Verify that the output has the right javascript.
  * @author   jamieh
- * @library  ../lib
+ * @library  ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build    JavadocTester
+ * @build    javadoc.tester.*
  * @run main TestJavascript
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestJavascript extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -40,7 +42,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         javadoc("-d", "out",
                 "--frames",
                 "-sourcepath", testSrc,
--- a/test/langtools/jdk/javadoc/doclet/testLambdaFeature/TestLambdaFeature.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testLambdaFeature/TestLambdaFeature.java	Wed Jan 02 10:21:54 2019 +0100
@@ -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
@@ -27,9 +27,9 @@
  * @summary  Make sure that the lambda feature changes work fine in
  *           javadoc.
  * @author   bpatel
- * @library  ../lib/
+ * @library  ../../lib/
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build    JavadocTester TestLambdaFeature
+ * @build    javadoc.tester.* TestLambdaFeature
  * @run main TestLambdaFeature
  */
 
@@ -39,6 +39,8 @@
  *              removed [ 8022738 ]
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestLambdaFeature extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -47,7 +49,7 @@
     }
 
     @Test
-    void testDefault() {
+    public void testDefault() {
         javadoc("-d", "out-default",
                 "-sourcepath", testSrc,
                 "pkg", "pkg1");
@@ -101,7 +103,7 @@
     }
 
     @Test
-    void testSource7() {
+    public void testSource7() {
         javadoc("-d", "out-7",
                 "-sourcepath", testSrc,
                 "-source", "1.7",
--- a/test/langtools/jdk/javadoc/doclet/testLeadingSpaces/LeadingSpaces.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testLeadingSpaces/LeadingSpaces.java	Wed Jan 02 10:21:54 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2016, 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
@@ -29,12 +29,14 @@
  *    begin their comment without a leading star without leading
  *    spaces stripped
  * @author jamieh
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
  * @run main LeadingSpaces
  */
 
+import javadoc.tester.JavadocTester;
+
 public class LeadingSpaces extends JavadocTester {
     /**
      * The entry point of the test.
@@ -47,7 +49,7 @@
     }
 
     @Test
-    void testLeadingSpaces() {
+    public void testLeadingSpaces() {
         javadoc("-d", "out", "-sourcepath", testSrc,
                 testSrc("LeadingSpaces.java"));
         checkExit(Exit.OK);
--- a/test/langtools/jdk/javadoc/doclet/testLegacyTaglet/TestLegacyTaglet.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testLegacyTaglet/TestLegacyTaglet.java	Wed Jan 02 10:21:54 2019 +0100
@@ -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,12 +27,14 @@
  * @summary Test to ensure that the refactored version of the standard
  * doclet still works with Taglets that implement the 1.4.0 interface.
  * @author jamieh
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester ToDoTaglet UnderlineTaglet Check
+ * @build javadoc.tester.* ToDoTaglet UnderlineTaglet Check
  * @run main TestLegacyTaglet
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestLegacyTaglet extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -41,7 +43,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         javadoc("-d", "out",
                 "-sourcepath", testSrc,
                 "-tagletpath", System.getProperty("test.classes", "."),
--- a/test/langtools/jdk/javadoc/doclet/testLinkOption/TestBadLinkOption.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testLinkOption/TestBadLinkOption.java	Wed Jan 02 10:21:54 2019 +0100
@@ -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
@@ -26,12 +26,14 @@
  * @bug 4625883 8180019
  * @summary Make sure that bad -link arguments trigger errors.
  * @author jamieh
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
  * @run main TestBadLinkOption
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestBadLinkOption extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -40,7 +42,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         String out = "out";
         javadoc("-d", out,
                 "-sourcepath", testSrc,
--- a/test/langtools/jdk/javadoc/doclet/testLinkOption/TestLinkOption.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testLinkOption/TestLinkOption.java	Wed Jan 02 10:21:54 2019 +0100
@@ -27,14 +27,16 @@
  * @summary Test to make sure that -link and -linkoffline link to
  * right files, and URLs with and without trailing slash are accepted.
  * @author jamieh
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
  * @run main TestLinkOption
  */
 
 import java.io.File;
 
+import javadoc.tester.JavadocTester;
+
 public class TestLinkOption extends JavadocTester {
     /**
      * The entry point of the test.
@@ -50,7 +52,7 @@
     // it generates. Therefore we run everything serially in a single @Test
     // method and not in independent @Test methods.
     @Test
-    void test() {
+    public void test() {
         String mylib = "mylib";
         String[] javacArgs = {
             "-d", mylib, testSrc + "/extra/StringBuilder.java"
--- a/test/langtools/jdk/javadoc/doclet/testLinkOption/TestLinkOptionWithModule.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testLinkOption/TestLinkOptionWithModule.java	Wed Jan 02 10:21:54 2019 +0100
@@ -25,12 +25,12 @@
  * @test
  * @bug 8205593
  * @summary Javadoc -link makes broken links if module name matches package name
- * @library /tools/lib ../lib
+ * @library /tools/lib ../../lib
  * @modules
  *      jdk.javadoc/jdk.javadoc.internal.tool
  *      jdk.compiler/com.sun.tools.javac.api
  *      jdk.compiler/com.sun.tools.javac.main
- * @build JavadocTester
+ * @build javadoc.tester.*
  * @run main TestLinkOptionWithModule
  */
 
@@ -43,6 +43,8 @@
 import toolbox.ToolBox;
 
 
+import javadoc.tester.JavadocTester;
+
 public class TestLinkOptionWithModule extends JavadocTester {
 
     final ToolBox tb;
@@ -60,7 +62,7 @@
     }
 
     @Test
-    void testModuleLinkedToModule(Path base) throws Exception {
+    public void testModuleLinkedToModule(Path base) throws Exception {
         Path out1 = base.resolve("out1a"), out2 = base.resolve("out1b");
 
         javadoc("-d", out1.toString(),
@@ -79,7 +81,7 @@
     }
 
     @Test
-    void testPackageLinkedToPackage(Path base) throws Exception {
+    public void testPackageLinkedToPackage(Path base) throws Exception {
         Path out1 = base.resolve("out2a"), out2 = base.resolve("out2b");
 
         javadoc("-d", out1.toString(),
@@ -98,7 +100,7 @@
     }
 
     @Test
-    void testModuleLinkedToPackage(Path base) throws Exception {
+    public void testModuleLinkedToPackage(Path base) throws Exception {
         Path out1 = base.resolve("out3a"), out2 = base.resolve("out3b");
 
         javadoc("-d", out1.toString(),
@@ -117,7 +119,7 @@
     }
 
     @Test
-    void testPackageLinkedToModule(Path base) throws Exception {
+    public void testPackageLinkedToModule(Path base) throws Exception {
         Path out1 = base.resolve("out4a"), out2 = base.resolve("out4b");
 
         javadoc("-d", out1.toString(),
--- a/test/langtools/jdk/javadoc/doclet/testLinkOption/TestNewLineInLink.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testLinkOption/TestNewLineInLink.java	Wed Jan 02 10:21:54 2019 +0100
@@ -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
@@ -27,12 +27,14 @@
  * @summary Make sure that a new line may act as a separator between
  * link and label.
  * @author jamieh
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
  * @run main TestNewLineInLink
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestNewLineInLink extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -41,7 +43,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         javadoc("-d", "out",
                 "-source", "8",
                 "-sourcepath", testSrc,
--- a/test/langtools/jdk/javadoc/doclet/testLinkOption/TestRedirectLinks.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testLinkOption/TestRedirectLinks.java	Wed Jan 02 10:21:54 2019 +0100
@@ -25,12 +25,12 @@
  * @test
  * @bug 8190312
  * @summary test redirected URLs for -link
- * @library /tools/lib ../lib
+ * @library /tools/lib ../../lib
  * @modules jdk.compiler/com.sun.tools.javac.api
  *          jdk.compiler/com.sun.tools.javac.main
  *          jdk.javadoc/jdk.javadoc.internal.api
  *          jdk.javadoc/jdk.javadoc.internal.tool
- * @build toolbox.ToolBox toolbox.JavacTask JavadocTester
+ * @build toolbox.ToolBox toolbox.JavacTask javadoc.tester.*
  * @run main TestRedirectLinks
  */
 
@@ -59,10 +59,10 @@
 import com.sun.net.httpserver.HttpsConfigurator;
 import com.sun.net.httpserver.HttpsServer;
 
+import javadoc.tester.JavadocTester;
 import toolbox.JavacTask;
 import toolbox.ToolBox;
 
-
 public class TestRedirectLinks extends JavadocTester {
     /**
      * The entry point of the test.
@@ -103,6 +103,7 @@
                     out.println("Header: " + httpConn.getHeaderFieldKey(n) + ": " + httpConn.getHeaderField(n));
                     n++;
                 }
+                httpConn.disconnect();
             }
         } catch (Exception e) {
             out.println("Exception occurred: " + e);
--- a/test/langtools/jdk/javadoc/doclet/testLinkTaglet/TestLinkTaglet.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testLinkTaglet/TestLinkTaglet.java	Wed Jan 02 10:21:54 2019 +0100
@@ -27,12 +27,14 @@
  * @summary  Make sure that you can link from one member to another using
  *           non-qualified name, furthermore, ensure the right one is linked.
  * @author   jamieh
- * @library  ../lib
+ * @library  ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build    JavadocTester
+ * @build    javadoc.tester.*
  * @run main TestLinkTaglet
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestLinkTaglet extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -41,7 +43,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         javadoc("-Xdoclint:none",
                 "-d", "out",
                 "-sourcepath", testSrc,
@@ -75,7 +77,7 @@
     }
 
     @Test
-    void test_html4() {
+    public void test_html4() {
         javadoc("-Xdoclint:none",
                 "-d", "out-html4",
                 "-html4",
--- a/test/langtools/jdk/javadoc/doclet/testLinkToSerialForm/TestLinkToSerialForm.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testLinkToSerialForm/TestLinkToSerialForm.java	Wed Jan 02 10:21:54 2019 +0100
@@ -27,12 +27,14 @@
  * @summary Test to make sure that there is a link with a proper anchor
  * from a serializable class to serialized-form.html.
  * @author jamieh
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
  * @run main TestLinkToSerialForm
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestLinkToSerialForm extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -41,7 +43,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         javadoc("-d", "out",
                 "-sourcepath", testSrc,
                 "pkg");
@@ -54,7 +56,7 @@
     }
 
     @Test
-    void test_html4() {
+    public void test_html4() {
         javadoc("-d", "out-html4",
                 "-html4",
                 "-sourcepath", testSrc,
--- a/test/langtools/jdk/javadoc/doclet/testLinksWithNoDeprecatedOption/TestLinksWithNoDeprecatedOption.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testLinksWithNoDeprecatedOption/TestLinksWithNoDeprecatedOption.java	Wed Jan 02 10:21:54 2019 +0100
@@ -25,12 +25,12 @@
  * @test
  * @bug 8202627
  * @summary javadoc generates broken links to deprecated items when -nodeprecated is used
- * @library /tools/lib ../lib
+ * @library /tools/lib ../../lib
  * @modules
  *      jdk.javadoc/jdk.javadoc.internal.tool
  *      jdk.compiler/com.sun.tools.javac.api
  *      jdk.compiler/com.sun.tools.javac.main
- * @build JavadocTester
+ * @build javadoc.tester.*
  * @run main TestLinksWithNoDeprecatedOption
  */
 
@@ -43,6 +43,8 @@
 import builder.ClassBuilder.MethodBuilder;
 import toolbox.ToolBox;
 
+import javadoc.tester.JavadocTester;
+
 public class TestLinksWithNoDeprecatedOption extends JavadocTester {
 
     final ToolBox tb;
@@ -57,7 +59,7 @@
     }
 
     @Test
-    void test(Path base) throws Exception {
+    public void test(Path base) throws Exception {
         Path srcDir = base.resolve("src");
         createTestClass(base, srcDir);
 
--- a/test/langtools/jdk/javadoc/doclet/testLiteralCodeInPre/TestLiteralCodeInPre.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testLiteralCodeInPre/TestLiteralCodeInPre.java	Wed Jan 02 10:21:54 2019 +0100
@@ -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
@@ -25,12 +25,14 @@
  * @test
  * @bug      8002387 8014636 8078320 8175200 8186332
  * @summary  Improve rendered HTML formatting for {@code}
- * @library  ../lib
+ * @library  ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build    JavadocTester
+ * @build    javadoc.tester.*
  * @run main TestLiteralCodeInPre
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestLiteralCodeInPre extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -39,7 +41,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         javadoc("-d", "out",
                 "-sourcepath", testSrc,
                 "-Xdoclint:none",
--- a/test/langtools/jdk/javadoc/doclet/testMemberInheritance/TestMemberInheritance.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testMemberInheritance/TestMemberInheritance.java	Wed Jan 02 10:21:54 2019 +0100
@@ -28,12 +28,14 @@
  * @summary Test to make sure that members are inherited properly in the Javadoc.
  *          Verify that inheritance labels are correct.
  * @author jamieh
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
  * @run main TestMemberInheritance
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestMemberInheritance extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -42,7 +44,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         javadoc("-d", "out",
                 "-sourcepath", testSrc,
                 "pkg", "diamond", "inheritDist", "pkg1");
@@ -105,7 +107,7 @@
     }
 
     @Test
-    void test_html4() {
+    public void test_html4() {
         javadoc("-d", "out-html4",
                 "-html4",
                 "-sourcepath", testSrc,
--- a/test/langtools/jdk/javadoc/doclet/testMemberSummary/TestMemberSummary.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testMemberSummary/TestMemberSummary.java	Wed Jan 02 10:21:54 2019 +0100
@@ -28,12 +28,14 @@
  *           type than the method in the child class.  Make sure the
  *           documentation is inherited but the return type isn't.
  * @author   jamieh
- * @library  ../lib
+ * @library  ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build    JavadocTester
+ * @build    javadoc.tester.*
  * @run main TestMemberSummary
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestMemberSummary extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -42,7 +44,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         javadoc("-d", "out",
                 "-private",
                 "-sourcepath", testSrc,
@@ -76,7 +78,7 @@
     }
 
     @Test
-    void test_html4() {
+    public void test_html4() {
         javadoc("-d", "out-html4",
                 "-html4",
                 "-private",
--- a/test/langtools/jdk/javadoc/doclet/testMethodTypes/TestMethodTypes.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testMethodTypes/TestMethodTypes.java	Wed Jan 02 10:21:54 2019 +0100
@@ -26,12 +26,14 @@
  * @bug      8002304 8024096 8193671 8196201 8203791 8184205
  * @summary  Test for various method type tabs in the method summary table
  * @author   Bhavesh Patel
- * @library  ../lib
+ * @library  ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build    JavadocTester
+ * @build    javadoc.tester.*
  * @run main TestMethodTypes
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestMethodTypes extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -40,7 +42,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         javadoc("-d", "out",
                 "-sourcepath", testSrc,
                 "pkg1");
--- a/test/langtools/jdk/javadoc/doclet/testMissingType/TestMissingType.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testMissingType/TestMissingType.java	Wed Jan 02 10:21:54 2019 +0100
@@ -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
@@ -25,12 +25,14 @@
  * @test
  * @bug      8173804
  * @summary  make sure doclet can handle missing types
- * @library  ../lib
+ * @library  ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build    JavadocTester
+ * @build    javadoc.tester.*
  * @run main TestMissingType
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestMissingType extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -39,7 +41,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         javadoc("-d", "out",
                 "-use",
                 "-sourcepath", testSrc,
--- a/test/langtools/jdk/javadoc/doclet/testModifierEx/TestModifierEx.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testModifierEx/TestModifierEx.java	Wed Jan 02 10:21:54 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2016, 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
@@ -24,12 +24,14 @@
 /*
  * @test
  * @summary Ensure the modifiers are correct
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
  * @run main TestModifierEx
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestModifierEx extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -38,7 +40,7 @@
     }
 
     @Test
-    void test1(){
+    public void test1(){
         javadoc("-d", "out-1",
                 "-sourcepath", testSrc,
                 "-package", "pkg1");
--- a/test/langtools/jdk/javadoc/doclet/testModuleDirs/TestModuleDirs.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testModuleDirs/TestModuleDirs.java	Wed Jan 02 10:21:54 2019 +0100
@@ -30,8 +30,8 @@
  *          jdk.javadoc/jdk.javadoc.internal.tool
  *          jdk.compiler/com.sun.tools.javac.api
  *          jdk.compiler/com.sun.tools.javac.main
- * @library ../lib /tools/lib
- * @build toolbox.ToolBox toolbox.ModuleBuilder JavadocTester
+ * @library ../../lib /tools/lib
+ * @build toolbox.ToolBox toolbox.ModuleBuilder javadoc.tester.*
  * @run main TestModuleDirs
  */
 
@@ -39,6 +39,7 @@
 import java.nio.file.Path;
 import java.nio.file.Paths;
 
+import javadoc.tester.JavadocTester;
 import toolbox.ModuleBuilder;
 import toolbox.ToolBox;
 
--- a/test/langtools/jdk/javadoc/doclet/testModules/TestEmptyModule.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testModules/TestEmptyModule.java	Wed Jan 02 10:21:54 2019 +0100
@@ -29,17 +29,18 @@
  *          jdk.javadoc/jdk.javadoc.internal.tool
  *          jdk.compiler/com.sun.tools.javac.api
  *          jdk.compiler/com.sun.tools.javac.main
- * @library ../lib /tools/lib
- * @build toolbox.ToolBox toolbox.ModuleBuilder JavadocTester
+ * @library ../../lib /tools/lib
+ * @build toolbox.ToolBox toolbox.ModuleBuilder javadoc.tester.*
  * @run main TestEmptyModule
  */
 
+import java.nio.file.Path;
+import java.nio.file.Paths;
+
+import javadoc.tester.JavadocTester;
 import toolbox.ModuleBuilder;
 import toolbox.ToolBox;
 
-import java.nio.file.Path;
-import java.nio.file.Paths;
-
 public class TestEmptyModule extends JavadocTester {
 
     public final ToolBox tb;
--- a/test/langtools/jdk/javadoc/doclet/testModules/TestIndirectExportsOpens.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testModules/TestIndirectExportsOpens.java	Wed Jan 02 10:21:54 2019 +0100
@@ -29,15 +29,17 @@
  *          jdk.javadoc/jdk.javadoc.internal.tool
  *          jdk.compiler/com.sun.tools.javac.api
  *          jdk.compiler/com.sun.tools.javac.main
- * @library ../lib /tools/lib
- * @build toolbox.ToolBox toolbox.ModuleBuilder JavadocTester
+ * @library ../../lib /tools/lib
+ * @build toolbox.ToolBox toolbox.ModuleBuilder javadoc.tester.*
  * @run main TestIndirectExportsOpens
  */
 
 import java.nio.file.Path;
 import java.nio.file.Paths;
 
-import toolbox.*;
+import javadoc.tester.JavadocTester;
+import toolbox.ModuleBuilder;
+import toolbox.ToolBox;
 
 public class TestIndirectExportsOpens extends JavadocTester {
 
--- a/test/langtools/jdk/javadoc/doclet/testModules/TestModulePackages.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testModules/TestModulePackages.java	Wed Jan 02 10:21:54 2019 +0100
@@ -25,11 +25,11 @@
  * @test
  * @bug 8178070 8196201 8184205
  * @summary Test packages table in module summary pages
- * @library /tools/lib ../lib
+ * @library /tools/lib ../../lib
  * @modules jdk.compiler/com.sun.tools.javac.api
  *          jdk.compiler/com.sun.tools.javac.main
  *          jdk.javadoc/jdk.javadoc.internal.tool
- * @build toolbox.ModuleBuilder toolbox.ToolBox JavadocTester
+ * @build toolbox.ModuleBuilder toolbox.ToolBox javadoc.tester.*
  * @run main TestModulePackages
  */
 
@@ -38,6 +38,7 @@
 import java.nio.file.Paths;
 import java.util.Set;
 
+import javadoc.tester.JavadocTester;
 import toolbox.ModuleBuilder;
 import toolbox.ToolBox;
 
--- a/test/langtools/jdk/javadoc/doclet/testModules/TestModuleServices.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testModules/TestModuleServices.java	Wed Jan 02 10:21:54 2019 +0100
@@ -29,8 +29,8 @@
  *          jdk.javadoc/jdk.javadoc.internal.tool
  *          jdk.compiler/com.sun.tools.javac.api
  *          jdk.compiler/com.sun.tools.javac.main
- * @library ../lib /tools/lib
- * @build toolbox.ToolBox toolbox.ModuleBuilder JavadocTester
+ * @library ../../lib /tools/lib
+ * @build toolbox.ToolBox toolbox.ModuleBuilder javadoc.tester.*
  * @run main TestModuleServices
  */
 
@@ -38,7 +38,9 @@
 import java.nio.file.Path;
 import java.nio.file.Paths;
 
-import toolbox.*;
+import javadoc.tester.JavadocTester;
+import toolbox.ModuleBuilder;
+import toolbox.ToolBox;
 
 public class TestModuleServices extends JavadocTester {
 
--- a/test/langtools/jdk/javadoc/doclet/testModules/TestModuleServicesLink.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testModules/TestModuleServicesLink.java	Wed Jan 02 10:21:54 2019 +0100
@@ -29,15 +29,17 @@
  *          jdk.compiler/com.sun.tools.javac.main
  *          jdk.javadoc/jdk.javadoc.internal.api
  *          jdk.javadoc/jdk.javadoc.internal.tool
- * @library ../lib /tools/lib
- * @build toolbox.ToolBox toolbox.ModuleBuilder JavadocTester
+ * @library ../../lib /tools/lib
+ * @build toolbox.ToolBox toolbox.ModuleBuilder javadoc.tester.*
  * @run main TestModuleServicesLink
  */
 
 import java.nio.file.Path;
 import java.nio.file.Paths;
 
-import toolbox.*;
+import javadoc.tester.JavadocTester;
+import toolbox.ModuleBuilder;
+import toolbox.ToolBox;
 
 public class TestModuleServicesLink extends JavadocTester {
 
--- a/test/langtools/jdk/javadoc/doclet/testModules/TestModules.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testModules/TestModules.java	Wed Jan 02 10:21:54 2019 +0100
@@ -30,11 +30,13 @@
         8184205
  * @summary Test modules support in javadoc.
  * @author bpatel
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
  * @run main TestModules
  */
+import javadoc.tester.JavadocTester;
+
 public class TestModules extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -46,7 +48,7 @@
      * Test generated module pages for HTML 4.
      */
     @Test
-    void testHtml4() {
+    public void testHtml4() {
         javadoc("-d", "out",
                 "-html4",
                 "-use",
@@ -73,7 +75,7 @@
      * Test generated module pages for HTML 5.
      */
     @Test
-    void testHtml5() {
+    public void testHtml5() {
         javadoc("-d", "out-html5",
                 "-use",
                 "-Xdoclint:none",
@@ -99,7 +101,7 @@
      * Test generated module pages for HTML 4 with -nocomment option.
      */
     @Test
-    void testHtml4NoComment() {
+    public void testHtml4NoComment() {
         javadoc("-d", "out-nocomment",
                 "-html4",
                 "-nocomment",
@@ -122,7 +124,7 @@
      * Test generated module pages for HTML 5 with -nocomment option.
      */
     @Test
-    void testHtml5NoComment() {
+    public void testHtml5NoComment() {
         javadoc("-d", "out-html5-nocomment",
                 "-nocomment",
                 "-use",
@@ -144,7 +146,7 @@
      * Test generated pages, in an unnamed module, for HTML 4.
      */
     @Test
-    void testHtml4UnnamedModule() {
+    public void testHtml4UnnamedModule() {
         javadoc("-d", "out-nomodule",
                 "-html4",
                 "-use",
@@ -164,7 +166,7 @@
      * Test generated pages, in an unnamed module, for HTML 5.
      */
     @Test
-    void testHtml5UnnamedModule() {
+    public void testHtml5UnnamedModule() {
         javadoc("-d", "out-html5-nomodule",
                 "-use",
                 "--frames",
@@ -182,7 +184,7 @@
      * Test generated module pages with javadoc tags.
      */
     @Test
-    void testJDTagsInModules() {
+    public void testJDTagsInModules() {
         javadoc("-d", "out-mdltags",
                 "-author",
                 "-version",
@@ -200,7 +202,7 @@
      * Test generated module pages with javadoc tags.
      */
     @Test
-    void testJDTagsInModules_html4() {
+    public void testJDTagsInModules_html4() {
         javadoc("-d", "out-mdltags-html4",
                 "-html4",
                 "-author",
@@ -219,7 +221,7 @@
      * Test generated module summary page.
      */
     @Test
-    void testModuleSummary() {
+    public void testModuleSummary() {
         javadoc("-d", "out-moduleSummary",
                 "-use",
                 "-Xdoclint:none",
@@ -235,7 +237,7 @@
      * Test generated module summary page.
      */
     @Test
-    void testModuleSummary_html4() {
+    public void testModuleSummary_html4() {
         javadoc("-d", "out-moduleSummary-html4",
                 "-html4",
                 "-use",
@@ -252,7 +254,7 @@
      * Test generated module summary page of an aggregating module.
      */
     @Test
-    void testAggregatorModuleSummary() {
+    public void testAggregatorModuleSummary() {
         javadoc("-d", "out-aggregatorModuleSummary",
                 "-use",
                 "--module-source-path", testSrc,
@@ -266,7 +268,7 @@
      * Test generated module pages and pages with link to modules.
      */
     @Test
-    void testModuleFilesAndLinks() {
+    public void testModuleFilesAndLinks() {
         javadoc("-d", "out-modulelinks",
                 "-Xdoclint:none",
                 "--frames",
@@ -282,7 +284,7 @@
      * Test generated module pages for a deprecated module.
      */
     @Test
-    void testModuleDeprecation() {
+    public void testModuleDeprecation() {
         javadoc("-d", "out-moduledepr",
                 "-Xdoclint:none",
                 "-tag", "regular:a:Regular Tag:",
@@ -298,7 +300,7 @@
      * Test annotations on modules.
      */
     @Test
-    void testModuleAnnotation() {
+    public void testModuleAnnotation() {
         javadoc("-d", "out-moduleanno",
                 "-Xdoclint:none",
                 "--module-source-path", testSrc,
@@ -312,7 +314,7 @@
      * Test annotations on modules.
      */
     @Test
-    void testModuleAnnotation_html4() {
+    public void testModuleAnnotation_html4() {
         javadoc("-d", "out-moduleanno-html4",
                 "-html4",
                 "-Xdoclint:none",
@@ -327,7 +329,7 @@
      * Test module summary pages in "api" mode.
      */
     @Test
-    void testApiMode() {
+    public void testApiMode() {
         javadoc("-d", "out-api",
                 "-use",
                 "--show-module-contents=api",
@@ -352,7 +354,7 @@
      * Test module summary pages in "all" mode.
      */
     @Test
-    void testAllMode() {
+    public void testAllMode() {
         javadoc("-d", "out-all",
                 "-use",
                 "--show-module-contents=all",
@@ -377,7 +379,7 @@
      * Test module summary pages in "all" mode.
      */
     @Test
-    void testAllModeHtml4() {
+    public void testAllModeHtml4() {
         javadoc("-d", "out-all-html4",
                 "-html4",
                 "-use",
@@ -400,7 +402,7 @@
      * Test generated module summary page of a module with no exported package.
      */
     @Test
-    void testModuleSummaryNoExportedPkgAll() {
+    public void testModuleSummaryNoExportedPkgAll() {
         javadoc("-d", "out-ModuleSummaryNoExportedPkgAll",
                 "-use",
                 "--show-module-contents=all",
@@ -415,7 +417,7 @@
      * Test generated module summary page of a module with no exported package.
      */
     @Test
-    void testModuleSummaryNoExportedPkgAll_html4() {
+    public void testModuleSummaryNoExportedPkgAll_html4() {
         javadoc("-d", "out-ModuleSummaryNoExportedPkgAll-html4",
                 "-html4",
                 "-use",
@@ -431,7 +433,7 @@
      * Test generated module summary page of a module with no exported package.
      */
     @Test
-    void testModuleSummaryNoExportedPkgApi() {
+    public void testModuleSummaryNoExportedPkgApi() {
         javadoc("-d", "out-ModuleSummaryNoExportedPkgApi",
                 "-use",
                 "-sourcepath", testSrc + "/moduleNoExport",
@@ -445,7 +447,7 @@
      * Test generated module summary page of a module with no exported package.
      */
     @Test
-    void testModuleSummaryNoExportedPkgApi_html4() {
+    public void testModuleSummaryNoExportedPkgApi_html4() {
         javadoc("-d", "out-ModuleSummaryNoExportedPkgApi-html4",
                 "-html4",
                 "-use",
@@ -460,7 +462,7 @@
      * Test generated module pages for javadoc run for a single module having a single package.
      */
     @Test
-    void testSingleModuleSinglePkg() {
+    public void testSingleModuleSinglePkg() {
         javadoc("-d", "out-singlemod",
                 "--frames",
                 "--module-source-path", testSrc,
@@ -474,7 +476,7 @@
      * Test generated module pages for javadoc run for a single module having multiple packages.
      */
     @Test
-    void testSingleModuleMultiplePkg() {
+    public void testSingleModuleMultiplePkg() {
         javadoc("-d", "out-singlemodmultiplepkg",
                 "--show-module-contents=all",
                 "-Xdoclint:none",
@@ -490,7 +492,7 @@
      * Test -group option for modules. The overview-summary.html page should group the modules accordingly.
      */
     @Test
-    void testGroupOption() {
+    public void testGroupOption() {
         javadoc("-d", "out-group",
                 "--show-module-contents=all",
                 "-Xdoclint:none",
@@ -512,7 +514,7 @@
      * Test -group option for modules. The overview-summary.html page should group the modules accordingly.
      */
     @Test
-    void testGroupOption_html4() {
+    public void testGroupOption_html4() {
         javadoc("-d", "out-group-html4",
                 "-html4",
                 "--show-module-contents=all",
@@ -537,7 +539,7 @@
      * the order it was provided on the command-line.
      */
     @Test
-    void testGroupOptionOrdering() {
+    public void testGroupOptionOrdering() {
         javadoc("-d", "out-groupOrder",
                 "--show-module-contents=all",
                 "-Xdoclint:none",
@@ -560,7 +562,7 @@
      * Test -group option for unnamed modules. The overview-summary.html page should group the packages accordingly.
      */
     @Test
-    void testUnnamedModuleGroupOption() {
+    public void testUnnamedModuleGroupOption() {
         javadoc("-d", "out-groupnomodule",
                 "-use",
                 "-Xdoclint:none",
@@ -578,7 +580,7 @@
      * Test -group option for unnamed modules. The overview-summary.html page should group the packages accordingly.
      */
     @Test
-    void testUnnamedModuleGroupOption_html4() {
+    public void testUnnamedModuleGroupOption_html4() {
         javadoc("-d", "out-groupnomodule-html4",
                 "-html4",
                 "-use",
@@ -599,7 +601,7 @@
      * the order it was provided on the command-line.
      */
     @Test
-    void testGroupOptionPackageOrdering() {
+    public void testGroupOptionPackageOrdering() {
         javadoc("-d", "out-groupPkgOrder",
                 "-use",
                 "-Xdoclint:none",
@@ -617,7 +619,7 @@
      * Test -group option for a single module.
      */
     @Test
-    void testGroupOptionSingleModule() {
+    public void testGroupOptionSingleModule() {
         javadoc("-d", "out-groupsinglemodule",
                 "-use",
                 "-Xdoclint:none",
@@ -634,7 +636,7 @@
      * Test -group option for a single module.
      */
     @Test
-    void testGroupOptionSingleModule_html4() {
+    public void testGroupOptionSingleModule_html4() {
         javadoc("-d", "out-groupsinglemodule-html4",
                 "-html4",
                 "-use",
@@ -652,7 +654,7 @@
      * Test -group option for a single module.
      */
     @Test
-    void testModuleName() {
+    public void testModuleName() {
         javadoc("-d", "out-modulename",
                 "-use",
                 "-Xdoclint:none",
@@ -668,7 +670,7 @@
      * Test -linkoffline option.
      */
     @Test
-    void testLinkOffline() {
+    public void testLinkOffline() {
         String url = "https://docs.oracle.com/javase/9/docs/api/";
         javadoc("-d", "out-linkoffline",
                 "-use",
--- a/test/langtools/jdk/javadoc/doclet/testNavigation/TestModuleNavigation.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testNavigation/TestModuleNavigation.java	Wed Jan 02 10:21:54 2019 +0100
@@ -29,8 +29,8 @@
  *          jdk.compiler/com.sun.tools.javac.main
  *          jdk.javadoc/jdk.javadoc.internal.api
  *          jdk.javadoc/jdk.javadoc.internal.tool
- * @library ../lib /tools/lib
- * @build toolbox.ToolBox toolbox.ModuleBuilder JavadocTester
+ * @library ../../lib /tools/lib
+ * @build toolbox.ToolBox toolbox.ModuleBuilder javadoc.tester.*
  * @run main TestModuleNavigation
  */
 
@@ -38,7 +38,9 @@
 import java.nio.file.Path;
 import java.nio.file.Paths;
 
-import toolbox.*;
+import javadoc.tester.JavadocTester;
+import toolbox.ModuleBuilder;
+import toolbox.ToolBox;
 
 public class TestModuleNavigation extends JavadocTester {
 
--- a/test/langtools/jdk/javadoc/doclet/testNavigation/TestNavigation.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testNavigation/TestNavigation.java	Wed Jan 02 10:21:54 2019 +0100
@@ -28,9 +28,9 @@
  * @summary  Make sure the Next/Prev Class links iterate through all types.
  *           Make sure the navagation is 2 columns, not 3.
  * @author   jamieh
- * @library  /tools/lib ../lib
+ * @library  /tools/lib ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build    toolbox.ToolBox JavadocTester
+ * @build    toolbox.ToolBox javadoc.tester.*
  * @run main TestNavigation
  */
 
@@ -38,7 +38,8 @@
 import java.nio.file.Path;
 import java.nio.file.Paths;
 
-import toolbox.*;
+import javadoc.tester.JavadocTester;
+import toolbox.ToolBox;
 
 public class TestNavigation extends JavadocTester {
 
@@ -53,7 +54,7 @@
     }
 
     @Test
-    void test(Path ignore) {
+    public void test(Path ignore) {
         javadoc("-d", "out",
                 "-overview", testSrc("overview.html"),
                 "--frames",
@@ -110,7 +111,7 @@
     }
 
     @Test
-    void test_html4(Path ignore) {
+    public void test_html4(Path ignore) {
         javadoc("-d", "out-html4",
                 "-html4",
                 "-overview", testSrc("overview.html"),
@@ -151,7 +152,7 @@
 
     // Test for checking additional padding to offset the fixed navigation bar in HTML5.
     @Test
-    void test1(Path ignore) {
+    public void test1(Path ignore) {
         javadoc("-d", "out-1",
                 "-html5",
                 "--frames",
@@ -185,7 +186,7 @@
 
     // Test to make sure that no extra padding for nav bar gets generated if -nonavbar is specified for HTML4.
     @Test
-    void test2(Path ignore) {
+    public void test2(Path ignore) {
         javadoc("-d", "out-2",
                 "-nonavbar",
                 "--frames",
@@ -217,7 +218,7 @@
 
     // Test to make sure that no extra padding for nav bar gets generated if -nonavbar is specified for HTML5.
     @Test
-    void test3(Path ignore) {
+    public void test3(Path ignore) {
         javadoc("-d", "out-3",
                 "-html5",
                 "-nonavbar",
@@ -251,7 +252,7 @@
     }
 
     @Test
-    void test4(Path base) throws IOException {
+    public void test4(Path base) throws IOException {
         Path src = base.resolve("src");
         tb.writeJavaFiles(src,
                 "package pkg1; public class A {\n"
--- a/test/langtools/jdk/javadoc/doclet/testNestedGenerics/TestNestedGenerics.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testNestedGenerics/TestNestedGenerics.java	Wed Jan 02 10:21:54 2019 +0100
@@ -26,12 +26,14 @@
  * @bug      6758050 8025633 8182765
  * @summary  Test HTML output for nested generic types.
  * @author   bpatel
- * @library  ../lib
+ * @library  ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build    JavadocTester
+ * @build    javadoc.tester.*
  * @run main TestNestedGenerics
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestNestedGenerics extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -40,7 +42,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         javadoc("-d", "out",
                 "-sourcepath", testSrc,
                 "pkg");
@@ -53,7 +55,7 @@
     }
 
     @Test
-    void test_html4() {
+    public void test_html4() {
         javadoc("-d", "out-html4",
                 "-html4",
                 "-sourcepath", testSrc,
--- a/test/langtools/jdk/javadoc/doclet/testNewLanguageFeatures/TestNewLanguageFeatures.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testNewLanguageFeatures/TestNewLanguageFeatures.java	Wed Jan 02 10:21:54 2019 +0100
@@ -29,12 +29,14 @@
  *           language features.  Check the output to ensure that the new
  *           language features are properly documented.
  * @author   jamieh
- * @library  ../lib
+ * @library  ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build    JavadocTester
+ * @build    javadoc.tester.*
  * @run main TestNewLanguageFeatures
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestNewLanguageFeatures extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -43,7 +45,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         javadoc("-Xdoclint:none",
                 "-d", "out",
                 "-use",
@@ -59,7 +61,7 @@
     }
 
     @Test
-    void test_html4() {
+    public void test_html4() {
         javadoc("-Xdoclint:none",
                 "-d", "out-html4",
                 "-html4",
--- a/test/langtools/jdk/javadoc/doclet/testNoPackagesFile/TestNoPackagesFile.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testNoPackagesFile/TestNoPackagesFile.java	Wed Jan 02 10:21:54 2019 +0100
@@ -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
@@ -27,12 +27,14 @@
  * @summary  Verify that packages.html is no longer generated since it is no
  *           longer used.
  * @author   jamieh
- * @library  ../lib
+ * @library  ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build    JavadocTester
+ * @build    javadoc.tester.*
  * @run main TestNoPackagesFile
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestNoPackagesFile extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -41,7 +43,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         javadoc("-d", "out",
                 "-sourcepath", testSrc,
                 testSrc("C.java"));
--- a/test/langtools/jdk/javadoc/doclet/testNonInlineHtmlTagRemoval/TestNonInlineHtmlTagRemoval.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testNonInlineHtmlTagRemoval/TestNonInlineHtmlTagRemoval.java	Wed Jan 02 10:21:54 2019 +0100
@@ -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
@@ -25,12 +25,14 @@
  * @test
  * @bug      8048628 8174715 8182765
  * @summary  Verify html inline tags are removed correctly in the first sentence.
- * @library  ../lib
+ * @library  ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build    JavadocTester
+ * @build    javadoc.tester.*
  * @run main TestNonInlineHtmlTagRemoval
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestNonInlineHtmlTagRemoval extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -39,7 +41,7 @@
     }
 
     @Test
-    void testPositive() {
+    public void testPositive() {
         javadoc("-d", "out1",
                 "-sourcepath", testSrc,
                 testSrc("C.java"));
@@ -64,7 +66,7 @@
     }
 
     @Test
-    void testPositive_html4() {
+    public void testPositive_html4() {
         javadoc("-d", "out1-html4",
                 "-html4",
                 "-sourcepath", testSrc,
@@ -73,7 +75,7 @@
     }
 
     @Test
-    void testNegative() {
+    public void testNegative() {
         javadoc("-d", "out2",
                 "-sourcepath", testSrc,
                 testSrc("Negative.java"));
--- a/test/langtools/jdk/javadoc/doclet/testNotifications/TestNotifications.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testNotifications/TestNotifications.java	Wed Jan 02 10:21:54 2019 +0100
@@ -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
@@ -28,12 +28,14 @@
  *           be created.
  *           Make sure classname is not include in javadoc usage message.
  * @author   jamieh
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build    JavadocTester
+ * @build    javadoc.tester.*
  * @run main TestNotifications
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestNotifications extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -42,7 +44,7 @@
     }
 
     @Test
-    void test1() {
+    public void test1() {
         String outDir = "out";
 
         // Notify that the destination directory must be created.
@@ -61,7 +63,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         //Make sure classname is not include in javadoc usage message.
         setOutputDirectoryCheck(DirectoryCheck.NO_HTML_FILES);
         javadoc("-help");
--- a/test/langtools/jdk/javadoc/doclet/testOptions/TestOptions.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testOptions/TestOptions.java	Wed Jan 02 10:21:54 2019 +0100
@@ -27,14 +27,16 @@
  * @summary  Test the output for -header, -footer, -nooverview, -nodeprecatedlist, -nonavbar, -notree,
  *           -stylesheetfile, --main-stylesheet, --add-stylesheet options.
  * @author   Bhavesh Patel
- * @library  ../lib
+ * @library  ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build    JavadocTester
+ * @build    javadoc.tester.*
  * @run main TestOptions
  */
 
 import java.io.File;
 
+import javadoc.tester.JavadocTester;
+
 public class TestOptions extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -43,7 +45,7 @@
     }
 
     @Test
-    void testHeaderFooter() {
+    public void testHeaderFooter() {
         javadoc("-d", "out-1",
                 "-header", "Test header",
                 "-footer", "Test footer",
@@ -57,7 +59,7 @@
     }
 
     @Test
-    void testNoOverview() {
+    public void testNoOverview() {
         javadoc("-d", "out-4",
                 "-nooverview",
                 "-sourcepath", testSrc,
@@ -69,7 +71,7 @@
     }
 
     @Test
-    void testNoDeprecatedList() {
+    public void testNoDeprecatedList() {
         javadoc("-d", "out-5",
                 "-nodeprecatedlist",
                 "-sourcepath", testSrc,
@@ -80,7 +82,7 @@
     }
 
     @Test
-    void testNoNavbar() {
+    public void testNoNavbar() {
         javadoc("-d", "out-6",
                 "-nonavbar",
                 "-bottom", "Bottom text",
@@ -93,7 +95,7 @@
     }
 
     @Test
-    void testNoTree() {
+    public void testNoTree() {
         javadoc("-d", "out-7",
                 "-notree",
                 "-sourcepath", testSrc,
@@ -106,7 +108,7 @@
     }
 
     @Test
-    void testStylesheetFile() {
+    public void testStylesheetFile() {
         javadoc("-d", "out-8",
                 "-stylesheetfile", new File(testSrc, "custom-stylesheet.css").getAbsolutePath(),
                 "-sourcepath", testSrc,
@@ -119,7 +121,7 @@
     }
 
     @Test
-    void testStylesheetFileAltOption() {
+    public void testStylesheetFileAltOption() {
         javadoc("-d", "out-stylesheet-file",
                 "--main-stylesheet", new File(testSrc, "custom-stylesheet.css").getAbsolutePath(),
                 "-sourcepath", testSrc,
@@ -132,7 +134,7 @@
     }
 
     @Test
-    void testAdditionalStylesheetFile() {
+    public void testAdditionalStylesheetFile() {
         javadoc("-d", "out-additional-css",
                 "--add-stylesheet", new File(testSrc, "additional-stylesheet-1.css").getAbsolutePath(),
                 "--add-stylesheet", new File(testSrc, "additional-stylesheet-2.css").getAbsolutePath(),
@@ -151,7 +153,7 @@
     }
 
     @Test
-    void testInvalidStylesheetFile() {
+    public void testInvalidStylesheetFile() {
         javadoc("-d", "out-invalid-css",
                 "--main-stylesheet", new File(testSrc, "custom-stylesheet-1.css").getAbsolutePath(),
                 "-sourcepath", testSrc,
@@ -164,7 +166,7 @@
     }
 
     @Test
-    void testInvalidAdditionalStylesheetFiles() {
+    public void testInvalidAdditionalStylesheetFiles() {
         javadoc("-d", "out-invalid-additional-css",
                 "--add-stylesheet", new File(testSrc, "additional-stylesheet-4.css").getAbsolutePath(),
                 "-sourcepath", testSrc,
@@ -177,7 +179,7 @@
     }
 
     @Test
-    void testLinkSource() {
+    public void testLinkSource() {
         javadoc("-d", "out-9",
                 "-linksource",
                 "-javafx",
@@ -250,7 +252,7 @@
     }
 
     @Test
-    void testLinkSource_html4() {
+    public void testLinkSource_html4() {
         javadoc("-d", "out-9-html4",
                 "-html4",
                 "-linksource",
@@ -285,7 +287,7 @@
     }
 
     @Test
-    void testNoQualifier() {
+    public void testNoQualifier() {
         javadoc("-d", "out-10",
                 "-noqualifier", "pkg",
                 "-sourcepath", testSrc,
--- a/test/langtools/jdk/javadoc/doclet/testOrdering/TestOrdering.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testOrdering/TestOrdering.java	Wed Jan 02 10:21:54 2019 +0100
@@ -25,9 +25,9 @@
  * @test
  * @bug 8039410 8042601 8042829 8049393 8050031 8155061 8155995 8167967 8169813 8182765 8196202
  * @summary test to determine if members are ordered correctly
- * @library ../lib/
+ * @library ../../lib/
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
  * @run main TestOrdering
  */
 
@@ -41,6 +41,8 @@
 
 import static java.nio.file.StandardOpenOption.*;
 
+import javadoc.tester.JavadocTester;
+
 public class TestOrdering extends JavadocTester {
 
     public static void main(String[] args) throws Exception {
@@ -49,94 +51,84 @@
     }
 
     @Test
-    void testUnnamedPackagesForClassUse() {
-        new UnnamedPackageForClassUseTest(this).run();
+    public void testUnnamedPackagesForClassUse() {
+        new UnnamedPackageForClassUseTest().run();
     }
 
     @Test
-    void testNamedPackagesForClassUse() {
-        new NamedPackagesForClassUseTest(this).run();
+    public void testNamedPackagesForClassUse() {
+        new NamedPackagesForClassUseTest().run();
     }
 
     @Test
-    void testIndexOrdering() throws IOException {
-        new IndexOrderingTest(this).run();
+    public void testIndexOrdering() throws IOException {
+        new IndexOrderingTest().run();
     }
 
     @Test
-    void testIndexTypeClustering() {
-        new IndexTypeClusteringTest(this).run();
+    public void testIndexTypeClustering() {
+        new IndexTypeClusteringTest().run();
     }
 
     @Test
-    void testTypeElementMemberOrdering() {
-        new TypeElementMemberOrderingTest(this).run();
+    public void testTypeElementMemberOrdering() {
+        new TypeElementMemberOrderingTest().run();
     }
 
-    static class UnnamedPackageForClassUseTest {
-        final JavadocTester tester;
-
-        UnnamedPackageForClassUseTest(JavadocTester tester) {
-            this.tester = tester;
-        }
+    class UnnamedPackageForClassUseTest {
 
         void run() {
-            tester.javadoc("-d", "out",
+            javadoc("-d", "out",
                     "-sourcepath", testSrc,
                     "-use",
-                    tester.testSrc("C.java"), tester.testSrc("UsedInC.java"));
-            tester.checkExit(Exit.OK);
+                    testSrc("C.java"), testSrc("UsedInC.java"));
+            checkExit(Exit.OK);
             checkExecutableMemberOrdering("class-use/UsedInC.html");
         }
 
         void checkExecutableMemberOrdering(String usePage) {
-            String contents = tester.readFile(usePage);
+            String contents = readFile(usePage);
             // check constructors
-            tester.checking("constructors");
+            checking("constructors");
             int idx1 = contents.indexOf("C.html#%3Cinit%3E(UsedInC");
             int idx2 = contents.indexOf("C.html#%3Cinit%3E(UsedInC,int");
             int idx3 = contents.indexOf("C.html#%3Cinit%3E(UsedInC,java.lang.String");
             if (idx1 == -1 || idx2 == -1 || idx3 == -1) {
-                tester.failed("ctor strings not found");
+                failed("ctor strings not found");
             } else if (idx1 > idx2 || idx2 > idx3 || idx1 > idx3) {
-                tester.failed("ctor strings are out of order");
+                failed("ctor strings are out of order");
             } else {
-                tester.passed("ctor strings are in order");
+                passed("ctor strings are in order");
             }
 
             // check methods
-            tester.checking("methods");
+            checking("methods");
             idx1 = contents.indexOf("C.html#ymethod(int");
             idx2 = contents.indexOf("C.html#ymethod(java.lang.String");
             if (idx1 == -1 || idx2 == -1) {
-                tester.failed("#ymethod strings not found");
+                failed("#ymethod strings not found");
             } else if (idx1 > idx2) {
-                tester.failed("#ymethod strings are out of order");
+                failed("#ymethod strings are out of order");
             } else {
-                tester.passed("Executable Member Ordering: OK");
+                passed("Executable Member Ordering: OK");
             }
         }
     }
 
-    static class NamedPackagesForClassUseTest {
-        final JavadocTester tester;
-
-        NamedPackagesForClassUseTest(JavadocTester tester) {
-            this.tester = tester;
-        }
+    class NamedPackagesForClassUseTest {
 
         public void run() {
-            tester.javadoc("-d", "out-1",
-                    "-sourcepath", tester.testSrc,
+            javadoc("-d", "out-1",
+                    "-sourcepath", testSrc,
                     "-use",
                     "--frames",
                     "pkg1");
-            tester.checkExit(Exit.OK);
-            tester.checkFiles(false, "allclasses-noframe.html");
+            checkExit(Exit.OK);
+            checkFiles(false, "allclasses-noframe.html");
 
             checkClassUseOrdering("pkg1/class-use/UsedClass.html");
 
-            tester.checkOrder("pkg1/class-use/UsedClass.html",
+            checkOrder("pkg1/class-use/UsedClass.html",
                     "../MethodOrder.html#m()",
                     "../MethodOrder.html#m(byte%5B%5D)",
                     "../MethodOrder.html#m(double)",
@@ -160,13 +152,13 @@
                     "../MethodOrder.html#m(java.util.Collection)",
                     "../MethodOrder.html#m(java.util.List)");
 
-            tester.checkOrder("pkg1/class-use/UsedClass.html",
+            checkOrder("pkg1/class-use/UsedClass.html",
                     "../MethodOrder.html#tpm(pkg1.UsedClass)",
                     "../MethodOrder.html#tpm(pkg1.UsedClass,pkg1.UsedClass)",
                     "../MethodOrder.html#tpm(pkg1.UsedClass,pkg1.UsedClass%5B%5D)",
                     "../MethodOrder.html#tpm(pkg1.UsedClass,java.lang.String)");
 
-            tester.checkOrder("pkg1/class-use/UsedClass.html",
+            checkOrder("pkg1/class-use/UsedClass.html",
                     "../A.html#%3Cinit%3E(pkg1.UsedClass)",
                     "../B.A.html#%3Cinit%3E(pkg1.UsedClass)",
                     "../B.html#%3Cinit%3E(pkg1.UsedClass)",
@@ -174,16 +166,16 @@
                     "../A.C.html#%3Cinit%3E(pkg1.UsedClass,java.util.Collection)",
                     "../A.C.html#%3Cinit%3E(pkg1.UsedClass,java.util.List)");
 
-            tester.checkOrder("pkg1/ImplementsOrdering.html",
+            checkOrder("pkg1/ImplementsOrdering.html",
                     "<dd><code>close</code>&nbsp;in interface&nbsp;<code>java.lang.AutoCloseable</code></dd>",
                     "<dd><code>close</code>&nbsp;in interface&nbsp;<code>java.nio.channels.Channel</code></dd>",
                     "<dd><code>close</code>&nbsp;in interface&nbsp;<code>java.io.Closeable</code></dd>");
 
-            tester.checkOrder("pkg1/OverrideOrdering.html",
+            checkOrder("pkg1/OverrideOrdering.html",
                     "<dd><code>iterator</code>&nbsp;in interface&nbsp;<code>java.util.Collection&lt;",
                     "<dd><code>iterator</code>&nbsp;in interface&nbsp;<code>java.lang.Iterable&lt;");
 
-            tester.checkOrder("allclasses-frame.html",
+            checkOrder("allclasses-frame.html",
                     "pkg1/A.html\" title=\"class in pkg1",
                     "pkg1/A.C.html\" title=\"class in pkg1",
                     "pkg1/B.html\" title=\"class in pkg1",
@@ -206,40 +198,36 @@
         }
 
         void checkClassUseOrdering(String usePage, String searchString) {
-            String contents = tester.readFile(usePage);
+            String contents = readFile(usePage);
             int lastidx = 0;
             System.out.println("testing for " + searchString);
             for (int i = 1; i < 5; i++) {
                 String s = searchString.replaceAll("#ITERATION#", Integer.toString(i));
-                tester.checking(s);
+                checking(s);
                 int idx = contents.indexOf(s);
                 if (idx < lastidx) {
-                    tester.failed(s + ", member ordering error, last:" + lastidx + ", got:" + idx);
+                    failed(s + ", member ordering error, last:" + lastidx + ", got:" + idx);
                 } else {
-                    tester.passed("\tlast: " + lastidx + " got:" + idx);
+                    passed("\tlast: " + lastidx + " got:" + idx);
                 }
                 lastidx = idx;
             }
         }
     }
 
-    static class IndexOrderingTest {
-        private final JavadocTester tester;
+    enum ListOrder {
+        NONE, REVERSE, SHUFFLE
+    };
 
-        IndexOrderingTest(JavadocTester tester) {
-            this.tester = tester;
-        }
+    class IndexOrderingTest {
 
-        enum ListOrder {
-            NONE, REVERSE, SHUFFLE
-        };
 
         /*
          * By default we do not shuffle the input list, in order to keep the list deterministic,
          * and the test predictable. However, we can turn on the stress mode, by setting the following
          * property if required.
          */
-        static final ListOrder STRESS_MODE = Boolean.getBoolean("TestOrder.STRESS")
+        final ListOrder STRESS_MODE = Boolean.getBoolean("TestOrder.STRESS")
                 ? ListOrder.SHUFFLE
                 : ListOrder.REVERSE;
 
@@ -255,7 +243,7 @@
          */
         static final int MAX_PACKAGES = 4;
 
-        static String[] contents = {
+        String[] contents = {
             "public add ADDADD;",
             "public add AddAdd;",
             "public add addadd;",
@@ -274,12 +262,12 @@
             "public int    add(Integer i) {return 0;}"
         };
 
-        static String expectedEnumOrdering[] = {
+        String expectedEnumOrdering[] = {
             "Add.add.html\" title=\"enum in REPLACE_ME\"",
             "Add.ADD.html\" title=\"enum in REPLACE_ME\""
         };
 
-        static String expectedFieldOrdering[] = {
+        String expectedFieldOrdering[] = {
             "Add.html#addadd\"",
             "add0/add/add/add/Add.html#addadd\"",
             "add0/add/add/Add.html#addadd\"",
@@ -333,7 +321,7 @@
             "add3/Add.html#ADDADD\""
         };
 
-        static String expectedMethodOrdering[] = {
+        String expectedMethodOrdering[] = {
             "Add.html#add()",
             "Add.html#add(double)",
             "Add.html#add(double,byte)",
@@ -347,7 +335,7 @@
             "Add.html#add(java.lang.Integer)"
         };
 
-        static String expectedPackageOrdering[] = {
+        String expectedPackageOrdering[] = {
             "\"add0/package-summary.html\">add0</a> - package add0",
             "\"add0/add/package-summary.html\">add0.add</a> - package add0.add",
             "\"add0/add/add/package-summary.html\">add0.add.add</a> - package add0.add.add",
@@ -390,13 +378,13 @@
             }
             File srcDir = new File(new File("."), "src");
             cmdArgs.add(new File(srcDir, clsname + ".java").getPath());
-            tester.javadoc(cmdArgs.toArray(new String[cmdArgs.size()]));
-            tester.checkExit(Exit.OK);
-            tester.checkOrder("index-all.html", composeTestVectors());
-            tester.checkOrder("add0/add/package-tree.html",
+            javadoc(cmdArgs.toArray(new String[cmdArgs.size()]));
+            checkExit(Exit.OK);
+            checkOrder("index-all.html", composeTestVectors());
+            checkOrder("add0/add/package-tree.html",
                     "<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",
+            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\">",
                     "<a href=\"add0/add/Add.add.html\" title=\"enum in add0.add\">",
@@ -432,7 +420,7 @@
                     "<a href=\"add3/add/add/Add.ADD.html\" title=\"enum in add3.add.add\">",
                     "<a href=\"add3/add/add/add/Add.ADD.html\" title=\"enum in add3.add.add.add\">");
 
-            tester.checkOrder("overview-frame.html",
+            checkOrder("overview-frame.html",
                     "<a href=\"package-frame.html\" target=\"packageFrame\">&lt;unnamed package&gt;</a>",
                     "<a href=\"add0/package-frame.html\" target=\"packageFrame\">add0</a>",
                     "<a href=\"add0/add/package-frame.html\" target=\"packageFrame\">add0.add</a>",
@@ -523,26 +511,20 @@
         }
     }
 
-    static class IndexTypeClusteringTest {
-
-        private final JavadocTester tester;
-
-        IndexTypeClusteringTest(JavadocTester tester) {
-            this.tester = tester;
-        }
+    class IndexTypeClusteringTest {
 
         void run() {
-            tester.javadoc("-d", "out-3",
-                    "-sourcepath", tester.testSrc("src-2"),
+            javadoc("-d", "out-3",
+                    "-sourcepath", testSrc("src-2"),
                     "-use",
                     "a",
                     "b",
                     "e",
                     "something");
 
-            tester.checkExit(Exit.OK);
+            checkExit(Exit.OK);
 
-            tester.checkOrder("index-all.html",
+            checkOrder("index-all.html",
                     "something</a> - package something</dt>",
                     "something</span></a> - Class in",
                     "something</span></a> - Enum in",
@@ -556,32 +538,26 @@
         }
     }
 
-    static class TypeElementMemberOrderingTest {
-
-        final JavadocTester tester;
-
-        TypeElementMemberOrderingTest(JavadocTester tester) {
-            this.tester = tester;
-        }
+    class TypeElementMemberOrderingTest {
 
         void run() {
-            tester.javadoc("-d", "out-5",
+            javadoc("-d", "out-5",
                     "-javafx",
                     "--disable-javafx-strict-checks",
-                    "-sourcepath", tester.testSrc(new File(".").getPath()),
+                    "-sourcepath", testSrc(new File(".").getPath()),
                     "pkg5"
             );
 
-            tester.checkExit(Exit.OK);
+            checkExit(Exit.OK);
 
-            tester.checkOrder("pkg5/AnnoFieldTest.html",
+            checkOrder("pkg5/AnnoFieldTest.html",
                     "<h3>Field Detail</h3>",
                     "<pre>static final&nbsp;int&nbsp;one</pre>",
                     "<pre>static final&nbsp;int&nbsp;two</pre>",
                     "<pre>static final&nbsp;int&nbsp;three</pre>",
                     "<pre>static final&nbsp;int&nbsp;four</pre>");
 
-            tester.checkOrder("pkg5/AnnoOptionalTest.html",
+            checkOrder("pkg5/AnnoOptionalTest.html",
                     "<h3>Optional Element Summary</h3>",
                     "<a href=\"#four()\">four</a>",
                     "<a href=\"#one()\">one</a>",
@@ -593,7 +569,7 @@
                     "<h4>three</h4>",
                     "<h4>four</h4>");
 
-            tester.checkOrder("pkg5/AnnoRequiredTest.html",
+            checkOrder("pkg5/AnnoRequiredTest.html",
                     "<h3>Required Element Summary</h3>",
                     "<a href=\"#four()\">four</a>",
                     "<a href=\"#one()\">one</a>",
@@ -605,7 +581,7 @@
                     "<h4>three</h4>",
                     "<h4>four</h4>");
 
-            tester.checkOrder("pkg5/CtorTest.html",
+            checkOrder("pkg5/CtorTest.html",
                     "<h3>Constructor Summary</h3>",
                     "<a href=\"#%3Cinit%3E(int)\"",
                     "<a href=\"#%3Cinit%3E(int,int)\"",
@@ -617,7 +593,7 @@
                     "<a id=\"&lt;init&gt;(int,int)\">",
                     "<a id=\"&lt;init&gt;(int)\">");
 
-            tester.checkOrder("pkg5/EnumTest.html",
+            checkOrder("pkg5/EnumTest.html",
                     "<h3>Enum Constant Summary</h3>",
                     "<a href=\"#FOUR\">FOUR</a>",
                     "<a href=\"#ONE\">ONE</a>",
@@ -629,7 +605,7 @@
                     "<h4>THREE</h4>",
                     "<h4>FOUR</h4>");
 
-            tester.checkOrder("pkg5/FieldTest.html",
+            checkOrder("pkg5/FieldTest.html",
                     "<h3>Field Summary</h3>",
                     "<a href=\"#four\">four</a>",
                     "<a href=\"#one\">one</a>",
@@ -641,7 +617,7 @@
                     "<h4>three</h4>",
                     "<h4>four</h4>");
 
-            tester.checkOrder("pkg5/IntfTest.html",
+            checkOrder("pkg5/IntfTest.html",
                     "<h3>Method Summary</h3>",
                     "<a href=\"#four()\">four</a>",
                     "<a href=\"#one()\">one</a>",
@@ -653,7 +629,7 @@
                     "<h4>three</h4>",
                     "<h4>four</h4>");
 
-            tester.checkOrder("pkg5/MethodTest.html",
+            checkOrder("pkg5/MethodTest.html",
                     "<h3>Method Summary</h3>",
                     "<a href=\"#four()\">four</a>",
                     "<a href=\"#one()\">one</a>",
@@ -665,7 +641,7 @@
                     "<h4>three</h4>",
                     "<h4>four</h4>");
 
-            tester.checkOrder("pkg5/PropertyTest.html",
+            checkOrder("pkg5/PropertyTest.html",
                     "<h3>Property Summary</h3>",
                     "<a href=\"#fourProperty\">four</a>",
                     "<a href=\"#oneProperty\">one</a>",
@@ -677,16 +653,16 @@
                     "<h4>threeProperty</h4>",
                     "<h4>fourProperty</h4>");
 
-            tester.javadoc("-d", "out-5-html4",
+            javadoc("-d", "out-5-html4",
                     "-html4",
                     "-javafx",
-                    "-sourcepath", tester.testSrc(new File(".").getPath()),
+                    "-sourcepath", testSrc(new File(".").getPath()),
                     "pkg5"
             );
 
-            tester.checkExit(Exit.OK);
+            checkExit(Exit.OK);
 
-            tester.checkOrder("pkg5/CtorTest.html",
+            checkOrder("pkg5/CtorTest.html",
                     "<a href=\"#CtorTest-int-\"",
                     "<a href=\"#CtorTest-int-int-\"",
                     "<a href=\"#CtorTest-int-int-int-\"",
--- a/test/langtools/jdk/javadoc/doclet/testOverriddenMethods/TestBadOverride.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testOverriddenMethods/TestBadOverride.java	Wed Jan 02 10:21:54 2019 +0100
@@ -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
@@ -25,12 +25,14 @@
  * @test
  * @bug      8174839 8175200 8186332
  * @summary  Bad overriding method should not crash
- * @library  ../lib
+ * @library  ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build    JavadocTester
+ * @build    javadoc.tester.*
  * @run main TestBadOverride
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestBadOverride extends JavadocTester {
 
     /**
@@ -43,7 +45,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         javadoc("-d", "out",
                 "-sourcepath", testSrc,
                 "pkg4");
--- a/test/langtools/jdk/javadoc/doclet/testOverriddenMethods/TestMultiInheritance.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testOverriddenMethods/TestMultiInheritance.java	Wed Jan 02 10:21:54 2019 +0100
@@ -27,12 +27,14 @@
  * @summary  Make sure that all inherited methods from multiple extended
  *           interfaces are documented
  * @author   jamieh
- * @library  ../lib
+ * @library  ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build    JavadocTester
+ * @build    javadoc.tester.*
  * @run main TestMultiInheritance
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestMultiInheritance extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -41,7 +43,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         javadoc("-d", "out",
                 "-sourcepath", testSrc,
                 "pkg3");
--- a/test/langtools/jdk/javadoc/doclet/testOverriddenMethods/TestOverriddenDeprecatedMethods.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testOverriddenMethods/TestOverriddenDeprecatedMethods.java	Wed Jan 02 10:21:54 2019 +0100
@@ -25,12 +25,14 @@
  * @test
  * @bug 8211901
  * @summary  javadoc generates broken links on deprecated items page
- * @library  ../lib
+ * @library  ../../lib
  * @modules  jdk.javadoc/jdk.javadoc.internal.tool
- * @build    JavadocTester
+ * @build    javadoc.tester.*
  * @run main TestOverriddenDeprecatedMethods
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestOverriddenDeprecatedMethods extends JavadocTester {
 
     public static void main(String args[]) throws Exception {
@@ -39,7 +41,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         javadoc("-d", "out-deprecated",
                 "-sourcepath", testSrc,
                 "--override-methods","summary",
--- a/test/langtools/jdk/javadoc/doclet/testOverriddenMethods/TestOverriddenMethodDocCopy.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testOverriddenMethods/TestOverriddenMethodDocCopy.java	Wed Jan 02 10:21:54 2019 +0100
@@ -27,12 +27,14 @@
  * @summary  Inherited comment should link directly to member, not just
  *           class
  * @author   jamieh
- * @library  ../lib
+ * @library  ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build    JavadocTester
+ * @build    javadoc.tester.*
  * @run main TestOverriddenMethodDocCopy
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestOverriddenMethodDocCopy extends JavadocTester {
 
     /**
@@ -45,7 +47,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         javadoc("-d", "out",
                 "-sourcepath", testSrc,
                 "pkg1", "pkg2");
@@ -58,7 +60,7 @@
     }
 
     @Test
-    void test_html4() {
+    public void test_html4() {
         javadoc("-d", "out-html4",
                 "-html4",
                 "-sourcepath", testSrc,
--- a/test/langtools/jdk/javadoc/doclet/testOverriddenMethods/TestOverriddenPrivateMethods.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testOverriddenMethods/TestOverriddenPrivateMethods.java	Wed Jan 02 10:21:54 2019 +0100
@@ -27,12 +27,14 @@
  * @summary Determine if overridden methods are properly documented when
  * -protected (default) visibility flag is used.
  * @author jamieh
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
  * @run main TestOverriddenPrivateMethods
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestOverriddenPrivateMethods extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -41,7 +43,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         javadoc("-d", "out",
                 "-sourcepath", testSrc,
                 "pkg1", "pkg2");
--- a/test/langtools/jdk/javadoc/doclet/testOverriddenMethods/TestOverriddenPrivateMethodsWithPackageFlag.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testOverriddenMethods/TestOverriddenPrivateMethodsWithPackageFlag.java	Wed Jan 02 10:21:54 2019 +0100
@@ -27,12 +27,14 @@
  * @summary Determine if overridden methods are properly documented when
  * -protected (default) visibility flag is used.
  * @author jamieh
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
  * @run main TestOverriddenPrivateMethodsWithPackageFlag
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestOverriddenPrivateMethodsWithPackageFlag extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -41,7 +43,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         javadoc("-d", "out",
                 "-sourcepath", testSrc,
                 "-package",
@@ -88,7 +90,7 @@
     }
 
     @Test
-    void test_html4() {
+    public void test_html4() {
         javadoc("-d", "out-html4",
                 "-html4",
                 "-sourcepath", testSrc,
--- a/test/langtools/jdk/javadoc/doclet/testOverriddenMethods/TestOverriddenPrivateMethodsWithPrivateFlag.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testOverriddenMethods/TestOverriddenPrivateMethodsWithPrivateFlag.java	Wed Jan 02 10:21:54 2019 +0100
@@ -27,12 +27,14 @@
  * @summary Determine if overridden methods are properly documented when
  * -protected (default) visibility flag is used.
  * @author jamieh
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
  * @run main TestOverriddenPrivateMethodsWithPrivateFlag
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestOverriddenPrivateMethodsWithPrivateFlag extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -41,7 +43,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         javadoc("-d", "out",
                 "-sourcepath", testSrc,
                 "-private",
--- a/test/langtools/jdk/javadoc/doclet/testOverriddenMethods/TestOverrideMethods.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testOverriddenMethods/TestOverrideMethods.java	Wed Jan 02 10:21:54 2019 +0100
@@ -25,12 +25,14 @@
  * @test
  * @bug 8157000 8192850 8182765
  * @summary  test the behavior of --override-methods option
- * @library  ../lib
+ * @library  ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build    JavadocTester
+ * @build    javadoc.tester.*
  * @run main TestOverrideMethods
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestOverrideMethods  extends JavadocTester {
     public static void main(String... args) throws Exception {
         TestOverrideMethods tester = new TestOverrideMethods();
@@ -38,7 +40,7 @@
     }
 
     @Test
-    void testInvalidOption() {
+    public void testInvalidOption() {
         // Make sure an invalid argument fails
         javadoc("-d", "out-bad-option",
                 "-sourcepath", testSrc,
@@ -51,7 +53,7 @@
     }
 
     @Test
-    void testDetail() {
+    public void testDetail() {
         // Make sure the option works
         javadoc("-d", "out-detail",
                 "-sourcepath", testSrc,
@@ -64,7 +66,7 @@
     }
 
     @Test
-    void testSummary() {
+    public void testSummary() {
         javadoc("-d", "out-summary",
                 "-sourcepath", testSrc,
                 "-javafx",
@@ -257,7 +259,7 @@
     }
 
     @Test
-    void testSummary_html4() {
+    public void testSummary_html4() {
         javadoc("-d", "out-summary-html4",
                 "-html4",
                 "-sourcepath", testSrc,
--- a/test/langtools/jdk/javadoc/doclet/testOverview/TestOverview.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testOverview/TestOverview.java	Wed Jan 02 10:21:54 2019 +0100
@@ -26,12 +26,14 @@
  * @bug 8173302 8182765 8196202 8210047
  * @summary make sure the overview-summary and module-summary pages don't
  *          don't have the See link, and the overview is copied correctly.
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
  * @run main TestOverview
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestOverview extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -40,7 +42,7 @@
     }
 
     @Test
-    void test1() {
+    public void test1() {
         javadoc("-d", "out-1",
                     "-doctitle", "Document Title",
                     "-windowtitle", "Window Title",
@@ -53,7 +55,7 @@
     }
 
     @Test
-    void test1_html4() {
+    public void test1_html4() {
         javadoc("-d", "out-1-html4",
                 "-html4",
                 "-doctitle", "Document Title",
@@ -67,7 +69,7 @@
     }
 
     @Test
-    void test2() {
+    public void test2() {
         javadoc("-d", "out-2",
                     "-doctitle", "Document Title",
                     "-windowtitle", "Window Title",
@@ -80,7 +82,7 @@
     }
 
     @Test
-    void test2_html4() {
+    public void test2_html4() {
         javadoc("-d", "out-2-html4",
                 "-html4",
                 "-doctitle", "Document Title",
--- a/test/langtools/jdk/javadoc/doclet/testPackageDeprecation/TestPackageDeprecation.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testPackageDeprecation/TestPackageDeprecation.java	Wed Jan 02 10:21:54 2019 +0100
@@ -26,12 +26,14 @@
  * @bug      6492694 8026567 8048351 8162363 8183511 8169819 8074407 8196202
  * @summary  Test package deprecation.
  * @author   bpatel
- * @library  ../lib/
+ * @library  ../../lib/
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build    JavadocTester TestPackageDeprecation
+ * @build    javadoc.tester.* TestPackageDeprecation
  * @run main TestPackageDeprecation
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestPackageDeprecation extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -41,7 +43,7 @@
     }
 
     @Test
-    void testDefault() {
+    public void testDefault() {
         javadoc("-d", "out-default",
                 "-sourcepath", testSrc,
                 "-use",
@@ -60,7 +62,7 @@
     }
 
     @Test
-    void testNoDeprecated() {
+    public void testNoDeprecated() {
         javadoc("-d", "out-nodepr",
                 "-sourcepath", testSrc,
                 "-use",
--- a/test/langtools/jdk/javadoc/doclet/testPackageDescription/TestPackageDescription.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testPackageDescription/TestPackageDescription.java	Wed Jan 02 10:21:54 2019 +0100
@@ -25,12 +25,14 @@
  * @test
  * @bug      8185194 8182765
  * @summary  Test anchor for package description in package summary page
-  * @library  ../lib/
+  * @library  ../../lib/
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build    JavadocTester TestPackageDescription
+ * @build    javadoc.tester.* TestPackageDescription
  * @run main TestPackageDescription
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestPackageDescription extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -39,7 +41,7 @@
     }
 
     @Test
-    void test1() {
+    public void test1() {
         javadoc("-d", "out",
                 "-sourcepath", testSrc,
                 "pkg");
@@ -53,7 +55,7 @@
     }
 
     @Test
-    void test2() {
+    public void test2() {
         javadoc("-d", "out-2",
                 "-html4",
                 "-sourcepath", testSrc,
--- a/test/langtools/jdk/javadoc/doclet/testPackageHtml/TestPackageHtml.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testPackageHtml/TestPackageHtml.java	Wed Jan 02 10:21:54 2019 +0100
@@ -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
@@ -25,12 +25,14 @@
  * @test
  * @bug      8150096 8179704
  * @summary  test package.html handling
- * @library  ../lib
+ * @library  ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build    JavadocTester
+ * @build    javadoc.tester.*
  * @run main TestPackageHtml
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestPackageHtml extends JavadocTester {
     public static void main(String... args) throws Exception  {
         TestPackageHtml tester = new TestPackageHtml();
@@ -39,7 +41,7 @@
 
     // Make sure package.html is recognized by doclint
     @Test
-    void testPackageHtml() {
+    public void testPackageHtml() {
         javadoc("-d", "out-pkg-html-1",
                 "-sourcepath", testSrc,
                 "pkg1");
@@ -51,7 +53,7 @@
     // ignore html comment in the first sentence and must
     // ignore trailing whitespace in a first sentence.
     @Test
-    void testPackageHtmlWithEmptyBody() {
+    public void testPackageHtmlWithEmptyBody() {
         javadoc("-d", "out-pkg-html-2",
                 "-sourcepath", testSrc,
                 "pkg2", "pkg3", "pkg4");
--- a/test/langtools/jdk/javadoc/doclet/testPackagePage/TestPackagePage.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testPackagePage/TestPackagePage.java	Wed Jan 02 10:21:54 2019 +0100
@@ -28,12 +28,14 @@
  * passed to Javadoc.  Also test that the proper package links are generated
  * when single or multiple packages are documented.
  * @author jamieh
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
  * @run main TestPackagePage
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestPackagePage extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -42,7 +44,7 @@
     }
 
     @Test
-    void testSinglePackage() {
+    public void testSinglePackage() {
         javadoc("-d", "out-1",
                 "-sourcepath", testSrc,
                 testSrc("com/pkg/C.java"));
@@ -69,7 +71,7 @@
 
 
     @Test
-    void testMultiplePackages() {
+    public void testMultiplePackages() {
         javadoc("-d", "out-2",
                 "-sourcepath", testSrc,
                 "com.pkg", "pkg2");
--- a/test/langtools/jdk/javadoc/doclet/testPackageSummary/TestPackageSummary.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testPackageSummary/TestPackageSummary.java	Wed Jan 02 10:21:54 2019 +0100
@@ -26,12 +26,14 @@
  * @test
  * @bug 8189841
  * @summary Error in alternate row coloring in package-summary files
- * @library  ../lib/
+ * @library  ../../lib/
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build    JavadocTester TestPackageSummary
+ * @build    javadoc.tester.* TestPackageSummary
  * @run main TestPackageSummary
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestPackageSummary extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -40,7 +42,7 @@
     }
 
     @Test
-    void testStripes() {
+    public void testStripes() {
         javadoc("-d", "out",
                 "-sourcepath", testSrc,
                 "pkg");
--- a/test/langtools/jdk/javadoc/doclet/testParamTaglet/TestParamTaglet.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testParamTaglet/TestParamTaglet.java	Wed Jan 02 10:21:54 2019 +0100
@@ -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
@@ -28,12 +28,14 @@
  *           match up with a real parameters.
  *           Make sure inheritDoc cannot be used in an invalid param tag.
  * @author   jamieh
- * @library  ../lib
+ * @library  ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build    JavadocTester
+ * @build    javadoc.tester.*
  * @run main TestParamTaglet
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestParamTaglet extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -42,7 +44,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         javadoc("-d", "out",
                 "-sourcepath", testSrc,
                 "pkg");
--- a/test/langtools/jdk/javadoc/doclet/testPrivateClasses/TestPrivateClasses.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testPrivateClasses/TestPrivateClasses.java	Wed Jan 02 10:21:54 2019 +0100
@@ -37,11 +37,13 @@
  *           Make sure when no modifier appear in the class signature, the
  *           signature is displayed correctly without extra space at the beginning.
  * @author   jamieh
- * @library  ../lib
+ * @library  ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build    JavadocTester
+ * @build    javadoc.tester.*
  * @run main TestPrivateClasses
  */
+import javadoc.tester.JavadocTester;
+
 public class TestPrivateClasses extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -50,7 +52,7 @@
     }
 
     @Test
-    void testDefault() {
+    public void testDefault() {
         javadoc("-d", "out-default",
                 "-sourcepath", testSrc,
                 "pkg", "pkg2");
@@ -139,7 +141,7 @@
     }
 
     @Test
-    void testDefault_html4() {
+    public void testDefault_html4() {
         javadoc("-d", "out-default-html4",
                 "-html4",
                 "-sourcepath", testSrc,
@@ -175,7 +177,7 @@
     }
 
     @Test
-    void testPrivate() {
+    public void testPrivate() {
         javadoc("-d", "out-private",
                 "-sourcepath", testSrc,
                 "-private",
@@ -269,7 +271,7 @@
     }
 
     @Test
-    void testPrivate_html4() {
+    public void testPrivate_html4() {
         javadoc("-d", "out-private-html4",
                 "-html4",
                 "-sourcepath", testSrc,
--- a/test/langtools/jdk/javadoc/doclet/testProperty/TestProperty.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testProperty/TestProperty.java	Wed Jan 02 10:21:54 2019 +0100
@@ -25,12 +25,14 @@
  * @test
  * @bug      8176231 8189843 8182765 8203791
  * @summary  Test JavaFX property.
- * @library  ../lib/
+ * @library  ../../lib/
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build    JavadocTester TestProperty
+ * @build    javadoc.tester.* TestProperty
  * @run main TestProperty
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestProperty extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -39,7 +41,7 @@
     }
 
     @Test
-    void testArrays() {
+    public void testArrays() {
         javadoc("-d", "out",
                 "-javafx",
                 "--disable-javafx-strict-checks",
@@ -110,7 +112,7 @@
     }
 
     @Test
-    void testArrays_html4() {
+    public void testArrays_html4() {
         javadoc("-d", "out-html4",
                 "-html4",
                 "-javafx",
--- a/test/langtools/jdk/javadoc/doclet/testRecurseSubPackages/TestRecurseSubPackages.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testRecurseSubPackages/TestRecurseSubPackages.java	Wed Jan 02 10:21:54 2019 +0100
@@ -26,12 +26,14 @@
  * @bug 4074234 8196202
  * @summary Make Javadoc capable of traversing/recursing all of given subpackages.
  * @author jamieh
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
  * @run main TestRecurseSubPackages
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestRecurseSubPackages extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -40,7 +42,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         javadoc("-d", "out",
                 "--frames",
                 "-sourcepath", testSrc,
--- a/test/langtools/jdk/javadoc/doclet/testRelativeLinks/TestRelativeLinks.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testRelativeLinks/TestRelativeLinks.java	Wed Jan 02 10:21:54 2019 +0100
@@ -27,12 +27,14 @@
  * @summary  Test to make sure that relative paths are redirected in the
  *           output so that they are not broken.
  * @author   jamieh
- * @library  ../lib
+ * @library  ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build    JavadocTester
+ * @build    javadoc.tester.*
  * @run main TestRelativeLinks
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestRelativeLinks extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -41,7 +43,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         javadoc("-d", "out",
                 "-use",
                 "--frames",
@@ -97,7 +99,7 @@
     }
 
     @Test
-    void test_html4() {
+    public void test_html4() {
         javadoc("-d", "out-html4",
                 "-html4",
                 "-use",
--- a/test/langtools/jdk/javadoc/doclet/testRepeatedAnnotations/TestRepeatedAnnotations.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testRepeatedAnnotations/TestRepeatedAnnotations.java	Wed Jan 02 10:21:54 2019 +0100
@@ -26,12 +26,14 @@
  * @bug      8005092 6469562 8182765
  * @summary  Test repeated annotations output.
  * @author   bpatel
- * @library  ../lib
+ * @library  ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build    JavadocTester
+ * @build    javadoc.tester.*
  * @run main TestRepeatedAnnotations
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestRepeatedAnnotations extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -40,7 +42,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         javadoc("-d", "out",
                 "-sourcepath", testSrc,
                 "pkg", "pkg1");
@@ -136,7 +138,7 @@
     }
 
     @Test
-    void test_html4() {
+    public void test_html4() {
         javadoc("-d", "out-html4",
                 "-html4",
                 "-sourcepath", testSrc,
--- a/test/langtools/jdk/javadoc/doclet/testReturnTag/TestReturnTag.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testReturnTag/TestReturnTag.java	Wed Jan 02 10:21:54 2019 +0100
@@ -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
@@ -26,12 +26,14 @@
  * @bug      4490068
  * @summary  Warn when a return tag is used on a method without a return type.
  * @author   jamieh
- * @library  ../lib
+ * @library  ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build    JavadocTester
+ * @build    javadoc.tester.*
  * @run main TestReturnTag
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestReturnTag extends JavadocTester {
 
     /**
@@ -47,7 +49,7 @@
     }
 
     @Test
-    void tests() {
+    public void tests() {
         javadoc("-Xdoclint:none",
                 "-d", "out",
                 "-sourcepath", testSrc,
--- a/test/langtools/jdk/javadoc/doclet/testSearch/TestSearch.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testSearch/TestSearch.java	Wed Jan 02 10:21:54 2019 +0100
@@ -28,11 +28,13 @@
  *      8184205 8214468
  * @summary Test the search feature of javadoc.
  * @author bpatel
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
  * @run main TestSearch
  */
+import javadoc.tester.JavadocTester;
+
 public class TestSearch extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -41,7 +43,7 @@
     }
 
     @Test
-    void test1() {
+    public void test1() {
         javadoc("-d", "out-1",
                 "-sourcepath",
                 "-use",
@@ -63,7 +65,7 @@
     }
 
     @Test
-    void test2() {
+    public void test2() {
         javadoc("-d", "out-2",
                 "-Xdoclint:none",
                 "-sourcepath", testSrc,
@@ -90,7 +92,7 @@
     }
 
     @Test
-    void test2_html4() {
+    public void test2_html4() {
         javadoc("-d", "out-2-html4",
                 "-html4",
                 "-Xdoclint:none",
@@ -102,7 +104,7 @@
     }
 
     @Test
-    void test2a() {
+    public void test2a() {
         javadoc("-d", "out-2a",
                 "-Xdoclint:all",
                 "-sourcepath", testSrc,
@@ -128,7 +130,7 @@
     }
 
     @Test
-    void test2a_html4() {
+    public void test2a_html4() {
         javadoc("-d", "out-2a-html4",
                 "-html4",
                 "-Xdoclint:all",
@@ -139,7 +141,7 @@
     }
 
     @Test
-    void test3() {
+    public void test3() {
         javadoc("-d", "out-3",
                 "-noindex",
                 "-Xdoclint:none",
@@ -165,7 +167,7 @@
     }
 
     @Test
-    void test4() {
+    public void test4() {
         javadoc("-d", "out-4",
                 "-html5",
                 "-Xdoclint:none",
@@ -191,7 +193,7 @@
     }
 
     @Test
-    void test5() {
+    public void test5() {
         javadoc("-d", "out-5",
                 "-html5",
                 "-noindex",
@@ -216,7 +218,7 @@
     }
 
     @Test
-    void test6() {
+    public void test6() {
         javadoc("-d", "out-6",
                 "-nocomment",
                 "-Xdoclint:none",
@@ -241,7 +243,7 @@
     }
 
     @Test
-    void test7() {
+    public void test7() {
         javadoc("-d", "out-7",
                 "-nodeprecated",
                 "-Xdoclint:none",
@@ -267,7 +269,7 @@
     }
 
     @Test
-    void test8() {
+    public void test8() {
         javadoc("-d", "out-8",
                 "-splitindex",
                 "-Xdoclint:none",
@@ -294,7 +296,7 @@
     }
 
     @Test
-    void test9() {
+    public void test9() {
         javadoc("-d", "out-9",
                 "-sourcepath", testSrc,
                 "-javafx",
@@ -321,7 +323,7 @@
     }
 
     @Test
-    void testNoModuleDirectories() {
+    public void testNoModuleDirectories() {
         javadoc("-d", "out-noMdlDir",
                 "--no-module-directories",
                 "-Xdoclint:none",
@@ -335,7 +337,7 @@
     }
 
     @Test
-    void testURLEncoding() {
+    public void testURLEncoding() {
         javadoc("-d", "out-encode-html5",
                 "--no-module-directories",
                 "-Xdoclint:none",
@@ -348,7 +350,7 @@
     }
 
     @Test
-    void testURLEncoding_html4() {
+    public void testURLEncoding_html4() {
         javadoc("-d", "out-encode-html4",
                 "-html4",
                 "--no-module-directories",
@@ -363,7 +365,7 @@
     }
 
     @Test
-    void testJapaneseLocale() {
+    public void testJapaneseLocale() {
         javadoc("-locale", "ja_JP",
                 "-d", "out-jp",
                 "--no-module-directories",
@@ -382,7 +384,7 @@
     }
 
     @Test
-    void testChineseLocale() {
+    public void testChineseLocale() {
         javadoc("-locale", "zh_CN",
                 "-d", "out-cn",
                 "--no-module-directories",
--- a/test/langtools/jdk/javadoc/doclet/testSeeTag/TestSeeTag.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testSeeTag/TestSeeTag.java	Wed Jan 02 10:21:54 2019 +0100
@@ -26,12 +26,14 @@
  * @bug      8017191 8182765 8200432
  * @summary  Javadoc is confused by at-link to imported classes outside of the set of generated packages
  * @author   jjg
- * @library  ../lib
+ * @library  ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build    JavadocTester
+ * @build    javadoc.tester.*
  * @run main TestSeeTag
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestSeeTag extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -40,7 +42,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         javadoc("-d", "out",
                 "-sourcepath", testSrc,
                 "pkg");
@@ -67,7 +69,7 @@
     }
 
     @Test
-    void test_html4() {
+    public void test_html4() {
         javadoc("-d", "out-html4",
                 "-html4",
                 "-sourcepath", testSrc,
@@ -86,7 +88,7 @@
     }
 
     @Test
-    void testBadReference() {
+    public void testBadReference() {
         javadoc("-d", "out-badref",
                 "-sourcepath", testSrc,
                 "badref");
--- a/test/langtools/jdk/javadoc/doclet/testSerialTag/TestSerialTag.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testSerialTag/TestSerialTag.java	Wed Jan 02 10:21:54 2019 +0100
@@ -25,9 +25,9 @@
  * @test
  * @bug 8207214
  * @summary Test package-level at-serial tags
- * @library /tools/lib ../lib
+ * @library /tools/lib ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester toolbox.ToolBox
+ * @build javadoc.tester.* toolbox.ToolBox
  * @run main TestSerialTag
  */
 
@@ -36,6 +36,8 @@
 
 import toolbox.ToolBox;
 
+import javadoc.tester.JavadocTester;
+
 public class TestSerialTag extends JavadocTester {
     public static void main(String... args) throws Exception {
         TestSerialTag tester = new TestSerialTag();
--- a/test/langtools/jdk/javadoc/doclet/testSerialVersionUID/TestSerialVersionUID.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testSerialVersionUID/TestSerialVersionUID.java	Wed Jan 02 10:21:54 2019 +0100
@@ -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
@@ -27,12 +27,14 @@
  * @summary  Test to make sure that the serialVersionUID is properly
  * documented in the serialized form.
  * @author   jamieh
- * @library  ../lib
+ * @library  ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build    JavadocTester
+ * @build    javadoc.tester.*
  * @run main TestSerialVersionUID
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestSerialVersionUID extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -41,7 +43,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         javadoc("-d", "out",
                 testSrc("C.java"));
         checkExit(Exit.OK);
--- a/test/langtools/jdk/javadoc/doclet/testSerializedForm/TestSerializedForm.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testSerializedForm/TestSerializedForm.java	Wed Jan 02 10:21:54 2019 +0100
@@ -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
@@ -32,15 +32,17 @@
  * in the serialized form page.
  * Make sure see tags work in serialized form.
  * @author jamieh
- * @library ../lib/
+ * @library ../../lib/
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
  * @build TestSerializedForm
  * @run main TestSerializedForm
  */
 
 import java.io.*;
 
+import javadoc.tester.JavadocTester;
+
 public class TestSerializedForm extends JavadocTester {
     public static void main(String... args) throws Exception {
         TestSerializedForm tester = new TestSerializedForm();
@@ -52,7 +54,7 @@
 
     // @ignore 8146022
     // @Test
-    void testDefault() {
+    public void testDefault() {
         javadoc("-d", "out-default", "-serialwarn", "-Xdoclint:none",
                 "-sourcepath", testSrc,
                 testSrc("SerializedForm.java"), testSrc("ExternalizedForm.java"), "pkg1");
@@ -100,7 +102,7 @@
     }
 
     @Test
-    void testPrivate() {
+    public void testPrivate() {
         javadoc("-private",
                 "-d", "out-private",
                 "-sourcepath", testSrc,
@@ -142,7 +144,7 @@
     }
 
     @Test
-    void test2() {
+    public void test2() {
         javadoc("-private",
                 "-d", "out-2",
                 "-sourcepath", testSrc,
--- a/test/langtools/jdk/javadoc/doclet/testSerializedFormDeprecationInfo/TestSerializedFormDeprecationInfo.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testSerializedFormDeprecationInfo/TestSerializedFormDeprecationInfo.java	Wed Jan 02 10:21:54 2019 +0100
@@ -26,12 +26,14 @@
  * @bug 6802694 8025633 8026567 8183511 8074407 8182765
  * @summary This test verifies deprecation info in serialized-form.html.
  * @author Bhavesh Patel
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
  * @run main TestSerializedFormDeprecationInfo
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestSerializedFormDeprecationInfo extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -40,7 +42,7 @@
     }
 
     @Test
-    void testDefault() {
+    public void testDefault() {
         javadoc("-d", "out-default",
                 "-sourcepath", testSrc,
                 "pkg1");
@@ -51,7 +53,7 @@
     }
 
     @Test
-    void testNoComment() {
+    public void testNoComment() {
         javadoc("-d", "out-nocmnt",
                 "-nocomment",
                 "-sourcepath", testSrc,
@@ -63,7 +65,7 @@
     }
 
     @Test
-    void testNoDeprecated() {
+    public void testNoDeprecated() {
         javadoc("-d", "out-nodepr",
                 "-nodeprecated",
                 "-sourcepath", testSrc,
@@ -75,7 +77,7 @@
     }
 
     @Test
-    void testNoCommentNoDeprecated() {
+    public void testNoCommentNoDeprecated() {
         javadoc("-d", "out-nocmnt-nodepr",
                 "-nocomment",
                 "-nodeprecated",
--- a/test/langtools/jdk/javadoc/doclet/testSerializedFormWithClassFile/TestSerializedFormWithClassFile.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testSerializedFormWithClassFile/TestSerializedFormWithClassFile.java	Wed Jan 02 10:21:54 2019 +0100
@@ -25,12 +25,12 @@
  * @test
  * @bug 8199307
  * @summary NPE in jdk.javadoc.internal.doclets.toolkit.util.Utils.getLineNumber
- * @library /tools/lib ../lib
+ * @library /tools/lib ../../lib
  * @modules
  *      jdk.javadoc/jdk.javadoc.internal.tool
  *      jdk.compiler/com.sun.tools.javac.api
  *      jdk.compiler/com.sun.tools.javac.main
- * @build JavadocTester
+ * @build javadoc.tester.*
  * @run main TestSerializedFormWithClassFile
  */
 
@@ -43,6 +43,8 @@
 import toolbox.ToolBox;
 import toolbox.JavacTask;
 
+import javadoc.tester.JavadocTester;
+
 public class TestSerializedFormWithClassFile extends JavadocTester {
 
     final ToolBox tb;
@@ -57,7 +59,7 @@
     }
 
     @Test
-    void test(Path base) throws Exception {
+    public void test(Path base) throws Exception {
         Path srcDir = base.resolve("src");
         createTestClass(base, srcDir);
 
--- a/test/langtools/jdk/javadoc/doclet/testSerializedFormWithSee/TestSerializedFormWithSee.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testSerializedFormWithSee/TestSerializedFormWithSee.java	Wed Jan 02 10:21:54 2019 +0100
@@ -25,9 +25,9 @@
  * @test
  * @bug 8207214
  * @summary Test serialized forms, with at-see to other members
- * @library /tools/lib ../lib
+ * @library /tools/lib ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester toolbox.ToolBox
+ * @build javadoc.tester.* toolbox.ToolBox
  * @run main TestSerializedFormWithSee
  */
 
@@ -46,6 +46,8 @@
  * to {@code checkLinks}, to verify that there are no broken
  * links in the generated files.
  */
+import javadoc.tester.JavadocTester;
+
 public class TestSerializedFormWithSee extends JavadocTester {
 
     public static void main(String... args) throws Exception {
--- a/test/langtools/jdk/javadoc/doclet/testSimpleTag/TestSimpleTag.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testSimpleTag/TestSimpleTag.java	Wed Jan 02 10:21:54 2019 +0100
@@ -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
@@ -29,12 +29,14 @@
  * you can escape the ":" character with a back slash so that it is not
  * considered a separator when parsing the simple tag argument.
  * @author jamieh
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
  * @run main TestSimpleTag
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestSimpleTag extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -43,7 +45,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         javadoc("-d", "out",
                 "-sourcepath", testSrc,
                 "-tag", "param",
--- a/test/langtools/jdk/javadoc/doclet/testSimpleTagExclude/TestSimpleTagExclude.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testSimpleTagExclude/TestSimpleTagExclude.java	Wed Jan 02 10:21:54 2019 +0100
@@ -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
@@ -27,12 +27,14 @@
  * @summary Test the parsing of the -tag option.  The user should be able to
  * exclude a simple tag by using -tag tagname:X
  * @author jamieh
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
  * @run main TestSimpleTagExclude
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestSimpleTagExclude extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -41,7 +43,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         javadoc("-d", "out",
                 "-sourcepath", testSrc,
                 "-tag", "todo:X",
--- a/test/langtools/jdk/javadoc/doclet/testSimpleTagInherit/TestSimpleTagInherit.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testSimpleTagInherit/TestSimpleTagInherit.java	Wed Jan 02 10:21:54 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2016, 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
@@ -25,12 +25,14 @@
  * @test
  * @bug      8008768 8026567
  * @summary  Using {@inheritDoc} in simple tag defined via -tag fails
- * @library  ../lib
+ * @library  ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build    JavadocTester
+ * @build    javadoc.tester.*
  * @run main TestSimpleTagInherit
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestSimpleTagInherit extends JavadocTester {
 
     //Javadoc arguments.
@@ -49,7 +51,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         javadoc("-d", "out",
                 "-sourcepath", testSrc,
                 "-tag", "custom:optcm:<em>Custom:</em>",
--- a/test/langtools/jdk/javadoc/doclet/testSinceTag/TestSinceTag.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testSinceTag/TestSinceTag.java	Wed Jan 02 10:21:54 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2016, 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
@@ -26,12 +26,14 @@
  * @bug      7180906 8026567
  * @summary  Test to make sure that the since tag works correctly
  * @author   Bhavesh Patel
- * @library  ../lib
+ * @library  ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build    JavadocTester
+ * @build    javadoc.tester.*
  * @run main TestSinceTag
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestSinceTag extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -41,7 +43,7 @@
     }
 
     @Test
-    void testSince() {
+    public void testSince() {
         javadoc("-d", "out-since",
                 "-sourcepath", testSrc,
                 "pkg1");
@@ -51,7 +53,7 @@
     }
 
     @Test
-    void testNoSince() {
+    public void testNoSince() {
         javadoc("-d", "out-nosince",
                 "-sourcepath", testSrc,
                 "-nosince",
--- a/test/langtools/jdk/javadoc/doclet/testSingleQuotedLink/TestSingleQuotedLink.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testSingleQuotedLink/TestSingleQuotedLink.java	Wed Jan 02 10:21:54 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2016, 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
@@ -26,11 +26,13 @@
  * @bug 6457406
  * @summary Verify that a link in single quotes copied to the class-use page as is.
  * @author Yuri Nesterenko
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
  * @run main TestSingleQuotedLink
  */
+import javadoc.tester.JavadocTester;
+
 public class TestSingleQuotedLink extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -39,7 +41,7 @@
     }
 
     @Test
-    void run() {
+    public void run() {
         javadoc("-d", "out",
                 "-sourcepath", testSrc,
                 "-use",
--- a/test/langtools/jdk/javadoc/doclet/testSourceTab/TestSourceTab.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testSourceTab/TestSourceTab.java	Wed Jan 02 10:21:54 2019 +0100
@@ -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
@@ -27,14 +27,16 @@
  * @summary Test to make sure that the source documentation is indented properly
  * when -linksourcetab is used.
  * @author jamieh
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
  * @run main TestSourceTab
  */
 
 import java.io.*;
 
+import javadoc.tester.JavadocTester;
+
 public class TestSourceTab extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -43,7 +45,7 @@
     }
 
     @Test
-    void test() throws Exception {
+    public void test() throws Exception {
         String tmpSrcDir = "tmpSrc";
         String outdir1 = "out-tabLengthEight";
         String outdir2 = "out-tabLengthFour";
--- a/test/langtools/jdk/javadoc/doclet/testStylesheet/TestStylesheet.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testStylesheet/TestStylesheet.java	Wed Jan 02 10:21:54 2019 +0100
@@ -27,12 +27,14 @@
  *           8175218 8176452 8181215 8182263 8183511 8169819 8183037 8185369 8182765 8196201 8184205
  * @summary  Run tests on doclet stylesheet.
  * @author   jamieh
- * @library  ../lib
+ * @library  ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build    JavadocTester
+ * @build    javadoc.tester.*
  * @run main TestStylesheet
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestStylesheet extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -41,7 +43,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         javadoc("-d", "out",
                 "-sourcepath", testSrc,
                 "pkg");
@@ -242,7 +244,7 @@
     }
 
     @Test
-    void test_html4() {
+    public void test_html4() {
         javadoc("-d", "out-html4",
                 "-html4",
                 "-sourcepath", testSrc,
--- a/test/langtools/jdk/javadoc/doclet/testStylesheetOverwrite/TestStylesheetOverwrite.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testStylesheetOverwrite/TestStylesheetOverwrite.java	Wed Jan 02 10:21:54 2019 +0100
@@ -24,9 +24,9 @@
  * @test
  * @bug      8196913
  * @summary  javadoc does not (over)write stylesheet.css
- * @library  /tools/lib ../lib
+ * @library  /tools/lib ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build    JavadocTester toolbox.ToolBox builder.ClassBuilder
+ * @build    javadoc.tester.* toolbox.ToolBox builder.ClassBuilder
  * @run main TestStylesheetOverwrite
  */
 
@@ -38,6 +38,8 @@
 import builder.ClassBuilder;
 import toolbox.ToolBox;
 
+import javadoc.tester.JavadocTester;
+
 public class TestStylesheetOverwrite extends JavadocTester {
     final ToolBox tb;
 
@@ -51,7 +53,7 @@
     }
 
     @Test
-    void testStylesheetFile(Path base) throws Exception {
+    public void testStylesheetFile(Path base) throws Exception {
         Path srcDir = base.resolve("src");
         createTestClass(srcDir);
 
--- a/test/langtools/jdk/javadoc/doclet/testSubTitle/TestSubTitle.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testSubTitle/TestSubTitle.java	Wed Jan 02 10:21:54 2019 +0100
@@ -26,12 +26,14 @@
  * @bug 7010342 8150000 8174974
  * @summary Test for correct sub title generation.
  * @author Bhavesh Patel
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
  * @run main TestSubTitle
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestSubTitle extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -40,7 +42,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         javadoc("-d", "out",
                 "-sourcepath", testSrc,
                 "pkg");
--- a/test/langtools/jdk/javadoc/doclet/testSummaryHeading/TestSummaryHeading.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testSummaryHeading/TestSummaryHeading.java	Wed Jan 02 10:21:54 2019 +0100
@@ -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
@@ -28,12 +28,14 @@
  *           "Method Summary" heading should still show up since the class
  *           inherits methods.
  * @author   jamieh
- * @library  ../lib
+ * @library  ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build    JavadocTester
+ * @build    javadoc.tester.*
  * @run main TestSummaryHeading
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestSummaryHeading extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -42,7 +44,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         javadoc("-d", "out",
                 "-sourcepath", testSrc,
                 testSrc("C.java"));
--- a/test/langtools/jdk/javadoc/doclet/testSummaryTag/TestSummaryTag.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testSummaryTag/TestSummaryTag.java	Wed Jan 02 10:21:54 2019 +0100
@@ -25,12 +25,14 @@
  * @test
  * @bug      8173425 8186332 8182765 8196202
  * @summary  tests for the summary tag behavior
- * @library  ../lib
+ * @library  ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build    JavadocTester
+ * @build    javadoc.tester.*
  * @run main TestSummaryTag
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestSummaryTag extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -39,7 +41,7 @@
     }
 
     @Test
-    void test1() {
+    public void test1() {
         javadoc("-d", "out1",
                 "-sourcepath", testSrc,
                 "p1");
@@ -95,7 +97,7 @@
     }
 
     @Test
-    void test1_html4() {
+    public void test1_html4() {
         javadoc("-d", "out1-html4",
                 "-html4",
                 "-sourcepath", testSrc,
@@ -139,7 +141,7 @@
     }
 
     @Test
-    void test2() {
+    public void test2() {
         javadoc("-d", "out2",
                 "-sourcepath", testSrc,
                 "p2");
@@ -153,7 +155,7 @@
     }
 
     @Test
-    void test3() {
+    public void test3() {
         javadoc("-d", "out3",
                 "--frames",
                 "-sourcepath", testSrc,
--- a/test/langtools/jdk/javadoc/doclet/testSuperclassInSerialForm/TestSuperClassInSerialForm.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testSuperclassInSerialForm/TestSuperClassInSerialForm.java	Wed Jan 02 10:21:54 2019 +0100
@@ -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
@@ -27,12 +27,14 @@
  * @summary Test to make sure link to superclass is generated for
  * each class in serialized form page.
  * @author jamieh
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
  * @run main TestSuperClassInSerialForm
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestSuperClassInSerialForm extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -41,7 +43,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         javadoc("-d", "out",
                 "-sourcepath", testSrc,
                 "pkg");
--- a/test/langtools/jdk/javadoc/doclet/testSupplementary/TestSupplementary.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testSupplementary/TestSupplementary.java	Wed Jan 02 10:21:54 2019 +0100
@@ -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
@@ -27,14 +27,16 @@
  * @summary Test to make sure that "see" tag and "serialField" tag handle supplementary
  *    characters correctly.  This test case needs to be run in en_US locale.
  * @author Naoto Sato
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
  * @run main TestSupplementary
  */
 
 import java.util.Locale;
 
+import javadoc.tester.JavadocTester;
+
 public class TestSupplementary extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -48,7 +50,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         javadoc("-locale", "en_US",
                 "-d", "out",
                 testSrc("C.java"));
--- a/test/langtools/jdk/javadoc/doclet/testSystemPropertyTaglet/TestSystemPropertyTaglet.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testSystemPropertyTaglet/TestSystemPropertyTaglet.java	Wed Jan 02 10:21:54 2019 +0100
@@ -25,9 +25,9 @@
  * @test
  * @bug 5076751
  * @summary System properties documentation needed in javadocs
- * @library /tools/lib ../lib
+ * @library /tools/lib ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester toolbox.ToolBox builder.ClassBuilder
+ * @build javadoc.tester.* toolbox.ToolBox builder.ClassBuilder
  * @run main TestSystemPropertyTaglet
  */
 
@@ -39,6 +39,8 @@
 import builder.ClassBuilder.MethodBuilder;
 import toolbox.ToolBox;
 
+import javadoc.tester.JavadocTester;
+
 public class TestSystemPropertyTaglet extends JavadocTester {
 
     final ToolBox tb;
@@ -53,7 +55,7 @@
     }
 
     @Test
-    void test(Path base) throws Exception {
+    public void test(Path base) throws Exception {
         Path srcDir = base.resolve("src");
         Path outDir = base.resolve("out");
 
@@ -97,7 +99,7 @@
     }
 
     @Test
-    void testSystemProperytWithinATag(Path base) throws Exception {
+    public void testSystemProperytWithinATag(Path base) throws Exception {
         Path srcDir = base.resolve("src");
         Path outDir = base.resolve("out");
 
--- a/test/langtools/jdk/javadoc/doclet/testTagInheritence/TestTagInheritence.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testTagInheritence/TestTagInheritence.java	Wed Jan 02 10:21:54 2019 +0100
@@ -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
@@ -26,13 +26,15 @@
  * @bug     4496223 4496270 4618686 4720974 4812240 6253614 6253604
  * @summary <DESC>
  * @author  jamieh
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
  * @run main TestTagInheritence
  */
 
 // TODO: Inheritence should be Inheritance!   fix separately as noreg-trivial
+import javadoc.tester.JavadocTester;
+
 public class TestTagInheritence extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -41,7 +43,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         javadoc("-Xdoclint:none",
                 "-d", "out",
                 "-sourcepath", testSrc,
--- a/test/langtools/jdk/javadoc/doclet/testTagMisuse/TestTagMisuse.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testTagMisuse/TestTagMisuse.java	Wed Jan 02 10:21:54 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2016, 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
@@ -25,12 +25,14 @@
  * @test
  * @summary Determine if proper warning messages are printed.
  * @author jamieh
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
  * @build TestTagMisuse
  * @run main TestTagMisuse
  */
+import javadoc.tester.JavadocTester;
+
 public class TestTagMisuse extends JavadocTester {
 
     /**
@@ -44,7 +46,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         javadoc("-Xdoclint:none",
                 "-d", "out",
                 testSrc("TestTagMisuse.java"));
--- a/test/langtools/jdk/javadoc/doclet/testTagOutput/TestTagOutput.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testTagOutput/TestTagOutput.java	Wed Jan 02 10:21:54 2019 +0100
@@ -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
@@ -26,12 +26,14 @@
  * @bug 8026370 8026567 8183511 8074407
  * @summary This test checks the generated tag output.
  * @author Bhavesh Patel
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
  * @run main TestTagOutput
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestTagOutput extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -40,7 +42,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         javadoc("-d", "out",
                 "-sourcepath", testSrc,
                 "pkg1");
--- a/test/langtools/jdk/javadoc/doclet/testTaglets/TestTaglets.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testTaglets/TestTaglets.java	Wed Jan 02 10:21:54 2019 +0100
@@ -25,9 +25,9 @@
  * @test
  * @bug      8202947
  * @summary  Test TagletManager initialization
- * @library  /tools/lib ../lib
+ * @library  /tools/lib ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build    toolbox.ToolBox JavadocTester
+ * @build    toolbox.ToolBox javadoc.tester.*
  * @run main TestTaglets
  */
 
@@ -37,6 +37,7 @@
 import java.nio.file.Paths;
 import java.util.List;
 
+import javadoc.tester.JavadocTester;
 import toolbox.ToolBox;
 
 /*
@@ -62,7 +63,7 @@
     }
 
     @Test
-    void test() throws Exception {
+    public void test() throws Exception {
         javadoc("-d", "out",
                 "-javafx",
                 "--show-taglets",
--- a/test/langtools/jdk/javadoc/doclet/testThrowsHead/TestThrowsHead.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testThrowsHead/TestThrowsHead.java	Wed Jan 02 10:21:54 2019 +0100
@@ -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
@@ -28,12 +28,14 @@
  * not documented with a throws tag, we generate a link to it in the
  * throws section.  Make sure that the link is below a Throws heading.
  * @author jamieh
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
  * @run main TestThrowsHead
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestThrowsHead extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -42,7 +44,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         javadoc("-d", "out",
                 testSrc("C.java"));
         checkExit(Exit.OK);
--- a/test/langtools/jdk/javadoc/doclet/testThrowsInheritence/TestThrowsTagInheritence.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testThrowsInheritence/TestThrowsTagInheritence.java	Wed Jan 02 10:21:54 2019 +0100
@@ -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
@@ -28,13 +28,15 @@
  * override the throws tags in interface. This test also verifies that throws tags are inherited properly
  * the case where the name of one exception is not fully qualified.
  * @author jamieh
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
  * @run main TestThrowsTagInheritence
  */
 
 // TODO: should be TestThrowsInheritance!
+import javadoc.tester.JavadocTester;
+
 public class TestThrowsTagInheritence extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -43,7 +45,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         javadoc("-d", "out",
                 "-sourcepath", testSrc,
                 testSrc("C.java"),
@@ -62,7 +64,7 @@
     }
 
     @Test
-    void test1() {
+    public void test1() {
         javadoc("-d", "out-1",
                 "-sourcepath", testSrc,
                 "-package", "pkg");
--- a/test/langtools/jdk/javadoc/doclet/testThrowsTag/TestThrowsTag.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testThrowsTag/TestThrowsTag.java	Wed Jan 02 10:21:54 2019 +0100
@@ -27,12 +27,14 @@
  * @summary  Test to make sure that exceptions always show up in the
  *           correct order.
  * @author   jamieh
- * @library  ../lib
+ * @library  ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build    JavadocTester
+ * @build    javadoc.tester.*
  * @run main TestThrowsTag
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestThrowsTag extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -41,7 +43,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         javadoc("-d", "out",
                 "-sourcepath", testSrc,
                 "pkg");
--- a/test/langtools/jdk/javadoc/doclet/testTitleInHref/TestTitleInHref.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testTitleInHref/TestTitleInHref.java	Wed Jan 02 10:21:54 2019 +0100
@@ -26,12 +26,14 @@
  * @bug 4714257 8164407 8205593
  * @summary Test to make sure that the title attribute shows up in links.
  * @author jamieh
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
  * @run main TestTitleInHref
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestTitleInHref extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -40,7 +42,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         String uri = "http://java.sun.com/j2se/1.4/docs/api";
         javadoc("-d", "out",
                 "-source", "8",
--- a/test/langtools/jdk/javadoc/doclet/testTopOption/TestTopOption.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testTopOption/TestTopOption.java	Wed Jan 02 10:21:54 2019 +0100
@@ -26,12 +26,14 @@
  * @bug      6227616 8043186 8196202
  * @summary  Test the new -top option.
  * @author   jamieh
- * @library  ../lib
+ * @library  ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build    JavadocTester
+ * @build    javadoc.tester.*
  * @run main TestTopOption
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestTopOption extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -40,7 +42,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         javadoc("-overview", testSrc("overview.html"),
                 "-use",
                 "-top", "TOP TEXT",
@@ -64,7 +66,7 @@
     }
 
     @Test
-    void testDocRootRewrite() {
+    public void testDocRootRewrite() {
         javadoc("-overview", testSrc("overview.html"),
                 "-use",
                 "-top", "\u0130{@docroot}TOP TEXT",
--- a/test/langtools/jdk/javadoc/doclet/testTypeAnnotations/TestTypeAnnotations.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testTypeAnnotations/TestTypeAnnotations.java	Wed Jan 02 10:21:54 2019 +0100
@@ -27,12 +27,14 @@
  *           8187288
  * @summary  Make sure that type annotations are displayed correctly
  * @author   Bhavesh Patel
- * @library  ../lib
+ * @library  ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build    JavadocTester
+ * @build    javadoc.tester.*
  * @run main TestTypeAnnotations
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestTypeAnnotations extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -41,7 +43,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         javadoc("-d", "out",
                 "-sourcepath", testSrc,
                 "-private",
@@ -720,7 +722,7 @@
     }
 
     @Test
-    void test_html4() {
+    public void test_html4() {
         javadoc("-d", "out-html4",
                 "-html4",
                 "-sourcepath", testSrc,
--- a/test/langtools/jdk/javadoc/doclet/testTypeParams/TestTypeParameters.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testTypeParams/TestTypeParameters.java	Wed Jan 02 10:21:54 2019 +0100
@@ -30,12 +30,14 @@
  *           class-use pages. The class/annotation pages should check for type
  *           parameter links in the class/annotation signature section when -linksource is set.
  * @author   jamieh
- * @library  ../lib
+ * @library  ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build    JavadocTester
+ * @build    javadoc.tester.*
  * @run main TestTypeParameters
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestTypeParameters extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -44,7 +46,7 @@
     }
 
     @Test
-    void test1() {
+    public void test1() {
         javadoc("-d", "out-1",
                 "-use",
                 "-sourcepath", testSrc,
@@ -74,7 +76,7 @@
     }
 
     @Test
-    void test1_html4() {
+    public void test1_html4() {
         javadoc("-d", "out-1-html4",
                 "-html4",
                 "-use",
@@ -90,7 +92,7 @@
     }
 
     @Test
-    void test2() {
+    public void test2() {
         javadoc("-d", "out-2",
                 "-linksource",
                 "-sourcepath", testSrc,
--- a/test/langtools/jdk/javadoc/doclet/testTypeVariableLinks/TestTypeVariableLinks.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testTypeVariableLinks/TestTypeVariableLinks.java	Wed Jan 02 10:21:54 2019 +0100
@@ -25,12 +25,14 @@
  * @test
  * @bug 8174805 8182765
  * @summary JavacTrees should use Types.skipTypeVars() to get the upper bound of type variables
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
  * @run main TestTypeVariableLinks
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestTypeVariableLinks extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -39,7 +41,7 @@
     }
 
     @Test
-    void test1() {
+    public void test1() {
         javadoc("-d", "out",
                 "-sourcepath", testSrc,
                 "-package",
@@ -57,7 +59,7 @@
     }
 
     @Test
-    void test1_html4() {
+    public void test1_html4() {
         javadoc("-d", "out-html4",
                 "-html4",
                 "-sourcepath", testSrc,
--- a/test/langtools/jdk/javadoc/doclet/testUnicode/TestUnicode.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testUnicode/TestUnicode.java	Wed Jan 02 10:21:54 2019 +0100
@@ -25,9 +25,9 @@
  * @test
  * @bug      8203176
  * @summary  javadoc handles non-ASCII characters incorrectly
- * @library  /tools/lib ../lib
+ * @library  /tools/lib ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build    toolbox.ToolBox JavadocTester
+ * @build    toolbox.ToolBox javadoc.tester.*
  * @run main TestUnicode
  */
 
@@ -35,6 +35,7 @@
 import java.nio.file.Path;
 import java.nio.file.Paths;
 
+import javadoc.tester.JavadocTester;
 import toolbox.ToolBox;
 
 public class TestUnicode extends JavadocTester {
@@ -47,7 +48,7 @@
     ToolBox tb = new ToolBox();
 
     @Test
-    void test() throws Exception {
+    public void test() throws Exception {
         char ellipsis = '\u2026';
         Path src = Files.createDirectories(Paths.get("src"));
         tb.writeJavaFiles(src,
--- a/test/langtools/jdk/javadoc/doclet/testUnnamedPackage/TestUnnamedPackage.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testUnnamedPackage/TestUnnamedPackage.java	Wed Jan 02 10:21:54 2019 +0100
@@ -27,12 +27,14 @@
  * @summary  Reference unnamed package as "Unnamed", not empty string.
  *           Generate a package summary for the unnamed package.
  * @author   jamieh
- * @library  ../lib
+ * @library  ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build    JavadocTester
+ * @build    javadoc.tester.*
  * @run main TestUnnamedPackage
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestUnnamedPackage extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -41,7 +43,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         javadoc("-d", "out",
                 "-sourcepath", testSrc,
                 testSrc("C.java"));
--- a/test/langtools/jdk/javadoc/doclet/testUseOption/TestUseOption.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testUseOption/TestUseOption.java	Wed Jan 02 10:21:54 2019 +0100
@@ -27,12 +27,14 @@
  *      8182765 8196202
  * @summary A simple test to ensure class-use files are correct.
  * @author jamieh
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
  * @run main TestUseOption
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestUseOption extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -42,7 +44,7 @@
     }
 
     @Test
-    void test1() {
+    public void test1() {
         javadoc("-d", "out-1",
                 "-sourcepath", testSrc,
                 "-use",
@@ -142,7 +144,7 @@
     }
 
     @Test
-    void test1_html4() {
+    public void test1_html4() {
         javadoc("-d", "out-1-html4",
                 "-html4",
                 "-sourcepath", testSrc,
@@ -181,7 +183,7 @@
     }
 
     @Test
-    void test2() {
+    public void test2() {
         javadoc("-d", "out-2",
                 "-sourcepath", testSrc,
                 "-use",
@@ -205,7 +207,7 @@
     }
 
     @Test
-    void test2_html4() {
+    public void test2_html4() {
         javadoc("-d", "out-2-html4",
                 "-html4",
                 "-sourcepath", testSrc,
@@ -223,7 +225,7 @@
     }
 
     @Test
-    void test3() {
+    public void test3() {
         javadoc("-d", "out-3",
                 "-sourcepath", testSrc,
                 "-use",
@@ -237,7 +239,7 @@
     }
 
     @Test
-    void test3_html4() {
+    public void test3_html4() {
         javadoc("-d", "out-3-html4",
                 "-html4",
                 "-sourcepath", testSrc,
--- a/test/langtools/jdk/javadoc/doclet/testUserTaglet/TestUserTaglet.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testUserTaglet/TestUserTaglet.java	Wed Jan 02 10:21:54 2019 +0100
@@ -25,12 +25,14 @@
  * @test
  * @bug      8176836 8201817
  * @summary  Provide Taglet with context
- * @library  ../lib
+ * @library  ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build    JavadocTester InfoTaglet
+ * @build    javadoc.tester.* InfoTaglet
  * @run main TestUserTaglet
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestUserTaglet extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -39,7 +41,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         javadoc("-d", "out",
                 "-sourcepath", testSrc,
                 "-tagletpath", System.getProperty("test.class.path"),
--- a/test/langtools/jdk/javadoc/doclet/testValueTag/TestValueTag.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testValueTag/TestValueTag.java	Wed Jan 02 10:21:54 2019 +0100
@@ -27,9 +27,9 @@
  * @summary  This test ensures that the value tag works in all
  *           use cases, the tests are explained below.
  * @author   jamieh
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build    JavadocTester
+ * @build    javadoc.tester.*
  * @run main TestValueTag
  */
 
@@ -39,6 +39,8 @@
 import java.nio.file.Paths;
 import java.util.List;
 
+import javadoc.tester.JavadocTester;
+
 public class TestValueTag extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -47,7 +49,7 @@
     }
 
     @Test
-    void test1() {
+    public void test1() {
         javadoc("-d", "out1",
                 "-sourcepath", testSrc,
                 "-tag", "todo",
@@ -117,7 +119,7 @@
     }
 
     @Test
-    void test2() {
+    public void test2() {
         javadoc("-Xdoclint:none",
                 "-d", "out2",
                 "-sourcepath", testSrc,
@@ -140,7 +142,7 @@
     }
 
     @Test
-    void test3() {
+    public void test3() {
         javadoc("-d", "out3",
                 "-sourcepath", testSrc,
                 "pkg2", "pkg3");
@@ -156,7 +158,7 @@
     }
 
     @Test
-    void test4() throws IOException {
+    public void test4() throws IOException {
         Path base = Paths.get("test4");
         Path src = base.resolve("src");
         Files.createDirectories(src.resolve("p"));
--- a/test/langtools/jdk/javadoc/doclet/testValueTag/TestValueTagInModule.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testValueTag/TestValueTagInModule.java	Wed Jan 02 10:21:54 2019 +0100
@@ -25,11 +25,11 @@
  * @test
  * @bug 8210244
  * @summary {@value} should be permitted in module documentation
- * @library /tools/lib ../lib
+ * @library /tools/lib ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
  *          jdk.compiler/com.sun.tools.javac.api
  *          jdk.compiler/com.sun.tools.javac.main
- * @build JavadocTester
+ * @build javadoc.tester.*
  * @run main TestValueTagInModule
  */
 
@@ -40,6 +40,8 @@
 import toolbox.ModuleBuilder;
 import toolbox.ToolBox;
 
+import javadoc.tester.JavadocTester;
+
 public class TestValueTagInModule extends JavadocTester {
 
     final ToolBox tb;
@@ -54,7 +56,7 @@
     }
 
     @Test
-    void test(Path base) throws Exception {
+    public void test(Path base) throws Exception {
         Path srcDir = base.resolve("src");
         createTestClass(srcDir);
 
--- a/test/langtools/jdk/javadoc/doclet/testVersionOption/TestVersionOption.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testVersionOption/TestVersionOption.java	Wed Jan 02 10:21:54 2019 +0100
@@ -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
@@ -25,12 +25,14 @@
  * @test
  * @bug      8177048
  * @summary  javadoc should support --version and --full-version flags
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build    JavadocTester TestVersionOption
+ * @build    javadoc.tester.* TestVersionOption
  * @run main TestVersionOption
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestVersionOption extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -39,7 +41,7 @@
     }
 
     @Test
-    void testFullVersionOption() {
+    public void testFullVersionOption() {
         javadoc("--full-version");
         checkExit(Exit.OK);
 
@@ -48,7 +50,7 @@
 
 
     @Test
-    void testVersionOption() {
+    public void testVersionOption() {
         javadoc("--version");
         checkExit(Exit.OK);
 
--- a/test/langtools/jdk/javadoc/doclet/testVersionTag/TestVersionTag.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testVersionTag/TestVersionTag.java	Wed Jan 02 10:21:54 2019 +0100
@@ -25,9 +25,9 @@
  * @test
  * @bug      8202947
  * @summary  test the at-version tag, and corresponding option
- * @library  /tools/lib ../lib
+ * @library  /tools/lib ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build    toolbox.ToolBox JavadocTester
+ * @build    toolbox.ToolBox javadoc.tester.*
  * @run main TestVersionTag
  */
 
@@ -35,6 +35,7 @@
 import java.nio.file.Path;
 import java.nio.file.Paths;
 
+import javadoc.tester.JavadocTester;
 import toolbox.ToolBox;
 
 public class TestVersionTag extends JavadocTester {
@@ -58,7 +59,7 @@
     }
 
     @Test
-    void testVersion() {
+    public void testVersion() {
         javadoc("-d", "out-version",
                 "-sourcepath", src.toString(),
                 "-version",
@@ -69,7 +70,7 @@
     }
 
     @Test
-    void testNoVersion() {
+    public void testNoVersion() {
         javadoc("-d", "out-noversion",
                 "-sourcepath", src.toString(),
                 "pkg");
--- a/test/langtools/jdk/javadoc/doclet/testVisibleMembers/TestVisibleMembers.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testVisibleMembers/TestVisibleMembers.java	Wed Jan 02 10:21:54 2019 +0100
@@ -26,9 +26,9 @@
  * @bug 8025091 8198890
  * @summary Verify the presence visible members in the case of
  *          member hiding and overridding.
- * @library /tools/lib ../lib
+ * @library /tools/lib ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester toolbox.ToolBox builder.ClassBuilder
+ * @build javadoc.tester.* toolbox.ToolBox builder.ClassBuilder
  * @run main TestVisibleMembers
  */
 
@@ -43,6 +43,8 @@
 import toolbox.ToolBox;
 import builder.ClassBuilder;
 
+import javadoc.tester.JavadocTester;
+
 public class TestVisibleMembers extends JavadocTester {
 
     final ToolBox tb;
@@ -56,7 +58,7 @@
     }
 
     @Test
-    void testChronoDiamondLeafDetail(Path base) throws Exception {
+    public void testChronoDiamondLeafDetail(Path base) throws Exception {
         Path srcDir = base.resolve("src");
         emitChronoDiamondLeaf(srcDir);
 
@@ -84,7 +86,7 @@
     }
 
     @Test
-    void testChronoDiamondLeafSummary(Path base) throws Exception {
+    public void testChronoDiamondLeafSummary(Path base) throws Exception {
         Path srcDir = base.resolve("src");
         emitChronoDiamondLeaf(srcDir);
 
@@ -182,7 +184,7 @@
     }
 
     @Test
-    void testNestedInterfaceDetail(Path base) throws Exception {
+    public void testNestedInterfaceDetail(Path base) throws Exception {
         Path srcDir = base.resolve("src");
         emitNestedInterface(srcDir);
 
@@ -202,7 +204,7 @@
     }
 
     @Test
-    void testNestedInterfaceSummary(Path base) throws Exception {
+    public void testNestedInterfaceSummary(Path base) throws Exception {
         Path srcDir = base.resolve("src");
         emitNestedInterface(srcDir);
 
@@ -256,7 +258,7 @@
     }
 
     @Test
-    void testStreamsMissingLinksDetail(Path base) throws Exception {
+    public void testStreamsMissingLinksDetail(Path base) throws Exception {
         Path srcDir = base.resolve("src");
         emitStreamsMissingLinks(srcDir);
 
@@ -291,7 +293,7 @@
     }
 
     @Test
-    void testStreamsMissingLinksSummary(Path base) throws Exception {
+    public void testStreamsMissingLinksSummary(Path base) throws Exception {
         Path srcDir = base.resolve("src");
         emitStreamsMissingLinks(srcDir);
 
@@ -395,7 +397,7 @@
     }
 
     @Test
-    void testVisibleMemberTableDetail(Path base) throws Exception {
+    public void testVisibleMemberTableDetail(Path base) throws Exception {
         Path srcDir = base.resolve("src");
         emitVisibleMemberTable(srcDir);
 
@@ -447,7 +449,7 @@
     }
 
     @Test
-    void testVisibleMemberTableSummary(Path base) throws Exception {
+    public void testVisibleMemberTableSummary(Path base) throws Exception {
         Path srcDir = base.resolve("src");
         emitVisibleMemberTable(srcDir);
 
@@ -569,7 +571,7 @@
     }
 
     @Test
-    void testHiddenMembersDetail(Path base) throws Exception {
+    public void testHiddenMembersDetail(Path base) throws Exception {
         Path srcDir = base.resolve("src");
         emitHiddenMembers(srcDir);
 
@@ -604,7 +606,7 @@
     }
 
     @Test
-    void testHiddenMembersSummary(Path base) throws Exception {
+    public void testHiddenMembersSummary(Path base) throws Exception {
         Path srcDir = base.resolve("src");
         emitHiddenMembers(srcDir);
 
--- a/test/langtools/jdk/javadoc/doclet/testWarnBadParamNames/TestWarnBadParamNames.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testWarnBadParamNames/TestWarnBadParamNames.java	Wed Jan 02 10:21:54 2019 +0100
@@ -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
@@ -27,12 +27,14 @@
  * @summary Test to make sure that warning is printed when bad parameter
  * name is used with param.
  * @author jamieh
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
  * @run main TestWarnBadParamNames
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestWarnBadParamNames extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -41,7 +43,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         javadoc("-Xdoclint:none",
                 "-d", "out",
                 testSrc("C.java"));
--- a/test/langtools/jdk/javadoc/doclet/testWarnings/TestWarnings.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testWarnings/TestWarnings.java	Wed Jan 02 10:21:54 2019 +0100
@@ -30,12 +30,14 @@
  *           a "link unresolved" warning.
  *           Make sure error message starts with "error -".
  * @author   jamieh
- * @library  ../lib
+ * @library  ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build    JavadocTester
+ * @build    javadoc.tester.*
  * @run main TestWarnings
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestWarnings extends JavadocTester {
     public static void main(String... args) throws Exception  {
         TestWarnings tester = new TestWarnings();
@@ -43,7 +45,7 @@
     }
 
     @Test
-    void testDefault() {
+    public void testDefault() {
         javadoc("-d", "out-default",
                 "-sourcepath", testSrc,
                 "pkg");
@@ -70,7 +72,7 @@
     }
 
     @Test
-    void testPrivate() {
+    public void testPrivate() {
         javadoc("-d", "out-private",
                 "-private",
                 "-sourcepath", testSrc,
@@ -84,7 +86,7 @@
     }
 
     @Test
-    void testPrivate_html4() {
+    public void testPrivate_html4() {
         javadoc("-d", "out-private-html4",
                 "-html4",
                 "-private",
--- a/test/langtools/jdk/javadoc/doclet/testWindowTitle/TestWindowTitle.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testWindowTitle/TestWindowTitle.java	Wed Jan 02 10:21:54 2019 +0100
@@ -26,11 +26,13 @@
  * @bug 8016675 8026736 8196202
  * @summary Test for window title.
  * @author Bhavesh Patel
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
  * @run main TestWindowTitle
  */
+import javadoc.tester.JavadocTester;
+
 public class TestWindowTitle extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -40,7 +42,7 @@
     }
 
     @Test
-    void testJavaScriptChars() {
+    public void testJavaScriptChars() {
         // Window title with JavaScript special characters.
         String title = "Testing \"Window 'Title'\" with a \\ backslash and a / "
                 + "forward slash and a \u00e8 unicode char also a    tab and also a "
@@ -67,7 +69,7 @@
     }
 
     @Test
-    void testScriptTag() {
+    public void testScriptTag() {
         // Window title with a script tag.
         String title = "Testing script tag in title </title><script>alert(\"Should not pop up\")</script>.";
 
@@ -100,7 +102,7 @@
     }
 
     @Test
-    void testHtmlTags() {
+    public void testHtmlTags() {
         // Window title with other HTML tags.
         String title = "Testing another <p>HTML</p> tag. Another <h1>tag</h1>. A "
                 + "<span id=\"testTag\">tag with attributes</span>. <script and </p are not tags.";
@@ -125,7 +127,7 @@
     }
 
     @Test
-    void testHtmlEntities() {
+    public void testHtmlEntities() {
         // Window title using entities.
         String title = "Testing entities &lt;script&gt;alert(\"Should not pop up\")&lt;/script&gt;.";
 
@@ -146,7 +148,7 @@
     }
 
     @Test
-    void testEmptyTags() {
+    public void testEmptyTags() {
         // Window title with just empty HTML tags.
         String title = "</title><script></script>";
 
@@ -166,7 +168,7 @@
     }
 
     @Test
-    void testUnicode() {
+    public void testUnicode() {
         //Window title with unicode characters.
         String title = "Testing unicode \u003cscript\u003ealert(\"Should not pop up\")\u003c/script\u003e.";
 
@@ -189,7 +191,7 @@
     }
 
     @Test
-    void testEmpty() {
+    public void testEmpty() {
         // An empty window title.
         String title = "";
         javadoc("-d", "out-empty",
@@ -204,7 +206,7 @@
     }
 
     @Test
-    void testDocTitle() {
+    public void testDocTitle() {
         // Window title with JavaScript special characters, specified with -doctitle
         String title = "Testing \"Window 'Title'\" with a \\ backslash and a / "
                 + "forward slash and a \u00e8 unicode char also a    tab and also a "
--- a/test/langtools/jdk/javadoc/doclet/testXOption/TestXOption.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testXOption/TestXOption.java	Wed Jan 02 10:21:54 2019 +0100
@@ -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
@@ -25,15 +25,17 @@
  * @test
  * @bug      8007687
  * @summary  Make sure that the -X option works properly.
- * @library ../lib
+ * @library ../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build    JavadocTester
+ * @build    javadoc.tester.*
  * @run main TestXOption
  */
 
 import java.util.*;
 import java.util.stream.*;
 
+import javadoc.tester.JavadocTester;
+
 public class TestXOption extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -42,7 +44,7 @@
     }
 
     @Test
-    void testLineLengths() {
+    public void testLineLengths() {
         javadoc("-d", "out1",
                 "-sourcepath", testSrc,
                 "-X",
@@ -62,7 +64,7 @@
     }
 
     @Test
-    void testWithHelpExtraOption() {
+    public void testWithHelpExtraOption() {
         javadoc("-d", "out1",
                 "-sourcepath", testSrc,
                 "--help-extra",
@@ -72,7 +74,7 @@
     }
 
     @Test
-    void testWithOption() {
+    public void testWithOption() {
         javadoc("-d", "out1",
                 "-sourcepath", testSrc,
                 "-X",
@@ -82,7 +84,7 @@
     }
 
     @Test
-    void testWithoutOption() {
+    public void testWithoutOption() {
         javadoc("-d", "out2",
                 "-sourcepath", testSrc,
                 testSrc("TestXOption.java"));
--- a/test/langtools/jdk/javadoc/doclet/typeAnnotations/smoke/TestSmoke.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/typeAnnotations/smoke/TestSmoke.java	Wed Jan 02 10:21:54 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 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,12 +27,14 @@
  * @summary  Smoke test for ensuring that annotations are emitted to javadoc
  *
  * @author   Mahmood Ali <mali>
- * @library  ../../lib
+ * @library  ../../../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build    JavadocTester
+ * @build    javadoc.tester.*
  * @run main TestSmoke
  */
 
+import javadoc.tester.JavadocTester;
+
 public class TestSmoke extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -41,7 +43,7 @@
     }
 
     @Test
-    void test() {
+    public void test() {
         javadoc("-d", "out",
                 "-private",
                 "-sourcepath", testSrc,
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/langtools/jdk/javadoc/lib/javadoc/tester/JavadocTester.java	Wed Jan 02 10:21:54 2019 +0100
@@ -0,0 +1,1800 @@
+/*
+ * 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
+ * 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.
+ */
+
+package javadoc.tester;
+
+import java.io.BufferedReader;
+import java.io.BufferedWriter;
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileWriter;
+import java.io.FilenameFilter;
+import java.io.InputStreamReader;
+import java.io.IOException;
+import java.io.PrintStream;
+import java.io.PrintWriter;
+import java.io.StringReader;
+import java.io.StringWriter;
+import java.lang.annotation.Annotation;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.ref.SoftReference;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.nio.charset.Charset;
+import java.nio.charset.CharsetDecoder;
+import java.nio.charset.CodingErrorAction;
+import java.nio.charset.UnsupportedCharsetException;
+import java.nio.file.FileVisitResult;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.nio.file.SimpleFileVisitor;
+import java.nio.file.attribute.BasicFileAttributes;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.EnumMap;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import java.util.TreeMap;
+import java.util.TreeSet;
+import java.util.function.Function;
+import java.util.regex.Pattern;
+import java.util.stream.Collectors;
+
+
+/**
+ * Test framework for running javadoc and performing tests on the resulting output.
+ *
+ * <p>
+ * Tests are typically written as subtypes of JavadocTester, with a main
+ * method that creates an instance of the test class and calls the runTests()
+ * method. The runTests() methods calls all the test methods declared in the class,
+ * and then calls a method to print a summary, and throw an exception if
+ * any of the test methods reported a failure.
+ *
+ * <p>
+ * Test methods are identified with a @Test annotation. They have no parameters.
+ * The name of the method is not important, but if you have more than one, it is
+ * recommended that the names be meaningful and suggestive of the test case
+ * contained therein.
+ *
+ * <p>
+ * Typically, a test method will invoke javadoc, and then perform various
+ * checks on the results. The standard checks are:
+ *
+ * <dl>
+ * <dt>checkExitCode
+ * <dd>Check the exit code returned from javadoc.
+ * <dt>checkOutput
+ * <dd>Perform a series of checks on the contents on a file or output stream
+ *     generated by javadoc.
+ *     The checks can be either that a series of strings are found or are not found.
+ * <dt>checkFiles
+ * <dd>Perform a series of checks on the files generated by javadoc.
+ *     The checks can be that a series of files are found or are not found.
+ * </dl>
+ *
+ * <pre><code>
+ *  public class MyTester extends JavadocTester {
+ *      public static void main(String... args) throws Exception {
+ *          MyTester tester = new MyTester();
+ *          tester.runTests();
+ *      }
+ *
+ *      // test methods...
+ *      @Test
+ *      void test() {
+ *          javadoc(<i>args</i>);
+ *          checkExit(Exit.OK);
+ *          checkOutput(<i>file</i>, true,
+ *              <i>strings-to-find</i>);
+ *          checkOutput(<i>file</i>, false,
+ *              <i>strings-to-not-find</i>);
+ *      }
+ *  }
+ * </code></pre>
+ *
+ * <p>
+ * If javadoc is run more than once in a test method, you can compare the
+ * results that are generated with the diff method. Since files written by
+ * javadoc typically contain a timestamp, you may want to use the -notimestamp
+ * option if you are going to compare the results from two runs of javadoc.
+ *
+ * <p>
+ * If you have many calls of checkOutput that are very similar, you can write
+ * your own check... method to reduce the amount of duplication. For example,
+ * if you want to check that many files contain the same string, you could
+ * write a method that takes a varargs list of files and calls checkOutput
+ * on each file in turn with the string to be checked.
+ *
+ * <p>
+ * You can also write you own custom check methods, which can use
+ * readFile to get the contents of a file generated by javadoc,
+ * and then use pass(...) or fail(...) to report whether the check
+ * succeeded or not.
+ *
+ * <p>
+ * You can have many separate test methods, each identified with a @Test
+ * annotation. However, you should <b>not</b> assume they will be called
+ * in the order declared in your source file.  If the order of a series
+ * of javadoc invocations is important, do that within a single method.
+ * If the invocations are independent, for better clarity, use separate
+ * test methods, each with their own set of checks on the results.
+ *
+ * @author Doug Kramer
+ * @author Jamie Ho
+ * @author Jonathan Gibbons (rewrite)
+ */
+public abstract class JavadocTester {
+
+    public static final String FS = System.getProperty("file.separator");
+    public static final String PS = System.getProperty("path.separator");
+    public static final String NL = System.getProperty("line.separator");
+    public static final Path currDir = Paths.get(".").toAbsolutePath().normalize();
+
+    public enum Output {
+        /** The name of the output stream from javadoc. */
+        OUT,
+        /** The name for any output written to System.out. */
+        STDOUT,
+        /** The name for any output written to System.err. */
+        STDERR
+    }
+
+    /** The output directory used in the most recent call of javadoc. */
+    protected File outputDir;
+
+    /** The output charset used in the most recent call of javadoc. */
+    protected Charset charset = Charset.defaultCharset();
+
+    /** The exit code of the most recent call of javadoc. */
+    private int exitCode;
+
+    /** The output generated by javadoc to the various writers and streams. */
+    private final Map<Output, String> outputMap = new EnumMap<>(Output.class);
+
+    /** A cache of file content, to avoid reading files unnecessarily. */
+    private final Map<File,SoftReference<String>> fileContentCache = new HashMap<>();
+    /** The charset used for files in the fileContentCache. */
+    private Charset fileContentCacheCharset = null;
+
+    /** Stream used for logging messages. */
+    protected final PrintStream out = System.out;
+
+    /** The directory containing the source code for the test. */
+    public static final String testSrc = System.getProperty("test.src");
+
+    /**
+     * Get the path for a source file in the test source directory.
+     * @param path the path of a file or directory in the source directory
+     * @return the full path of the specified file
+     */
+    public static String testSrc(String path) {
+        return new File(testSrc, path).getPath();
+    }
+
+    /**
+     * Alternatives for checking the contents of a directory.
+     */
+    public enum DirectoryCheck {
+        /**
+         * Check that the directory is empty.
+         */
+        EMPTY((file, name) -> true),
+        /**
+         * Check that the directory does not contain any HTML files,
+         * such as may have been generated by a prior run of javadoc
+         * using this directory.
+         * For now, the check is only performed on the top level directory.
+         */
+        NO_HTML_FILES((file, name) -> name.endsWith(".html")),
+        /**
+         * No check is performed on the directory contents.
+         */
+        NONE(null) { @Override void check(File dir) { } };
+
+        /** The filter used to detect that files should <i>not</i> be present. */
+        FilenameFilter filter;
+
+        DirectoryCheck(FilenameFilter f) {
+            filter = f;
+        }
+
+        void check(File dir) {
+            if (dir.isDirectory()) {
+                String[] contents = dir.list(filter);
+                if (contents == null)
+                    throw new Error("cannot list directory: " + dir);
+                if (contents.length > 0) {
+                    System.err.println("Found extraneous files in dir:" + dir.getAbsolutePath());
+                    for (String x : contents) {
+                        System.err.println(x);
+                    }
+                    throw new Error("directory has unexpected content: " + dir);
+                }
+            }
+        }
+    }
+
+    private DirectoryCheck outputDirectoryCheck = DirectoryCheck.EMPTY;
+
+    private boolean automaticCheckLinks = true;
+
+    /** The current subtest number. Incremented when checking(...) is called. */
+    private int numTestsRun = 0;
+
+    /** The number of subtests passed. Incremented when passed(...) is called. */
+    private int numTestsPassed = 0;
+
+    /** The current run of javadoc. Incremented when javadoc is called. */
+    private int javadocRunNum = 0;
+
+    /** The current subtest number for this run of javadoc. Incremented when checking(...) is called. */
+    private int javadocTestNum = 0;
+
+    /** Marker annotation for test methods to be invoked by runTests. */
+    @Retention(RetentionPolicy.RUNTIME)
+    public @interface Test { }
+
+    /**
+     * Run all methods annotated with @Test, followed by printSummary.
+     * Typically called on a tester object in main()
+     * @throws Exception if any errors occurred
+     */
+    public void runTests() throws Exception {
+        runTests(m -> new Object[0]);
+    }
+
+    /**
+     * Run all methods annotated with @Test, followed by printSummary.
+     * Typically called on a tester object in main()
+     * @param f a function which will be used to provide arguments to each
+     *          invoked method
+     * @throws Exception if any errors occurred
+     */
+    public void runTests(Function<Method, Object[]> f) throws Exception {
+        for (Method m: getClass().getDeclaredMethods()) {
+            Annotation a = m.getAnnotation(Test.class);
+            if (a != null) {
+                try {
+                    out.println("Running test " + m.getName());
+                    m.invoke(this, f.apply(m));
+                } catch (InvocationTargetException e) {
+                    Throwable cause = e.getCause();
+                    throw (cause instanceof Exception) ? ((Exception) cause) : e;
+                }
+                out.println();
+            }
+        }
+        printSummary();
+    }
+
+    /**
+     * Run javadoc.
+     * The output directory used by this call and the final exit code
+     * will be saved for later use.
+     * To aid the reader, it is recommended that calls to this method
+     * put each option and the arguments it takes on a separate line.
+     *
+     * Example:
+     * <pre><code>
+     *  javadoc("-d", "out",
+     *          "-sourcepath", testSrc,
+     *          "-notimestamp",
+     *          "pkg1", "pkg2", "pkg3/C.java");
+     * </code></pre>
+     *
+     * @param args the arguments to pass to javadoc
+     */
+    public void javadoc(String... args) {
+        outputMap.clear();
+        fileContentCache.clear();
+
+        javadocRunNum++;
+        javadocTestNum = 0; // reset counter for this run of javadoc
+        if (javadocRunNum == 1) {
+            out.println("Running javadoc...");
+        } else {
+            out.println("Running javadoc (run "+ javadocRunNum + ")...");
+        }
+
+        outputDir = new File(".");
+        String charsetArg = null;
+        String docencodingArg = null;
+        String encodingArg = null;
+        for (int i = 0; i < args.length - 2; i++) {
+            switch (args[i]) {
+                case "-d":
+                    outputDir = new File(args[++i]);
+                    break;
+                case "-charset":
+                    charsetArg = args[++i];
+                    break;
+                case "-docencoding":
+                    docencodingArg = args[++i];
+                    break;
+                case "-encoding":
+                    encodingArg = args[++i];
+                    break;
+            }
+        }
+
+        // The following replicates HtmlConfiguration.finishOptionSettings0
+        // and sets up the charset used to read files.
+        String cs;
+        if (docencodingArg == null) {
+            if (charsetArg == null) {
+                cs = (encodingArg == null) ? "UTF-8" : encodingArg;
+            } else {
+                cs = charsetArg;
+            }
+        } else {
+           cs = docencodingArg;
+        }
+        try {
+            charset = Charset.forName(cs);
+        } catch (UnsupportedCharsetException e) {
+            charset = Charset.defaultCharset();
+        }
+
+        out.println("args: " + Arrays.toString(args));
+//        log.setOutDir(outputDir);
+
+        outputDirectoryCheck.check(outputDir);
+
+        // This is the sole stream used by javadoc
+        WriterOutput outOut = new WriterOutput();
+
+        // These are to catch output to System.out and System.err,
+        // in case these are used instead of the primary streams
+        StreamOutput sysOut = new StreamOutput(System.out, System::setOut);
+        StreamOutput sysErr = new StreamOutput(System.err, System::setErr);
+
+        try {
+            exitCode = jdk.javadoc.internal.tool.Main.execute(args, outOut.pw);
+        } finally {
+            outputMap.put(Output.STDOUT, sysOut.close());
+            outputMap.put(Output.STDERR, sysErr.close());
+            outputMap.put(Output.OUT, outOut.close());
+        }
+
+        outputMap.forEach((name, text) -> {
+            if (!text.isEmpty()) {
+                out.println("javadoc " + name + ":");
+                out.println(text);
+            }
+        });
+
+        if (automaticCheckLinks && exitCode == Exit.OK.code && outputDir.exists()) {
+            checkLinks();
+        }
+    }
+
+    /**
+     * Set the kind of check for the initial contents of the output directory
+     * before javadoc is run.
+     * The filter should return true for files that should <b>not</b> appear.
+     * @param c the kind of check to perform
+     */
+    public void setOutputDirectoryCheck(DirectoryCheck c) {
+        outputDirectoryCheck = c;
+    }
+
+    /**
+     * Set whether or not to perform an automatic call of checkLinks.
+     */
+    public void setAutomaticCheckLinks(boolean b) {
+        automaticCheckLinks = b;
+    }
+
+    /**
+     * The exit codes returned by the javadoc tool.
+     * @see jdk.javadoc.internal.tool.Main.Result
+     */
+    public enum Exit {
+        OK(0),        // Javadoc completed with no errors.
+        ERROR(1),     // Completed but reported errors.
+        CMDERR(2),    // Bad command-line arguments
+        SYSERR(3),    // System error or resource exhaustion.
+        ABNORMAL(4);  // Javadoc terminated abnormally
+
+        Exit(int code) {
+            this.code = code;
+        }
+
+        final int code;
+
+        @Override
+        public String toString() {
+            return name() + '(' + code + ')';
+        }
+    }
+
+    /**
+     * Check the exit code of the most recent call of javadoc.
+     *
+     * @param expected the exit code that is required for the test
+     * to pass.
+     */
+    public void checkExit(Exit expected) {
+        checking("check exit code");
+        if (exitCode == expected.code) {
+            passed("return code " + exitCode);
+        } else {
+            failed("return code " + exitCode +"; expected " + expected);
+        }
+    }
+
+    /**
+     * Check for content in (or not in) the generated output.
+     * Within the search strings, the newline character \n
+     * will be translated to the platform newline character sequence.
+     * @param path a path within the most recent output directory
+     *  or the name of one of the output buffers, identifying
+     *  where to look for the search strings.
+     * @param expectedFound true if all of the search strings are expected
+     *  to be found, or false if the file is not expected to be found
+     * @param strings the strings to be searched for
+     */
+    public void checkFileAndOutput(String path, boolean expectedFound, String... strings) {
+        if (expectedFound) {
+            checkOutput(path, true, strings);
+        } else {
+            checkFiles(false, path);
+        }
+    }
+
+    /**
+     * Check for content in (or not in) the generated output.
+     * Within the search strings, the newline character \n
+     * will be translated to the platform newline character sequence.
+     * @param path a path within the most recent output directory, identifying
+     *  where to look for the search strings.
+     * @param expectedFound true if all of the search strings are expected
+     *  to be found, or false if all of the strings are expected to be
+     *  not found
+     * @param strings the strings to be searched for
+     */
+    public void checkOutput(String path, boolean expectedFound, String... strings) {
+        // Read contents of file
+        try {
+            String fileString = readFile(outputDir, path);
+            checkOutput(new File(outputDir, path).getPath(), fileString, expectedFound, strings);
+        } catch (Error e) {
+            checking("Read file");
+            failed("Error reading file: " + e);
+        }
+    }
+
+    /**
+     * Check for content in (or not in) the one of the output streams written by
+     * javadoc. Within the search strings, the newline character \n
+     * will be translated to the platform newline character sequence.
+     * @param output the output stream to check
+     * @param expectedFound true if all of the search strings are expected
+     *  to be found, or false if all of the strings are expected to be
+     *  not found
+     * @param strings the strings to be searched for
+     */
+    public void checkOutput(Output output, boolean expectedFound, String... strings) {
+        checkOutput(output.toString(), outputMap.get(output), expectedFound, strings);
+    }
+
+    // NOTE: path may be the name of an Output stream as well as a file path
+    private void checkOutput(String path, String fileString, boolean expectedFound, String... strings) {
+        for (String stringToFind : strings) {
+//            log.logCheckOutput(path, expectedFound, stringToFind);
+            checking("checkOutput");
+            // Find string in file's contents
+            boolean isFound = findString(fileString, stringToFind);
+            if (isFound == expectedFound) {
+                passed(path + ": following text " + (isFound ? "found:" : "not found:") + "\n"
+                        + stringToFind);
+            } else {
+                failed(path + ": following text " + (isFound ? "found:" : "not found:") + "\n"
+                        + stringToFind + '\n' +
+                        "found \n" +
+                        fileString);
+            }
+        }
+    }
+
+    public void checkLinks() {
+        checking("Check links");
+        LinkChecker c = new LinkChecker(out, this::readFile);
+        try {
+            c.checkDirectory(outputDir.toPath());
+            c.report();
+            int errors = c.getErrorCount();
+            if (errors == 0) {
+                passed("Links are OK");
+            } else {
+                failed(errors + " errors found when checking links");
+            }
+        } catch (IOException e) {
+            failed("exception thrown when reading files: " + e);
+        }
+    }
+
+    /**
+     * Get the content of the one of the output streams written by javadoc.
+     * @param output the name of the output stream
+     * @return the content of the output stream
+     */
+    public String getOutput(Output output) {
+        return outputMap.get(output);
+    }
+
+    /**
+     * Get the content of the one of the output streams written by javadoc.
+     * @param output the name of the output stream
+     * @return the content of the output stream, as a line of lines
+     */
+    public List<String> getOutputLines(Output output) {
+        String text = outputMap.get(output);
+        return (text == null) ? Collections.emptyList() : Arrays.asList(text.split(NL));
+    }
+
+    /**
+     * Check for files in (or not in) the generated output.
+     * @param expectedFound true if all of the files are expected
+     *  to be found, or false if all of the files are expected to be
+     *  not found
+     * @param paths the files to check, within the most recent output directory.
+     * */
+    public void checkFiles(boolean expectedFound, String... paths) {
+        checkFiles(expectedFound, Arrays.asList(paths));
+    }
+
+    /**
+     * Check for files in (or not in) the generated output.
+     * @param expectedFound true if all of the files are expected
+     *  to be found, or false if all of the files are expected to be
+     *  not found
+     * @param paths the files to check, within the most recent output directory.
+     * */
+    public void checkFiles(boolean expectedFound, Collection<String> paths) {
+        for (String path: paths) {
+//            log.logCheckFile(path, expectedFound);
+            checking("checkFile");
+            File file = new File(outputDir, path);
+            boolean isFound = file.exists();
+            if (isFound == expectedFound) {
+                passed(file, "file " + (isFound ? "found:" : "not found:") + "\n");
+            } else {
+                failed(file, "file " + (isFound ? "found:" : "not found:") + "\n");
+            }
+        }
+    }
+
+    /**
+     * Check that a series of strings are found in order in a file in
+     * the generated output.
+     * @param path the file to check
+     * @param strings  the strings whose order to check
+     */
+    public void checkOrder(String path, String... strings) {
+        File file = new File(outputDir, path);
+        String fileString = readOutputFile(path);
+        int prevIndex = -1;
+        for (String s : strings) {
+            s = s.replace("\n", NL); // normalize new lines
+            int currentIndex = fileString.indexOf(s, prevIndex + 1);
+            checking("file: " + file + ": " + s + " at index " + currentIndex);
+            if (currentIndex == -1) {
+                failed(file, s + " not found.");
+                continue;
+            }
+            if (currentIndex > prevIndex) {
+                passed(file, s + " is in the correct order");
+            } else {
+                failed(file, s + " is in the wrong order.");
+            }
+            prevIndex = currentIndex;
+        }
+    }
+
+    /**
+     * Ensures that a series of strings appear only once, in the generated output,
+     * noting that, this test does not exhaustively check for all other possible
+     * duplicates once one is found.
+     * @param path the file to check
+     * @param strings ensure each are unique
+     */
+    public void checkUnique(String path, String... strings) {
+        File file = new File(outputDir, path);
+        String fileString = readOutputFile(path);
+        for (String s : strings) {
+            int currentIndex = fileString.indexOf(s);
+            checking(s + " at index " + currentIndex);
+            if (currentIndex == -1) {
+                failed(file, s + " not found.");
+                continue;
+            }
+            int nextindex = fileString.indexOf(s, currentIndex + s.length());
+            if (nextindex == -1) {
+                passed(file, s + " is unique");
+            } else {
+                failed(file, s + " is not unique, found at " + nextindex);
+            }
+        }
+    }
+
+    /**
+     * Compare a set of files in each of two directories.
+     *
+     * @param baseDir1 the directory containing the first set of files
+     * @param baseDir2 the directory containing the second set of files
+     * @param files the set of files to be compared
+     */
+    public void diff(String baseDir1, String baseDir2, String... files) {
+        File bd1 = new File(baseDir1);
+        File bd2 = new File(baseDir2);
+        for (String file : files) {
+            diff(bd1, bd2, file);
+        }
+    }
+
+    /**
+     * A utility to copy a directory from one place to another.
+     *
+     * @param targetDir the directory to copy.
+     * @param destDir the destination to copy the directory to.
+     */
+    // TODO: convert to using java.nio.Files.walkFileTree
+    public void copyDir(String targetDir, String destDir) {
+        try {
+            File targetDirObj = new File(targetDir);
+            File destDirParentObj = new File(destDir);
+            File destDirObj = new File(destDirParentObj, targetDirObj.getName());
+            if (! destDirParentObj.exists()) {
+                destDirParentObj.mkdir();
+            }
+            if (! destDirObj.exists()) {
+                destDirObj.mkdir();
+            }
+            String[] files = targetDirObj.list();
+            for (String file : files) {
+                File srcFile = new File(targetDirObj, file);
+                File destFile = new File(destDirObj, file);
+                if (srcFile.isFile()) {
+                    out.println("Copying " + srcFile + " to " + destFile);
+                    copyFile(destFile, srcFile);
+                } else if(srcFile.isDirectory()) {
+                    copyDir(srcFile.getAbsolutePath(), destDirObj.getAbsolutePath());
+                }
+            }
+        } catch (IOException exc) {
+            throw new Error("Could not copy " + targetDir + " to " + destDir);
+        }
+    }
+
+    /**
+     * Copy source file to destination file.
+     *
+     * @param destfile the destination file
+     * @param srcfile the source file
+     * @throws IOException
+     */
+    public void copyFile(File destfile, File srcfile) throws IOException {
+        Files.copy(srcfile.toPath(), destfile.toPath());
+    }
+
+    /**
+     * Read a file from the output directory.
+     *
+     * @param fileName  the name of the file to read
+     * @return          the file in string format
+     */
+    public String readOutputFile(String fileName) throws Error {
+        return readFile(outputDir, fileName);
+    }
+
+    protected String readFile(String fileName) throws Error {
+        return readFile(outputDir, fileName);
+    }
+
+    protected String readFile(String baseDir, String fileName) throws Error {
+        return readFile(new File(baseDir), fileName);
+    }
+
+    private String readFile(Path file) {
+        File baseDir;
+        if (file.startsWith(outputDir.toPath())) {
+            baseDir = outputDir;
+        } else if (file.startsWith(currDir)) {
+            baseDir = currDir.toFile();
+        } else {
+            baseDir = file.getParent().toFile();
+        }
+        String fileName = baseDir.toPath().relativize(file).toString();
+        return readFile(baseDir, fileName);
+    }
+
+    /**
+     * Read the file and return it as a string.
+     *
+     * @param baseDir   the directory in which to locate the file
+     * @param fileName  the name of the file to read
+     * @return          the file in string format
+     */
+    private String readFile(File baseDir, String fileName) throws Error {
+        if (!Objects.equals(fileContentCacheCharset, charset)) {
+            fileContentCache.clear();
+            fileContentCacheCharset = charset;
+        }
+        try {
+            File file = new File(baseDir, fileName);
+            SoftReference<String> ref = fileContentCache.get(file);
+            String content = (ref == null) ? null : ref.get();
+            if (content != null)
+                return content;
+
+            // charset defaults to a value inferred from latest javadoc run
+            content = new String(Files.readAllBytes(file.toPath()), charset);
+            fileContentCache.put(file, new SoftReference<>(content));
+            return content;
+        } catch (FileNotFoundException e) {
+            throw new Error("File not found: " + fileName + ": " + e);
+        } catch (IOException e) {
+            throw new Error("Error reading file: " + fileName + ": " + e);
+        }
+    }
+
+    protected void checking(String message) {
+        numTestsRun++;
+        javadocTestNum++;
+        print("Starting subtest " + javadocRunNum + "." + javadocTestNum, message);
+    }
+
+    protected void passed(File file, String message) {
+        passed(file + ": " + message);
+    }
+
+    protected void passed(String message) {
+        numTestsPassed++;
+        print("Passed", message);
+        out.println();
+    }
+
+    protected void failed(File file, String message) {
+        failed(file + ": " + message);
+    }
+
+    protected void failed(String message) {
+        print("FAILED", message);
+        StackWalker.getInstance().walk(s -> {
+            s.dropWhile(f -> f.getMethodName().equals("failed"))
+                    .takeWhile(f -> !f.getMethodName().equals("runTests"))
+                    .forEach(f -> out.println("        at "
+                            + f.getClassName() + "." + f.getMethodName()
+                            + "(" + f.getFileName() + ":" + f.getLineNumber() + ")"));
+            return null;
+        });
+        out.println();
+    }
+
+    private void print(String prefix, String message) {
+        if (message.isEmpty())
+            out.println(prefix);
+        else {
+            out.print(prefix);
+            out.print(": ");
+            out.print(message.replace("\n", NL));
+            if (!(message.endsWith("\n") || message.endsWith(NL))) {
+                out.println();
+            }
+        }
+    }
+
+    /**
+     * Print a summary of the test results.
+     */
+    protected void printSummary() {
+        String javadocRuns = (javadocRunNum <= 1) ? ""
+                : ", in " + javadocRunNum + " runs of javadoc";
+
+        if (numTestsRun != 0 && numTestsPassed == numTestsRun) {
+            // Test passed
+            out.println();
+            out.println("All " + numTestsPassed + " subtests passed" + javadocRuns);
+        } else {
+            // Test failed
+            throw new Error((numTestsRun - numTestsPassed)
+                    + " of " + (numTestsRun)
+                    + " subtests failed"
+                    + javadocRuns);
+        }
+    }
+
+    /**
+     * Search for the string in the given file and return true
+     * if the string was found.
+     *
+     * @param fileString    the contents of the file to search through
+     * @param stringToFind  the string to search for
+     * @return              true if the string was found
+     */
+    private boolean findString(String fileString, String stringToFind) {
+        // javadoc (should) always use the platform newline sequence,
+        // but in the strings to find it is more convenient to use the Java
+        // newline character. So we translate \n to NL before we search.
+        stringToFind = stringToFind.replace("\n", NL);
+        return fileString.contains(stringToFind);
+    }
+
+    /**
+     * Compare the two given files.
+     *
+     * @param baseDir1 the directory in which to locate the first file
+     * @param baseDir2 the directory in which to locate the second file
+     * @param file the file to compare in the two base directories
+     * @param throwErrorIFNoMatch flag to indicate whether or not to throw
+     * an error if the files do not match.
+     * @return true if the files are the same and false otherwise.
+     */
+    private void diff(File baseDir1, File baseDir2, String file) {
+        String file1Contents = readFile(baseDir1, file);
+        String file2Contents = readFile(baseDir2, file);
+        checking("diff " + new File(baseDir1, file) + ", " + new File(baseDir2, file));
+        if (file1Contents.trim().compareTo(file2Contents.trim()) == 0) {
+            passed("files are equal");
+        } else {
+            failed("files differ");
+        }
+    }
+
+    /**
+     * Utility class to simplify the handling of temporarily setting a
+     * new stream for System.out or System.err.
+     */
+    private static class StreamOutput {
+        // functional interface to set a stream.
+        private interface Initializer {
+            void set(PrintStream s);
+        }
+
+        private final ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        private final PrintStream ps = new PrintStream(baos);
+        private final PrintStream prev;
+        private final Initializer init;
+
+        StreamOutput(PrintStream s, Initializer init) {
+            prev = s;
+            init.set(ps);
+            this.init = init;
+        }
+
+        String close() {
+            init.set(prev);
+            ps.close();
+            return baos.toString();
+        }
+    }
+
+    /**
+     * Utility class to simplify the handling of creating an in-memory PrintWriter.
+     */
+    private static class WriterOutput {
+        private final StringWriter sw = new StringWriter();
+        final PrintWriter pw = new PrintWriter(sw);
+        String close() {
+            pw.close();
+            return sw.toString();
+        }
+    }
+
+
+//    private final Logger log = new Logger();
+
+    //--------- Logging --------------------------------------------------------
+    //
+    // This class writes out the details of calls to checkOutput and checkFile
+    // in a canonical way, so that the resulting file can be checked against
+    // similar files from other versions of JavadocTester using the same logging
+    // facilities.
+
+    static class Logger {
+        private static final int PREFIX = 40;
+        private static final int SUFFIX = 20;
+        private static final int MAX = PREFIX + SUFFIX;
+        List<String> tests = new ArrayList<>();
+        String outDir;
+        String rootDir = rootDir();
+
+        static String rootDir() {
+            File f = new File(".").getAbsoluteFile();
+            while (!new File(f, ".hg").exists())
+                f = f.getParentFile();
+            return f.getPath();
+        }
+
+        void setOutDir(File outDir) {
+            this.outDir = outDir.getPath();
+        }
+
+        void logCheckFile(String file, boolean positive) {
+            // Strip the outdir because that will typically not be the same
+            if (file.startsWith(outDir + "/"))
+                file = file.substring(outDir.length() + 1);
+            tests.add(file + " " + positive);
+        }
+
+        void logCheckOutput(String file, boolean positive, String text) {
+            // Compress the string to be displayed in the log file
+            String simpleText = text.replaceAll("\\s+", " ").replace(rootDir, "[ROOT]");
+            if (simpleText.length() > MAX)
+                simpleText = simpleText.substring(0, PREFIX)
+                        + "..." + simpleText.substring(simpleText.length() - SUFFIX);
+            // Strip the outdir because that will typically not be the same
+            if (file.startsWith(outDir + "/"))
+                file = file.substring(outDir.length() + 1);
+            // The use of text.hashCode ensure that all of "text" is taken into account
+            tests.add(file + " " + positive + " " + text.hashCode() + " " + simpleText);
+        }
+
+        void write() {
+            // sort the log entries because the subtests may not be executed in the same order
+            tests.sort((a, b) -> a.compareTo(b));
+            try (BufferedWriter bw = new BufferedWriter(new FileWriter("tester.log"))) {
+                for (String t: tests) {
+                    bw.write(t);
+                    bw.newLine();
+                }
+            } catch (IOException e) {
+                throw new Error("problem writing log: " + e);
+            }
+        }
+    }
+
+    // Support classes for checkLinks
+
+    /**
+     * A basic HTML parser. Override the protected methods as needed to get notified
+     * of significant items in any file that is read.
+     */
+    static abstract class HtmlParser {
+
+        protected final PrintStream out;
+        protected final Function<Path,String> fileReader;
+
+        private Path file;
+        private StringReader in;
+        private int ch;
+        private int lineNumber;
+        private boolean inScript;
+        private boolean xml;
+
+        HtmlParser(PrintStream out, Function<Path,String> fileReader) {
+            this.out = out;
+            this.fileReader = fileReader;
+        }
+
+        /**
+         * Read a file.
+         * @param file the file to be read
+         * @throws IOException if an error occurs while reading the file
+         */
+        void read(Path file) throws IOException {
+            try (StringReader r = new StringReader(fileReader.apply(file))) {
+                this.file = file;
+                this.in = r;
+
+                startFile(file);
+                try {
+                    lineNumber = 1;
+                    xml = false;
+                    nextChar();
+
+                    while (ch != -1) {
+                        switch (ch) {
+
+                            case '<':
+                                html();
+                                break;
+
+                            default:
+                                nextChar();
+                        }
+                    }
+                } finally {
+                    endFile();
+                }
+            } catch (IOException e) {
+                error(file, lineNumber, e);
+            } catch (Throwable t) {
+                error(file, lineNumber, t);
+                t.printStackTrace(out);
+            }
+        }
+
+
+        int getLineNumber() {
+            return lineNumber;
+        }
+
+        /**
+         * Called when a file has been opened, before parsing begins.
+         * This is always the first notification when reading a file.
+         * This implementation does nothing.
+         *
+         * @param file the file
+         */
+        protected void startFile(Path file) { }
+
+        /**
+         * Called when the parser has finished reading a file.
+         * This is always the last notification when reading a file,
+         * unless any errors occur while closing the file.
+         * This implementation does nothing.
+         */
+        protected void endFile() { }
+
+        /**
+         * Called when a doctype declaration is found, at the beginning of the file.
+         * This implementation does nothing.
+         * @param s the doctype declaration
+         */
+        protected void docType(String s) { }
+
+        /**
+         * Called when the opening tag of an HTML element is encountered.
+         * This implementation does nothing.
+         * @param name the name of the tag
+         * @param attrs the attribute
+         * @param selfClosing whether or not this is a self-closing tag
+         */
+        protected void startElement(String name, Map<String,String> attrs, boolean selfClosing) { }
+
+        /**
+         * Called when the closing tag of an HTML tag is encountered.
+         * This implementation does nothing.
+         * @param name the name of the tag
+         */
+        protected void endElement(String name) { }
+
+        /**
+         * Called when an error has been encountered.
+         * @param file the file being read
+         * @param lineNumber the line number of line containing the error
+         * @param message a description of the error
+         */
+        protected void error(Path file, int lineNumber, String message) {
+            out.println(file + ":" + lineNumber + ": " + message);
+        }
+
+        /**
+         * Called when an exception has been encountered.
+         * @param file the file being read
+         * @param lineNumber the line number of the line being read when the exception was found
+         * @param t the exception
+         */
+        protected void error(Path file, int lineNumber, Throwable t) {
+            out.println(file + ":" + lineNumber + ": " + t);
+        }
+
+        private void nextChar() throws IOException {
+            ch = in.read();
+            if (ch == '\n')
+                lineNumber++;
+        }
+
+        /**
+         * Read the start or end of an HTML tag, or an HTML comment
+         * {@literal <identifier attrs> } or {@literal </identifier> }
+         * @throws java.io.IOException if there is a problem reading the file
+         */
+        private void html() throws IOException {
+            nextChar();
+            if (isIdentifierStart((char) ch)) {
+                String name = readIdentifier().toLowerCase(Locale.US);
+                Map<String,String> attrs = htmlAttrs();
+                if (attrs != null) {
+                    boolean selfClosing = false;
+                    if (ch == '/') {
+                        nextChar();
+                        selfClosing = true;
+                    }
+                    if (ch == '>') {
+                        nextChar();
+                        startElement(name, attrs, selfClosing);
+                        if (name.equals("script")) {
+                            inScript = true;
+                        }
+                        return;
+                    }
+                }
+            } else if (ch == '/') {
+                nextChar();
+                if (isIdentifierStart((char) ch)) {
+                    String name = readIdentifier().toLowerCase(Locale.US);
+                    skipWhitespace();
+                    if (ch == '>') {
+                        nextChar();
+                        endElement(name);
+                        if (name.equals("script")) {
+                            inScript = false;
+                        }
+                        return;
+                    }
+                }
+            } else if (ch == '!') {
+                nextChar();
+                if (ch == '-') {
+                    nextChar();
+                    if (ch == '-') {
+                        nextChar();
+                        while (ch != -1) {
+                            int dash = 0;
+                            while (ch == '-') {
+                                dash++;
+                                nextChar();
+                            }
+                            // Strictly speaking, a comment should not contain "--"
+                            // so dash > 2 is an error, dash == 2 implies ch == '>'
+                            // See http://www.w3.org/TR/html-markup/syntax.html#syntax-comments
+                            // for more details.
+                            if (dash >= 2 && ch == '>') {
+                                nextChar();
+                                return;
+                            }
+
+                            nextChar();
+                        }
+                    }
+                } else if (ch == '[') {
+                    nextChar();
+                    if (ch == 'C') {
+                        nextChar();
+                        if (ch == 'D') {
+                            nextChar();
+                            if (ch == 'A') {
+                                nextChar();
+                                if (ch == 'T') {
+                                    nextChar();
+                                    if (ch == 'A') {
+                                        nextChar();
+                                        if (ch == '[') {
+                                            while (true) {
+                                                nextChar();
+                                                if (ch == ']') {
+                                                    nextChar();
+                                                    if (ch == ']') {
+                                                        nextChar();
+                                                        if (ch == '>') {
+                                                            nextChar();
+                                                            return;
+                                                        }
+                                                    }
+                                                }
+                                            }
+
+                                        }
+                                    }
+                                }
+                            }
+                        }
+                    }
+                } else {
+                    StringBuilder sb = new StringBuilder();
+                    while (ch != -1 && ch != '>') {
+                        sb.append((char) ch);
+                        nextChar();
+                    }
+                    Pattern p = Pattern.compile("(?is)doctype\\s+html\\s?.*");
+                    String s = sb.toString();
+                    if (p.matcher(s).matches()) {
+                        docType(s);
+                        return;
+                    }
+                }
+            } else if (ch == '?') {
+                nextChar();
+                if (ch == 'x') {
+                    nextChar();
+                    if (ch == 'm') {
+                        nextChar();
+                        if (ch == 'l') {
+                            Map<String,String> attrs = htmlAttrs();
+                            if (ch == '?') {
+                                nextChar();
+                                if (ch == '>') {
+                                    nextChar();
+                                    xml = true;
+                                    return;
+                                }
+                            }
+                        }
+                    }
+
+                }
+            }
+
+            if (!inScript) {
+                error(file, lineNumber, "bad html");
+            }
+        }
+
+        /**
+         * Read a series of HTML attributes, terminated by {@literal > }.
+         * Each attribute is of the form {@literal identifier[=value] }.
+         * "value" may be unquoted, single-quoted, or double-quoted.
+         */
+        private Map<String,String> htmlAttrs() throws IOException {
+            Map<String, String> map = new LinkedHashMap<>();
+            skipWhitespace();
+
+            loop:
+            while (isIdentifierStart((char) ch)) {
+                String name = readAttributeName().toLowerCase(Locale.US);
+                skipWhitespace();
+                String value = null;
+                if (ch == '=') {
+                    nextChar();
+                    skipWhitespace();
+                    if (ch == '\'' || ch == '"') {
+                        char quote = (char) ch;
+                        nextChar();
+                        StringBuilder sb = new StringBuilder();
+                        while (ch != -1 && ch != quote) {
+                            sb.append((char) ch);
+                            nextChar();
+                        }
+                        value = sb.toString() // hack to replace common entities
+                                .replace("&lt;", "<")
+                                .replace("&gt;", ">")
+                                .replace("&amp;", "&");
+                        nextChar();
+                    } else {
+                        StringBuilder sb = new StringBuilder();
+                        while (ch != -1 && !isUnquotedAttrValueTerminator((char) ch)) {
+                            sb.append((char) ch);
+                            nextChar();
+                        }
+                        value = sb.toString();
+                    }
+                    skipWhitespace();
+                }
+                map.put(name, value);
+            }
+
+            return map;
+        }
+
+        private boolean isIdentifierStart(char ch) {
+            return Character.isUnicodeIdentifierStart(ch);
+        }
+
+        private String readIdentifier() throws IOException {
+            StringBuilder sb = new StringBuilder();
+            sb.append((char) ch);
+            nextChar();
+            while (ch != -1 && Character.isUnicodeIdentifierPart(ch)) {
+                sb.append((char) ch);
+                nextChar();
+            }
+            return sb.toString();
+        }
+
+        private String readAttributeName() throws IOException {
+            StringBuilder sb = new StringBuilder();
+            sb.append((char) ch);
+            nextChar();
+            while (ch != -1 && Character.isUnicodeIdentifierPart(ch)
+                    || ch == '-'
+                    || xml && ch == ':') {
+                sb.append((char) ch);
+                nextChar();
+            }
+            return sb.toString();
+        }
+
+        private boolean isWhitespace(char ch) {
+            return Character.isWhitespace(ch);
+        }
+
+        private void skipWhitespace() throws IOException {
+            while (isWhitespace((char) ch)) {
+                nextChar();
+            }
+        }
+
+        private boolean isUnquotedAttrValueTerminator(char ch) {
+            switch (ch) {
+                case '\f': case '\n': case '\r': case '\t':
+                case ' ':
+                case '"': case '\'': case '`':
+                case '=': case '<': case '>':
+                    return true;
+                default:
+                    return false;
+            }
+        }
+    }
+
+    /**
+     * A class to check the links in a set of HTML files.
+     */
+    static class LinkChecker extends HtmlParser {
+        private final Map<Path, IDTable> allFiles;
+        private final Map<URI, IDTable> allURIs;
+
+        private int files;
+        private int links;
+        private int badSchemes;
+        private int duplicateIds;
+        private int missingIds;
+
+        private Path currFile;
+        private IDTable currTable;
+        private boolean html5;
+        private boolean xml;
+
+        private int errors;
+
+        LinkChecker(PrintStream out, Function<Path,String> fileReader) {
+            super(out, fileReader);
+            allFiles = new HashMap<>();
+            allURIs = new HashMap<>();
+        }
+
+        void checkDirectory(Path dir) throws IOException {
+            checkFiles(List.of(dir), false, Collections.emptySet());
+        }
+
+        void checkFiles(List<Path> files, boolean skipSubdirs, Set<Path> excludeFiles) throws IOException {
+            for (Path file : files) {
+                Files.walkFileTree(file, new SimpleFileVisitor<Path>() {
+                    int depth = 0;
+
+                    @Override
+                    public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) {
+                        if ((skipSubdirs && depth > 0) || excludeFiles.contains(dir)) {
+                            return FileVisitResult.SKIP_SUBTREE;
+                        }
+                        depth++;
+                        return FileVisitResult.CONTINUE;
+                    }
+
+                    @Override
+                    public FileVisitResult visitFile(Path p, BasicFileAttributes attrs) {
+                        if (excludeFiles.contains(p)) {
+                            return FileVisitResult.CONTINUE;
+                        }
+
+                        if (Files.isRegularFile(p) && p.getFileName().toString().endsWith(".html")) {
+                            checkFile(p);
+                        }
+                        return FileVisitResult.CONTINUE;
+                    }
+
+                    @Override
+                    public FileVisitResult postVisitDirectory(Path dir, IOException e) throws IOException {
+                        depth--;
+                        return super.postVisitDirectory(dir, e);
+                    }
+                });
+            }
+        }
+
+        void checkFile(Path file) {
+            try {
+                read(file);
+            } catch (IOException e) {
+                error(file, 0, e);
+            }
+        }
+
+        int getErrorCount() {
+            return errors;
+        }
+
+        public void report() {
+            List<Path> missingFiles = getMissingFiles();
+            if (!missingFiles.isEmpty()) {
+                report("Missing files: (" + missingFiles.size() + ")");
+                missingFiles.stream()
+                        .sorted()
+                        .forEach(this::reportMissingFile);
+
+            }
+
+            if (!allURIs.isEmpty()) {
+                report(false, "External URLs:");
+                allURIs.keySet().stream()
+                        .sorted(new URIComparator())
+                        .forEach(uri -> report(false, "  %s", uri.toString()));
+            }
+
+            int anchors = 0;
+            for (IDTable t : allFiles.values()) {
+                anchors += t.map.values().stream()
+                        .filter(e -> !e.getReferences().isEmpty())
+                        .count();
+            }
+            for (IDTable t : allURIs.values()) {
+                anchors += t.map.values().stream()
+                        .filter(e -> !e.references.isEmpty())
+                        .count();
+            }
+
+            report(false, "Checked " + files + " files.");
+            report(false, "Found " + links + " references to " + anchors + " anchors "
+                    + "in " + allFiles.size() + " files and " + allURIs.size() + " other URIs.");
+            report(!missingFiles.isEmpty(),   "%6d missing files", missingFiles.size());
+            report(duplicateIds > 0, "%6d duplicate ids", duplicateIds);
+            report(missingIds > 0,   "%6d missing ids", missingIds);
+
+            Map<String, Integer> schemeCounts = new TreeMap<>();
+            Map<String, Integer> hostCounts = new TreeMap<>(new HostComparator());
+            for (URI uri : allURIs.keySet()) {
+                String scheme = uri.getScheme();
+                if (scheme != null) {
+                    schemeCounts.put(scheme, schemeCounts.computeIfAbsent(scheme, s -> 0) + 1);
+                }
+                String host = uri.getHost();
+                if (host != null) {
+                    hostCounts.put(host, hostCounts.computeIfAbsent(host, h -> 0) + 1);
+                }
+            }
+
+            if (schemeCounts.size() > 0) {
+                report(false, "Schemes");
+                schemeCounts.forEach((s, n) -> report(!isSchemeOK(s), "%6d %s", n, s));
+            }
+
+            if (hostCounts.size() > 0) {
+                report(false, "Hosts");
+                hostCounts.forEach((h, n) -> report(false, "%6d %s", n, h));
+            }
+        }
+
+        private void report(String message, Object... args) {
+            out.println(String.format(message, args));
+        }
+
+        private void report(boolean highlight, String message, Object... args) {
+            out.print(highlight ? "* " : "  ");
+            out.println(String.format(message, args));
+        }
+
+        private void reportMissingFile(Path file) {
+            report("%s", relativePath(file));
+            IDTable table = allFiles.get(file);
+            Set<Path> refs = new TreeSet<>();
+            for (ID id : table.map.values()) {
+                if (id.references != null) {
+                    for (Position p : id.references) {
+                        refs.add(p.path);
+                    }
+                }
+            }
+            int n = 0;
+            int MAX_REFS = 10;
+            for (Path ref : refs) {
+                report("    in " + relativePath(ref));
+                if (++n == MAX_REFS) {
+                    report("    ... and %d more", refs.size() - n);
+                    break;
+                }
+            }
+        }
+
+        @Override
+        public void startFile(Path path) {
+            currFile = path.toAbsolutePath().normalize();
+            currTable = allFiles.computeIfAbsent(currFile, p -> new IDTable(p));
+            html5 = false;
+            files++;
+        }
+
+        @Override
+        public void endFile() {
+            currTable.check();
+        }
+
+        @Override
+        public void docType(String doctype) {
+            html5 = doctype.matches("(?i)<\\?doctype\\s+html>");
+        }
+
+        @Override @SuppressWarnings("fallthrough")
+        public void startElement(String name, Map<String, String> attrs, boolean selfClosing) {
+            int line = getLineNumber();
+            switch (name) {
+                case "a":
+                    String nameAttr = html5 ? null : attrs.get("name");
+                    if (nameAttr != null) {
+                        foundAnchor(line, nameAttr);
+                    }
+                    // fallthrough
+                case "link":
+                    String href = attrs.get("href");
+                    if (href != null) {
+                        foundReference(line, href);
+                    }
+                    break;
+            }
+
+            String idAttr = attrs.get("id");
+            if (idAttr != null) {
+                foundAnchor(line, idAttr);
+            }
+        }
+
+        @Override
+        public void endElement(String name) { }
+
+        private void foundAnchor(int line, String name) {
+            currTable.addID(line, name);
+        }
+
+        private void foundReference(int line, String ref) {
+            links++;
+            try {
+                URI uri = new URI(ref);
+                if (uri.isAbsolute()) {
+                    foundReference(line, uri);
+                } else {
+                    Path p;
+                    String uriPath = uri.getPath();
+                    if (uriPath == null || uriPath.isEmpty()) {
+                        p = currFile;
+                    } else {
+                        p = currFile.getParent().resolve(uriPath).normalize();
+                    }
+                    foundReference(line, p, uri.getFragment());
+                }
+            } catch (URISyntaxException e) {
+                error(currFile, line, "invalid URI: " + e);
+            }
+        }
+
+        private void foundReference(int line, Path p, String fragment) {
+            IDTable t = allFiles.computeIfAbsent(p, key -> new IDTable(key));
+            t.addReference(fragment, currFile, line);
+        }
+
+        private void foundReference(int line, URI uri) {
+            if (!isSchemeOK(uri.getScheme())) {
+                error(currFile, line, "bad scheme in URI");
+                badSchemes++;
+            }
+
+            String fragment = uri.getFragment();
+            try {
+                URI noFrag = new URI(uri.toString().replaceAll("#\\Q" + fragment + "\\E$", ""));
+                IDTable t = allURIs.computeIfAbsent(noFrag, key -> new IDTable(key.toString()));
+                t.addReference(fragment, currFile, line);
+            } catch (URISyntaxException e) {
+                throw new Error(e);
+            }
+        }
+
+        private boolean isSchemeOK(String uriScheme) {
+            if (uriScheme == null) {
+                return true;
+            }
+
+            switch (uriScheme) {
+                case "file":
+                case "ftp":
+                case "http":
+                case "https":
+                case "javascript":
+                case "mailto":
+                    return true;
+
+                default:
+                    return false;
+            }
+        }
+
+        private List<Path> getMissingFiles() {
+            return allFiles.entrySet().stream()
+                    .filter(e -> !Files.exists(e.getKey()))
+                    .map(e -> e.getKey())
+                    .collect(Collectors.toList());
+        }
+
+        @Override
+        protected void error(Path file, int lineNumber, String message) {
+            super.error(relativePath(file), lineNumber, message);
+            errors++;
+        }
+
+        @Override
+        protected void error(Path file, int lineNumber, Throwable t) {
+            super.error(relativePath(file), lineNumber, t);
+            errors++;
+        }
+
+        private Path relativePath(Path path) {
+            return path.startsWith(currDir) ? currDir.relativize(path) : path;
+        }
+
+        /**
+         * A position in a file, as identified by a file name and line number.
+         */
+        static class Position implements Comparable<Position> {
+            Path path;
+            int line;
+
+            Position(Path path, int line) {
+                this.path = path;
+                this.line = line;
+            }
+
+            @Override
+            public int compareTo(Position o) {
+                int v = path.compareTo(o.path);
+                return v != 0 ? v : Integer.compare(line, o.line);
+            }
+
+            @Override
+            public boolean equals(Object obj) {
+                if (this == obj) {
+                    return true;
+                } else if (obj == null || getClass() != obj.getClass()) {
+                    return false;
+                } else {
+                    final Position other = (Position) obj;
+                    return Objects.equals(this.path, other.path)
+                            && this.line == other.line;
+                }
+            }
+
+            @Override
+            public int hashCode() {
+                return Objects.hashCode(path) * 37 + line;
+            }
+        }
+
+        /**
+         * Infor for an ID within an HTML file, and a set of positions that reference it.
+         */
+        static class ID {
+            boolean declared;
+            Set<Position> references;
+
+            Set<Position> getReferences() {
+                return (references) == null ? Collections.emptySet() : references;
+            }
+        }
+
+        /**
+         * A table for the set of IDs in an HTML file.
+         */
+        class IDTable {
+            private String name;
+            private boolean checked;
+            private final Map<String, ID> map = new HashMap<>();
+
+            IDTable(Path p) {
+                this(relativePath(p).toString());
+            }
+
+            IDTable(String name) {
+                this.name = name;
+            }
+
+            void addID(int line, String name) {
+                if (checked) {
+                    throw new IllegalStateException("Adding ID after file has been read");
+                }
+                Objects.requireNonNull(name);
+                ID id = map.computeIfAbsent(name, x -> new ID());
+                if (id.declared) {
+                    error(currFile, line, "name already declared: " + name);
+                    duplicateIds++;
+                } else {
+                    id.declared = true;
+                }
+            }
+
+            void addReference(String name, Path from, int line) {
+                if (checked) {
+                    if (name != null) {
+                        ID id = map.get(name);
+                        if (id == null || !id.declared) {
+                            error(from, line, "id not found: " + this.name + "#" + name);
+                        }
+                    }
+                } else {
+                    ID id = map.computeIfAbsent(name, x -> new ID());
+                    if (id.references == null) {
+                        id.references = new TreeSet<>();
+                    }
+                    id.references.add(new Position(from, line));
+                }
+            }
+
+            void check() {
+                map.forEach((name, id) -> {
+                    if (name != null && !id.declared) {
+                        //log.error(currFile, 0, "id not declared: " + name);
+                        for (Position ref : id.references) {
+                            error(ref.path, ref.line, "id not found: " + this.name + "#" + name);
+                        }
+                        missingIds++;
+                    }
+                });
+                checked = true;
+            }
+        }
+
+        static class URIComparator implements Comparator<URI> {
+            final HostComparator hostComparator = new HostComparator();
+
+            @Override
+            public int compare(URI o1, URI o2) {
+                if (o1.isOpaque() || o2.isOpaque()) {
+                    return o1.compareTo(o2);
+                }
+                String h1 = o1.getHost();
+                String h2 = o2.getHost();
+                String s1 = o1.getScheme();
+                String s2 = o2.getScheme();
+                if (h1 == null || h1.isEmpty() || s1 == null || s1.isEmpty()
+                        || h2 == null || h2.isEmpty() || s2 == null || s2.isEmpty()) {
+                    return o1.compareTo(o2);
+                }
+                int v = hostComparator.compare(h1, h2);
+                if (v != 0) {
+                    return v;
+                }
+                v = s1.compareTo(s2);
+                if (v != 0) {
+                    return v;
+                }
+                return o1.compareTo(o2);
+            }
+        }
+
+        static class HostComparator implements Comparator<String> {
+            @Override
+            public int compare(String h1, String h2) {
+                List<String> l1 = new ArrayList<>(Arrays.asList(h1.split("\\.")));
+                Collections.reverse(l1);
+                String r1 = String.join(".", l1);
+                List<String> l2 = new ArrayList<>(Arrays.asList(h2.split("\\.")));
+                Collections.reverse(l2);
+                String r2 = String.join(".", l2);
+                return r1.compareTo(r2);
+            }
+        }
+
+    }
+}
--- a/test/langtools/tools/javac/modules/QueryBeforeEnter.java	Fri Dec 21 01:29:51 2018 -0800
+++ b/test/langtools/tools/javac/modules/QueryBeforeEnter.java	Wed Jan 02 10:21:54 2019 +0100
@@ -23,6 +23,7 @@
 
 /**
  * @test
+ * @bug 8208184
  * @summary tests for module resolution
  * @library /tools/lib
  * @modules
@@ -33,19 +34,33 @@
  */
 
 import java.io.File;
+import java.io.IOException;
 import java.io.OutputStream;
+import java.net.URI;
+import java.net.URISyntaxException;
 import java.nio.file.*;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
 import java.util.Arrays;
 import java.util.Set;
 
 import javax.annotation.processing.AbstractProcessor;
 import javax.annotation.processing.RoundEnvironment;
 import javax.annotation.processing.SupportedAnnotationTypes;
-import javax.annotation.processing.SupportedSourceVersion;
 import javax.lang.model.SourceVersion;
 import javax.lang.model.element.TypeElement;
+import javax.tools.FileObject;
+import javax.tools.ForwardingJavaFileManager;
 import javax.tools.JavaCompiler;
+import javax.tools.JavaFileManager;
+import javax.tools.JavaFileObject;
+import javax.tools.JavaFileObject.Kind;
+import javax.tools.SimpleJavaFileObject;
 import javax.tools.StandardJavaFileManager;
+import javax.tools.StandardLocation;
 import javax.tools.ToolProvider;
 
 // import com.sun.source.util.JavacTask;
@@ -427,6 +442,125 @@
 
     }
 
+    @Test
+    public void testBrokenModule(Path base) throws Exception {
+        Map<String, String> sourceFileName2Content = new HashMap<>();
+
+        sourceFileName2Content.put("module-info.java", "module test { requires unknown.; } ");
+        sourceFileName2Content.put("test/Test.java", "package test; public class Test {}");
+
+        Path out = base.resolve("out");
+
+        Files.createDirectories(out);
+
+        JavaCompiler javaCompiler = ToolProvider.getSystemJavaCompiler();
+        try (StandardJavaFileManager fm = javaCompiler.getStandardFileManager(null, null, null)) {
+            com.sun.source.util.JavacTask task =
+                (com.sun.source.util.JavacTask) javaCompiler.getTask(null,
+                                                              new TestMemoryFileManager(fm, sourceFileName2Content),
+                                                              null,
+                                                              Arrays.asList("-d", out.toString()),
+                                                              null,
+                                                              null);
+            task.getElements().getTypeElement("test.Test");
+        }
+    }
+
+    private static final class TestMemoryFileManager extends ForwardingJavaFileManager<JavaFileManager> {
+
+        private final Map<String, String> sourceFileName2Content;
+
+        public TestMemoryFileManager(JavaFileManager fileManager, Map<String, String> sourceFileName2Content) {
+            super(fileManager);
+            this.sourceFileName2Content = sourceFileName2Content;
+        }
+
+        @Override
+        public Iterable<JavaFileObject> list(Location location, String packageName, Set<Kind> kinds, boolean recurse) throws IOException {
+            if (location == StandardLocation.SOURCE_PATH) {
+                List<JavaFileObject> result = new ArrayList<>();
+                String dir = packageName.replace('.', '/') + "/";
+
+                for (Entry<String, String> e : sourceFileName2Content.entrySet()) {
+                    if (e.getKey().startsWith(dir) &&
+                        !e.getKey().substring(dir.length()).contains("/")) {
+                        try {
+                            result.add(new SourceFileObject(e.getKey(), e.getValue()));
+                        } catch (URISyntaxException ex) {
+                            throw new IOException(ex);
+                        }
+                    }
+                }
+
+                return result;
+            }
+            return super.list(location, packageName, kinds, recurse);
+        }
+
+        @Override
+        public JavaFileObject getJavaFileForInput(Location location, String className, Kind kind) throws IOException {
+            if (location == StandardLocation.SOURCE_PATH) {
+                String path = className.replace('.', '/') + ".java";
+                String code = sourceFileName2Content.get(path);
+
+                if (code == null) return null;
+
+                try {
+                    return new SourceFileObject(path, code);
+                } catch (URISyntaxException ex) {
+                    throw new IOException(ex);
+                }
+            }
+            return super.getJavaFileForInput(location, className, kind);
+        }
+
+        @Override
+        public boolean hasLocation(Location location) {
+            return super.hasLocation(location) || location == StandardLocation.SOURCE_PATH;
+        }
+
+        @Override
+        public boolean contains(Location location, FileObject fo) throws IOException {
+            if (location == StandardLocation.SOURCE_PATH) {
+                return fo instanceof SourceFileObject;
+            }
+            return super.contains(location, fo);
+        }
+
+        @Override
+        public String inferBinaryName(Location location, JavaFileObject file) {
+            if (location == StandardLocation.SOURCE_PATH) {
+                String path = ((SourceFileObject) file).path;
+                String fileName = path.substring(path.lastIndexOf('/'));
+                return fileName.substring(0, fileName.length() - ".java".length());
+            }
+            return super.inferBinaryName(location, file);
+        }
+
+    }
+
+    private static final class SourceFileObject extends SimpleJavaFileObject {
+        private final String path;
+        private final String code;
+
+        public SourceFileObject(String path, String code) throws URISyntaxException {
+            super(new URI("mem://" + path), Kind.SOURCE);
+            this.path = path;
+            this.code = code;
+        }
+
+        @Override
+        public CharSequence getCharContent(boolean ignoreEncodingErrors) throws IOException {
+            return code;
+        }
+
+        @Override
+        public boolean isNameCompatible(String simpleName, Kind kind) {
+            return path.endsWith(simpleName + kind.extension);
+        }
+
+    }
+
     private static void assertNotNull(Object actual) {
         if (actual == null) {
             throw new AssertionError("unexpected null!");