Merge jdk9-b26
authorduke
Wed, 05 Jul 2017 19:53:51 +0200
changeset 25851 cd6f4557e7fe
parent 25850 c3d78c30da05 (diff)
parent 25703 a21f9875097e (current diff)
child 25852 c0f0eddca930
child 25853 63fbc565bba5
child 25855 29d6b79146e6
child 25858 836adbf7a2cd
child 25861 cca845a10cc5
child 25864 62406a5c8345
child 25867 3d364c870c90
child 25870 b5e266a4356c
child 25873 024ed9c9ed13
child 25879 eb26234bf435
child 25887 f2a451de5953
child 25938 d1161ea75e14
child 25966 71ee1f15845e
child 26045 6f623e8e8f54
child 26052 41d18e9e45a4
child 26075 fe5794075a0b
child 26081 0387214634ac
child 26087 93e7681752f6
child 26120 0fbd39144922
Merge
--- a/.hgtags-top-repo	Wed Jul 05 19:52:35 2017 +0200
+++ b/.hgtags-top-repo	Wed Jul 05 19:53:51 2017 +0200
@@ -267,3 +267,4 @@
 8e4bdab4c362aadde2d321f968cd503a2f779e2f jdk9-b22
 88567461a2cd9b7fb431fee6440005a694df1f47 jdk9-b23
 1d4a293fbec19dc2d5790bbb2c7dd0ed8f265484 jdk9-b24
+aefd8899a8d6615fb34ba99b2e38996a7145baa8 jdk9-b25
--- a/corba/.hgtags	Wed Jul 05 19:52:35 2017 +0200
+++ b/corba/.hgtags	Wed Jul 05 19:53:51 2017 +0200
@@ -267,3 +267,4 @@
 ddc07abf4307855c0dc904cc5c96cc764023a930 jdk9-b22
 57735d66face054440a63ce99789eac5a5ee1dfd jdk9-b23
 8a44142bb7fc8118f70f91a1b97c12dfc50563ee jdk9-b24
+da08cca6b97f41b7081a3e176dcb400af6e4bb26 jdk9-b25
--- a/hotspot/.hgtags	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/.hgtags	Wed Jul 05 19:53:51 2017 +0200
@@ -427,3 +427,4 @@
 518d1fcc0799494f013e00e0a94a91b6f212d54f jdk9-b22
 dd472cdacc32e3afc7c5bfa7ef16ea0e0befb7fa jdk9-b23
 dde2d03b0ea46a27650839e3a1d212c7c1f7b4c8 jdk9-b24
+6de94e8693240cec8aae11f6b42f43433456a733 jdk9-b25
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Klass.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Klass.java	Wed Jul 05 19:53:51 2017 +0200
@@ -55,7 +55,10 @@
     layoutHelper = new IntField(type.getJIntField("_layout_helper"), 0);
     name         = type.getAddressField("_name");
     accessFlags  = new CIntField(type.getCIntegerField("_access_flags"), 0);
-    traceIDField  = type.getField("_trace_id");
+    try {
+      traceIDField  = type.getField("_trace_id");
+    } catch(Exception e) {
+    }
     subklass     = new MetadataField(type.getAddressField("_subklass"), 0);
     nextSibling  = new MetadataField(type.getAddressField("_next_sibling"), 0);
 
@@ -108,7 +111,11 @@
   public AccessFlags getAccessFlagsObj(){ return new AccessFlags(getAccessFlags());      }
   public Klass    getSubklassKlass()    { return (Klass)    subklass.getValue(this);     }
   public Klass    getNextSiblingKlass() { return (Klass)    nextSibling.getValue(this);  }
-  public long     traceID() { return traceIDField.getJLong(addr);  }
+
+  public long traceID() {
+    if (traceIDField == null) return 0;
+    return traceIDField.getJLong(addr);
+  }
 
   // computed access flags - takes care of inner classes etc.
   // This is closer to actual source level than getAccessFlags() etc.
--- a/hotspot/make/jprt.properties	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/make/jprt.properties	Wed Jul 05 19:53:51 2017 +0200
@@ -126,7 +126,7 @@
     ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-jvm98, \
     ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-jvm98_nontiered, \
     ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-scimark, \
-    ${jprt.my.solaris.sparcv9}-product-c2-runThese, \
+    ${jprt.my.solaris.sparcv9}-product-c2-runThese8, \
     ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-GCBasher_SerialGC, \
     ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-GCBasher_ParallelGC, \
     ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-GCBasher_ParNewGC, \
@@ -150,8 +150,9 @@
     ${jprt.my.solaris.x64}-{product|fastdebug}-c2-jvm98, \
     ${jprt.my.solaris.x64}-{product|fastdebug}-c2-jvm98_nontiered, \
     ${jprt.my.solaris.x64}-{product|fastdebug}-c2-scimark, \
-    ${jprt.my.solaris.x64}-product-c2-runThese, \
-    ${jprt.my.solaris.x64}-product-c2-runThese_Xcomp, \
+    ${jprt.my.solaris.x64}-product-c2-runThese8, \
+    ${jprt.my.solaris.x64}-product-c2-runThese8_Xcomp_lang, \
+    ${jprt.my.solaris.x64}-product-c2-runThese8_Xcomp_vm, \
     ${jprt.my.solaris.x64}-{product|fastdebug}-c2-GCBasher_SerialGC, \
     ${jprt.my.solaris.x64}-{product|fastdebug}-c2-GCBasher_ParallelGC, \
     ${jprt.my.solaris.x64}-{product|fastdebug}-c2-GCBasher_ParNewGC, \
@@ -175,9 +176,11 @@
     ${jprt.my.linux.i586}-{product|fastdebug}-{c1|c2}-jvm98, \
     ${jprt.my.linux.i586}-{product|fastdebug}-c2-jvm98_nontiered, \
     ${jprt.my.linux.i586}-{product|fastdebug}-{c1|c2}-scimark, \
-    ${jprt.my.linux.i586}-product-c1-runThese_Xcomp, \
-    ${jprt.my.linux.i586}-fastdebug-c1-runThese_Xshare, \
-    ${jprt.my.linux.i586}-fastdebug-c2-runThese_Xcomp, \
+    ${jprt.my.linux.i586}-product-c1-runThese8_Xcomp_lang, \
+    ${jprt.my.linux.i586}-product-c1-runThese8_Xcomp_vm, \
+    ${jprt.my.linux.i586}-fastdebug-c1-runThese8_Xshare, \
+    ${jprt.my.linux.i586}-fastdebug-c2-runThese8_Xcomp_lang, \
+    ${jprt.my.linux.i586}-fastdebug-c2-runThese8_Xcomp_vm, \
     ${jprt.my.linux.i586}-{product|fastdebug}-{c1|c2}-GCBasher_SerialGC, \
     ${jprt.my.linux.i586}-{product|fastdebug}-{c1|c2}-GCBasher_ParallelGC, \
     ${jprt.my.linux.i586}-{product|fastdebug}-{c1|c2}-GCBasher_ParNewGC, \
@@ -243,9 +246,10 @@
     ${jprt.my.windows.i586}-{product|fastdebug}-{c1|c2}-jvm98, \
     ${jprt.my.windows.i586}-{product|fastdebug}-c2-jvm98_nontiered, \
     ${jprt.my.windows.i586}-{product|fastdebug}-{c1|c2}-scimark, \
-    ${jprt.my.windows.i586}-product-{c1|c2}-runThese, \
-    ${jprt.my.windows.i586}-product-{c1|c2}-runThese_Xcomp, \
-    ${jprt.my.windows.i586}-fastdebug-c1-runThese_Xshare, \
+    ${jprt.my.windows.i586}-product-{c1|c2}-runThese8, \
+    ${jprt.my.windows.i586}-product-{c1|c2}-runThese8_Xcomp_lang, \
+    ${jprt.my.windows.i586}-product-{c1|c2}-runThese8_Xcomp_vm, \
+    ${jprt.my.windows.i586}-fastdebug-c1-runThese8_Xshare, \
     ${jprt.my.windows.i586}-{product|fastdebug}-{c1|c2}-GCBasher_SerialGC, \
     ${jprt.my.windows.i586}-{product|fastdebug}-{c1|c2}-GCBasher_ParallelGC, \
     ${jprt.my.windows.i586}-{product|fastdebug}-{c1|c2}-GCBasher_ParNewGC, \
@@ -269,8 +273,9 @@
     ${jprt.my.windows.x64}-{product|fastdebug}-c2-jvm98, \
     ${jprt.my.windows.x64}-{product|fastdebug}-c2-jvm98_nontiered, \
     ${jprt.my.windows.x64}-{product|fastdebug}-c2-scimark, \
-    ${jprt.my.windows.x64}-product-c2-runThese, \
-    ${jprt.my.windows.x64}-product-c2-runThese_Xcomp, \
+    ${jprt.my.windows.x64}-product-c2-runThese8, \
+    ${jprt.my.windows.x64}-product-c2-runThese8_Xcomp_lang, \
+    ${jprt.my.windows.x64}-product-c2-runThese8_Xcomp_vm, \
     ${jprt.my.windows.x64}-{product|fastdebug}-c2-GCBasher_SerialGC, \
     ${jprt.my.windows.x64}-{product|fastdebug}-c2-GCBasher_ParallelGC, \
     ${jprt.my.windows.x64}-{product|fastdebug}-c2-GCBasher_ParNewGC, \
--- a/hotspot/src/cpu/ppc/vm/frame_ppc.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/cpu/ppc/vm/frame_ppc.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -36,7 +36,6 @@
 #include "runtime/signature.hpp"
 #include "runtime/stubCodeGenerator.hpp"
 #include "runtime/stubRoutines.hpp"
-#include "vmreg_ppc.inline.hpp"
 #ifdef COMPILER1
 #include "c1/c1_Runtime1.hpp"
 #include "runtime/vframeArray.hpp"
@@ -155,15 +154,6 @@
   }
 }
 
-void frame::pd_gc_epilog() {
-  if (is_interpreted_frame()) {
-    // Set constant pool cache entry for interpreter.
-    Method* m = interpreter_frame_method();
-
-    *interpreter_frame_cpoolcache_addr() = m->constants()->cache();
-  }
-}
-
 bool frame::is_interpreted_frame_valid(JavaThread* thread) const {
   // Is there anything to do?
   assert(is_interpreted_frame(), "Not an interpreted frame");
--- a/hotspot/src/cpu/ppc/vm/frame_ppc.inline.hpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/cpu/ppc/vm/frame_ppc.inline.hpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2012, 2014 SAP AG. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -27,6 +27,7 @@
 #define CPU_PPC_VM_FRAME_PPC_INLINE_HPP
 
 #include "code/codeCache.hpp"
+#include "code/vmreg.inline.hpp"
 
 // Inline functions for ppc64 frames:
 
@@ -134,12 +135,12 @@
   return (intptr_t**)&istate->_locals;
 }
 
-inline intptr_t* frame::interpreter_frame_bcx_addr() const {
+inline intptr_t* frame::interpreter_frame_bcp_addr() const {
   interpreterState istate = get_interpreterState();
   return (intptr_t*)&istate->_bcp;
 }
 
-inline intptr_t* frame::interpreter_frame_mdx_addr() const {
+inline intptr_t* frame::interpreter_frame_mdp_addr() const {
   interpreterState istate = get_interpreterState();
   return (intptr_t*)&istate->_mdx;
 }
@@ -209,10 +210,10 @@
 inline intptr_t** frame::interpreter_frame_locals_addr() const {
   return (intptr_t**) &(get_ijava_state()->locals);
 }
-inline intptr_t* frame::interpreter_frame_bcx_addr() const {
+inline intptr_t* frame::interpreter_frame_bcp_addr() const {
   return (intptr_t*) &(get_ijava_state()->bcp);
 }
-inline intptr_t* frame::interpreter_frame_mdx_addr() const {
+inline intptr_t* frame::interpreter_frame_mdp_addr() const {
   return (intptr_t*) &(get_ijava_state()->mdx);
 }
 // Pointer beyond the "oldest/deepest" BasicObjectLock on stack.
--- a/hotspot/src/cpu/ppc/vm/icache_ppc.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/cpu/ppc/vm/icache_ppc.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -68,7 +68,6 @@
 }
 
 void ICacheStubGenerator::generate_icache_flush(ICache::flush_icache_stub_t* flush_icache_stub) {
-  StubCodeMark mark(this, "ICache", "flush_icache_stub");
 
   *flush_icache_stub = (ICache::flush_icache_stub_t)ICache::ppc64_flush_icache;
 
--- a/hotspot/src/cpu/ppc/vm/interpreterRT_ppc.hpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/cpu/ppc/vm/interpreterRT_ppc.hpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,6 +1,6 @@
 /*
- * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
- * Copyright 2012, 2013 SAP AG. All rights reserved.
+ * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright 2012, 2014 SAP AG. 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,6 +26,7 @@
 #ifndef CPU_PPC_VM_INTERPRETERRT_PPC_HPP
 #define CPU_PPC_VM_INTERPRETERRT_PPC_HPP
 
+#include "asm/macroAssembler.hpp"
 #include "memory/allocation.hpp"
 
 // native method calls
--- a/hotspot/src/cpu/ppc/vm/interpreter_ppc.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/cpu/ppc/vm/interpreter_ppc.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -30,6 +30,7 @@
 #include "interpreter/interpreter.hpp"
 #include "interpreter/interpreterGenerator.hpp"
 #include "interpreter/interpreterRuntime.hpp"
+#include "interpreter/interp_masm.hpp"
 #include "interpreter/templateTable.hpp"
 #include "oops/arrayOop.hpp"
 #include "oops/methodData.hpp"
--- a/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -32,6 +32,7 @@
 #include "memory/resourceArea.hpp"
 #include "prims/methodHandles.hpp"
 #include "runtime/biasedLocking.hpp"
+#include "runtime/icache.hpp"
 #include "runtime/interfaceSupport.hpp"
 #include "runtime/objectMonitor.hpp"
 #include "runtime/os.hpp"
--- a/hotspot/src/cpu/ppc/vm/ppc.ad	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/cpu/ppc/vm/ppc.ad	Wed Jul 05 19:53:51 2017 +0200
@@ -267,7 +267,7 @@
 // It's worth about 1% on SPEC geomean to get this right.
 
 // Chunk0, chunk1, and chunk2 form the MachRegisterNumbers enumeration
-// in adGlobals_ppc64.hpp which defines the <register>_num values, e.g.
+// in adGlobals_ppc.hpp which defines the <register>_num values, e.g.
 // R3_num. Therefore, R3_num may not be (and in reality is not)
 // the same as R3->encoding()! Furthermore, we cannot make any
 // assumptions on ordering, e.g. R3_num may be less than R2_num.
@@ -1632,7 +1632,7 @@
 static enum RC rc_class(OptoReg::Name reg) {
   // Return the register class for the given register. The given register
   // reg is a <register>_num value, which is an index into the MachRegisterNumbers
-  // enumeration in adGlobals_ppc64.hpp.
+  // enumeration in adGlobals_ppc.hpp.
 
   if (reg == OptoReg::Bad) return rc_bad;
 
--- a/hotspot/src/cpu/ppc/vm/register_ppc.hpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/cpu/ppc/vm/register_ppc.hpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2012, 2014 SAP AG. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -27,7 +27,6 @@
 #define CPU_PPC_VM_REGISTER_PPC_HPP
 
 #include "asm/register.hpp"
-#include "vm_version_ppc.hpp"
 
 // forward declaration
 class Address;
@@ -92,8 +91,8 @@
   inline friend Register as_Register(int encoding);
 
   // accessors
-  int      encoding()  const { assert(is_valid(), "invalid register"); return value(); }
-  VMReg    as_VMReg();
+  int encoding()  const { assert(is_valid(), "invalid register"); return value(); }
+  inline VMReg as_VMReg();
   Register successor() const { return as_Register(encoding() + 1); }
 
   // testers
@@ -208,8 +207,8 @@
   inline friend ConditionRegister as_ConditionRegister(int encoding);
 
   // accessors
-  int   encoding() const { assert(is_valid(), "invalid register"); return value(); }
-  VMReg as_VMReg();
+  int encoding() const { assert(is_valid(), "invalid register"); return value(); }
+  inline VMReg as_VMReg();
 
   // testers
   bool is_valid()       const { return  (0 <= value()        &&  value() < number_of_registers); }
@@ -264,7 +263,7 @@
 
   // accessors
   int           encoding() const { assert(is_valid(), "invalid register"); return value(); }
-  VMReg         as_VMReg();
+  inline VMReg  as_VMReg();
   FloatRegister successor() const { return as_FloatRegister(encoding() + 1); }
 
   // testers
@@ -365,7 +364,7 @@
 
   // accessors
   int             encoding()  const { assert(is_valid(), "invalid register"); return value(); }
-  VMReg           as_VMReg();
+  inline VMReg    as_VMReg();
 
   // testers
   bool is_valid()       const { return 0 <= value() && value() < number_of_registers; }
--- a/hotspot/src/cpu/ppc/vm/runtime_ppc.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/cpu/ppc/vm/runtime_ppc.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,6 +1,6 @@
 /*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
- * Copyright 2012, 2013 SAP AG. All rights reserved.
+ * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright 2012, 2014 SAP AG. 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
@@ -30,6 +30,7 @@
 #include "classfile/systemDictionary.hpp"
 #include "code/vmreg.hpp"
 #include "interpreter/interpreter.hpp"
+#include "interpreter/interp_masm.hpp"
 #include "nativeInst_ppc.hpp"
 #include "opto/runtime.hpp"
 #include "runtime/interfaceSupport.hpp"
@@ -37,7 +38,6 @@
 #include "runtime/stubRoutines.hpp"
 #include "runtime/vframeArray.hpp"
 #include "utilities/globalDefinitions.hpp"
-#include "vmreg_ppc.inline.hpp"
 #endif
 
 #define __ masm->
--- a/hotspot/src/cpu/ppc/vm/sharedRuntime_ppc.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/cpu/ppc/vm/sharedRuntime_ppc.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2012, 2014 SAP AG. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -29,16 +29,17 @@
 #include "code/icBuffer.hpp"
 #include "code/vtableStubs.hpp"
 #include "interpreter/interpreter.hpp"
+#include "interpreter/interp_masm.hpp"
 #include "oops/compiledICHolder.hpp"
 #include "prims/jvmtiRedefineClassesTrace.hpp"
 #include "runtime/sharedRuntime.hpp"
 #include "runtime/vframeArray.hpp"
 #include "vmreg_ppc.inline.hpp"
-#include "adfiles/ad_ppc_64.hpp"
 #ifdef COMPILER1
 #include "c1/c1_Runtime1.hpp"
 #endif
 #ifdef COMPILER2
+#include "adfiles/ad_ppc_64.hpp"
 #include "opto/runtime.hpp"
 #endif
 
--- a/hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2012, 2014 SAP AG. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -401,11 +401,11 @@
     __ load_const(exception_file, (void*)__FILE__);
     __ load_const(exception_line, (void*)__LINE__);
 
-    __ std(R3_ARG1, thread_(pending_exception));
+    __ std(R3_ARG1, in_bytes(JavaThread::pending_exception_offset()), R16_thread);
     // store into `char *'
-    __ std(exception_file, thread_(exception_file));
+    __ std(exception_file, in_bytes(JavaThread::exception_file_offset()), R16_thread);
     // store into `int'
-    __ stw(exception_line, thread_(exception_line));
+    __ stw(exception_line, in_bytes(JavaThread::exception_line_offset()), R16_thread);
 
     // complete return to VM
     assert(StubRoutines::_call_stub_return_address != NULL, "must have been generated before");
@@ -524,8 +524,6 @@
     int frame_size_in_bytes = frame::abi_reg_args_size;
     OopMap* map = new OopMap(frame_size_in_bytes / sizeof(jint), 0);
 
-    StubCodeMark mark(this, "StubRoutines", "throw_exception");
-
     address start = __ pc();
 
     __ save_LR_CR(R11_scratch1);
@@ -846,8 +844,6 @@
   //
   // Don't generate, rather use C++ code.
   address generate_verify_oop() {
-    StubCodeMark mark(this, "StubRoutines", "verify_oop");
-
     // this is actually a `FunctionDescriptor*'.
     address start = 0;
 
--- a/hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -30,6 +30,7 @@
 #include "interpreter/interpreter.hpp"
 #include "interpreter/interpreterGenerator.hpp"
 #include "interpreter/interpreterRuntime.hpp"
+#include "interpreter/interp_masm.hpp"
 #include "interpreter/templateTable.hpp"
 #include "oops/arrayOop.hpp"
 #include "oops/methodData.hpp"
--- a/hotspot/src/cpu/ppc/vm/templateTable_ppc_64.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/cpu/ppc/vm/templateTable_ppc_64.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -27,6 +27,7 @@
 #include "asm/macroAssembler.inline.hpp"
 #include "interpreter/interpreter.hpp"
 #include "interpreter/interpreterRuntime.hpp"
+#include "interpreter/interp_masm.hpp"
 #include "interpreter/templateInterpreter.hpp"
 #include "interpreter/templateTable.hpp"
 #include "memory/universe.inline.hpp"
--- a/hotspot/src/cpu/ppc/vm/vmreg_ppc.hpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/cpu/ppc/vm/vmreg_ppc.hpp	Wed Jul 05 19:53:51 2017 +0200
@@ -26,10 +26,28 @@
 #ifndef CPU_PPC_VM_VMREG_PPC_HPP
 #define CPU_PPC_VM_VMREG_PPC_HPP
 
-  bool is_Register();
-  Register as_Register();
+inline bool is_Register() {
+  return (unsigned int)value() < (unsigned int)ConcreteRegisterImpl::max_gpr;
+}
+
+inline bool is_FloatRegister() {
+  return value() >= ConcreteRegisterImpl::max_gpr &&
+         value() < ConcreteRegisterImpl::max_fpr;
+}
 
-  bool is_FloatRegister();
-  FloatRegister as_FloatRegister();
+inline Register as_Register() {
+  assert(is_Register() && is_even(value()), "even-aligned GPR name");
+  return ::as_Register(value()>>1);
+}
+
+inline FloatRegister as_FloatRegister() {
+  assert(is_FloatRegister() && is_even(value()), "must be");
+  return ::as_FloatRegister((value() - ConcreteRegisterImpl::max_gpr) >> 1);
+}
+
+inline bool is_concrete() {
+  assert(is_reg(), "must be");
+  return is_even(value());
+}
 
 #endif // CPU_PPC_VM_VMREG_PPC_HPP
--- a/hotspot/src/cpu/ppc/vm/vmreg_ppc.inline.hpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/cpu/ppc/vm/vmreg_ppc.inline.hpp	Wed Jul 05 19:53:51 2017 +0200
@@ -44,28 +44,5 @@
   return VMRegImpl::as_VMReg((encoding()) + ConcreteRegisterImpl::max_cnd);
 }
 
-inline bool VMRegImpl::is_Register() {
-  return (unsigned int)value() < (unsigned int)ConcreteRegisterImpl::max_gpr;
-}
-
-inline bool VMRegImpl::is_FloatRegister() {
-  return value() >= ConcreteRegisterImpl::max_gpr &&
-         value() < ConcreteRegisterImpl::max_fpr;
-}
-
-inline Register VMRegImpl::as_Register() {
-  assert(is_Register() && is_even(value()), "even-aligned GPR name");
-  return ::as_Register(value()>>1);
-}
-
-inline FloatRegister VMRegImpl::as_FloatRegister() {
-  assert(is_FloatRegister() && is_even(value()), "must be");
-  return ::as_FloatRegister((value() - ConcreteRegisterImpl::max_gpr) >> 1);
-}
-
-inline bool VMRegImpl::is_concrete() {
-  assert(is_reg(), "must be");
-  return is_even(value());
-}
 
 #endif // CPU_PPC_VM_VMREG_PPC_INLINE_HPP
--- a/hotspot/src/cpu/sparc/vm/c1_Runtime1_sparc.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/cpu/sparc/vm/c1_Runtime1_sparc.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, 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,7 +31,6 @@
 #include "oops/compiledICHolder.hpp"
 #include "oops/oop.inline.hpp"
 #include "prims/jvmtiExport.hpp"
-#include "register_sparc.hpp"
 #include "runtime/sharedRuntime.hpp"
 #include "runtime/signature.hpp"
 #include "runtime/vframeArray.hpp"
--- a/hotspot/src/cpu/sparc/vm/frame_sparc.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/cpu/sparc/vm/frame_sparc.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, 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
@@ -23,6 +23,7 @@
  */
 
 #include "precompiled.hpp"
+#include "code/codeCache.hpp"
 #include "interpreter/interpreter.hpp"
 #include "memory/resourceArea.hpp"
 #include "oops/markOop.hpp"
@@ -593,17 +594,6 @@
   return this->fp() == fp;
 }
 
-
-void frame::pd_gc_epilog() {
-  if (is_interpreted_frame()) {
-    // set constant pool cache entry for interpreter
-    Method* m = interpreter_frame_method();
-
-    *interpreter_frame_cpoolcache_addr() = m->constants()->cache();
-  }
-}
-
-
 bool frame::is_interpreted_frame_valid(JavaThread* thread) const {
 #ifdef CC_INTERP
   // Is there anything to do?
@@ -641,10 +631,10 @@
     return false;
   }
 
-  // validate bci/bcx
+  // validate bci/bcp
 
-  intptr_t  bcx    = interpreter_frame_bcx();
-  if (m->validate_bci_from_bcx(bcx) < 0) {
+  address bcp = interpreter_frame_bcp();
+  if (m->validate_bci_from_bcp(bcp) < 0) {
     return false;
   }
 
--- a/hotspot/src/cpu/sparc/vm/frame_sparc.hpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/cpu/sparc/vm/frame_sparc.hpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -78,7 +78,6 @@
 //    Lesp         first free element of expression stack
 //                 (which grows towards __higher__ addresses)
 //    Lbcp         is set to address of bytecode to execute
-//                 It is accessed in the frame under the name "bcx".
 //                 It may at times (during GC) be an index instead.
 //    Lmethod      the method being interpreted
 //    Llocals      the base pointer for accessing the locals array
--- a/hotspot/src/cpu/sparc/vm/frame_sparc.inline.hpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/cpu/sparc/vm/frame_sparc.inline.hpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, 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,6 +26,7 @@
 #define CPU_SPARC_VM_FRAME_SPARC_INLINE_HPP
 
 #include "asm/macroAssembler.hpp"
+#include "code/vmreg.inline.hpp"
 
 // Inline functions for SPARC frames:
 
@@ -98,12 +99,12 @@
   return (intptr_t**) &istate->_locals;
 }
 
-inline intptr_t* frame::interpreter_frame_bcx_addr() const {
+inline intptr_t* frame::interpreter_frame_bcp_addr() const {
   interpreterState istate = get_interpreterState();
   return (intptr_t*) &istate->_bcp;
 }
 
-inline intptr_t* frame::interpreter_frame_mdx_addr() const {
+inline intptr_t* frame::interpreter_frame_mdp_addr() const {
   interpreterState istate = get_interpreterState();
   return (intptr_t*) &istate->_mdx;
 }
@@ -165,12 +166,11 @@
   return (intptr_t**) sp_addr_at( Llocals->sp_offset_in_saved_window());
 }
 
-inline intptr_t* frame::interpreter_frame_bcx_addr() const {
-  // %%%%% reinterpreting Lbcp as a bcx
+inline intptr_t* frame::interpreter_frame_bcp_addr() const {
   return (intptr_t*) sp_addr_at( Lbcp->sp_offset_in_saved_window());
 }
 
-inline intptr_t* frame::interpreter_frame_mdx_addr() const {
+inline intptr_t* frame::interpreter_frame_mdp_addr() const {
   // %%%%% reinterpreting ImethodDataPtr as a mdx
   return (intptr_t*) sp_addr_at( ImethodDataPtr->sp_offset_in_saved_window());
 }
--- a/hotspot/src/cpu/sparc/vm/interpreterRT_sparc.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/cpu/sparc/vm/interpreterRT_sparc.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -23,6 +23,7 @@
  */
 
 #include "precompiled.hpp"
+#include "asm/macroAssembler.inline.hpp"
 #include "interpreter/interpreter.hpp"
 #include "interpreter/interpreterRuntime.hpp"
 #include "memory/allocation.inline.hpp"
--- a/hotspot/src/cpu/sparc/vm/interpreter_sparc.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/cpu/sparc/vm/interpreter_sparc.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, 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,6 +28,7 @@
 #include "interpreter/interpreter.hpp"
 #include "interpreter/interpreterGenerator.hpp"
 #include "interpreter/interpreterRuntime.hpp"
+#include "interpreter/interp_masm.hpp"
 #include "interpreter/templateTable.hpp"
 #include "oops/arrayOop.hpp"
 #include "oops/methodData.hpp"
--- a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -23,7 +23,7 @@
  */
 
 #include "precompiled.hpp"
-#include "asm/assembler.inline.hpp"
+#include "asm/macroAssembler.inline.hpp"
 #include "compiler/disassembler.hpp"
 #include "gc_interface/collectedHeap.inline.hpp"
 #include "interpreter/interpreter.hpp"
--- a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.hpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.hpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, 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
@@ -186,8 +186,7 @@
 //       the interpreter to work right
 // (These assignments must be compatible with L7_thread_cache; see above.)
 
-// Since Lbcp points into the middle of the method object,
-// it is temporarily converted into a "bcx" during GC.
+// Lbcp points into the middle of the method object.
 
 // Exception processing
 // These registers are passed into exception handlers.
--- a/hotspot/src/cpu/sparc/vm/methodHandles_sparc.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/cpu/sparc/vm/methodHandles_sparc.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,7 @@
 #include "precompiled.hpp"
 #include "asm/macroAssembler.hpp"
 #include "interpreter/interpreter.hpp"
+#include "interpreter/interp_masm.hpp"
 #include "memory/allocation.inline.hpp"
 #include "prims/methodHandles.hpp"
 
--- a/hotspot/src/cpu/sparc/vm/register_sparc.hpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/cpu/sparc/vm/register_sparc.hpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, 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,7 +26,6 @@
 #define CPU_SPARC_VM_REGISTER_SPARC_HPP
 
 #include "asm/register.hpp"
-#include "vm_version_sparc.hpp"
 
 // forward declaration
 class Address;
@@ -65,7 +64,7 @@
   friend Register as_oRegister(int number);
   friend Register as_gRegister(int number);
 
-  VMReg as_VMReg();
+  inline VMReg as_VMReg();
 
   // accessors
   int   encoding() const                              { assert(is_valid(), "invalid register"); return value(); }
@@ -234,7 +233,7 @@
   };
 
   // construction
-  VMReg as_VMReg( );
+  inline VMReg as_VMReg( );
 
   // accessors
   int encoding() const                                { assert(is_valid(), "invalid register"); return value(); }
--- a/hotspot/src/cpu/sparc/vm/sparc.ad	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/cpu/sparc/vm/sparc.ad	Wed Jul 05 19:53:51 2017 +0200
@@ -9728,7 +9728,7 @@
 
   size(4);
   ins_cost(BRANCH_COST);
-  format %{ "CWB$cmp  $op1,op2,$labl\t! compressed ptr" %}
+  format %{ "CWB$cmp  $op1,$op2,$labl\t! compressed ptr" %}
   ins_encode %{
     Label* L = $labl$$label;
     assert(__ use_cbcond(*L), "back to back cbcond");
--- a/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, 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,6 +28,7 @@
 #include "interpreter/interpreter.hpp"
 #include "interpreter/interpreterGenerator.hpp"
 #include "interpreter/interpreterRuntime.hpp"
+#include "interpreter/interp_masm.hpp"
 #include "interpreter/templateTable.hpp"
 #include "oops/arrayOop.hpp"
 #include "oops/methodData.hpp"
@@ -1785,7 +1786,7 @@
   __ verify_thread();
   // expression stack is undefined here
   // O0: exception, i.e. Oexception
-  // Lbcp: exception bcx
+  // Lbcp: exception bcp
   __ verify_oop(Oexception);
 
 
--- a/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,7 @@
 #include "precompiled.hpp"
 #include "interpreter/interpreter.hpp"
 #include "interpreter/interpreterRuntime.hpp"
+#include "interpreter/interp_masm.hpp"
 #include "interpreter/templateTable.hpp"
 #include "memory/universe.inline.hpp"
 #include "oops/methodData.hpp"
--- a/hotspot/src/cpu/sparc/vm/vmreg_sparc.hpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/cpu/sparc/vm/vmreg_sparc.hpp	Wed Jul 05 19:53:51 2017 +0200
@@ -25,10 +25,35 @@
 #ifndef CPU_SPARC_VM_VMREG_SPARC_HPP
 #define CPU_SPARC_VM_VMREG_SPARC_HPP
 
-  bool is_Register();
-  Register as_Register();
+inline bool is_Register() { return value() >= 0 && value() < ConcreteRegisterImpl::max_gpr; }
+inline bool is_FloatRegister() { return value() >= ConcreteRegisterImpl::max_gpr &&
+                                                   value() < ConcreteRegisterImpl::max_fpr; }
+inline Register as_Register() {
+
+  assert( is_Register() && is_even(value()), "even-aligned GPR name" );
+  // Yuk
+  return ::as_Register(value()>>1);
+}
 
-  bool is_FloatRegister();
-  FloatRegister as_FloatRegister();
+inline FloatRegister as_FloatRegister() {
+  assert( is_FloatRegister(), "must be" );
+  // Yuk
+  return ::as_FloatRegister( value() - ConcreteRegisterImpl::max_gpr );
+}
+
+inline   bool is_concrete() {
+  assert(is_reg(), "must be");
+  int v = value();
+  if ( v  <  ConcreteRegisterImpl::max_gpr ) {
+    return is_even(v);
+  }
+  // F0..F31
+  if ( v <= ConcreteRegisterImpl::max_gpr + 31) return true;
+  if ( v <  ConcreteRegisterImpl::max_fpr) {
+    return is_even(v);
+  }
+  assert(false, "what register?");
+  return false;
+}
 
 #endif // CPU_SPARC_VM_VMREG_SPARC_HPP
--- a/hotspot/src/cpu/sparc/vm/vmreg_sparc.inline.hpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/cpu/sparc/vm/vmreg_sparc.inline.hpp	Wed Jul 05 19:53:51 2017 +0200
@@ -33,35 +33,5 @@
 inline VMReg FloatRegisterImpl::as_VMReg() { return VMRegImpl::as_VMReg( ConcreteRegisterImpl::max_gpr + encoding() ); }
 
 
-inline bool VMRegImpl::is_Register() { return value() >= 0 && value() < ConcreteRegisterImpl::max_gpr; }
-inline bool VMRegImpl::is_FloatRegister() { return value() >= ConcreteRegisterImpl::max_gpr &&
-                                                   value() < ConcreteRegisterImpl::max_fpr; }
-inline Register VMRegImpl::as_Register() {
-
-  assert( is_Register() && is_even(value()), "even-aligned GPR name" );
-  // Yuk
-  return ::as_Register(value()>>1);
-}
-
-inline FloatRegister VMRegImpl::as_FloatRegister() {
-  assert( is_FloatRegister(), "must be" );
-  // Yuk
-  return ::as_FloatRegister( value() - ConcreteRegisterImpl::max_gpr );
-}
-
-inline   bool VMRegImpl::is_concrete() {
-  assert(is_reg(), "must be");
-  int v = value();
-  if ( v  <  ConcreteRegisterImpl::max_gpr ) {
-    return is_even(v);
-  }
-  // F0..F31
-  if ( v <= ConcreteRegisterImpl::max_gpr + 31) return true;
-  if ( v <  ConcreteRegisterImpl::max_fpr) {
-    return is_even(v);
-  }
-  assert(false, "what register?");
-  return false;
-}
 
 #endif // CPU_SPARC_VM_VMREG_SPARC_INLINE_HPP
--- a/hotspot/src/cpu/x86/vm/frame_x86.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/cpu/x86/vm/frame_x86.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -537,10 +537,6 @@
   return _fp == (fp - diff);
 }
 
-void frame::pd_gc_epilog() {
-  // nothing done here now
-}
-
 bool frame::is_interpreted_frame_valid(JavaThread* thread) const {
 // QQQ
 #ifdef CC_INTERP
@@ -577,10 +573,10 @@
     return false;
   }
 
-  // validate bci/bcx
+  // validate bci/bcp
 
-  intptr_t  bcx    = interpreter_frame_bcx();
-  if (m->validate_bci_from_bcx(bcx) < 0) {
+  address bcp = interpreter_frame_bcp();
+  if (m->validate_bci_from_bcp(bcp) < 0) {
     return false;
   }
 
@@ -692,10 +688,10 @@
     DESCRIBE_FP_OFFSET(interpreter_frame_sender_sp);
     DESCRIBE_FP_OFFSET(interpreter_frame_last_sp);
     DESCRIBE_FP_OFFSET(interpreter_frame_method);
-    DESCRIBE_FP_OFFSET(interpreter_frame_mdx);
+    DESCRIBE_FP_OFFSET(interpreter_frame_mdp);
     DESCRIBE_FP_OFFSET(interpreter_frame_cache);
     DESCRIBE_FP_OFFSET(interpreter_frame_locals);
-    DESCRIBE_FP_OFFSET(interpreter_frame_bcx);
+    DESCRIBE_FP_OFFSET(interpreter_frame_bcp);
     DESCRIBE_FP_OFFSET(interpreter_frame_initial_sp);
 #endif
   }
--- a/hotspot/src/cpu/x86/vm/frame_x86.hpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/cpu/x86/vm/frame_x86.hpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, 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
@@ -40,7 +40,7 @@
 //     ...                        | monitor block size
 //    [monitors              ]   /
 //    [monitor block size    ]
-//    [byte code index/pointr]                   = bcx()                bcx_offset
+//    [byte code pointer     ]                   = bcp()                bcp_offset
 //    [pointer to locals     ]                   = locals()             locals_offset
 //    [constant pool cache   ]                   = cache()              cache_offset
 //    [methodData            ]                   = mdp()                mdx_offset
@@ -111,11 +111,11 @@
     // outgoing sp before a call to an invoked method
     interpreter_frame_last_sp_offset                 = interpreter_frame_sender_sp_offset - 1,
     interpreter_frame_method_offset                  = interpreter_frame_last_sp_offset - 1,
-    interpreter_frame_mdx_offset                     = interpreter_frame_method_offset - 1,
-    interpreter_frame_cache_offset                   = interpreter_frame_mdx_offset - 1,
+    interpreter_frame_mdp_offset                     = interpreter_frame_method_offset - 1,
+    interpreter_frame_cache_offset                   = interpreter_frame_mdp_offset - 1,
     interpreter_frame_locals_offset                  = interpreter_frame_cache_offset - 1,
-    interpreter_frame_bcx_offset                     = interpreter_frame_locals_offset - 1,
-    interpreter_frame_initial_sp_offset              = interpreter_frame_bcx_offset - 1,
+    interpreter_frame_bcp_offset                     = interpreter_frame_locals_offset - 1,
+    interpreter_frame_initial_sp_offset              = interpreter_frame_bcp_offset - 1,
 
     interpreter_frame_monitor_block_top_offset       = interpreter_frame_initial_sp_offset,
     interpreter_frame_monitor_block_bottom_offset    = interpreter_frame_initial_sp_offset,
--- a/hotspot/src/cpu/x86/vm/frame_x86.inline.hpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/cpu/x86/vm/frame_x86.inline.hpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, 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,6 +26,7 @@
 #define CPU_X86_VM_FRAME_X86_INLINE_HPP
 
 #include "code/codeCache.hpp"
+#include "code/vmreg.inline.hpp"
 
 // Inline functions for Intel frames:
 
@@ -168,7 +169,7 @@
   return &(get_interpreterState()->_locals);
 }
 
-inline intptr_t* frame::interpreter_frame_bcx_addr() const {
+inline intptr_t* frame::interpreter_frame_bcp_addr() const {
   assert(is_interpreted_frame(), "must be interpreted");
   return (intptr_t*) &(get_interpreterState()->_bcp);
 }
@@ -188,7 +189,7 @@
   return &(get_interpreterState()->_method);
 }
 
-inline intptr_t* frame::interpreter_frame_mdx_addr() const {
+inline intptr_t* frame::interpreter_frame_mdp_addr() const {
   assert(is_interpreted_frame(), "must be interpreted");
   return (intptr_t*) &(get_interpreterState()->_mdx);
 }
@@ -210,13 +211,13 @@
   return *(intptr_t**)addr_at(interpreter_frame_last_sp_offset);
 }
 
-inline intptr_t* frame::interpreter_frame_bcx_addr() const {
-  return (intptr_t*)addr_at(interpreter_frame_bcx_offset);
+inline intptr_t* frame::interpreter_frame_bcp_addr() const {
+  return (intptr_t*)addr_at(interpreter_frame_bcp_offset);
 }
 
 
-inline intptr_t* frame::interpreter_frame_mdx_addr() const {
-  return (intptr_t*)addr_at(interpreter_frame_mdx_offset);
+inline intptr_t* frame::interpreter_frame_mdp_addr() const {
+  return (intptr_t*)addr_at(interpreter_frame_mdp_offset);
 }
 
 
--- a/hotspot/src/cpu/x86/vm/interp_masm_x86.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/cpu/x86/vm/interp_masm_x86.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, 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
@@ -134,7 +134,7 @@
         shll(tmp, exact_log2(DataLayout::cell_size));
         addptr(mdp, tmp);
       }
-      movptr(Address(rbp, frame::interpreter_frame_mdx_offset * wordSize), mdp);
+      movptr(Address(rbp, frame::interpreter_frame_mdp_offset * wordSize), mdp);
     } else {
       assert(MethodData::profile_return(), "either profile call args or call ret");
       update_mdp_by_constant(mdp, in_bytes(TypeEntriesAtCall::return_only_size()));
--- a/hotspot/src/cpu/x86/vm/interp_masm_x86_32.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/cpu/x86/vm/interp_masm_x86_32.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, 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
@@ -826,7 +826,7 @@
 // Test ImethodDataPtr.  If it is null, continue at the specified label
 void InterpreterMacroAssembler::test_method_data_pointer(Register mdp, Label& zero_continue) {
   assert(ProfileInterpreter, "must be profiling interpreter");
-  movptr(mdp, Address(rbp, frame::interpreter_frame_mdx_offset * wordSize));
+  movptr(mdp, Address(rbp, frame::interpreter_frame_mdp_offset * wordSize));
   testptr(mdp, mdp);
   jcc(Assembler::zero, zero_continue);
 }
@@ -853,7 +853,7 @@
   addptr(rbx, in_bytes(MethodData::data_offset()));
   addptr(rax, rbx);
   bind(set_mdp);
-  movptr(Address(rbp, frame::interpreter_frame_mdx_offset * wordSize), rax);
+  movptr(Address(rbp, frame::interpreter_frame_mdp_offset * wordSize), rax);
   pop(rbx);
   pop(rax);
 }
@@ -975,7 +975,7 @@
   assert(ProfileInterpreter, "must be profiling interpreter");
   Address disp_address(mdp_in, offset_of_disp);
   addptr(mdp_in,disp_address);
-  movptr(Address(rbp, frame::interpreter_frame_mdx_offset * wordSize), mdp_in);
+  movptr(Address(rbp, frame::interpreter_frame_mdp_offset * wordSize), mdp_in);
 }
 
 
@@ -983,14 +983,14 @@
   assert(ProfileInterpreter, "must be profiling interpreter");
   Address disp_address(mdp_in, reg, Address::times_1, offset_of_disp);
   addptr(mdp_in, disp_address);
-  movptr(Address(rbp, frame::interpreter_frame_mdx_offset * wordSize), mdp_in);
+  movptr(Address(rbp, frame::interpreter_frame_mdp_offset * wordSize), mdp_in);
 }
 
 
 void InterpreterMacroAssembler::update_mdp_by_constant(Register mdp_in, int constant) {
   assert(ProfileInterpreter, "must be profiling interpreter");
   addptr(mdp_in, constant);
-  movptr(Address(rbp, frame::interpreter_frame_mdx_offset * wordSize), mdp_in);
+  movptr(Address(rbp, frame::interpreter_frame_mdp_offset * wordSize), mdp_in);
 }
 
 
--- a/hotspot/src/cpu/x86/vm/interp_masm_x86_32.hpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/cpu/x86/vm/interp_masm_x86_32.hpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, 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
@@ -61,8 +61,8 @@
 
 #else
 
-  void save_bcp()                                          { movptr(Address(rbp, frame::interpreter_frame_bcx_offset * wordSize), rsi); }
-  void restore_bcp()                                       { movptr(rsi, Address(rbp, frame::interpreter_frame_bcx_offset * wordSize)); }
+  void save_bcp()                                          { movptr(Address(rbp, frame::interpreter_frame_bcp_offset * wordSize), rsi); }
+  void restore_bcp()                                       { movptr(rsi, Address(rbp, frame::interpreter_frame_bcp_offset * wordSize)); }
   void restore_locals()                                    { movptr(rdi, Address(rbp, frame::interpreter_frame_locals_offset * wordSize)); }
 
   // Helpers for runtime call arguments/results
--- a/hotspot/src/cpu/x86/vm/interp_masm_x86_64.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/cpu/x86/vm/interp_masm_x86_64.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, 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
@@ -841,7 +841,7 @@
 void InterpreterMacroAssembler::test_method_data_pointer(Register mdp,
                                                          Label& zero_continue) {
   assert(ProfileInterpreter, "must be profiling interpreter");
-  movptr(mdp, Address(rbp, frame::interpreter_frame_mdx_offset * wordSize));
+  movptr(mdp, Address(rbp, frame::interpreter_frame_mdp_offset * wordSize));
   testptr(mdp, mdp);
   jcc(Assembler::zero, zero_continue);
 }
@@ -868,7 +868,7 @@
   addptr(rbx, in_bytes(MethodData::data_offset()));
   addptr(rax, rbx);
   bind(set_mdp);
-  movptr(Address(rbp, frame::interpreter_frame_mdx_offset * wordSize), rax);
+  movptr(Address(rbp, frame::interpreter_frame_mdp_offset * wordSize), rax);
   pop(rbx);
   pop(rax);
 }
@@ -991,7 +991,7 @@
   assert(ProfileInterpreter, "must be profiling interpreter");
   Address disp_address(mdp_in, offset_of_disp);
   addptr(mdp_in, disp_address);
-  movptr(Address(rbp, frame::interpreter_frame_mdx_offset * wordSize), mdp_in);
+  movptr(Address(rbp, frame::interpreter_frame_mdp_offset * wordSize), mdp_in);
 }
 
 
@@ -1001,7 +1001,7 @@
   assert(ProfileInterpreter, "must be profiling interpreter");
   Address disp_address(mdp_in, reg, Address::times_1, offset_of_disp);
   addptr(mdp_in, disp_address);
-  movptr(Address(rbp, frame::interpreter_frame_mdx_offset * wordSize), mdp_in);
+  movptr(Address(rbp, frame::interpreter_frame_mdp_offset * wordSize), mdp_in);
 }
 
 
@@ -1009,7 +1009,7 @@
                                                        int constant) {
   assert(ProfileInterpreter, "must be profiling interpreter");
   addptr(mdp_in, constant);
-  movptr(Address(rbp, frame::interpreter_frame_mdx_offset * wordSize), mdp_in);
+  movptr(Address(rbp, frame::interpreter_frame_mdp_offset * wordSize), mdp_in);
 }
 
 
--- a/hotspot/src/cpu/x86/vm/interp_masm_x86_64.hpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/cpu/x86/vm/interp_masm_x86_64.hpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, 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
@@ -58,11 +58,11 @@
 
   // Interpreter-specific registers
   void save_bcp() {
-    movptr(Address(rbp, frame::interpreter_frame_bcx_offset * wordSize), r13);
+    movptr(Address(rbp, frame::interpreter_frame_bcp_offset * wordSize), r13);
   }
 
   void restore_bcp() {
-    movptr(r13, Address(rbp, frame::interpreter_frame_bcx_offset * wordSize));
+    movptr(r13, Address(rbp, frame::interpreter_frame_bcp_offset * wordSize));
   }
 
   void restore_locals() {
--- a/hotspot/src/cpu/x86/vm/interpreter_x86_32.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/cpu/x86/vm/interpreter_x86_32.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, 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,6 +28,7 @@
 #include "interpreter/interpreter.hpp"
 #include "interpreter/interpreterGenerator.hpp"
 #include "interpreter/interpreterRuntime.hpp"
+#include "interpreter/interp_masm.hpp"
 #include "interpreter/templateTable.hpp"
 #include "oops/arrayOop.hpp"
 #include "oops/methodData.hpp"
--- a/hotspot/src/cpu/x86/vm/interpreter_x86_64.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/cpu/x86/vm/interpreter_x86_64.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -28,6 +28,7 @@
 #include "interpreter/interpreter.hpp"
 #include "interpreter/interpreterGenerator.hpp"
 #include "interpreter/interpreterRuntime.hpp"
+#include "interpreter/interp_masm.hpp"
 #include "interpreter/templateTable.hpp"
 #include "oops/arrayOop.hpp"
 #include "oops/methodData.hpp"
--- a/hotspot/src/cpu/x86/vm/register_x86.hpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/cpu/x86/vm/register_x86.hpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, 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,7 +26,6 @@
 #define CPU_X86_VM_REGISTER_X86_HPP
 
 #include "asm/register.hpp"
-#include "vm_version_x86.hpp"
 
 class VMRegImpl;
 typedef VMRegImpl* VMReg;
@@ -59,7 +58,7 @@
   // construction
   inline friend Register as_Register(int encoding);
 
-  VMReg as_VMReg();
+  inline VMReg as_VMReg();
 
   // accessors
   int   encoding() const                         { assert(is_valid(), "invalid register"); return (intptr_t)this; }
@@ -110,9 +109,10 @@
   // construction
   inline friend FloatRegister as_FloatRegister(int encoding);
 
-  VMReg as_VMReg();
+  inline VMReg as_VMReg();
 
   // derived registers, offsets, and addresses
+
   FloatRegister successor() const                          { return as_FloatRegister(encoding() + 1); }
 
   // accessors
@@ -152,7 +152,7 @@
   // construction
   friend XMMRegister as_XMMRegister(int encoding);
 
-  VMReg as_VMReg();
+  inline VMReg as_VMReg();
 
   // derived registers, offsets, and addresses
   XMMRegister successor() const                          { return as_XMMRegister(encoding() + 1); }
--- a/hotspot/src/cpu/x86/vm/templateInterpreter_x86_32.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/cpu/x86/vm/templateInterpreter_x86_32.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, 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,6 +28,7 @@
 #include "interpreter/interpreter.hpp"
 #include "interpreter/interpreterGenerator.hpp"
 #include "interpreter/interpreterRuntime.hpp"
+#include "interpreter/interp_masm.hpp"
 #include "interpreter/templateTable.hpp"
 #include "oops/arrayOop.hpp"
 #include "oops/methodData.hpp"
@@ -51,7 +52,7 @@
 
 #ifndef CC_INTERP
 const int method_offset = frame::interpreter_frame_method_offset * wordSize;
-const int bci_offset    = frame::interpreter_frame_bcx_offset    * wordSize;
+const int bcp_offset    = frame::interpreter_frame_bcp_offset    * wordSize;
 const int locals_offset = frame::interpreter_frame_locals_offset * wordSize;
 
 //------------------------------------------------------------------------------------------------------------------------
--- a/hotspot/src/cpu/x86/vm/templateInterpreter_x86_64.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/cpu/x86/vm/templateInterpreter_x86_64.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, 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,6 +28,7 @@
 #include "interpreter/interpreter.hpp"
 #include "interpreter/interpreterGenerator.hpp"
 #include "interpreter/interpreterRuntime.hpp"
+#include "interpreter/interp_masm.hpp"
 #include "interpreter/templateTable.hpp"
 #include "oops/arrayOop.hpp"
 #include "oops/methodData.hpp"
@@ -51,7 +52,7 @@
 #ifndef CC_INTERP
 
 const int method_offset = frame::interpreter_frame_method_offset * wordSize;
-const int bci_offset    = frame::interpreter_frame_bcx_offset    * wordSize;
+const int bcp_offset    = frame::interpreter_frame_bcp_offset    * wordSize;
 const int locals_offset = frame::interpreter_frame_locals_offset * wordSize;
 
 //-----------------------------------------------------------------------------
--- a/hotspot/src/cpu/x86/vm/templateTable_x86_32.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/cpu/x86/vm/templateTable_x86_32.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, 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,6 +26,7 @@
 #include "asm/macroAssembler.hpp"
 #include "interpreter/interpreter.hpp"
 #include "interpreter/interpreterRuntime.hpp"
+#include "interpreter/interp_masm.hpp"
 #include "interpreter/templateTable.hpp"
 #include "memory/universe.inline.hpp"
 #include "oops/methodData.hpp"
--- a/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, 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,6 +26,7 @@
 #include "asm/macroAssembler.hpp"
 #include "interpreter/interpreter.hpp"
 #include "interpreter/interpreterRuntime.hpp"
+#include "interpreter/interp_masm.hpp"
 #include "interpreter/templateTable.hpp"
 #include "memory/universe.inline.hpp"
 #include "oops/methodData.hpp"
--- a/hotspot/src/cpu/x86/vm/vmreg_x86.hpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/cpu/x86/vm/vmreg_x86.hpp	Wed Jul 05 19:53:51 2017 +0200
@@ -25,13 +25,49 @@
 #ifndef CPU_X86_VM_VMREG_X86_HPP
 #define CPU_X86_VM_VMREG_X86_HPP
 
-  bool is_Register();
-  Register as_Register();
+
+
+inline bool is_Register() {
+  return (unsigned int) value() < (unsigned int) ConcreteRegisterImpl::max_gpr;
+}
+
+inline bool is_FloatRegister() {
+  return value() >= ConcreteRegisterImpl::max_gpr && value() < ConcreteRegisterImpl::max_fpr;
+}
+
+inline bool is_XMMRegister() {
+  return value() >= ConcreteRegisterImpl::max_fpr && value() < ConcreteRegisterImpl::max_xmm;
+}
+
+inline Register as_Register() {
 
-  bool is_FloatRegister();
-  FloatRegister as_FloatRegister();
+  assert( is_Register(), "must be");
+  // Yuk
+#ifdef AMD64
+  return ::as_Register(value() >> 1);
+#else
+  return ::as_Register(value());
+#endif // AMD64
+}
 
-  bool is_XMMRegister();
-  XMMRegister as_XMMRegister();
+inline FloatRegister as_FloatRegister() {
+  assert( is_FloatRegister() && is_even(value()), "must be" );
+  // Yuk
+  return ::as_FloatRegister((value() - ConcreteRegisterImpl::max_gpr) >> 1);
+}
+
+inline XMMRegister as_XMMRegister() {
+  assert( is_XMMRegister() && is_even(value()), "must be" );
+  // Yuk
+  return ::as_XMMRegister((value() - ConcreteRegisterImpl::max_fpr) >> 3);
+}
+
+inline   bool is_concrete() {
+  assert(is_reg(), "must be");
+#ifndef AMD64
+  if (is_Register()) return true;
+#endif // AMD64
+  return is_even(value());
+}
 
 #endif // CPU_X86_VM_VMREG_X86_HPP
--- a/hotspot/src/cpu/x86/vm/vmreg_x86.inline.hpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/cpu/x86/vm/vmreg_x86.inline.hpp	Wed Jul 05 19:53:51 2017 +0200
@@ -42,48 +42,4 @@
   return VMRegImpl::as_VMReg((encoding() << 3) + ConcreteRegisterImpl::max_fpr);
 }
 
-
-inline bool VMRegImpl::is_Register() {
-  return (unsigned int) value() < (unsigned int) ConcreteRegisterImpl::max_gpr;
-}
-
-inline bool VMRegImpl::is_FloatRegister() {
-  return value() >= ConcreteRegisterImpl::max_gpr && value() < ConcreteRegisterImpl::max_fpr;
-}
-
-inline bool VMRegImpl::is_XMMRegister() {
-  return value() >= ConcreteRegisterImpl::max_fpr && value() < ConcreteRegisterImpl::max_xmm;
-}
-
-inline Register VMRegImpl::as_Register() {
-
-  assert( is_Register(), "must be");
-  // Yuk
-#ifdef AMD64
-  return ::as_Register(value() >> 1);
-#else
-  return ::as_Register(value());
-#endif // AMD64
-}
-
-inline FloatRegister VMRegImpl::as_FloatRegister() {
-  assert( is_FloatRegister() && is_even(value()), "must be" );
-  // Yuk
-  return ::as_FloatRegister((value() - ConcreteRegisterImpl::max_gpr) >> 1);
-}
-
-inline XMMRegister VMRegImpl::as_XMMRegister() {
-  assert( is_XMMRegister() && is_even(value()), "must be" );
-  // Yuk
-  return ::as_XMMRegister((value() - ConcreteRegisterImpl::max_fpr) >> 3);
-}
-
-inline   bool VMRegImpl::is_concrete() {
-  assert(is_reg(), "must be");
-#ifndef AMD64
-  if (is_Register()) return true;
-#endif // AMD64
-  return is_even(value());
-}
-
 #endif // CPU_X86_VM_VMREG_X86_INLINE_HPP
--- a/hotspot/src/cpu/x86/vm/x86.ad	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/cpu/x86/vm/x86.ad	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 //
-// Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 2011, 2014, 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
@@ -487,6 +487,8 @@
 // To keep related declarations/definitions/uses close together,
 // we switch between source %{ }% and source_hpp %{ }% freely as needed.
 
+class NativeJump;
+
 class CallStubImpl {
  
   //--------------------------------------------------------------
--- a/hotspot/src/cpu/zero/vm/frame_zero.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/cpu/zero/vm/frame_zero.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2007, 2008, 2009, 2010, 2011 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -119,9 +119,6 @@
   return false;
 }
 
-void frame::pd_gc_epilog() {
-}
-
 bool frame::is_interpreted_frame_valid(JavaThread *thread) const {
   ShouldNotCallThis();
   return false;
--- a/hotspot/src/cpu/zero/vm/frame_zero.inline.hpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/cpu/zero/vm/frame_zero.inline.hpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2007, 2008, 2009, 2010 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -101,7 +101,7 @@
   return &(get_interpreterState()->_locals);
 }
 
-inline intptr_t* frame::interpreter_frame_bcx_addr() const {
+inline intptr_t* frame::interpreter_frame_bcp_addr() const {
   return (intptr_t*) &(get_interpreterState()->_bcp);
 }
 
@@ -113,7 +113,7 @@
   return &(get_interpreterState()->_method);
 }
 
-inline intptr_t* frame::interpreter_frame_mdx_addr() const {
+inline intptr_t* frame::interpreter_frame_mdp_addr() const {
   return (intptr_t*) &(get_interpreterState()->_mdx);
 }
 
--- a/hotspot/src/os/aix/vm/os_aix.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/os/aix/vm/os_aix.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -66,6 +66,7 @@
 #include "runtime/thread.inline.hpp"
 #include "runtime/threadCritical.hpp"
 #include "runtime/timer.hpp"
+#include "runtime/vm_version.hpp"
 #include "services/attachListener.hpp"
 #include "services/runtimeService.hpp"
 #include "utilities/decoder.hpp"
@@ -1213,10 +1214,6 @@
   ::abort();
 }
 
-// Unused on Aix for now.
-void os::set_error_file(const char *logfile) {}
-
-
 // This method is a copy of JDK's sysGetLastErrorString
 // from src/solaris/hpi/src/system_md.c
 
--- a/hotspot/src/os/aix/vm/os_aix.inline.hpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/os/aix/vm/os_aix.inline.hpp	Wed Jul 05 19:53:51 2017 +0200
@@ -36,9 +36,6 @@
 #include <sys/ioctl.h>
 #include <netdb.h>
 
-// Defined in the system headers included above.
-#undef rem_size
-
 inline void* os::thread_local_storage_at(int index) {
   return pthread_getspecific((pthread_key_t)index);
 }
--- a/hotspot/src/os/bsd/dtrace/generateJvmOffsets.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/os/bsd/dtrace/generateJvmOffsets.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, 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
@@ -202,11 +202,11 @@
   GEN_VALUE(OFFSET_interpreter_frame_method, 2 * pointer_size);     /* L2 in saved window */
   GEN_VALUE(OFFSET_interpreter_frame_sender_sp, 13 * pointer_size); /* I5 in saved window */
   // Fake value for consistency. It is not going to be used.
-  GEN_VALUE(OFFSET_interpreter_frame_bcx_offset, 0xFFFF);
+  GEN_VALUE(OFFSET_interpreter_frame_bcp_offset, 0xFFFF);
 #elif defined(i386) || defined(__i386) || defined(__amd64)
   GEN_VALUE(OFFSET_interpreter_frame_sender_sp, -1 * pointer_size);
   GEN_VALUE(OFFSET_interpreter_frame_method, -3 * pointer_size);
-  GEN_VALUE(OFFSET_interpreter_frame_bcx_offset, -7 * pointer_size);
+  GEN_VALUE(OFFSET_interpreter_frame_bcp_offset, -7 * pointer_size);
 #endif
 
   GEN_OFFS(Klass, _name);
--- a/hotspot/src/os/bsd/dtrace/libjvm_db.c	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/os/bsd/dtrace/libjvm_db.c	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, 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
@@ -164,7 +164,7 @@
   int32_t  SIZE_CodeCache_log2_segment;
 
   uint64_t methodPtr;
-  uint64_t bcx;
+  uint64_t bcp;
 
   Nmethod_t *N;                 /*Inlined methods support */
   Frame_t   prev_fr;
@@ -260,6 +260,9 @@
   uint64_t base;
   int err;
 
+  /* Clear *vmp now in case we jump to fail: */
+  memset(vmp, 0, sizeof(VMStructEntry));
+
   err = ps_pglobal_lookup(J->P, LIBJVM_SO, "gHotSpotVMStructs", &sym_addr);
   CHECK_FAIL(err);
   err = read_pointer(J, sym_addr, &gHotSpotVMStructs);
@@ -1068,19 +1071,9 @@
   return err;
 }
 
-int is_bci(intptr_t bcx) {
-  switch (DATA_MODEL) {
-  case PR_MODEL_LP64:
-    return ((uintptr_t) bcx) <= ((uintptr_t) MAX_METHOD_CODE_SIZE) ;
-  case PR_MODEL_ILP32:
-  default:
-    return 0 <= bcx && bcx <= MAX_METHOD_CODE_SIZE;
-  }
-}
-
 static int
 name_for_imethod(jvm_agent_t* J,
-                 uint64_t bcx,
+                 uint64_t bcp,
                  uint64_t method,
                  char *result,
                  size_t size,
@@ -1095,7 +1088,7 @@
   err = read_pointer(J, method + OFFSET_Method_constMethod, &constMethod);
   CHECK_FAIL(err);
 
-  bci = is_bci(bcx) ? bcx : bcx - (constMethod + (uint64_t) SIZE_ConstMethod);
+  bci = bcp - (constMethod + (uint64_t) SIZE_ConstMethod);
 
   if (debug)
       fprintf(stderr, "\t name_for_imethod: BEGIN: method: %#llx\n", method);
@@ -1169,7 +1162,7 @@
     if (err == PS_OK && strncmp(name, "Interpreter", 11) == 0) {
       *is_interpreted = 1;
       if (is_method(J, J->methodPtr)) {
-        return name_for_imethod(J, J->bcx, J->methodPtr, result, size, jframe);
+        return name_for_imethod(J, J->bcp, J->methodPtr, result, size, jframe);
       }
     }
 
@@ -1326,7 +1319,7 @@
   /* arguments given to read_pointer need to be worst case sized */
   uint64_t methodPtr = 0;
   uint64_t sender_sp;
-  uint64_t bcx = 0;
+  uint64_t bcp = 0;
   int is_interpreted = 0;
   int result = PS_OK;
   int err = PS_OK;
@@ -1357,7 +1350,7 @@
      * regs[R_PC] contains a CALL instruction pc offset.
      */
     pc += 8;
-    bcx          = (uintptr_t) regs[R_L1];
+    bcp          = (uintptr_t) regs[R_L1];
     methodPtr = (uintptr_t) regs[R_L2];
     sender_sp = regs[R_I5];
     if (debug > 2) {
@@ -1385,13 +1378,13 @@
     if (read_pointer(J,  fp + OFFSET_interpreter_frame_sender_sp, &sender_sp) != PS_OK) {
       sender_sp = 0;
     }
-    if (read_pointer(J,  fp + OFFSET_interpreter_frame_bcx_offset, &bcx) != PS_OK) {
-      bcx = 0;
+    if (read_pointer(J,  fp + OFFSET_interpreter_frame_bcp_offset, &bcp) != PS_OK) {
+      bcp = 0;
     }
 #endif /* i386 */
 
   J->methodPtr = methodPtr;
-  J->bcx = bcx;
+  J->bcp = bcp;
 
   /* On x86 with C2 JVM: native frame may have wrong regs[R_FP]
    * For example: JVM_SuspendThread frame poins to the top interpreted frame.
@@ -1402,7 +1395,7 @@
    */
 #ifndef X86_COMPILER2
   if (is_method(J, J->methodPtr)) {
-    result = name_for_imethod(J, bcx, J->methodPtr, name, size, jframe);
+    result = name_for_imethod(J, bcp, J->methodPtr, name, size, jframe);
     /* If the methodPtr is a method then this is highly likely to be
        an interpreter frame */
     if (result >= 0) {
@@ -1416,7 +1409,7 @@
   }
 #ifdef X86_COMPILER2
   else if (is_method(J, J->methodPtr)) {
-    result = name_for_imethod(J, bcx, J->methodPtr, name, size, jframe);
+    result = name_for_imethod(J, bcp, J->methodPtr, name, size, jframe);
     /* If the methodPtr is a method then this is highly likely to be
        an interpreter frame */
     if (result >= 0) {
--- a/hotspot/src/os/solaris/dtrace/generateJvmOffsets.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/os/solaris/dtrace/generateJvmOffsets.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -197,11 +197,11 @@
   GEN_VALUE(OFFSET_interpreter_frame_method, 2 * pointer_size);     /* L2 in saved window */
   GEN_VALUE(OFFSET_interpreter_frame_sender_sp, 13 * pointer_size); /* I5 in saved window */
   // Fake value for consistency. It is not going to be used.
-  GEN_VALUE(OFFSET_interpreter_frame_bcx_offset, 0xFFFF);
+  GEN_VALUE(OFFSET_interpreter_frame_bcp_offset, 0xFFFF);
 #elif defined(i386) || defined(__i386) || defined(__amd64)
   GEN_VALUE(OFFSET_interpreter_frame_sender_sp, -1 * pointer_size);
   GEN_VALUE(OFFSET_interpreter_frame_method, -3 * pointer_size);
-  GEN_VALUE(OFFSET_interpreter_frame_bcx_offset, -7 * pointer_size);
+  GEN_VALUE(OFFSET_interpreter_frame_bcp_offset, -7 * pointer_size);
 #endif
 
   GEN_OFFS(Klass, _name);
--- a/hotspot/src/os/solaris/dtrace/libjvm_db.c	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/os/solaris/dtrace/libjvm_db.c	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, 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
@@ -164,7 +164,7 @@
   int32_t  SIZE_CodeCache_log2_segment;
 
   uint64_t methodPtr;
-  uint64_t bcx;
+  uint64_t bcp;
 
   Nmethod_t *N;                 /*Inlined methods support */
   Frame_t   prev_fr;
@@ -260,6 +260,9 @@
   uint64_t base;
   int err;
 
+  /* Clear *vmp now in case we jump to fail: */
+  memset(vmp, 0, sizeof(VMStructEntry));
+
   err = ps_pglobal_lookup(J->P, LIBJVM_SO, "gHotSpotVMStructs", &sym_addr);
   CHECK_FAIL(err);
   err = read_pointer(J, sym_addr, &gHotSpotVMStructs);
@@ -1068,19 +1071,9 @@
   return err;
 }
 
-int is_bci(intptr_t bcx) {
-  switch (DATA_MODEL) {
-  case PR_MODEL_LP64:
-    return ((uintptr_t) bcx) <= ((uintptr_t) MAX_METHOD_CODE_SIZE) ;
-  case PR_MODEL_ILP32:
-  default:
-    return 0 <= bcx && bcx <= MAX_METHOD_CODE_SIZE;
-  }
-}
-
 static int
 name_for_imethod(jvm_agent_t* J,
-                 uint64_t bcx,
+                 uint64_t bcp,
                  uint64_t method,
                  char *result,
                  size_t size,
@@ -1095,7 +1088,7 @@
   err = read_pointer(J, method + OFFSET_Method_constMethod, &constMethod);
   CHECK_FAIL(err);
 
-  bci = is_bci(bcx) ? bcx : bcx - (constMethod + (uint64_t) SIZE_ConstMethod);
+  bci = bcp - (constMethod + (uint64_t) SIZE_ConstMethod);
 
   if (debug)
       fprintf(stderr, "\t name_for_imethod: BEGIN: method: %#llx\n", method);
@@ -1169,7 +1162,7 @@
     if (err == PS_OK && strncmp(name, "Interpreter", 11) == 0) {
       *is_interpreted = 1;
       if (is_method(J, J->methodPtr)) {
-        return name_for_imethod(J, J->bcx, J->methodPtr, result, size, jframe);
+        return name_for_imethod(J, J->bcp, J->methodPtr, result, size, jframe);
       }
     }
 
@@ -1326,7 +1319,7 @@
   /* arguments given to read_pointer need to be worst case sized */
   uint64_t methodPtr = 0;
   uint64_t sender_sp;
-  uint64_t bcx = 0;
+  uint64_t bcp = 0;
   int is_interpreted = 0;
   int result = PS_OK;
   int err = PS_OK;
@@ -1357,7 +1350,7 @@
      * regs[R_PC] contains a CALL instruction pc offset.
      */
     pc += 8;
-    bcx          = (uintptr_t) regs[R_L1];
+    bcp          = (uintptr_t) regs[R_L1];
     methodPtr = (uintptr_t) regs[R_L2];
     sender_sp = regs[R_I5];
     if (debug > 2) {
@@ -1385,13 +1378,13 @@
     if (read_pointer(J,  fp + OFFSET_interpreter_frame_sender_sp, &sender_sp) != PS_OK) {
       sender_sp = 0;
     }
-    if (read_pointer(J,  fp + OFFSET_interpreter_frame_bcx_offset, &bcx) != PS_OK) {
-      bcx = 0;
+    if (read_pointer(J,  fp + OFFSET_interpreter_frame_bcp_offset, &bcp) != PS_OK) {
+      bcp = 0;
     }
 #endif /* i386 */
 
   J->methodPtr = methodPtr;
-  J->bcx = bcx;
+  J->bcp = bcp;
 
   /* On x86 with C2 JVM: native frame may have wrong regs[R_FP]
    * For example: JVM_SuspendThread frame poins to the top interpreted frame.
@@ -1402,7 +1395,7 @@
    */
 #ifndef X86_COMPILER2
   if (is_method(J, J->methodPtr)) {
-    result = name_for_imethod(J, bcx, J->methodPtr, name, size, jframe);
+    result = name_for_imethod(J, bcp, J->methodPtr, name, size, jframe);
     /* If the methodPtr is a method then this is highly likely to be
        an interpreter frame */
     if (result >= 0) {
@@ -1416,7 +1409,7 @@
   }
 #ifdef X86_COMPILER2
   else if (is_method(J, J->methodPtr)) {
-    result = name_for_imethod(J, bcx, J->methodPtr, name, size, jframe);
+    result = name_for_imethod(J, bcp, J->methodPtr, name, size, jframe);
     /* If the methodPtr is a method then this is highly likely to be
        an interpreter frame */
     if (result >= 0) {
--- a/hotspot/src/os/solaris/vm/os_solaris.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/os/solaris/vm/os_solaris.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -59,6 +59,7 @@
 #include "runtime/thread.inline.hpp"
 #include "runtime/threadCritical.hpp"
 #include "runtime/timer.hpp"
+#include "runtime/vm_version.hpp"
 #include "services/attachListener.hpp"
 #include "services/memTracker.hpp"
 #include "services/runtimeService.hpp"
--- a/hotspot/src/os/windows/vm/os_windows.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/os/windows/vm/os_windows.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -62,6 +62,7 @@
 #include "runtime/thread.inline.hpp"
 #include "runtime/threadCritical.hpp"
 #include "runtime/timer.hpp"
+#include "runtime/vm_version.hpp"
 #include "services/attachListener.hpp"
 #include "services/memTracker.hpp"
 #include "services/runtimeService.hpp"
--- a/hotspot/src/os_cpu/aix_ppc/vm/atomic_aix_ppc.inline.hpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/os_cpu/aix_ppc/vm/atomic_aix_ppc.inline.hpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,6 +1,6 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
- * Copyright 2012, 2013 SAP AG. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2014, SAP AG. 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,7 +28,6 @@
 
 #include "runtime/atomic.hpp"
 #include "runtime/os.hpp"
-#include "vm_version_ppc.hpp"
 
 #ifndef _LP64
 #error "Atomic currently only impleneted for PPC64"
--- a/hotspot/src/os_cpu/aix_ppc/vm/orderAccess_aix_ppc.inline.hpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/os_cpu/aix_ppc/vm/orderAccess_aix_ppc.inline.hpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,6 +1,6 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
- * Copyright 2012, 2013 SAP AG. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2014, SAP AG. 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,7 +27,6 @@
 #define OS_CPU_AIX_OJDKPPC_VM_ORDERACCESS_AIX_PPC_INLINE_HPP
 
 #include "runtime/orderAccess.hpp"
-#include "vm_version_ppc.hpp"
 
 // Implementation of class OrderAccess.
 
--- a/hotspot/src/os_cpu/bsd_x86/vm/atomic_bsd_x86.inline.hpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/os_cpu/bsd_x86/vm/atomic_bsd_x86.inline.hpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, 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,7 +27,6 @@
 
 #include "runtime/atomic.hpp"
 #include "runtime/os.hpp"
-#include "vm_version_x86.hpp"
 
 // Implementation of class atomic
 
--- a/hotspot/src/os_cpu/bsd_x86/vm/orderAccess_bsd_x86.inline.hpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/os_cpu/bsd_x86/vm/orderAccess_bsd_x86.inline.hpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, 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,7 +28,6 @@
 #include "runtime/atomic.inline.hpp"
 #include "runtime/orderAccess.hpp"
 #include "runtime/os.hpp"
-#include "vm_version_x86.hpp"
 
 // Implementation of class OrderAccess.
 
--- a/hotspot/src/os_cpu/bsd_zero/vm/atomic_bsd_zero.inline.hpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/os_cpu/bsd_zero/vm/atomic_bsd_zero.inline.hpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2007, 2008, 2011 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -28,7 +28,6 @@
 
 #include "runtime/atomic.hpp"
 #include "runtime/os.hpp"
-#include "vm_version_zero.hpp"
 
 // Implementation of class atomic
 
--- a/hotspot/src/os_cpu/bsd_zero/vm/orderAccess_bsd_zero.inline.hpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/os_cpu/bsd_zero/vm/orderAccess_bsd_zero.inline.hpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2007, 2008, 2009 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -27,7 +27,6 @@
 #define OS_CPU_BSD_ZERO_VM_ORDERACCESS_BSD_ZERO_INLINE_HPP
 
 #include "runtime/orderAccess.hpp"
-#include "vm_version_zero.hpp"
 
 #ifdef ARM
 
--- a/hotspot/src/os_cpu/linux_ppc/vm/atomic_linux_ppc.inline.hpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/os_cpu/linux_ppc/vm/atomic_linux_ppc.inline.hpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,6 +1,6 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
- * Copyright 2012, 2013 SAP AG. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2014, SAP AG. 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,7 +28,6 @@
 
 #include "runtime/atomic.hpp"
 #include "runtime/os.hpp"
-#include "vm_version_ppc.hpp"
 
 #ifndef PPC64
 #error "Atomic currently only implemented for PPC64"
--- a/hotspot/src/os_cpu/linux_ppc/vm/orderAccess_linux_ppc.inline.hpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/os_cpu/linux_ppc/vm/orderAccess_linux_ppc.inline.hpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,6 +1,6 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
- * Copyright 2012, 2013 SAP AG. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2014, SAP AG. 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,7 +27,6 @@
 #define OS_CPU_LINUX_PPC_VM_ORDERACCESS_LINUX_PPC_INLINE_HPP
 
 #include "runtime/orderAccess.hpp"
-#include "vm_version_ppc.hpp"
 
 #ifndef PPC64
 #error "OrderAccess currently only implemented for PPC64"
--- a/hotspot/src/os_cpu/linux_sparc/vm/atomic_linux_sparc.inline.hpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/os_cpu/linux_sparc/vm/atomic_linux_sparc.inline.hpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, 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,7 +27,6 @@
 
 #include "runtime/atomic.hpp"
 #include "runtime/os.hpp"
-#include "vm_version_sparc.hpp"
 
 // Implementation of class atomic
 
--- a/hotspot/src/os_cpu/linux_sparc/vm/orderAccess_linux_sparc.inline.hpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/os_cpu/linux_sparc/vm/orderAccess_linux_sparc.inline.hpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, 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,7 +26,6 @@
 #define OS_CPU_LINUX_SPARC_VM_ORDERACCESS_LINUX_SPARC_INLINE_HPP
 
 #include "runtime/orderAccess.hpp"
-#include "vm_version_sparc.hpp"
 
 // Implementation of class OrderAccess.
 
--- a/hotspot/src/os_cpu/linux_sparc/vm/os_linux_sparc.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/os_cpu/linux_sparc/vm/os_linux_sparc.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -118,7 +118,7 @@
       *ret_sp = os::Linux::ucontext_get_sp(uc);
     }
     if (ret_fp) {
-      *ret_fp = os::Linux::ucontext_get_fp(uc);
+      *ret_fp = (intptr_t*)NULL;
     }
   } else {
     // construct empty ExtendedPC for return value checking
@@ -136,18 +136,15 @@
 
 frame os::fetch_frame_from_context(void* ucVoid) {
   intptr_t* sp;
-  intptr_t* fp;
-  ExtendedPC epc = fetch_frame_from_context(ucVoid, &sp, &fp);
-  return frame(sp, fp, epc.pc());
+  ExtendedPC epc = fetch_frame_from_context(ucVoid, &sp, NULL);
+  return frame(sp, frame::unpatchable, epc.pc());
 }
 
 frame os::get_sender_for_C_frame(frame* fr) {
-  return frame(fr->sender_sp(), fr->link(), fr->sender_pc());
+  return frame(fr->sender_sp(), frame::unpatchable, fr->sender_pc());
 }
 
 frame os::current_frame() {
-  fprintf(stderr, "current_frame()");
-
   intptr_t* sp = StubRoutines::Sparc::flush_callers_register_windows_func()();
   frame myframe(sp, frame::unpatchable,
                 CAST_FROM_FN_PTR(address, os::current_frame));
--- a/hotspot/src/os_cpu/linux_x86/vm/atomic_linux_x86.inline.hpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/os_cpu/linux_x86/vm/atomic_linux_x86.inline.hpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, 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,7 +27,6 @@
 
 #include "runtime/atomic.hpp"
 #include "runtime/os.hpp"
-#include "vm_version_x86.hpp"
 
 // Implementation of class atomic
 
--- a/hotspot/src/os_cpu/linux_x86/vm/orderAccess_linux_x86.inline.hpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/os_cpu/linux_x86/vm/orderAccess_linux_x86.inline.hpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, 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,7 +28,6 @@
 #include "runtime/atomic.inline.hpp"
 #include "runtime/orderAccess.hpp"
 #include "runtime/os.hpp"
-#include "vm_version_x86.hpp"
 
 // Implementation of class OrderAccess.
 
--- a/hotspot/src/os_cpu/linux_zero/vm/atomic_linux_zero.inline.hpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/os_cpu/linux_zero/vm/atomic_linux_zero.inline.hpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2007, 2008, 2011 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -28,7 +28,6 @@
 
 #include "runtime/atomic.hpp"
 #include "runtime/os.hpp"
-#include "vm_version_zero.hpp"
 
 // Implementation of class atomic
 
--- a/hotspot/src/os_cpu/linux_zero/vm/orderAccess_linux_zero.inline.hpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/os_cpu/linux_zero/vm/orderAccess_linux_zero.inline.hpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2007, 2008, 2009 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -27,7 +27,6 @@
 #define OS_CPU_LINUX_ZERO_VM_ORDERACCESS_LINUX_ZERO_INLINE_HPP
 
 #include "runtime/orderAccess.hpp"
-#include "vm_version_zero.hpp"
 
 #ifdef ARM
 
--- a/hotspot/src/os_cpu/solaris_sparc/vm/atomic_solaris_sparc.inline.hpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/os_cpu/solaris_sparc/vm/atomic_solaris_sparc.inline.hpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, 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,7 +27,6 @@
 
 #include "runtime/atomic.hpp"
 #include "runtime/os.hpp"
-#include "vm_version_sparc.hpp"
 
 // Implementation of class atomic
 
--- a/hotspot/src/os_cpu/solaris_sparc/vm/orderAccess_solaris_sparc.inline.hpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/os_cpu/solaris_sparc/vm/orderAccess_solaris_sparc.inline.hpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, 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,7 +27,6 @@
 
 #include "runtime/atomic.inline.hpp"
 #include "runtime/orderAccess.hpp"
-#include "vm_version_sparc.hpp"
 
 // Implementation of class OrderAccess.
 
--- a/hotspot/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -27,6 +27,7 @@
 #include "classfile/classLoader.hpp"
 #include "classfile/systemDictionary.hpp"
 #include "classfile/vmSymbols.hpp"
+#include "code/codeCache.hpp"
 #include "code/icBuffer.hpp"
 #include "code/vtableStubs.hpp"
 #include "interpreter/interpreter.hpp"
--- a/hotspot/src/os_cpu/solaris_x86/vm/atomic_solaris_x86.inline.hpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/os_cpu/solaris_x86/vm/atomic_solaris_x86.inline.hpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, 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,7 +27,6 @@
 
 #include "runtime/atomic.hpp"
 #include "runtime/os.hpp"
-#include "vm_version_x86.hpp"
 
 inline void Atomic::store    (jbyte    store_value, jbyte*    dest) { *dest = store_value; }
 inline void Atomic::store    (jshort   store_value, jshort*   dest) { *dest = store_value; }
--- a/hotspot/src/os_cpu/solaris_x86/vm/orderAccess_solaris_x86.inline.hpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/os_cpu/solaris_x86/vm/orderAccess_solaris_x86.inline.hpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, 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,7 +28,6 @@
 #include "runtime/atomic.inline.hpp"
 #include "runtime/orderAccess.hpp"
 #include "runtime/os.hpp"
-#include "vm_version_x86.hpp"
 
 // Implementation of class OrderAccess.
 
--- a/hotspot/src/os_cpu/windows_x86/vm/atomic_windows_x86.inline.hpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/os_cpu/windows_x86/vm/atomic_windows_x86.inline.hpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, 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,7 +27,6 @@
 
 #include "runtime/atomic.hpp"
 #include "runtime/os.hpp"
-#include "vm_version_x86.hpp"
 
 // The following alternative implementations are needed because
 // Windows 95 doesn't support (some of) the corresponding Windows NT
--- a/hotspot/src/os_cpu/windows_x86/vm/orderAccess_windows_x86.inline.hpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/os_cpu/windows_x86/vm/orderAccess_windows_x86.inline.hpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, 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,7 +28,6 @@
 #include "runtime/atomic.inline.hpp"
 #include "runtime/orderAccess.hpp"
 #include "runtime/os.hpp"
-#include "vm_version_x86.hpp"
 
 // Implementation of class OrderAccess.
 
--- a/hotspot/src/share/vm/adlc/main.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/adlc/main.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, 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,8 @@
   AD.addInclude(AD._CPP_file, "memory/allocation.inline.hpp");
   AD.addInclude(AD._CPP_file, "asm/macroAssembler.inline.hpp");
   AD.addInclude(AD._CPP_file, "code/compiledIC.hpp");
-  AD.addInclude(AD._CPP_file, "code/vmreg.hpp");
+  AD.addInclude(AD._CPP_file, "code/nativeInst.hpp");
+  AD.addInclude(AD._CPP_file, "code/vmreg.inline.hpp");
   AD.addInclude(AD._CPP_file, "gc_interface/collectedHeap.inline.hpp");
   AD.addInclude(AD._CPP_file, "oops/compiledICHolder.hpp");
   AD.addInclude(AD._CPP_file, "oops/markOop.hpp");
@@ -230,23 +231,8 @@
   AD.addInclude(AD._CPP_file, "runtime/sharedRuntime.hpp");
   AD.addInclude(AD._CPP_file, "runtime/stubRoutines.hpp");
   AD.addInclude(AD._CPP_file, "utilities/growableArray.hpp");
-#ifdef TARGET_ARCH_x86
-  AD.addInclude(AD._CPP_file, "nativeInst_x86.hpp");
-  AD.addInclude(AD._CPP_file, "vmreg_x86.inline.hpp");
-#endif
-#ifdef TARGET_ARCH_sparc
-  AD.addInclude(AD._CPP_file, "nativeInst_sparc.hpp");
-  AD.addInclude(AD._CPP_file, "vmreg_sparc.inline.hpp");
-#endif
-#ifdef TARGET_ARCH_arm
-  AD.addInclude(AD._CPP_file, "nativeInst_arm.hpp");
-  AD.addInclude(AD._CPP_file, "vmreg_arm.inline.hpp");
-#endif
-#ifdef TARGET_ARCH_ppc
-  AD.addInclude(AD._CPP_file, "nativeInst_ppc.hpp");
-  AD.addInclude(AD._CPP_file, "vmreg_ppc.inline.hpp");
-#endif
   AD.addInclude(AD._HPP_file, "memory/allocation.hpp");
+  AD.addInclude(AD._HPP_file, "code/nativeInst.hpp");
   AD.addInclude(AD._HPP_file, "opto/machnode.hpp");
   AD.addInclude(AD._HPP_file, "opto/node.hpp");
   AD.addInclude(AD._HPP_file, "opto/regalloc.hpp");
--- a/hotspot/src/share/vm/asm/assembler.hpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/asm/assembler.hpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, 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,34 +26,15 @@
 #define SHARE_VM_ASM_ASSEMBLER_HPP
 
 #include "asm/codeBuffer.hpp"
+#include "asm/register.hpp"
 #include "code/oopRecorder.hpp"
 #include "code/relocInfo.hpp"
 #include "memory/allocation.hpp"
+#include "runtime/vm_version.hpp"
 #include "utilities/debug.hpp"
 #include "utilities/growableArray.hpp"
 #include "utilities/top.hpp"
 
-#ifdef TARGET_ARCH_x86
-# include "register_x86.hpp"
-# include "vm_version_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "register_sparc.hpp"
-# include "vm_version_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_zero
-# include "register_zero.hpp"
-# include "vm_version_zero.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "register_arm.hpp"
-# include "vm_version_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "register_ppc.hpp"
-# include "vm_version_ppc.hpp"
-#endif
-
 // This file contains platform-independent assembler declarations.
 
 class MacroAssembler;
--- a/hotspot/src/share/vm/asm/codeBuffer.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/asm/codeBuffer.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -28,6 +28,7 @@
 #include "memory/gcLocker.hpp"
 #include "oops/methodData.hpp"
 #include "oops/oop.inline.hpp"
+#include "runtime/icache.hpp"
 #include "utilities/copy.hpp"
 #include "utilities/xmlstream.hpp"
 
--- a/hotspot/src/share/vm/c1/c1_CodeStubs.hpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/c1/c1_CodeStubs.hpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, 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
@@ -30,6 +30,7 @@
 #include "c1/c1_Instruction.hpp"
 #include "c1/c1_LIR.hpp"
 #include "c1/c1_Runtime1.hpp"
+#include "code/nativeInst.hpp"
 #include "utilities/array.hpp"
 #include "utilities/macros.hpp"
 
--- a/hotspot/src/share/vm/c1/c1_Defs.hpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/c1/c1_Defs.hpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, 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,21 +26,7 @@
 #define SHARE_VM_C1_C1_DEFS_HPP
 
 #include "utilities/globalDefinitions.hpp"
-#ifdef TARGET_ARCH_x86
-# include "register_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "register_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_zero
-# include "register_zero.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "register_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "register_ppc.hpp"
-#endif
+#include "asm/register.hpp"
 
 // set frame size and return address offset to these values in blobs
 // (if the compiled frame uses ebp as link pointer on IA; otherwise,
--- a/hotspot/src/share/vm/c1/c1_FrameMap.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/c1/c1_FrameMap.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, 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,24 +25,8 @@
 #include "precompiled.hpp"
 #include "c1/c1_FrameMap.hpp"
 #include "c1/c1_LIR.hpp"
+#include "code/vmreg.inline.hpp"
 #include "runtime/sharedRuntime.hpp"
-#ifdef TARGET_ARCH_x86
-# include "vmreg_x86.inline.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "vmreg_sparc.inline.hpp"
-#endif
-#ifdef TARGET_ARCH_zero
-# include "vmreg_zero.inline.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "vmreg_arm.inline.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "vmreg_ppc.inline.hpp"
-#endif
-
-
 
 //-----------------------------------------------------
 
--- a/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, 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
@@ -36,6 +36,7 @@
 #include "interpreter/bytecode.hpp"
 #include "runtime/sharedRuntime.hpp"
 #include "runtime/compilationPolicy.hpp"
+#include "runtime/vm_version.hpp"
 #include "utilities/bitMap.inline.hpp"
 
 class BlockListBuilder VALUE_OBJ_CLASS_SPEC {
--- a/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, 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
@@ -30,27 +30,6 @@
 #include "c1/c1_MacroAssembler.hpp"
 #include "c1/c1_ValueStack.hpp"
 #include "ci/ciInstance.hpp"
-#ifdef TARGET_ARCH_x86
-# include "nativeInst_x86.hpp"
-# include "vmreg_x86.inline.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "nativeInst_sparc.hpp"
-# include "vmreg_sparc.inline.hpp"
-#endif
-#ifdef TARGET_ARCH_zero
-# include "nativeInst_zero.hpp"
-# include "vmreg_zero.inline.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "nativeInst_arm.hpp"
-# include "vmreg_arm.inline.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "nativeInst_ppc.hpp"
-# include "vmreg_ppc.inline.hpp"
-#endif
-
 
 void LIR_Assembler::patching_epilog(PatchingStub* patch, LIR_PatchCode patch_code, Register obj, CodeEmitInfo* info) {
   // we must have enough patching space so that call can be inserted
--- a/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2014, 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
@@ -34,6 +34,7 @@
 #include "ci/ciObjArray.hpp"
 #include "runtime/sharedRuntime.hpp"
 #include "runtime/stubRoutines.hpp"
+#include "runtime/vm_version.hpp"
 #include "utilities/bitMap.inline.hpp"
 #include "utilities/macros.hpp"
 #if INCLUDE_ALL_GCS
--- a/hotspot/src/share/vm/c1/c1_LinearScan.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/c1/c1_LinearScan.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2014, 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,23 +31,8 @@
 #include "c1/c1_LIRGenerator.hpp"
 #include "c1/c1_LinearScan.hpp"
 #include "c1/c1_ValueStack.hpp"
+#include "code/vmreg.inline.hpp"
 #include "utilities/bitMap.inline.hpp"
-#ifdef TARGET_ARCH_x86
-# include "vmreg_x86.inline.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "vmreg_sparc.inline.hpp"
-#endif
-#ifdef TARGET_ARCH_zero
-# include "vmreg_zero.inline.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "vmreg_arm.inline.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "vmreg_ppc.inline.hpp"
-#endif
-
 
 #ifndef PRODUCT
 
--- a/hotspot/src/share/vm/c1/c1_Runtime1.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/c1/c1_Runtime1.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -56,6 +56,7 @@
 #include "runtime/threadCritical.hpp"
 #include "runtime/vframe.hpp"
 #include "runtime/vframeArray.hpp"
+#include "runtime/vm_version.hpp"
 #include "utilities/copy.hpp"
 #include "utilities/events.hpp"
 
--- a/hotspot/src/share/vm/ci/ciField.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/ci/ciField.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -138,6 +138,17 @@
     return;
   }
 
+  // Access check based on declared_holder. canonical_holder should not be used
+  // to check access because it can erroneously succeed. If this check fails,
+  // propagate the declared holder to will_link() which in turn will bail out
+  // compilation for this field access.
+  if (!Reflection::verify_field_access(klass->get_Klass(), declared_holder->get_Klass(), canonical_holder, field_desc.access_flags(), true)) {
+    _holder = declared_holder;
+    _offset = -1;
+    _is_constant = false;
+    return;
+  }
+
   assert(canonical_holder == field_desc.field_holder(), "just checking");
   initialize_from(&field_desc);
 }
--- a/hotspot/src/share/vm/classfile/bytecodeAssembler.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/classfile/bytecodeAssembler.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2014, 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,22 +28,7 @@
 #include "interpreter/bytecodes.hpp"
 #include "memory/oopFactory.hpp"
 #include "oops/constantPool.hpp"
-
-#ifdef TARGET_ARCH_x86
-# include "bytes_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "bytes_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_zero
-# include "bytes_zero.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "bytes_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "bytes_ppc.hpp"
-#endif
+#include "utilities/bytes.hpp"
 
 u2 BytecodeConstantPool::find_or_add(BytecodeCPEntry const& bcpe) {
   u2 index;
--- a/hotspot/src/share/vm/classfile/classFileStream.hpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/classfile/classFileStream.hpp	Wed Jul 05 19:53:51 2017 +0200
@@ -25,22 +25,8 @@
 #ifndef SHARE_VM_CLASSFILE_CLASSFILESTREAM_HPP
 #define SHARE_VM_CLASSFILE_CLASSFILESTREAM_HPP
 
+#include "utilities/bytes.hpp"
 #include "utilities/top.hpp"
-#ifdef TARGET_ARCH_x86
-# include "bytes_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "bytes_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_zero
-# include "bytes_zero.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "bytes_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "bytes_ppc.hpp"
-#endif
 
 // Input stream for reading .class file
 //
--- a/hotspot/src/share/vm/classfile/javaClasses.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/classfile/javaClasses.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1639,9 +1639,9 @@
       if (fr.is_first_frame()) break;
       address pc = fr.pc();
       if (fr.is_interpreted_frame()) {
-        intptr_t bcx = fr.interpreter_frame_bcx();
+        address bcp = fr.interpreter_frame_bcp();
         method = fr.interpreter_frame_method();
-        bci =  fr.is_bci(bcx) ? bcx : method->bci_from((address)bcx);
+        bci =  method->bci_from(bcp);
         fr = fr.sender(&map);
       } else {
         CodeBlob* cb = fr.cb();
--- a/hotspot/src/share/vm/classfile/stackMapTable.hpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/classfile/stackMapTable.hpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, 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
@@ -30,22 +30,8 @@
 #include "memory/allocation.hpp"
 #include "oops/constantPool.hpp"
 #include "oops/method.hpp"
+#include "utilities/bytes.hpp"
 #include "utilities/globalDefinitions.hpp"
-#ifdef TARGET_ARCH_x86
-# include "bytes_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "bytes_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_zero
-# include "bytes_zero.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "bytes_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "bytes_ppc.hpp"
-#endif
 
 class StackMapReader;
 
--- a/hotspot/src/share/vm/classfile/verifier.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/classfile/verifier.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -45,21 +45,7 @@
 #include "runtime/javaCalls.hpp"
 #include "runtime/orderAccess.inline.hpp"
 #include "runtime/os.hpp"
-#ifdef TARGET_ARCH_x86
-# include "bytes_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "bytes_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_zero
-# include "bytes_zero.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "bytes_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "bytes_ppc.hpp"
-#endif
+#include "utilities/bytes.hpp"
 
 #define NOFAILOVER_MAJOR_VERSION                       51
 #define NONZERO_PADDING_BYTES_IN_SWITCH_MAJOR_VERSION  51
@@ -439,7 +425,7 @@
   if (_bci != -1 && method != NULL) {
     streamIndentor si(ss);
     const char* bytecode_name = "<invalid>";
-    if (method->validate_bci_from_bcx(_bci) != -1) {
+    if (method->validate_bci(_bci) != -1) {
       Bytecodes::Code code = Bytecodes::code_or_bp_at(method->bcp_from(_bci));
       if (Bytecodes::is_defined(code)) {
           bytecode_name = Bytecodes::name(code);
--- a/hotspot/src/share/vm/code/codeBlob.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/code/codeBlob.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -39,21 +39,6 @@
 #include "runtime/sharedRuntime.hpp"
 #include "runtime/vframe.hpp"
 #include "services/memoryService.hpp"
-#ifdef TARGET_ARCH_x86
-# include "nativeInst_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "nativeInst_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_zero
-# include "nativeInst_zero.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "nativeInst_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "nativeInst_ppc.hpp"
-#endif
 #ifdef COMPILER1
 #include "c1/c1_Runtime1.hpp"
 #endif
--- a/hotspot/src/share/vm/code/compiledIC.hpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/code/compiledIC.hpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, 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,23 +25,9 @@
 #ifndef SHARE_VM_CODE_COMPILEDIC_HPP
 #define SHARE_VM_CODE_COMPILEDIC_HPP
 
+#include "code/nativeInst.hpp"
 #include "interpreter/linkResolver.hpp"
 #include "oops/compiledICHolder.hpp"
-#ifdef TARGET_ARCH_x86
-# include "nativeInst_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "nativeInst_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_zero
-# include "nativeInst_zero.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "nativeInst_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "nativeInst_ppc.hpp"
-#endif
 
 //-----------------------------------------------------------------------------
 // The CompiledIC represents a compiled inline cache.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/src/share/vm/code/nativeInst.hpp	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2014, 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_CODE_NATIVEINST_HPP
+#define SHARE_VM_CODE_NATIVEINST_HPP
+
+#ifdef TARGET_ARCH_x86
+# include "nativeInst_x86.hpp"
+#endif
+#ifdef TARGET_ARCH_sparc
+# include "nativeInst_sparc.hpp"
+#endif
+#ifdef TARGET_ARCH_zero
+# include "nativeInst_zero.hpp"
+#endif
+#ifdef TARGET_ARCH_arm
+# include "nativeInst_arm.hpp"
+#endif
+#ifdef TARGET_ARCH_ppc
+# include "nativeInst_ppc.hpp"
+#endif
+
+#endif // SHARE_VM_CODE_NATIVEINST_HPP
--- a/hotspot/src/share/vm/code/nmethod.hpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/code/nmethod.hpp	Wed Jul 05 19:53:51 2017 +0200
@@ -69,7 +69,12 @@
   friend class VMStructs;
  private:
   enum { cache_size = 4 };
-  PcDesc* _pc_descs[cache_size]; // last cache_size pc_descs found
+  // The array elements MUST be volatile! Several threads may modify
+  // and read from the cache concurrently. find_pc_desc_internal has
+  // returned wrong results. C++ compiler (namely xlC12) may duplicate
+  // C++ field accesses if the elements are not volatile.
+  typedef PcDesc* PcDescPtr;
+  volatile PcDescPtr _pc_descs[cache_size]; // last cache_size pc_descs found
  public:
   PcDescCache() { debug_only(_pc_descs[0] = NULL); }
   void    reset_to(PcDesc* initial_pc_desc);
--- a/hotspot/src/share/vm/code/vmreg.hpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/code/vmreg.hpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014, 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,34 +25,13 @@
 #ifndef SHARE_VM_CODE_VMREG_HPP
 #define SHARE_VM_CODE_VMREG_HPP
 
+#include "asm/register.hpp"
 #include "memory/allocation.hpp"
 #include "utilities/globalDefinitions.hpp"
-#include "asm/register.hpp"
 
 #ifdef COMPILER2
 #include "opto/adlcVMDeps.hpp"
 #include "utilities/ostream.hpp"
-#ifdef TARGET_ARCH_MODEL_x86_32
-# include "adfiles/adGlobals_x86_32.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_x86_64
-# include "adfiles/adGlobals_x86_64.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_sparc
-# include "adfiles/adGlobals_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_zero
-# include "adfiles/adGlobals_zero.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_arm
-# include "adfiles/adGlobals_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_ppc_32
-# include "adfiles/adGlobals_ppc_32.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_ppc_64
-# include "adfiles/adGlobals_ppc_64.hpp"
-#endif
 #endif
 
 //------------------------------VMReg------------------------------------------
@@ -107,7 +86,7 @@
   // also a register you could use in the assembler. On machines with
   // 64bit registers only one half of the VMReg (and OptoReg) is considered
   // concrete.
-  bool is_concrete();
+  //  bool is_concrete();
 
   // VMRegs are 4 bytes wide on all platforms
   static const int stack_slot_size;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/src/share/vm/code/vmreg.inline.hpp	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2014, 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_CODE_VMREG_INLINE_HPP
+#define SHARE_VM_CODE_VMREG_INLINE_HPP
+
+#include "asm/register.hpp"
+#include "code/vmreg.hpp"
+#ifdef TARGET_ARCH_x86
+# include "vmreg_x86.inline.hpp"
+#endif
+#ifdef TARGET_ARCH_sparc
+# include "vmreg_sparc.inline.hpp"
+#endif
+#ifdef TARGET_ARCH_zero
+# include "vmreg_zero.inline.hpp"
+#endif
+#ifdef TARGET_ARCH_arm
+# include "vmreg_arm.inline.hpp"
+#endif
+#ifdef TARGET_ARCH_ppc
+# include "vmreg_ppc.inline.hpp"
+#endif
+
+#endif // SHARE_VM_CODE_VMREG_INLINE_HPP
--- a/hotspot/src/share/vm/compiler/compileLog.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/compiler/compileLog.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -24,6 +24,7 @@
 
 #include "precompiled.hpp"
 #include "ci/ciMethod.hpp"
+#include "code/codeCache.hpp"
 #include "compiler/compileLog.hpp"
 #include "memory/allocation.inline.hpp"
 #include "oops/method.hpp"
--- a/hotspot/src/share/vm/compiler/oopMap.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/compiler/oopMap.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -36,6 +36,9 @@
 #ifdef COMPILER1
 #include "c1/c1_Defs.hpp"
 #endif
+#ifdef COMPILER2
+#include "opto/optoreg.hpp"
+#endif
 
 // OopMapStream
 
--- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1904,12 +1904,12 @@
   assert(size > new_size, "Split from a smaller block?");
   assert(is_aligned(chunk), "alignment problem");
   assert(size == adjustObjectSize(size), "alignment problem");
-  size_t rem_size = size - new_size;
-  assert(rem_size == adjustObjectSize(rem_size), "alignment problem");
-  assert(rem_size >= MinChunkSize, "Free chunk smaller than minimum");
+  size_t rem_sz = size - new_size;
+  assert(rem_sz == adjustObjectSize(rem_sz), "alignment problem");
+  assert(rem_sz >= MinChunkSize, "Free chunk smaller than minimum");
   FreeChunk* ffc = (FreeChunk*)((HeapWord*)chunk + new_size);
   assert(is_aligned(ffc), "alignment problem");
-  ffc->set_size(rem_size);
+  ffc->set_size(rem_sz);
   ffc->link_next(NULL);
   ffc->link_prev(NULL); // Mark as a free block for other (parallel) GC threads.
   // Above must occur before BOT is updated below.
@@ -1917,18 +1917,18 @@
   OrderAccess::storestore();
   assert(chunk->is_free() && ffc->is_free(), "Error");
   _bt.split_block((HeapWord*)chunk, chunk->size(), new_size);
-  if (rem_size < SmallForDictionary) {
+  if (rem_sz < SmallForDictionary) {
     bool is_par = (SharedHeap::heap()->n_par_threads() > 0);
-    if (is_par) _indexedFreeListParLocks[rem_size]->lock();
+    if (is_par) _indexedFreeListParLocks[rem_sz]->lock();
     assert(!is_par ||
            (SharedHeap::heap()->n_par_threads() ==
             SharedHeap::heap()->workers()->active_workers()), "Mismatch");
     returnChunkToFreeList(ffc);
-    split(size, rem_size);
-    if (is_par) _indexedFreeListParLocks[rem_size]->unlock();
+    split(size, rem_sz);
+    if (is_par) _indexedFreeListParLocks[rem_sz]->unlock();
   } else {
     returnChunkToDictionary(ffc);
-    split(size ,rem_size);
+    split(size, rem_sz);
   }
   chunk->set_size(new_size);
   return chunk;
--- a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -891,6 +891,10 @@
   guarantee(!g1h->mark_in_progress(), "invariant");
 }
 
+bool ConcurrentMark::nextMarkBitmapIsClear() {
+  return _nextMarkBitMap->getNextMarkedWordAddress(_heap_start, _heap_end) == _heap_end;
+}
+
 class NoteStartOfMarkHRClosure: public HeapRegionClosure {
 public:
   bool doHeapRegion(HeapRegion* r) {
@@ -3358,7 +3362,8 @@
 
 // abandon current marking iteration due to a Full GC
 void ConcurrentMark::abort() {
-  // Clear all marks to force marking thread to do nothing
+  // Clear all marks in the next bitmap for the next marking cycle. This will allow us to skip the next
+  // concurrent bitmap clearing.
   _nextMarkBitMap->clearAll();
 
   // Note we cannot clear the previous marking bitmap here
--- a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.hpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.hpp	Wed Jul 05 19:53:51 2017 +0200
@@ -736,6 +736,9 @@
   // Clear the next marking bitmap (will be called concurrently).
   void clearNextBitmap();
 
+  // Return whether the next mark bitmap has no marks set.
+  bool nextMarkBitmapIsClear();
+
   // These two do the work that needs to be done before and after the
   // initial root checkpoint. Since this checkpoint can be done at two
   // different points (i.e. an explicit pause or piggy-backed on a
--- a/hotspot/src/share/vm/gc_implementation/g1/concurrentMarkThread.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentMarkThread.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -277,9 +277,13 @@
 
       // We now want to allow clearing of the marking bitmap to be
       // suspended by a collection pause.
-      {
+      // We may have aborted just before the remark. Do not bother clearing the
+      // bitmap then, as it has been done during mark abort.
+      if (!cm()->has_aborted()) {
         SuspendibleThreadSetJoiner sts;
         _cm->clearNextBitmap();
+      } else {
+        assert(!G1VerifyBitmaps || _cm->nextMarkBitmapIsClear(), "Next mark bitmap must be clear");
       }
     }
 
--- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -2950,10 +2950,17 @@
   }
 }
 
-CompactibleSpace* G1CollectedHeap::first_compactible_space() {
-  return n_regions() > 0 ? region_at(0) : NULL;
-}
-
+HeapRegion* G1CollectedHeap::next_compaction_region(const HeapRegion* from) const {
+  // We're not using an iterator given that it will wrap around when
+  // it reaches the last region and this is not what we want here.
+  for (uint index = from->hrs_index() + 1; index < n_regions(); index++) {
+    HeapRegion* hr = region_at(index);
+    if (!hr->isHumongous()) {
+      return hr;
+    }
+  }
+  return NULL;
+}
 
 Space* G1CollectedHeap::space_containing(const void* addr) const {
   return heap_region_containing(addr);
--- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1158,19 +1158,19 @@
   }
 
   // The total number of regions in the heap.
-  uint n_regions() { return _hrs.length(); }
+  uint n_regions() const { return _hrs.length(); }
 
   // The max number of regions in the heap.
-  uint max_regions() { return _hrs.max_length(); }
+  uint max_regions() const { return _hrs.max_length(); }
 
   // The number of regions that are completely free.
-  uint free_regions() { return _free_list.length(); }
+  uint free_regions() const { return _free_list.length(); }
 
   // The number of regions that are not completely free.
-  uint used_regions() { return n_regions() - free_regions(); }
+  uint used_regions() const { return n_regions() - free_regions(); }
 
   // The number of regions available for "regular" expansion.
-  uint expansion_regions() { return _expansion_regions; }
+  uint expansion_regions() const { return _expansion_regions; }
 
   // Factory method for HeapRegion instances. It will return NULL if
   // the allocation fails.
@@ -1392,8 +1392,7 @@
   // As above but starting from region r
   void collection_set_iterate_from(HeapRegion* r, HeapRegionClosure *blk);
 
-  // Returns the first (lowest address) compactible space in the heap.
-  virtual CompactibleSpace* first_compactible_space();
+  HeapRegion* next_compaction_region(const HeapRegion* from) const;
 
   // A CollectedHeap will contain some number of spaces.  This finds the
   // space containing a given address, or else returns NULL.
--- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1047,7 +1047,7 @@
 
   bool new_in_marking_window = _in_marking_window;
   bool new_in_marking_window_im = false;
-  if (during_initial_mark_pause()) {
+  if (last_pause_included_initial_mark) {
     new_in_marking_window = true;
     new_in_marking_window_im = true;
   }
--- a/hotspot/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -76,7 +76,6 @@
   // When collecting the permanent generation Method*s may be moving,
   // so we either have to flush all bcp data or convert it into bci.
   CodeCache::gc_prologue();
-  Threads::gc_prologue();
 
   bool marked_for_unloading = false;
 
@@ -106,7 +105,6 @@
   //  Universe::set_heap_capacity_at_last_gc(Universe::heap()->capacity());
   //  Universe::set_heap_used_at_last_gc(Universe::heap()->used());
 
-  Threads::gc_epilogue();
   CodeCache::gc_epilogue();
   JvmtiExport::gc_epilogue();
 
@@ -201,6 +199,23 @@
   CompactPoint _cp;
   HeapRegionSetCount _humongous_regions_removed;
 
+  bool is_cp_initialized() const {
+    return _cp.space != NULL;
+  }
+
+  void prepare_for_compaction(HeapRegion* hr, HeapWord* end) {
+    // If this is the first live region that we came across which we can compact,
+    // initialize the CompactPoint.
+    if (!is_cp_initialized()) {
+      _cp.space = hr;
+      _cp.threshold = hr->initialize_threshold();
+    }
+    hr->prepare_for_compaction(&_cp);
+    // Also clear the part of the card table that will be unused after
+    // compaction.
+    _mrbs->clear(MemRegion(hr->compaction_top(), end));
+  }
+
   void free_humongous_region(HeapRegion* hr) {
     HeapWord* end = hr->end();
     FreeRegionList dummy_free_list("Dummy Free List for G1MarkSweep");
@@ -212,18 +227,15 @@
     _humongous_regions_removed.increment(1u, hr->capacity());
 
     _g1h->free_humongous_region(hr, &dummy_free_list, false /* par */);
-    hr->prepare_for_compaction(&_cp);
-    // Also clear the part of the card table that will be unused after
-    // compaction.
-    _mrbs->clear(MemRegion(hr->compaction_top(), end));
+    prepare_for_compaction(hr, end);
     dummy_free_list.remove_all();
   }
 
 public:
-  G1PrepareCompactClosure(CompactibleSpace* cs)
+  G1PrepareCompactClosure()
   : _g1h(G1CollectedHeap::heap()),
     _mrbs(_g1h->g1_barrier_set()),
-    _cp(NULL, cs, cs->initialize_threshold()),
+    _cp(NULL),
     _humongous_regions_removed() { }
 
   void update_sets() {
@@ -246,10 +258,7 @@
         assert(hr->continuesHumongous(), "Invalid humongous.");
       }
     } else {
-      hr->prepare_for_compaction(&_cp);
-      // Also clear the part of the card table that will be unused after
-      // compaction.
-      _mrbs->clear(MemRegion(hr->compaction_top(), hr->end()));
+      prepare_for_compaction(hr, hr->end());
     }
     return false;
   }
@@ -267,14 +276,7 @@
   GCTraceTime tm("phase 2", G1Log::fine() && Verbose, true, gc_timer(), gc_tracer()->gc_id());
   GenMarkSweep::trace("2");
 
-  // find the first region
-  HeapRegion* r = g1h->region_at(0);
-  CompactibleSpace* sp = r;
-  if (r->isHumongous() && oop(r->bottom())->is_gc_marked()) {
-    sp = r->next_compaction_space();
-  }
-
-  G1PrepareCompactClosure blk(sp);
+  G1PrepareCompactClosure blk;
   g1h->heap_region_iterate(&blk);
   blk.update_sets();
 }
--- a/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -381,18 +381,7 @@
 }
 
 CompactibleSpace* HeapRegion::next_compaction_space() const {
-  // We're not using an iterator given that it will wrap around when
-  // it reaches the last region and this is not what we want here.
-  G1CollectedHeap* g1h = G1CollectedHeap::heap();
-  uint index = hrs_index() + 1;
-  while (index < g1h->n_regions()) {
-    HeapRegion* hr = g1h->region_at(index);
-    if (!hr->isHumongous()) {
-      return hr;
-    }
-    index += 1;
-  }
-  return NULL;
+  return G1CollectedHeap::heap()->next_compaction_region(this);
 }
 
 void HeapRegion::note_self_forwarding_removal_start(bool during_initial_mark,
--- a/hotspot/src/share/vm/gc_implementation/g1/heapRegionSet.hpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegionSet.hpp	Wed Jul 05 19:53:51 2017 +0200
@@ -119,7 +119,7 @@
 public:
   const char* name() { return _name; }
 
-  uint length() { return _count.length(); }
+  uint length() const { return _count.length(); }
 
   bool is_empty() { return _count.length() == 0; }
 
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -180,7 +180,6 @@
     size_policy->major_collection_begin();
 
     CodeCache::gc_prologue();
-    Threads::gc_prologue();
     BiasedLocking::preserve_marks();
 
     // Capture heap size before collection for printing.
@@ -251,7 +250,6 @@
     MetaspaceAux::verify_metrics();
 
     BiasedLocking::restore_marks();
-    Threads::gc_epilogue();
     CodeCache::gc_epilogue();
     JvmtiExport::gc_epilogue();
 
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1066,7 +1066,6 @@
   ClassLoaderDataGraph::purge();
   MetaspaceAux::verify_metrics();
 
-  Threads::gc_epilogue();
   CodeCache::gc_epilogue();
   JvmtiExport::gc_epilogue();
 
@@ -2068,7 +2067,6 @@
     size_policy->major_collection_begin();
 
     CodeCache::gc_prologue();
-    Threads::gc_prologue();
 
     COMPILER2_PRESENT(DerivedPointerTable::clear());
 
--- a/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, 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,29 +25,12 @@
 #ifndef SHARE_VM_INTERPRETER_ABSTRACTINTERPRETER_HPP
 #define SHARE_VM_INTERPRETER_ABSTRACTINTERPRETER_HPP
 
+#include "asm/macroAssembler.hpp"
 #include "code/stubs.hpp"
 #include "interpreter/bytecodes.hpp"
 #include "runtime/thread.inline.hpp"
 #include "runtime/vmThread.hpp"
 #include "utilities/top.hpp"
-#ifdef TARGET_ARCH_x86
-# include "interp_masm_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_sparc
-# include "interp_masm_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_zero
-# include "interp_masm_zero.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_arm
-# include "interp_masm_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_ppc_32
-# include "interp_masm_ppc_32.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_ppc_64
-# include "interp_masm_ppc_64.hpp"
-#endif
 
 // This file contains the platform-independent parts
 // of the abstract interpreter and the abstract interpreter generator.
@@ -75,6 +58,8 @@
 //------------------------------------------------------------------------------------------------------------------------
 // The C++ interface to the bytecode interpreter(s).
 
+class InterpreterMacroAssembler;
+
 class AbstractInterpreter: AllStatic {
   friend class VMStructs;
   friend class Interpreter;
--- a/hotspot/src/share/vm/interpreter/bytecode.hpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/interpreter/bytecode.hpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, 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,21 +28,7 @@
 #include "interpreter/bytecodes.hpp"
 #include "memory/allocation.hpp"
 #include "oops/method.hpp"
-#ifdef TARGET_ARCH_x86
-# include "bytes_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "bytes_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_zero
-# include "bytes_zero.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "bytes_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "bytes_ppc.hpp"
-#endif
+#include "utilities/bytes.hpp"
 
 class ciBytecodeStream;
 
--- a/hotspot/src/share/vm/interpreter/bytecodeInterpreter.hpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/interpreter/bytecodeInterpreter.hpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2014, 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,21 +32,6 @@
 #include "runtime/frame.hpp"
 #include "runtime/globals.hpp"
 #include "utilities/globalDefinitions.hpp"
-#ifdef TARGET_ARCH_x86
-# include "bytes_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "bytes_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_zero
-# include "bytes_zero.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "bytes_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "bytes_ppc.hpp"
-#endif
 
 #ifdef CC_INTERP
 
@@ -56,6 +41,8 @@
 
 // CVM definitions find hotspot equivalents...
 
+class InterpreterMacroAssembler;
+
 union VMJavaVal64 {
     jlong   l;
     jdouble d;
--- a/hotspot/src/share/vm/interpreter/bytecodeStream.hpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/interpreter/bytecodeStream.hpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, 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,21 +29,7 @@
 #include "memory/allocation.hpp"
 #include "oops/method.hpp"
 #include "runtime/handles.inline.hpp"
-#ifdef TARGET_ARCH_x86
-# include "bytes_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "bytes_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_zero
-# include "bytes_zero.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "bytes_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "bytes_ppc.hpp"
-#endif
+#include "utilities/bytes.hpp"
 
 // A BytecodeStream is used for fast iteration over the bytecodes
 // of a Method*.
--- a/hotspot/src/share/vm/interpreter/bytecodes.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/interpreter/bytecodes.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, 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,21 +26,7 @@
 #include "interpreter/bytecodes.hpp"
 #include "memory/resourceArea.hpp"
 #include "oops/method.hpp"
-#ifdef TARGET_ARCH_x86
-# include "bytes_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "bytes_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_zero
-# include "bytes_zero.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "bytes_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "bytes_ppc.hpp"
-#endif
+#include "utilities/bytes.hpp"
 
 
 #if defined(WIN32) && (defined(_MSC_VER) && (_MSC_VER < 1600))
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/src/share/vm/interpreter/interp_masm.hpp	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2014, 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_INTERPRETER_INTERP_MASM_HPP
+#define SHARE_VM_INTERPRETER_INTERP_MASM_HPP
+
+#include "asm/macroAssembler.hpp"
+
+#ifdef TARGET_ARCH_x86
+# include "interp_masm_x86.hpp"
+#endif
+#ifdef TARGET_ARCH_MODEL_sparc
+# include "interp_masm_sparc.hpp"
+#endif
+#ifdef TARGET_ARCH_MODEL_zero
+# include "interp_masm_zero.hpp"
+#endif
+#ifdef TARGET_ARCH_MODEL_arm
+# include "interp_masm_arm.hpp"
+#endif
+#ifdef TARGET_ARCH_MODEL_ppc_32
+# include "interp_masm_ppc_32.hpp"
+#endif
+#ifdef TARGET_ARCH_MODEL_ppc_64
+# include "interp_masm_ppc_64.hpp"
+#endif
+
+#endif // SHARE_VM_INTERPRETER_INTERP_MASM_HPP
--- a/hotspot/src/share/vm/interpreter/interpreter.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/interpreter/interpreter.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -30,6 +30,7 @@
 #include "interpreter/bytecodeInterpreter.hpp"
 #include "interpreter/interpreter.hpp"
 #include "interpreter/interpreterRuntime.hpp"
+#include "interpreter/interp_masm.hpp"
 #include "interpreter/templateTable.hpp"
 #include "memory/allocation.inline.hpp"
 #include "memory/resourceArea.hpp"
@@ -80,9 +81,35 @@
   }
 }
 
+CodeletMark::CodeletMark(InterpreterMacroAssembler*& masm,
+                         const char* description,
+                         Bytecodes::Code bytecode) :
+  _clet((InterpreterCodelet*)AbstractInterpreter::code()->request(codelet_size())),
+  _cb(_clet->code_begin(), _clet->code_size()) {
+  // Request all space (add some slack for Codelet data).
+  assert(_clet != NULL, "we checked not enough space already");
+
+  // Initialize Codelet attributes.
+  _clet->initialize(description, bytecode);
+  // Create assembler for code generation.
+  masm = new InterpreterMacroAssembler(&_cb);
+  _masm = &masm;
+}
+
+CodeletMark::~CodeletMark() {
+  // Align so printing shows nop's instead of random code at the end (Codelets are aligned).
+  (*_masm)->align(wordSize);
+  // Make sure all code is in code buffer.
+  (*_masm)->flush();
+
+  // Commit Codelet.
+  AbstractInterpreter::code()->commit((*_masm)->code()->pure_insts_size(), (*_masm)->code()->strings());
+  // Make sure nobody can use _masm outside a CodeletMark lifespan.
+  *_masm = NULL;
+}
 
 //------------------------------------------------------------------------------------------------------------------------
-// Implementation of  platform independent aspects of Interpreter
+// Implementation of platform independent aspects of Interpreter
 
 void AbstractInterpreter::initialize() {
   if (_code != NULL) return;
--- a/hotspot/src/share/vm/interpreter/interpreter.hpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/interpreter/interpreter.hpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, 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,6 +37,8 @@
 // This file contains the platform-independent parts
 // of the interpreter and the interpreter generator.
 
+class InterpreterMacroAssembler;
+
 //------------------------------------------------------------------------------------------------------------------------
 // An InterpreterCodelet is a piece of interpreter code. All
 // interpreter code is generated into little codelets which
@@ -99,42 +101,17 @@
     int codelet_size = AbstractInterpreter::code()->available_space() - 2*K;
 
     // Guarantee there's a little bit of code space left.
-    guarantee (codelet_size > 0 && (size_t)codelet_size >  2*K,
-               "not enough space for interpreter generation");
+    guarantee(codelet_size > 0 && (size_t)codelet_size > 2*K,
+              "not enough space for interpreter generation");
 
     return codelet_size;
   }
 
  public:
-  CodeletMark(
-    InterpreterMacroAssembler*& masm,
-    const char* description,
-    Bytecodes::Code bytecode = Bytecodes::_illegal):
-    _clet((InterpreterCodelet*)AbstractInterpreter::code()->request(codelet_size())),
-    _cb(_clet->code_begin(), _clet->code_size())
-
-  { // request all space (add some slack for Codelet data)
-    assert (_clet != NULL, "we checked not enough space already");
-
-    // initialize Codelet attributes
-    _clet->initialize(description, bytecode);
-    // create assembler for code generation
-    masm  = new InterpreterMacroAssembler(&_cb);
-    _masm = &masm;
-  }
-
-  ~CodeletMark() {
-    // align so printing shows nop's instead of random code at the end (Codelets are aligned)
-    (*_masm)->align(wordSize);
-    // make sure all code is in code buffer
-    (*_masm)->flush();
-
-
-    // commit Codelet
-    AbstractInterpreter::code()->commit((*_masm)->code()->pure_insts_size(), (*_masm)->code()->strings());
-    // make sure nobody can use _masm outside a CodeletMark lifespan
-    *_masm = NULL;
-  }
+  CodeletMark(InterpreterMacroAssembler*& masm,
+              const char* description,
+              Bytecodes::Code bytecode = Bytecodes::_illegal);
+  ~CodeletMark();
 };
 
 // Wrapper classes to produce Interpreter/InterpreterGenerator from either
@@ -142,9 +119,10 @@
 
 class Interpreter: public CC_INTERP_ONLY(CppInterpreter) NOT_CC_INTERP(TemplateInterpreter) {
 
-  public:
+ public:
   // Debugging/printing
-  static InterpreterCodelet* codelet_containing(address pc)     { return (InterpreterCodelet*)_code->stub_containing(pc); }
+  static InterpreterCodelet* codelet_containing(address pc) { return (InterpreterCodelet*)_code->stub_containing(pc); }
+
 #ifdef TARGET_ARCH_x86
 # include "interpreter_x86.hpp"
 #endif
--- a/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -48,6 +48,7 @@
 #include "runtime/deoptimization.hpp"
 #include "runtime/fieldDescriptor.hpp"
 #include "runtime/handles.inline.hpp"
+#include "runtime/icache.hpp"
 #include "runtime/interfaceSupport.hpp"
 #include "runtime/java.hpp"
 #include "runtime/jfieldIDWorkaround.hpp"
@@ -57,21 +58,6 @@
 #include "runtime/synchronizer.hpp"
 #include "runtime/threadCritical.hpp"
 #include "utilities/events.hpp"
-#ifdef TARGET_ARCH_x86
-# include "vm_version_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "vm_version_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_zero
-# include "vm_version_zero.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "vm_version_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "vm_version_ppc.hpp"
-#endif
 #ifdef COMPILER2
 #include "opto/runtime.hpp"
 #endif
--- a/hotspot/src/share/vm/interpreter/templateInterpreter.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/interpreter/templateInterpreter.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -26,6 +26,8 @@
 #include "interpreter/interpreter.hpp"
 #include "interpreter/interpreterGenerator.hpp"
 #include "interpreter/interpreterRuntime.hpp"
+#include "interpreter/interp_masm.hpp"
+#include "interpreter/templateInterpreter.hpp"
 #include "interpreter/templateTable.hpp"
 
 #ifndef CC_INTERP
--- a/hotspot/src/share/vm/interpreter/templateInterpreter.hpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/interpreter/templateInterpreter.hpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -33,6 +33,8 @@
 
 #ifndef CC_INTERP
 
+class InterpreterMacroAssembler;
+
 //------------------------------------------------------------------------------------------------------------------------
 // A little wrapper class to group tosca-specific entry points into a unit.
 // (tosca = Top-Of-Stack CAche)
--- a/hotspot/src/share/vm/interpreter/templateTable.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/interpreter/templateTable.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, 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,6 +24,7 @@
 
 #include "precompiled.hpp"
 #include "gc_interface/collectedHeap.hpp"
+#include "interpreter/interp_masm.hpp"
 #include "interpreter/templateTable.hpp"
 #include "runtime/timer.hpp"
 
--- a/hotspot/src/share/vm/interpreter/templateTable.hpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/interpreter/templateTable.hpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, 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,24 +28,6 @@
 #include "interpreter/bytecodes.hpp"
 #include "memory/allocation.hpp"
 #include "runtime/frame.hpp"
-#ifdef TARGET_ARCH_x86
-# include "interp_masm_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_sparc
-# include "interp_masm_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_zero
-# include "interp_masm_zero.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_arm
-# include "interp_masm_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_ppc_32
-# include "interp_masm_ppc_32.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_ppc_64
-# include "interp_masm_ppc_64.hpp"
-#endif
 
 #ifndef CC_INTERP
 // All the necessary definitions used for (bytecode) template generation. Instead of
@@ -53,6 +35,7 @@
 // and the snippet generator, a template is assigned to each bytecode which can be
 // used to generate the bytecode's implementation if needed.
 
+class InterpreterMacroAssembler;
 
 // A Template describes the properties of a code template for a given bytecode
 // and provides a generator to generate the code template.
--- a/hotspot/src/share/vm/memory/filemap.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/memory/filemap.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -30,6 +30,7 @@
 #include "runtime/arguments.hpp"
 #include "runtime/java.hpp"
 #include "runtime/os.hpp"
+#include "runtime/vm_version.hpp"
 #include "services/memTracker.hpp"
 #include "utilities/defaultStream.hpp"
 
--- a/hotspot/src/share/vm/memory/genCollectedHeap.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/memory/genCollectedHeap.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1088,7 +1088,7 @@
   guarantee(_n_gens = 2, "Wrong number of generations");
   Generation* old_gen = _gens[1];
   // Start by compacting into same gen.
-  CompactPoint cp(old_gen, NULL, NULL);
+  CompactPoint cp(old_gen);
   old_gen->prepare_for_compaction(&cp);
   Generation* young_gen = _gens[0];
   young_gen->prepare_for_compaction(&cp);
--- a/hotspot/src/share/vm/memory/genMarkSweep.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/memory/genMarkSweep.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -76,7 +76,6 @@
   // When collecting the permanent generation Method*s may be moving,
   // so we either have to flush all bcp data or convert it into bci.
   CodeCache::gc_prologue();
-  Threads::gc_prologue();
 
   // Increment the invocation count
   _total_invocations++;
@@ -132,7 +131,6 @@
     rs->invalidate_or_clear(old_gen);
   }
 
-  Threads::gc_epilogue();
   CodeCache::gc_epilogue();
   JvmtiExport::gc_epilogue();
 
--- a/hotspot/src/share/vm/memory/space.hpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/memory/space.hpp	Wed Jul 05 19:53:51 2017 +0200
@@ -330,9 +330,9 @@
   Generation* gen;
   CompactibleSpace* space;
   HeapWord* threshold;
-  CompactPoint(Generation* _gen, CompactibleSpace* _space,
-               HeapWord* _threshold) :
-    gen(_gen), space(_space), threshold(_threshold) {}
+
+  CompactPoint(Generation* _gen) :
+    gen(_gen), space(NULL), threshold(0) {}
 };
 
 
--- a/hotspot/src/share/vm/memory/threadLocalAllocBuffer.hpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/memory/threadLocalAllocBuffer.hpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, 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,6 +28,7 @@
 #include "gc_implementation/shared/gcUtil.hpp"
 #include "oops/typeArrayOop.hpp"
 #include "runtime/perfData.hpp"
+#include "runtime/vm_version.hpp"
 
 class GlobalTLABStats;
 
--- a/hotspot/src/share/vm/oops/constantPool.hpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/oops/constantPool.hpp	Wed Jul 05 19:53:51 2017 +0200
@@ -31,22 +31,8 @@
 #include "oops/symbol.hpp"
 #include "oops/typeArrayOop.hpp"
 #include "runtime/handles.hpp"
+#include "utilities/bytes.hpp"
 #include "utilities/constantTag.hpp"
-#ifdef TARGET_ARCH_x86
-# include "bytes_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "bytes_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_zero
-# include "bytes_zero.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "bytes_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "bytes_ppc.hpp"
-#endif
 
 // A ConstantPool is an array containing class constants as described in the
 // class file.
--- a/hotspot/src/share/vm/oops/method.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/oops/method.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -240,6 +240,9 @@
 
 
 int Method::bci_from(address bcp) const {
+  if (is_native() && bcp == 0) {
+    return 0;
+  }
 #ifdef ASSERT
   { ResourceMark rm;
   assert(is_native() && bcp == code_base() || contains(bcp) || is_error_reported(),
@@ -250,24 +253,23 @@
 }
 
 
-// Return (int)bcx if it appears to be a valid BCI.
-// Return bci_from((address)bcx) if it appears to be a valid BCP.
+int Method::validate_bci(int bci) const {
+  return (bci == 0 || bci < code_size()) ? bci : -1;
+}
+
+// Return bci if it appears to be a valid bcp
 // Return -1 otherwise.
 // Used by profiling code, when invalid data is a possibility.
 // The caller is responsible for validating the Method* itself.
-int Method::validate_bci_from_bcx(intptr_t bcx) const {
+int Method::validate_bci_from_bcp(address bcp) const {
   // keep bci as -1 if not a valid bci
   int bci = -1;
-  if (bcx == 0 || (address)bcx == code_base()) {
+  if (bcp == 0 || bcp == code_base()) {
     // code_size() may return 0 and we allow 0 here
     // the method may be native
     bci = 0;
-  } else if (frame::is_bci(bcx)) {
-    if (bcx < code_size()) {
-      bci = (int)bcx;
-    }
-  } else if (contains((address)bcx)) {
-    bci = (address)bcx - code_base();
+  } else if (contains(bcp)) {
+    bci = bcp - code_base();
   }
   // Assert that if we have dodged any asserts, bci is negative.
   assert(bci == -1 || bci == bci_from(bcp_from(bci)), "sane bci if >=0");
--- a/hotspot/src/share/vm/oops/method.hpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/oops/method.hpp	Wed Jul 05 19:53:51 2017 +0200
@@ -649,7 +649,8 @@
   // Returns the byte code index from the byte code pointer
   int     bci_from(address bcp) const;
   address bcp_from(int     bci) const;
-  int validate_bci_from_bcx(intptr_t bcx) const;
+  int validate_bci_from_bcp(address bcp) const;
+  int validate_bci(int bci) const;
 
   // Returns the line number for a bci if debugging information for the method is prowided,
   // -1 is returned otherwise.
--- a/hotspot/src/share/vm/oops/methodData.hpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/oops/methodData.hpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, 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
@@ -2338,10 +2338,6 @@
     return dp - ((address)_data);
   }
 
-  address di_to_dp(int di) {
-    return (address)data_layout_at(di);
-  }
-
   // bci to di/dp conversion.
   address bci_to_dp(int bci);
   int bci_to_di(int bci) {
--- a/hotspot/src/share/vm/oops/oop.inline.hpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/oops/oop.inline.hpp	Wed Jul 05 19:53:51 2017 +0200
@@ -42,21 +42,6 @@
 #include "runtime/orderAccess.inline.hpp"
 #include "runtime/os.hpp"
 #include "utilities/macros.hpp"
-#ifdef TARGET_ARCH_x86
-# include "bytes_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "bytes_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_zero
-# include "bytes_zero.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "bytes_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "bytes_ppc.hpp"
-#endif
 
 // Implementation of all inlined member functions defined in oop.hpp
 // We need a separate file to avoid circular references
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/src/share/vm/opto/ad.hpp	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2014, 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_OPTO_AD_HPP
+#define SHARE_VM_OPTO_AD_HPP
+
+#ifdef TARGET_ARCH_MODEL_x86_32
+# include "adfiles/ad_x86_32.hpp"
+#endif
+#ifdef TARGET_ARCH_MODEL_x86_64
+# include "adfiles/ad_x86_64.hpp"
+#endif
+#ifdef TARGET_ARCH_MODEL_sparc
+# include "adfiles/ad_sparc.hpp"
+#endif
+#ifdef TARGET_ARCH_MODEL_zero
+# include "adfiles/ad_zero.hpp"
+#endif
+#ifdef TARGET_ARCH_MODEL_arm
+# include "adfiles/ad_arm.hpp"
+#endif
+#ifdef TARGET_ARCH_MODEL_ppc_32
+# include "adfiles/ad_ppc_32.hpp"
+#endif
+#ifdef TARGET_ARCH_MODEL_ppc_64
+# include "adfiles/ad_ppc_64.hpp"
+#endif
+
+#endif // SHARE_VM_OPTO_AD_HPP
--- a/hotspot/src/share/vm/opto/buildOopMap.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/opto/buildOopMap.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2014, 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
@@ -23,6 +23,7 @@
  */
 
 #include "precompiled.hpp"
+#include "code/vmreg.inline.hpp"
 #include "compiler/oopMap.hpp"
 #include "opto/addnode.hpp"
 #include "opto/callnode.hpp"
@@ -32,21 +33,6 @@
 #include "opto/phase.hpp"
 #include "opto/regalloc.hpp"
 #include "opto/rootnode.hpp"
-#ifdef TARGET_ARCH_x86
-# include "vmreg_x86.inline.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "vmreg_sparc.inline.hpp"
-#endif
-#ifdef TARGET_ARCH_zero
-# include "vmreg_zero.inline.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "vmreg_arm.inline.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "vmreg_ppc.inline.hpp"
-#endif
 
 // The functions in this file builds OopMaps after all scheduling is done.
 //
--- a/hotspot/src/share/vm/opto/c2compiler.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/opto/c2compiler.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, 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,28 +24,8 @@
 
 #include "precompiled.hpp"
 #include "opto/c2compiler.hpp"
+#include "opto/optoreg.hpp"
 #include "opto/runtime.hpp"
-#ifdef TARGET_ARCH_MODEL_x86_32
-# include "adfiles/ad_x86_32.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_x86_64
-# include "adfiles/ad_x86_64.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_sparc
-# include "adfiles/ad_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_zero
-# include "adfiles/ad_zero.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_arm
-# include "adfiles/ad_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_ppc_32
-# include "adfiles/ad_ppc_32.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_ppc_64
-# include "adfiles/ad_ppc_64.hpp"
-#endif
 
 // register information defined by ADLC
 extern const char register_save_policy[];
--- a/hotspot/src/share/vm/opto/compile.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/opto/compile.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -69,27 +69,6 @@
 #include "runtime/timer.hpp"
 #include "trace/tracing.hpp"
 #include "utilities/copy.hpp"
-#ifdef TARGET_ARCH_MODEL_x86_32
-# include "adfiles/ad_x86_32.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_x86_64
-# include "adfiles/ad_x86_64.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_sparc
-# include "adfiles/ad_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_zero
-# include "adfiles/ad_zero.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_arm
-# include "adfiles/ad_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_ppc_32
-# include "adfiles/ad_ppc_32.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_ppc_64
-# include "adfiles/ad_ppc_64.hpp"
-#endif
 
 
 // -------------------- Compile::mach_constant_base_node -----------------------
--- a/hotspot/src/share/vm/opto/gcm.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/opto/gcm.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -35,28 +35,6 @@
 #include "opto/rootnode.hpp"
 #include "opto/runtime.hpp"
 #include "runtime/deoptimization.hpp"
-#ifdef TARGET_ARCH_MODEL_x86_32
-# include "adfiles/ad_x86_32.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_x86_64
-# include "adfiles/ad_x86_64.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_sparc
-# include "adfiles/ad_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_zero
-# include "adfiles/ad_zero.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_arm
-# include "adfiles/ad_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_ppc_32
-# include "adfiles/ad_ppc_32.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_ppc_64
-# include "adfiles/ad_ppc_64.hpp"
-#endif
-
 
 // Portions of code courtesy of Clifford Click
 
--- a/hotspot/src/share/vm/opto/lcm.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/opto/lcm.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014, 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,33 +24,13 @@
 
 #include "precompiled.hpp"
 #include "memory/allocation.inline.hpp"
+#include "opto/ad.hpp"
 #include "opto/block.hpp"
 #include "opto/c2compiler.hpp"
 #include "opto/callnode.hpp"
 #include "opto/cfgnode.hpp"
 #include "opto/machnode.hpp"
 #include "opto/runtime.hpp"
-#ifdef TARGET_ARCH_MODEL_x86_32
-# include "adfiles/ad_x86_32.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_x86_64
-# include "adfiles/ad_x86_64.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_sparc
-# include "adfiles/ad_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_zero
-# include "adfiles/ad_zero.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_arm
-# include "adfiles/ad_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_ppc_32
-# include "adfiles/ad_ppc_32.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_ppc_64
-# include "adfiles/ad_ppc_64.hpp"
-#endif
 
 // Optimization - Graph Style
 
--- a/hotspot/src/share/vm/opto/library_call.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/opto/library_call.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -23,6 +23,7 @@
  */
 
 #include "precompiled.hpp"
+#include "asm/macroAssembler.hpp"
 #include "classfile/systemDictionary.hpp"
 #include "classfile/vmSymbols.hpp"
 #include "compiler/compileBroker.hpp"
--- a/hotspot/src/share/vm/opto/locknode.hpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/opto/locknode.hpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, 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,27 +28,9 @@
 #include "opto/node.hpp"
 #include "opto/opcodes.hpp"
 #include "opto/subnode.hpp"
-#ifdef TARGET_ARCH_MODEL_x86_32
-# include "adfiles/ad_x86_32.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_x86_64
-# include "adfiles/ad_x86_64.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_sparc
-# include "adfiles/ad_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_zero
-# include "adfiles/ad_zero.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_arm
-# include "adfiles/ad_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_ppc_32
-# include "adfiles/ad_ppc_32.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_ppc_64
-# include "adfiles/ad_ppc_64.hpp"
-#endif
+
+class BiasedLockingCounters;
+class RTMLockingCounters;
 
 //------------------------------BoxLockNode------------------------------------
 class BoxLockNode : public Node {
--- a/hotspot/src/share/vm/opto/matcher.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/opto/matcher.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -24,6 +24,7 @@
 
 #include "precompiled.hpp"
 #include "memory/allocation.inline.hpp"
+#include "opto/ad.hpp"
 #include "opto/addnode.hpp"
 #include "opto/callnode.hpp"
 #include "opto/idealGraphPrinter.hpp"
@@ -37,27 +38,6 @@
 #include "opto/type.hpp"
 #include "opto/vectornode.hpp"
 #include "runtime/os.hpp"
-#ifdef TARGET_ARCH_MODEL_x86_32
-# include "adfiles/ad_x86_32.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_x86_64
-# include "adfiles/ad_x86_64.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_sparc
-# include "adfiles/ad_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_zero
-# include "adfiles/ad_zero.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_arm
-# include "adfiles/ad_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_ppc_32
-# include "adfiles/ad_ppc_32.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_ppc_64
-# include "adfiles/ad_ppc_64.hpp"
-#endif
 
 OptoReg::Name OptoReg::c_frame_pointer;
 
--- a/hotspot/src/share/vm/opto/optoreg.hpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/opto/optoreg.hpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,30 @@
 #ifndef SHARE_VM_OPTO_OPTOREG_HPP
 #define SHARE_VM_OPTO_OPTOREG_HPP
 
+// AdGlobals contains c2 specific register handling code as specified
+// in the .ad files.
+#ifdef TARGET_ARCH_MODEL_x86_32
+# include "adfiles/adGlobals_x86_32.hpp"
+#endif
+#ifdef TARGET_ARCH_MODEL_x86_64
+# include "adfiles/adGlobals_x86_64.hpp"
+#endif
+#ifdef TARGET_ARCH_MODEL_sparc
+# include "adfiles/adGlobals_sparc.hpp"
+#endif
+#ifdef TARGET_ARCH_MODEL_zero
+# include "adfiles/adGlobals_zero.hpp"
+#endif
+#ifdef TARGET_ARCH_MODEL_arm
+# include "adfiles/adGlobals_arm.hpp"
+#endif
+#ifdef TARGET_ARCH_MODEL_ppc_32
+# include "adfiles/adGlobals_ppc_32.hpp"
+#endif
+#ifdef TARGET_ARCH_MODEL_ppc_64
+# include "adfiles/adGlobals_ppc_64.hpp"
+#endif
+
 //------------------------------OptoReg----------------------------------------
 // We eventually need Registers for the Real World.  Registers are essentially
 // non-SSA names.  A Register is represented as a number.  Non-regular values
--- a/hotspot/src/share/vm/opto/output.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/opto/output.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -30,10 +30,12 @@
 #include "compiler/compileBroker.hpp"
 #include "compiler/oopMap.hpp"
 #include "memory/allocation.inline.hpp"
+#include "opto/ad.hpp"
 #include "opto/callnode.hpp"
 #include "opto/cfgnode.hpp"
 #include "opto/locknode.hpp"
 #include "opto/machnode.hpp"
+#include "opto/optoreg.hpp"
 #include "opto/output.hpp"
 #include "opto/regalloc.hpp"
 #include "opto/runtime.hpp"
--- a/hotspot/src/share/vm/opto/output.hpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/opto/output.hpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, 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,29 +25,9 @@
 #ifndef SHARE_VM_OPTO_OUTPUT_HPP
 #define SHARE_VM_OPTO_OUTPUT_HPP
 
+#include "opto/ad.hpp"
 #include "opto/block.hpp"
 #include "opto/node.hpp"
-#ifdef TARGET_ARCH_MODEL_x86_32
-# include "adfiles/ad_x86_32.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_x86_64
-# include "adfiles/ad_x86_64.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_sparc
-# include "adfiles/ad_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_zero
-# include "adfiles/ad_zero.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_arm
-# include "adfiles/ad_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_ppc_32
-# include "adfiles/ad_ppc_32.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_ppc_64
-# include "adfiles/ad_ppc_64.hpp"
-#endif
 
 class Arena;
 class Bundle;
--- a/hotspot/src/share/vm/opto/phaseX.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/opto/phaseX.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1089,7 +1089,7 @@
 #endif
 
   while (i != NULL) {
-#ifndef PRODUCT
+#ifdef ASSERT
     if (loop_count >= K) {
       dump_infinite_loop_info(i);
     }
--- a/hotspot/src/share/vm/opto/regmask.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/opto/regmask.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -23,29 +23,9 @@
  */
 
 #include "precompiled.hpp"
+#include "opto/ad.hpp"
 #include "opto/compile.hpp"
 #include "opto/regmask.hpp"
-#ifdef TARGET_ARCH_MODEL_x86_32
-# include "adfiles/ad_x86_32.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_x86_64
-# include "adfiles/ad_x86_64.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_sparc
-# include "adfiles/ad_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_zero
-# include "adfiles/ad_zero.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_arm
-# include "adfiles/ad_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_ppc_32
-# include "adfiles/ad_ppc_32.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_ppc_64
-# include "adfiles/ad_ppc_64.hpp"
-#endif
 
 #define RM_SIZE _RM_SIZE /* a constant private to the class RegMask */
 
--- a/hotspot/src/share/vm/opto/regmask.hpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/opto/regmask.hpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, 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,27 +27,6 @@
 
 #include "code/vmreg.hpp"
 #include "opto/optoreg.hpp"
-#ifdef TARGET_ARCH_MODEL_x86_32
-# include "adfiles/adGlobals_x86_32.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_x86_64
-# include "adfiles/adGlobals_x86_64.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_sparc
-# include "adfiles/adGlobals_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_zero
-# include "adfiles/adGlobals_zero.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_arm
-# include "adfiles/adGlobals_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_ppc_32
-# include "adfiles/adGlobals_ppc_32.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_ppc_64
-# include "adfiles/adGlobals_ppc_64.hpp"
-#endif
 
 // Some fun naming (textual) substitutions:
 //
--- a/hotspot/src/share/vm/opto/runtime.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/opto/runtime.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -25,6 +25,7 @@
 #include "precompiled.hpp"
 #include "classfile/systemDictionary.hpp"
 #include "classfile/vmSymbols.hpp"
+#include "code/codeCache.hpp"
 #include "code/compiledIC.hpp"
 #include "code/icBuffer.hpp"
 #include "code/nmethod.hpp"
@@ -45,6 +46,7 @@
 #include "memory/oopFactory.hpp"
 #include "oops/objArrayKlass.hpp"
 #include "oops/oop.inline.hpp"
+#include "opto/ad.hpp"
 #include "opto/addnode.hpp"
 #include "opto/callnode.hpp"
 #include "opto/cfgnode.hpp"
@@ -68,27 +70,6 @@
 #include "runtime/vframe_hp.hpp"
 #include "utilities/copy.hpp"
 #include "utilities/preserveException.hpp"
-#ifdef TARGET_ARCH_MODEL_x86_32
-# include "adfiles/ad_x86_32.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_x86_64
-# include "adfiles/ad_x86_64.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_sparc
-# include "adfiles/ad_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_zero
-# include "adfiles/ad_zero.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_arm
-# include "adfiles/ad_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_ppc_32
-# include "adfiles/ad_ppc_32.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_ppc_64
-# include "adfiles/ad_ppc_64.hpp"
-#endif
 
 
 // For debugging purposes:
--- a/hotspot/src/share/vm/opto/runtime.hpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/opto/runtime.hpp	Wed Jul 05 19:53:51 2017 +0200
@@ -27,6 +27,7 @@
 
 #include "code/codeBlob.hpp"
 #include "opto/machnode.hpp"
+#include "opto/optoreg.hpp"
 #include "opto/type.hpp"
 #include "runtime/biasedLocking.hpp"
 #include "runtime/rtmLocking.hpp"
--- a/hotspot/src/share/vm/precompiled/precompiled.hpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/precompiled/precompiled.hpp	Wed Jul 05 19:53:51 2017 +0200
@@ -70,6 +70,7 @@
 # include "code/exceptionHandlerTable.hpp"
 # include "code/jvmticmlr.h"
 # include "code/location.hpp"
+# include "code/nativeInst.hpp"
 # include "code/nmethod.hpp"
 # include "code/oopRecorder.hpp"
 # include "code/pcDesc.hpp"
@@ -106,6 +107,7 @@
 # include "interpreter/bytecodes.hpp"
 # include "interpreter/cppInterpreter.hpp"
 # include "interpreter/interpreter.hpp"
+# include "interpreter/interp_masm.hpp"
 # include "interpreter/invocationCounter.hpp"
 # include "interpreter/linkResolver.hpp"
 # include "interpreter/templateInterpreter.hpp"
@@ -228,6 +230,7 @@
 # include "utilities/array.hpp"
 # include "utilities/bitMap.hpp"
 # include "utilities/bitMap.inline.hpp"
+# include "utilities/bytes.hpp"
 # include "utilities/constantTag.hpp"
 # include "utilities/copy.hpp"
 # include "utilities/debug.hpp"
@@ -250,6 +253,7 @@
 # include "libadt/dict.hpp"
 # include "libadt/set.hpp"
 # include "libadt/vectset.hpp"
+# include "opto/ad.hpp"
 # include "opto/addnode.hpp"
 # include "opto/adlcVMDeps.hpp"
 # include "opto/block.hpp"
--- a/hotspot/src/share/vm/prims/forte.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/prims/forte.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, 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
@@ -234,9 +234,8 @@
     *method_p = method;
     if (!method->is_valid_method()) return false;
 
-    intptr_t bcx = fr->interpreter_frame_bcx();
-
-    int      bci = method->validate_bci_from_bcx(bcx);
+    address bcp = fr->interpreter_frame_bcp();
+    int bci = method->validate_bci_from_bcp(bcp);
 
     // note: bci is set to -1 if not a valid bci
     *bci_p = bci;
--- a/hotspot/src/share/vm/prims/jniCheck.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/prims/jniCheck.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -37,21 +37,6 @@
 #include "runtime/interfaceSupport.hpp"
 #include "runtime/jfieldIDWorkaround.hpp"
 #include "runtime/thread.inline.hpp"
-#ifdef TARGET_ARCH_x86
-# include "jniTypes_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "jniTypes_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_zero
-# include "jniTypes_zero.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "jniTypes_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "jniTypes_ppc.hpp"
-#endif
 
 // Complain every extra number of unplanned local refs
 #define CHECK_JNI_LOCAL_REF_CAP_WARN_THRESHOLD 32
--- a/hotspot/src/share/vm/prims/jvm.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/prims/jvm.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -59,6 +59,7 @@
 #include "runtime/thread.inline.hpp"
 #include "runtime/vframe.hpp"
 #include "runtime/vm_operations.hpp"
+#include "runtime/vm_version.hpp"
 #include "services/attachListener.hpp"
 #include "services/management.hpp"
 #include "services/threadService.hpp"
--- a/hotspot/src/share/vm/prims/jvmtiClassFileReconstituter.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/prims/jvmtiClassFileReconstituter.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2014, 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,21 +28,8 @@
 #include "oops/fieldStreams.hpp"
 #include "prims/jvmtiClassFileReconstituter.hpp"
 #include "runtime/signature.hpp"
-#ifdef TARGET_ARCH_x86
-# include "bytes_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "bytes_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_zero
-# include "bytes_zero.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "bytes_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "bytes_ppc.hpp"
-#endif
+#include "utilities/bytes.hpp"
+
 // FIXME: add Deprecated attribute
 // FIXME: fix Synthetic attribute
 // FIXME: per Serguei, add error return handling for ConstantPool::copy_cpool_bytes()
--- a/hotspot/src/share/vm/prims/jvmtiTagMap.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/prims/jvmtiTagMap.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, 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,6 +26,7 @@
 #include "classfile/symbolTable.hpp"
 #include "classfile/systemDictionary.hpp"
 #include "classfile/vmSymbols.hpp"
+#include "code/codeCache.hpp"
 #include "jvmtifiles/jvmtiEnv.hpp"
 #include "oops/instanceMirrorKlass.hpp"
 #include "oops/objArrayKlass.hpp"
--- a/hotspot/src/share/vm/prims/unsafe.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/prims/unsafe.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -38,6 +38,7 @@
 #include "runtime/orderAccess.inline.hpp"
 #include "runtime/reflection.hpp"
 #include "runtime/synchronizer.hpp"
+#include "runtime/vm_version.hpp"
 #include "services/threadService.hpp"
 #include "trace/tracing.hpp"
 #include "utilities/copy.hpp"
--- a/hotspot/src/share/vm/prims/whitebox.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/prims/whitebox.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -24,6 +24,7 @@
 
 #include "precompiled.hpp"
 
+#include "code/codeCache.hpp"
 #include "memory/metadataFactory.hpp"
 #include "memory/universe.hpp"
 #include "oops/oop.inline.hpp"
@@ -38,6 +39,7 @@
 #include "runtime/arguments.hpp"
 #include "runtime/interfaceSupport.hpp"
 #include "runtime/os.hpp"
+#include "runtime/vm_version.hpp"
 
 #include "utilities/array.hpp"
 #include "utilities/debug.hpp"
--- a/hotspot/src/share/vm/runtime/advancedThresholdPolicy.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/runtime/advancedThresholdPolicy.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2014, 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
@@ -23,6 +23,7 @@
  */
 
 #include "precompiled.hpp"
+#include "code/codeCache.hpp"
 #include "runtime/advancedThresholdPolicy.hpp"
 #include "runtime/simpleThresholdPolicy.inline.hpp"
 
--- a/hotspot/src/share/vm/runtime/arguments.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/runtime/arguments.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -38,6 +38,7 @@
 #include "runtime/globals_extension.hpp"
 #include "runtime/java.hpp"
 #include "runtime/os.hpp"
+#include "runtime/vm_version.hpp"
 #include "services/management.hpp"
 #include "services/memTracker.hpp"
 #include "utilities/defaultStream.hpp"
@@ -1537,8 +1538,10 @@
     heap_alignment = G1CollectedHeap::conservative_max_heap_alignment();
   }
 #endif // INCLUDE_ALL_GCS
-  _conservative_max_heap_alignment = MAX3(heap_alignment, os::max_page_size(),
-    CollectorPolicy::compute_heap_alignment());
+  _conservative_max_heap_alignment = MAX4(heap_alignment,
+                                          (size_t)os::vm_allocation_granularity(),
+                                          os::max_page_size(),
+                                          CollectorPolicy::compute_heap_alignment());
 }
 
 void Arguments::set_ergonomics_flags() {
--- a/hotspot/src/share/vm/runtime/deoptimization.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/runtime/deoptimization.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -24,6 +24,7 @@
 
 #include "precompiled.hpp"
 #include "classfile/systemDictionary.hpp"
+#include "code/codeCache.hpp"
 #include "code/debugInfoRec.hpp"
 #include "code/nmethod.hpp"
 #include "code/pcDesc.hpp"
@@ -50,44 +51,6 @@
 #include "runtime/vframe_hp.hpp"
 #include "utilities/events.hpp"
 #include "utilities/xmlstream.hpp"
-#ifdef TARGET_ARCH_x86
-# include "vmreg_x86.inline.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "vmreg_sparc.inline.hpp"
-#endif
-#ifdef TARGET_ARCH_zero
-# include "vmreg_zero.inline.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "vmreg_arm.inline.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "vmreg_ppc.inline.hpp"
-#endif
-#ifdef COMPILER2
-#ifdef TARGET_ARCH_MODEL_x86_32
-# include "adfiles/ad_x86_32.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_x86_64
-# include "adfiles/ad_x86_64.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_sparc
-# include "adfiles/ad_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_zero
-# include "adfiles/ad_zero.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_arm
-# include "adfiles/ad_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_ppc_32
-# include "adfiles/ad_ppc_32.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_ppc_64
-# include "adfiles/ad_ppc_64.hpp"
-#endif
-#endif // COMPILER2
 
 PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
 
--- a/hotspot/src/share/vm/runtime/dtraceJSDT.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/runtime/dtraceJSDT.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -25,6 +25,7 @@
 #include "precompiled.hpp"
 #include "classfile/javaClasses.hpp"
 #include "code/codeBlob.hpp"
+#include "code/nativeInst.hpp"
 #include "memory/allocation.hpp"
 #include "prims/jvm.h"
 #include "runtime/dtraceJSDT.hpp"
--- a/hotspot/src/share/vm/runtime/dtraceJSDT.hpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/runtime/dtraceJSDT.hpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, 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,21 +26,6 @@
 #define SHARE_VM_RUNTIME_DTRACEJSDT_HPP
 
 #include "code/nmethod.hpp"
-#ifdef TARGET_ARCH_x86
-# include "nativeInst_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "nativeInst_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_zero
-# include "nativeInst_zero.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "nativeInst_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "nativeInst_ppc.hpp"
-#endif
 
 class RegisteredProbes;
 typedef jlong OpaqueProbes;
--- a/hotspot/src/share/vm/runtime/fprofiler.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/runtime/fprofiler.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -24,6 +24,7 @@
 
 #include "precompiled.hpp"
 #include "classfile/classLoader.hpp"
+#include "code/codeCache.hpp"
 #include "code/vtableStubs.hpp"
 #include "gc_interface/collectedHeap.inline.hpp"
 #include "interpreter/interpreter.hpp"
--- a/hotspot/src/share/vm/runtime/frame.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/runtime/frame.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -23,6 +23,8 @@
  */
 
 #include "precompiled.hpp"
+#include "code/codeCache.hpp"
+#include "code/vmreg.inline.hpp"
 #include "compiler/abstractCompiler.hpp"
 #include "compiler/disassembler.hpp"
 #include "gc_interface/collectedHeap.inline.hpp"
@@ -48,21 +50,6 @@
 #include "runtime/thread.inline.hpp"
 #include "utilities/decoder.hpp"
 
-#ifdef TARGET_ARCH_x86
-# include "nativeInst_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "nativeInst_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_zero
-# include "nativeInst_zero.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "nativeInst_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "nativeInst_ppc.hpp"
-#endif
 
 PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
 
@@ -412,91 +399,32 @@
   *interpreter_frame_method_addr() = method;
 }
 
-void frame::interpreter_frame_set_bcx(intptr_t bcx) {
-  assert(is_interpreted_frame(), "Not an interpreted frame");
-  if (ProfileInterpreter) {
-    bool formerly_bci = is_bci(interpreter_frame_bcx());
-    bool is_now_bci = is_bci(bcx);
-    *interpreter_frame_bcx_addr() = bcx;
-
-    intptr_t mdx = interpreter_frame_mdx();
-
-    if (mdx != 0) {
-      if (formerly_bci) {
-        if (!is_now_bci) {
-          // The bcx was just converted from bci to bcp.
-          // Convert the mdx in parallel.
-          MethodData* mdo = interpreter_frame_method()->method_data();
-          assert(mdo != NULL, "");
-          int mdi = mdx - 1; // We distinguish valid mdi from zero by adding one.
-          address mdp = mdo->di_to_dp(mdi);
-          interpreter_frame_set_mdx((intptr_t)mdp);
-        }
-      } else {
-        if (is_now_bci) {
-          // The bcx was just converted from bcp to bci.
-          // Convert the mdx in parallel.
-          MethodData* mdo = interpreter_frame_method()->method_data();
-          assert(mdo != NULL, "");
-          int mdi = mdo->dp_to_di((address)mdx);
-          interpreter_frame_set_mdx((intptr_t)mdi + 1); // distinguish valid from 0.
-        }
-      }
-    }
-  } else {
-    *interpreter_frame_bcx_addr() = bcx;
-  }
-}
-
 jint frame::interpreter_frame_bci() const {
   assert(is_interpreted_frame(), "interpreted frame expected");
-  intptr_t bcx = interpreter_frame_bcx();
-  return is_bci(bcx) ? bcx : interpreter_frame_method()->bci_from((address)bcx);
-}
-
-void frame::interpreter_frame_set_bci(jint bci) {
-  assert(is_interpreted_frame(), "interpreted frame expected");
-  assert(!is_bci(interpreter_frame_bcx()), "should not set bci during GC");
-  interpreter_frame_set_bcx((intptr_t)interpreter_frame_method()->bcp_from(bci));
+  address bcp = interpreter_frame_bcp();
+  return interpreter_frame_method()->bci_from(bcp);
 }
 
 address frame::interpreter_frame_bcp() const {
   assert(is_interpreted_frame(), "interpreted frame expected");
-  intptr_t bcx = interpreter_frame_bcx();
-  return is_bci(bcx) ? interpreter_frame_method()->bcp_from(bcx) : (address)bcx;
+  return (address)*interpreter_frame_bcp_addr();
 }
 
 void frame::interpreter_frame_set_bcp(address bcp) {
   assert(is_interpreted_frame(), "interpreted frame expected");
-  assert(!is_bci(interpreter_frame_bcx()), "should not set bcp during GC");
-  interpreter_frame_set_bcx((intptr_t)bcp);
-}
-
-void frame::interpreter_frame_set_mdx(intptr_t mdx) {
-  assert(is_interpreted_frame(), "Not an interpreted frame");
-  assert(ProfileInterpreter, "must be profiling interpreter");
-  *interpreter_frame_mdx_addr() = mdx;
+  *interpreter_frame_bcp_addr() = (intptr_t)bcp;
 }
 
 address frame::interpreter_frame_mdp() const {
   assert(ProfileInterpreter, "must be profiling interpreter");
   assert(is_interpreted_frame(), "interpreted frame expected");
-  intptr_t bcx = interpreter_frame_bcx();
-  intptr_t mdx = interpreter_frame_mdx();
-
-  assert(!is_bci(bcx), "should not access mdp during GC");
-  return (address)mdx;
+  return (address)*interpreter_frame_mdp_addr();
 }
 
 void frame::interpreter_frame_set_mdp(address mdp) {
   assert(is_interpreted_frame(), "interpreted frame expected");
-  if (mdp == NULL) {
-    // Always allow the mdp to be cleared.
-    interpreter_frame_set_mdx((intptr_t)mdp);
-  }
-  intptr_t bcx = interpreter_frame_bcx();
-  assert(!is_bci(bcx), "should not set mdp during GC");
-  interpreter_frame_set_mdx((intptr_t)mdp);
+  assert(ProfileInterpreter, "must be profiling interpreter");
+  *interpreter_frame_mdp_addr() = (intptr_t)mdp;
 }
 
 BasicObjectLock* frame::next_monitor_in_interpreter_frame(BasicObjectLock* current) const {
@@ -1182,24 +1110,6 @@
   }
 }
 
-void frame::gc_prologue() {
-  if (is_interpreted_frame()) {
-    // set bcx to bci to become Method* position independent during GC
-    interpreter_frame_set_bcx(interpreter_frame_bci());
-  }
-}
-
-
-void frame::gc_epilogue() {
-  if (is_interpreted_frame()) {
-    // set bcx back to bcp for interpreter
-    interpreter_frame_set_bcx((intptr_t)interpreter_frame_bcp());
-  }
-  // call processor specific epilog function
-  pd_gc_epilog();
-}
-
-
 # ifdef ENABLE_ZAP_DEAD_LOCALS
 
 void frame::CheckValueClosure::do_oop(oop* p) {
--- a/hotspot/src/share/vm/runtime/frame.hpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/runtime/frame.hpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, 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
@@ -30,29 +30,6 @@
 #include "runtime/monitorChunk.hpp"
 #include "runtime/registerMap.hpp"
 #include "utilities/top.hpp"
-#ifdef COMPILER2
-#ifdef TARGET_ARCH_MODEL_x86_32
-# include "adfiles/adGlobals_x86_32.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_x86_64
-# include "adfiles/adGlobals_x86_64.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_sparc
-# include "adfiles/adGlobals_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_zero
-# include "adfiles/adGlobals_zero.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_arm
-# include "adfiles/adGlobals_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_ppc_32
-# include "adfiles/adGlobals_ppc_32.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_ppc_64
-# include "adfiles/adGlobals_ppc_64.hpp"
-#endif
-#endif // COMPILER2
 #ifdef ZERO
 #ifdef TARGET_ARCH_zero
 # include "stack_zero.hpp"
@@ -241,8 +218,8 @@
 
  private:
   intptr_t** interpreter_frame_locals_addr() const;
-  intptr_t*  interpreter_frame_bcx_addr() const;
-  intptr_t*  interpreter_frame_mdx_addr() const;
+  intptr_t*  interpreter_frame_bcp_addr() const;
+  intptr_t*  interpreter_frame_mdp_addr() const;
 
  public:
   // Locals
@@ -252,23 +229,13 @@
 
   void interpreter_frame_set_locals(intptr_t* locs);
 
-  // byte code index/pointer (use these functions for unchecked frame access only!)
-  intptr_t interpreter_frame_bcx() const                  { return *interpreter_frame_bcx_addr(); }
-  void interpreter_frame_set_bcx(intptr_t bcx);
-
   // byte code index
   jint interpreter_frame_bci() const;
-  void interpreter_frame_set_bci(jint bci);
 
   // byte code pointer
   address interpreter_frame_bcp() const;
   void    interpreter_frame_set_bcp(address bcp);
 
-  // Unchecked access to the method data index/pointer.
-  // Only use this if you know what you are doing.
-  intptr_t interpreter_frame_mdx() const                  { return *interpreter_frame_mdx_addr(); }
-  void interpreter_frame_set_mdx(intptr_t mdx);
-
   // method data pointer
   address interpreter_frame_mdp() const;
   void    interpreter_frame_set_mdp(address dp);
@@ -437,10 +404,6 @@
   // RedefineClasses support for finding live interpreted methods on the stack
   void metadata_do(void f(Metadata*));
 
-  void gc_prologue();
-  void gc_epilogue();
-  void pd_gc_epilog();
-
 # ifdef ENABLE_ZAP_DEAD_LOCALS
  private:
   class CheckValueClosure: public OopClosure {
@@ -477,7 +440,6 @@
   // Verification
   void verify(const RegisterMap* map);
   static bool verify_return_pc(address x);
-  static bool is_bci(intptr_t bcx);
   // Usage:
   // assert(frame::verify_return_pc(return_address), "must be a return pc");
 
--- a/hotspot/src/share/vm/runtime/frame.inline.hpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/runtime/frame.inline.hpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, 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,21 +31,6 @@
 #include "oops/method.hpp"
 #include "runtime/frame.hpp"
 #include "runtime/signature.hpp"
-#ifdef TARGET_ARCH_x86
-# include "jniTypes_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "jniTypes_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_zero
-# include "jniTypes_zero.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "jniTypes_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "jniTypes_ppc.hpp"
-#endif
 #ifdef ZERO
 #ifdef TARGET_ARCH_zero
 # include "entryFrame_zero.hpp"
@@ -55,26 +40,6 @@
 #endif
 #endif
 
-// This file holds platform-independent bodies of inline functions for frames.
-
-// Note: The bcx usually contains the bcp; however during GC it contains the bci
-//       (changed by gc_prologue() and gc_epilogue()) to be Method* position
-//       independent. These accessors make sure the correct value is returned
-//       by testing the range of the bcx value. bcp's are guaranteed to be above
-//       max_method_code_size, since methods are always allocated in OldSpace and
-//       Eden is allocated before OldSpace.
-//
-//       The bcp is accessed sometimes during GC for ArgumentDescriptors; than
-//       the correct translation has to be performed (was bug).
-
-inline bool frame::is_bci(intptr_t bcx) {
-#ifdef _LP64
-  return ((uintptr_t) bcx) <= ((uintptr_t) max_method_code_size) ;
-#else
-  return 0 <= bcx && bcx <= max_method_code_size;
-#endif
-}
-
 inline bool frame::is_entry_frame() const {
   return StubRoutines::returns_to_call_stub(pc());
 }
--- a/hotspot/src/share/vm/runtime/java.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/runtime/java.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -65,21 +65,6 @@
 #include "utilities/histogram.hpp"
 #include "utilities/macros.hpp"
 #include "utilities/vmError.hpp"
-#ifdef TARGET_ARCH_x86
-# include "vm_version_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "vm_version_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_zero
-# include "vm_version_zero.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "vm_version_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "vm_version_ppc.hpp"
-#endif
 #if INCLUDE_ALL_GCS
 #include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.hpp"
 #include "gc_implementation/parallelScavenge/psScavenge.hpp"
--- a/hotspot/src/share/vm/runtime/os.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/runtime/os.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -27,6 +27,7 @@
 #include "classfile/javaClasses.hpp"
 #include "classfile/systemDictionary.hpp"
 #include "classfile/vmSymbols.hpp"
+#include "code/codeCache.hpp"
 #include "code/icBuffer.hpp"
 #include "code/vtableStubs.hpp"
 #include "gc_implementation/shared/vmGCOperations.hpp"
@@ -49,6 +50,7 @@
 #include "runtime/os.inline.hpp"
 #include "runtime/stubRoutines.hpp"
 #include "runtime/thread.inline.hpp"
+#include "runtime/vm_version.hpp"
 #include "services/attachListener.hpp"
 #include "services/memTracker.hpp"
 #include "services/threadService.hpp"
--- a/hotspot/src/share/vm/runtime/registerMap.hpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/runtime/registerMap.hpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2014, 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,21 +27,6 @@
 
 #include "code/vmreg.hpp"
 #include "utilities/globalDefinitions.hpp"
-#ifdef TARGET_ARCH_x86
-# include "register_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "register_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_zero
-# include "register_zero.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "register_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "register_ppc.hpp"
-#endif
 
 class JavaThread;
 
--- a/hotspot/src/share/vm/runtime/relocator.hpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/runtime/relocator.hpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, 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,21 +27,7 @@
 
 #include "interpreter/bytecodes.hpp"
 #include "oops/method.hpp"
-#ifdef TARGET_ARCH_x86
-# include "bytes_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "bytes_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_zero
-# include "bytes_zero.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "bytes_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "bytes_ppc.hpp"
-#endif
+#include "utilities/bytes.hpp"
 
 // This code has been converted from the 1.1E java virtual machine
 // Thanks to the JavaTopics group for using the code
--- a/hotspot/src/share/vm/runtime/rframe.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/runtime/rframe.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -23,6 +23,7 @@
  */
 
 #include "precompiled.hpp"
+#include "code/codeCache.hpp"
 #include "interpreter/interpreter.hpp"
 #include "oops/oop.inline.hpp"
 #include "oops/symbol.hpp"
--- a/hotspot/src/share/vm/runtime/safepoint.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/runtime/safepoint.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -56,26 +56,6 @@
 #include "services/runtimeService.hpp"
 #include "utilities/events.hpp"
 #include "utilities/macros.hpp"
-#ifdef TARGET_ARCH_x86
-# include "nativeInst_x86.hpp"
-# include "vmreg_x86.inline.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "nativeInst_sparc.hpp"
-# include "vmreg_sparc.inline.hpp"
-#endif
-#ifdef TARGET_ARCH_zero
-# include "nativeInst_zero.hpp"
-# include "vmreg_zero.inline.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "nativeInst_arm.hpp"
-# include "vmreg_arm.inline.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "nativeInst_ppc.hpp"
-# include "vmreg_ppc.inline.hpp"
-#endif
 #if INCLUDE_ALL_GCS
 #include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.hpp"
 #include "gc_implementation/shared/suspendibleThreadSet.hpp"
--- a/hotspot/src/share/vm/runtime/sharedRuntime.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/runtime/sharedRuntime.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -25,6 +25,7 @@
 #include "precompiled.hpp"
 #include "classfile/systemDictionary.hpp"
 #include "classfile/vmSymbols.hpp"
+#include "code/codeCache.hpp"
 #include "code/compiledIC.hpp"
 #include "code/scopeDesc.hpp"
 #include "code/vtableStubs.hpp"
@@ -59,26 +60,6 @@
 #include "utilities/hashtable.inline.hpp"
 #include "utilities/macros.hpp"
 #include "utilities/xmlstream.hpp"
-#ifdef TARGET_ARCH_x86
-# include "nativeInst_x86.hpp"
-# include "vmreg_x86.inline.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "nativeInst_sparc.hpp"
-# include "vmreg_sparc.inline.hpp"
-#endif
-#ifdef TARGET_ARCH_zero
-# include "nativeInst_zero.hpp"
-# include "vmreg_zero.inline.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "nativeInst_arm.hpp"
-# include "vmreg_arm.inline.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "nativeInst_ppc.hpp"
-# include "vmreg_ppc.inline.hpp"
-#endif
 #ifdef COMPILER1
 #include "c1/c1_Runtime1.hpp"
 #endif
--- a/hotspot/src/share/vm/runtime/stackValueCollection.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/runtime/stackValueCollection.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -24,21 +24,6 @@
 
 #include "precompiled.hpp"
 #include "runtime/stackValueCollection.hpp"
-#ifdef TARGET_ARCH_x86
-# include "jniTypes_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "jniTypes_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_zero
-# include "jniTypes_zero.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "jniTypes_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "jniTypes_ppc.hpp"
-#endif
 
 PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
 
--- a/hotspot/src/share/vm/runtime/statSampler.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/runtime/statSampler.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -33,21 +33,7 @@
 #include "runtime/javaCalls.hpp"
 #include "runtime/os.hpp"
 #include "runtime/statSampler.hpp"
-#ifdef TARGET_ARCH_x86
-# include "vm_version_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "vm_version_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_zero
-# include "vm_version_zero.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "vm_version_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "vm_version_ppc.hpp"
-#endif
+#include "runtime/vm_version.hpp"
 
 // --------------------------------------------------------
 // StatSamplerTask
--- a/hotspot/src/share/vm/runtime/stubRoutines.hpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/runtime/stubRoutines.hpp	Wed Jul 05 19:53:51 2017 +0200
@@ -31,21 +31,6 @@
 #include "runtime/mutexLocker.hpp"
 #include "runtime/stubCodeGenerator.hpp"
 #include "utilities/top.hpp"
-#ifdef TARGET_ARCH_x86
-# include "nativeInst_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "nativeInst_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_zero
-# include "nativeInst_zero.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "nativeInst_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "nativeInst_ppc.hpp"
-#endif
 
 // StubRoutines provides entry points to assembly routines used by
 // compiled code and the run-time system. Platform-specific entry
--- a/hotspot/src/share/vm/runtime/thread.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/runtime/thread.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -27,6 +27,7 @@
 #include "classfile/javaClasses.hpp"
 #include "classfile/systemDictionary.hpp"
 #include "classfile/vmSymbols.hpp"
+#include "code/codeCache.hpp"
 #include "code/scopeDesc.hpp"
 #include "compiler/compileBroker.hpp"
 #include "interpreter/interpreter.hpp"
@@ -74,6 +75,7 @@
 #include "runtime/vframe_hp.hpp"
 #include "runtime/vmThread.hpp"
 #include "runtime/vm_operations.hpp"
+#include "runtime/vm_version.hpp"
 #include "services/attachListener.hpp"
 #include "services/management.hpp"
 #include "services/memTracker.hpp"
@@ -2647,20 +2649,6 @@
 }
 
 
-// GC support
-static void frame_gc_epilogue(frame* f, const RegisterMap* map) { f->gc_epilogue(); }
-
-void JavaThread::gc_epilogue() {
-  frames_do(frame_gc_epilogue);
-}
-
-
-static void frame_gc_prologue(frame* f, const RegisterMap* map) { f->gc_prologue(); }
-
-void JavaThread::gc_prologue() {
-  frames_do(frame_gc_prologue);
-}
-
 // If the caller is a NamedThread, then remember, in the current scope,
 // the given JavaThread in its _processed_thread field.
 class RememberProcessedThread: public StackObj {
@@ -4149,18 +4137,6 @@
   }
 }
 
-void Threads::gc_epilogue() {
-  ALL_JAVA_THREADS(p) {
-    p->gc_epilogue();
-  }
-}
-
-void Threads::gc_prologue() {
-  ALL_JAVA_THREADS(p) {
-    p->gc_prologue();
-  }
-}
-
 void Threads::deoptimized_wrt_marked_nmethods() {
   ALL_JAVA_THREADS(p) {
     p->deoptimized_wrt_marked_nmethods();
--- a/hotspot/src/share/vm/runtime/thread.hpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/runtime/thread.hpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1416,10 +1416,6 @@
   // RedefineClasses Support
   void metadata_do(void f(Metadata*));
 
-  // Memory management operations
-  void gc_epilogue();
-  void gc_prologue();
-
   // Misc. operations
   char* name() const { return (char*)get_thread_name(); }
   void print_on(outputStream* st) const;
@@ -1899,8 +1895,6 @@
   // RedefineClasses support
   static void metadata_do(void f(Metadata*));
 
-  static void gc_epilogue();
-  static void gc_prologue();
 #ifdef ASSERT
   static bool is_vm_complete() { return _vm_complete; }
 #endif
--- a/hotspot/src/share/vm/runtime/vframe.hpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/runtime/vframe.hpp	Wed Jul 05 19:53:51 2017 +0200
@@ -511,8 +511,8 @@
 
 inline void vframeStreamCommon::fill_from_interpreter_frame() {
   Method* method = _frame.interpreter_frame_method();
-  intptr_t  bcx    = _frame.interpreter_frame_bcx();
-  int       bci    = method->validate_bci_from_bcx(bcx);
+  address   bcp    = _frame.interpreter_frame_bcp();
+  int       bci    = method->validate_bci_from_bcp(bcp);
   // 6379830 AsyncGetCallTrace sometimes feeds us wild frames.
   if (bci < 0) {
     found_bad_method_frame();
--- a/hotspot/src/share/vm/runtime/vframeArray.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/runtime/vframeArray.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -24,6 +24,7 @@
 
 #include "precompiled.hpp"
 #include "classfile/vmSymbols.hpp"
+#include "code/vmreg.inline.hpp"
 #include "interpreter/bytecode.hpp"
 #include "interpreter/interpreter.hpp"
 #include "memory/allocation.inline.hpp"
@@ -296,9 +297,9 @@
     src->lock()->move_to(src->obj(), top->lock());
   }
   if (ProfileInterpreter) {
-    iframe()->interpreter_frame_set_mdx(0); // clear out the mdp.
+    iframe()->interpreter_frame_set_mdp(0); // clear out the mdp.
   }
-  iframe()->interpreter_frame_set_bcx((intptr_t)bcp); // cannot use bcp because frame is not initialized yet
+  iframe()->interpreter_frame_set_bcp(bcp);
   if (ProfileInterpreter) {
     MethodData* mdo = method()->method_data();
     if (mdo != NULL) {
--- a/hotspot/src/share/vm/runtime/vmStructs.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/runtime/vmStructs.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -193,33 +193,13 @@
 #include "opto/movenode.hpp"
 #include "opto/narrowptrnode.hpp"
 #include "opto/opaquenode.hpp"
+#include "opto/optoreg.hpp"
 #include "opto/phaseX.hpp"
 #include "opto/parse.hpp"
 #include "opto/regalloc.hpp"
 #include "opto/rootnode.hpp"
 #include "opto/subnode.hpp"
 #include "opto/vectornode.hpp"
-#ifdef TARGET_ARCH_MODEL_x86_32
-# include "adfiles/adGlobals_x86_32.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_x86_64
-# include "adfiles/adGlobals_x86_64.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_sparc
-# include "adfiles/adGlobals_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_zero
-# include "adfiles/adGlobals_zero.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_arm
-# include "adfiles/adGlobals_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_ppc_32
-# include "adfiles/adGlobals_ppc_32.hpp"
-#endif
-#ifdef TARGET_ARCH_MODEL_ppc_64
-# include "adfiles/adGlobals_ppc_64.hpp"
-#endif
 #endif // COMPILER2
 
 // Note: the cross-product of (c1, c2, product, nonproduct, ...),
--- a/hotspot/src/share/vm/runtime/vm_operations.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/runtime/vm_operations.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -25,6 +25,7 @@
 #include "precompiled.hpp"
 #include "classfile/symbolTable.hpp"
 #include "classfile/vmSymbols.hpp"
+#include "code/codeCache.hpp"
 #include "compiler/compileBroker.hpp"
 #include "compiler/compilerOracle.hpp"
 #include "gc_implementation/shared/isGCActiveMark.hpp"
--- a/hotspot/src/share/vm/runtime/vm_version.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/runtime/vm_version.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -26,21 +26,7 @@
 #include "memory/universe.hpp"
 #include "oops/oop.inline.hpp"
 #include "runtime/arguments.hpp"
-#ifdef TARGET_ARCH_x86
-# include "vm_version_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "vm_version_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_zero
-# include "vm_version_zero.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "vm_version_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "vm_version_ppc.hpp"
-#endif
+#include "runtime/vm_version.hpp"
 
 const char* Abstract_VM_Version::_s_vm_release = Abstract_VM_Version::vm_release();
 const char* Abstract_VM_Version::_s_internal_vm_info_string = Abstract_VM_Version::internal_vm_info_string();
--- a/hotspot/src/share/vm/runtime/vm_version.hpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/runtime/vm_version.hpp	Wed Jul 05 19:53:51 2017 +0200
@@ -128,4 +128,20 @@
   static unsigned int calc_parallel_worker_threads();
 };
 
+#ifdef TARGET_ARCH_x86
+# include "vm_version_x86.hpp"
+#endif
+#ifdef TARGET_ARCH_sparc
+# include "vm_version_sparc.hpp"
+#endif
+#ifdef TARGET_ARCH_zero
+# include "vm_version_zero.hpp"
+#endif
+#ifdef TARGET_ARCH_arm
+# include "vm_version_arm.hpp"
+#endif
+#ifdef TARGET_ARCH_ppc
+# include "vm_version_ppc.hpp"
+#endif
+
 #endif // SHARE_VM_RUNTIME_VM_VERSION_HPP
--- a/hotspot/src/share/vm/services/diagnosticCommand.hpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/services/diagnosticCommand.hpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2014, 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,17 +25,16 @@
 #ifndef SHARE_VM_SERVICES_DIAGNOSTICCOMMAND_HPP
 #define SHARE_VM_SERVICES_DIAGNOSTICCOMMAND_HPP
 
+#include "classfile/vmSymbols.hpp"
 #include "runtime/arguments.hpp"
-#include "classfile/vmSymbols.hpp"
-#include "utilities/ostream.hpp"
-#include "runtime/vm_version.hpp"
+#include "runtime/os.hpp"
 #include "runtime/vmThread.hpp"
-#include "runtime/os.hpp"
 #include "services/diagnosticArgument.hpp"
 #include "services/diagnosticCommand.hpp"
+#include "services/diagnosticCommand_ext.hpp"
 #include "services/diagnosticFramework.hpp"
-#include "services/diagnosticCommand_ext.hpp"
 #include "utilities/macros.hpp"
+#include "utilities/ostream.hpp"
 
 class HelpDCmd : public DCmdWithParser {
 protected:
--- a/hotspot/src/share/vm/services/diagnosticFramework.hpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/services/diagnosticFramework.hpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -29,7 +29,6 @@
 #include "memory/allocation.hpp"
 #include "runtime/arguments.hpp"
 #include "runtime/os.hpp"
-#include "runtime/vm_version.hpp"
 #include "runtime/vmThread.hpp"
 #include "utilities/ostream.hpp"
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/src/share/vm/utilities/bytes.hpp	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2014, 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_UTILITIES_BYTES_HPP
+#define SHARE_VM_UTILITIES_BYTES_HPP
+
+#ifdef TARGET_ARCH_x86
+# include "bytes_x86.hpp"
+#endif
+#ifdef TARGET_ARCH_sparc
+# include "bytes_sparc.hpp"
+#endif
+#ifdef TARGET_ARCH_zero
+# include "bytes_zero.hpp"
+#endif
+#ifdef TARGET_ARCH_arm
+# include "bytes_arm.hpp"
+#endif
+#ifdef TARGET_ARCH_ppc
+# include "bytes_ppc.hpp"
+#endif
+
+#endif // SHARE_VM_UTILITIES_BYTES_HPP
--- a/hotspot/src/share/vm/utilities/debug.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/utilities/debug.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -48,6 +48,7 @@
 #include "runtime/stubRoutines.hpp"
 #include "runtime/thread.inline.hpp"
 #include "runtime/vframe.hpp"
+#include "runtime/vm_version.hpp"
 #include "services/heapDumper.hpp"
 #include "utilities/defaultStream.hpp"
 #include "utilities/events.hpp"
--- a/hotspot/src/share/vm/utilities/ostream.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/utilities/ostream.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -28,6 +28,7 @@
 #include "oops/oop.inline.hpp"
 #include "runtime/arguments.hpp"
 #include "runtime/os.hpp"
+#include "runtime/vm_version.hpp"
 #include "utilities/defaultStream.hpp"
 #include "utilities/ostream.hpp"
 #include "utilities/top.hpp"
--- a/hotspot/src/share/vm/utilities/vmError.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/src/share/vm/utilities/vmError.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -23,6 +23,7 @@
  */
 
 #include "precompiled.hpp"
+#include "code/codeCache.hpp"
 #include "compiler/compileBroker.hpp"
 #include "gc_interface/collectedHeap.hpp"
 #include "prims/whitebox.hpp"
--- a/hotspot/test/TEST.groups	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/test/TEST.groups	Wed Jul 05 19:53:51 2017 +0200
@@ -117,15 +117,6 @@
 # Tests that require compact3 API's
 #
 needs_compact3 = \
-  compiler/8009761/Test8009761.java \
-  compiler/whitebox/DeoptimizeMethodTest.java \
-  compiler/whitebox/SetForceInlineMethodTest.java \
-  compiler/whitebox/SetDontInlineMethodTest.java \
-  compiler/whitebox/DeoptimizeAllTest.java \
-  compiler/whitebox/MakeMethodNotCompilableTest.java \
-  compiler/whitebox/ClearMethodStateTest.java \
-  compiler/whitebox/EnqueueMethodForCompilationTest.java \
-  compiler/whitebox/IsMethodCompilableTest.java \
   gc/6581734/Test6581734.java \
   gc/7072527/TestFullGCCount.java \
   gc/g1/TestHumongousAllocInitialMark.java \
@@ -138,11 +129,7 @@
   runtime/InternalApi/ThreadCpuTimesDeadlock.java \
   serviceability/threads/TestFalseDeadLock.java \
   serviceability/jvmti/GetObjectSizeOverflow.java \
-  serviceability/jvmti/TestRedefineWithUnresolvedClass.java \
-  compiler/tiered/NonTieredLevelsTest.java \
-  compiler/tiered/TieredLevelsTest.java \
-  compiler/intrinsics/bmi/verifycode \
-  runtime/whitebox/WBStackSize.java
+  serviceability/jvmti/TestRedefineWithUnresolvedClass.java
 
 # Compact 2 adds full VM tests
 compact2 = \
@@ -199,8 +186,7 @@
 
 # Tests that require compact2 API's
 #
-needs_compact2 = \
-  compiler/6589834/Test_ia32.java
+needs_compact2 =
 
 # All tests that run on the most minimal configuration: Minimal VM on Compact 1
 compact1_minimal = \
--- a/hotspot/test/compiler/5091921/Test6890943.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/test/compiler/5091921/Test6890943.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2014, 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,163 +27,195 @@
  * @bug 6890943
  * @summary JVM mysteriously gives wrong result on 64-bit 1.6 VMs in hotspot mode.
  *
- * @run shell/timeout=240 Test6890943.sh
+ * @run main/othervm/timeout=240 Test6890943
  */
-import java.util.*;
+
 import java.io.*;
-import java.util.regex.*;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Scanner;
 
 public class Test6890943 {
-  public static final boolean AIR = true, ROCK = false;
-  public static void main(String[] args) {
-    new Test6890943().go();
-  }
+    public static final boolean AIR = true, ROCK = false;
+    private static final Path PATH = Paths.get(System.getProperty("test.src", "."));
+    private static final Path INPUT_FILE = PATH.resolve("input6890943.txt");
+    private static final Path GOLDEN_FILE = PATH.resolve("output6890943.txt");
+
+    public static void main(String[] args) {
+        new Test6890943().go();
+    }
 
-  int r, c, f, t;
-  boolean[][] grid;
+    int r, c, f, t;
+    boolean[][] grid;
+
+    public void go() {
+        Scanner in, golden;
+        try {
+            in = new Scanner(new FileInputStream(INPUT_FILE.toFile()));
+            golden = new Scanner(new FileInputStream(GOLDEN_FILE.toFile()));
+        } catch (FileNotFoundException e) {
+            throw new RuntimeException("TEST failure: can't open test file", e);
+        }
+        in.useDelimiter("\\s+");
+        golden.useDelimiter("\\s+");
 
-  public void go() {
-    Scanner s = new Scanner(System.in);
-    s.useDelimiter("\\s+");
-    int T = s.nextInt();
-    for (t = 0 ; t < T ; t++) {
-      r = s.nextInt(); c = s.nextInt(); f = s.nextInt();
-      grid = new boolean[r][c];
-      for (int x = 0 ; x < r ; x++) {
-        String line = s.next();
-        for (int y = 0 ; y < c ; y++) grid[x][y] = line.charAt(y) == '.';
-      }
-      int digs = solve();
-      String res = digs == -1 ? "No" : "Yes " + digs;
-      System.out.printf("Case #%d: %s\n", t+1, res);
+        int T = in.nextInt();
+        for (t = 0; t < T; t++) {
+            r = in.nextInt();
+            c = in.nextInt();
+            f = in.nextInt();
+            grid = new boolean[r][c];
+            for (int x = 0; x < r; x++) {
+                String line = in.next();
+                for (int y = 0; y < c; y++) {
+                    grid[x][y] = line.charAt(y) == '.';
+                }
+            }
+            int digs = solve();
+            String result = "Case #" + (t + 1) + ": " + (digs == -1 ? "No" : "Yes " + digs);
+            System.out.println(result);
+            // Compare with golden string from the file
+            String goldenStr = golden.nextLine();
+            if (!result.equals(goldenStr)) {
+                System.err.println("FAIL: strings are not equal\n"
+                        + "-- Result: " + result + "\n"
+                        + "-- Golden: " + goldenStr);
+                throw new RuntimeException("FAIL: Result string is not equal to the golden");
+            }
+        }
     }
-  }
 
-  Map<Integer, Integer> M = new HashMap<Integer, Integer>();
+    Map<Integer, Integer> M = new HashMap<Integer, Integer>();
 
-  private int solve() {
-    M = new HashMap<Integer, Integer>();
-    M.put(calcWalkingRange(0, 0), 0);
-    for (int digDown = 0 ; digDown < r ; digDown++) {
-      Map<Integer, Integer> tries = new HashMap<Integer, Integer>();
-      for (Map.Entry<Integer, Integer> m : M.entrySet()) {
-        int q = m.getKey();
-        if (depth(q) != (digDown)) continue;
-        if (stuck(q)) continue;
-        tries.put(q, m.getValue());
-      }
+    private int solve() {
+        M = new HashMap<Integer, Integer>();
+        M.put(calcWalkingRange(0, 0), 0);
+        for (int digDown = 0; digDown < r; digDown++) {
+            Map<Integer, Integer> tries = new HashMap<Integer, Integer>();
+            for (Map.Entry<Integer, Integer> m : M.entrySet()) {
+                int q = m.getKey();
+                if (depth(q) != (digDown)) continue;
+                if (stuck(q)) continue;
+                tries.put(q, m.getValue());
+            }
+
+            for (Map.Entry<Integer, Integer> m : tries.entrySet()) {
+                int q = m.getKey();
+                int fallLeftDelta = 0, fallRightDelta = 0;
+                //fall left
+                int fallLeft = fall(digDown, start(q));
+                if (fallLeft > 0) {
+                    fallLeftDelta = 1;
+                    if (fallLeft <= f) addToM(calcWalkingRange(digDown + fallLeft, start(q)), m.getValue());
+                }
+
+                //fall right
+                int fallRight = fall(digDown, end(q));
+                if (fallRight > 0) {
+                    fallRightDelta = 1;
+
+                    if (fallRight <= f) addToM(calcWalkingRange(digDown + fallRight, end(q)), m.getValue());
+                }
 
-      for (Map.Entry<Integer, Integer> m : tries.entrySet()) {
-        int q = m.getKey();
-        int fallLeftDelta = 0, fallRightDelta = 0;
-        //fall left
-        int fallLeft = fall(digDown, start(q));
-        if (fallLeft > 0) {
-          fallLeftDelta = 1;
-          if (fallLeft <= f) addToM(calcWalkingRange(digDown+fallLeft, start(q)), m.getValue());
-        }
+                for (int p = start(q) + fallLeftDelta; p <= end(q) - fallRightDelta; p++) {
+                    //goLeft
+                    for (int digSpot = p; digSpot > start(q) + fallLeftDelta; digSpot--) {
+                        int fallDown = 1 + fall(digDown + 1, digSpot);
+                        if (fallDown <= f) {
+                            if (fallDown == 1) {
+                                addToM(calcWalkingRange(digDown + 1, digSpot, digSpot, p),
+                                        m.getValue() + Math.abs(digSpot - p) + 1);
+                            } else {
+                                addToM(calcWalkingRange(digDown + fallDown, digSpot),
+                                        m.getValue() + Math.abs(digSpot - p) + 1);
+                            }
+                        }
+                    }
 
-        //fall right
-        int fallRight = fall(digDown, end(q));
-        if (fallRight > 0) {
-          fallRightDelta = 1;
-
-          if (fallRight <= f) addToM(calcWalkingRange(digDown+fallRight, end(q)), m.getValue());
+                    //goRight
+                    for (int digSpot = p; digSpot < end(q) - fallRightDelta; digSpot++) {
+                        int fallDown = 1 + fall(digDown + 1, digSpot);
+                        if (fallDown <= f) {
+                            if (fallDown == 1) {
+                                addToM(calcWalkingRange(digDown + 1, digSpot, p, digSpot),
+                                        m.getValue() + Math.abs(digSpot - p) + 1);
+                            } else {
+                                addToM(calcWalkingRange(digDown + fallDown, digSpot),
+                                        m.getValue() + Math.abs(digSpot - p) + 1);
+                            }
+                        }
+                    }
+                }
+            }
         }
 
-        for (int p = start(q) + fallLeftDelta ; p <= end(q) - fallRightDelta ; p++) {
-          //goLeft
-          for (int digSpot = p ; digSpot > start(q) +fallLeftDelta ; digSpot--) {
-            int fallDown = 1+fall(digDown+1, digSpot);
-            if (fallDown <= f) {
-              if (fallDown == 1) {
-                addToM(calcWalkingRange(digDown + 1, digSpot, digSpot, p), m.getValue() + Math.abs(digSpot-p)+1);
-              } else {
-                addToM(calcWalkingRange(digDown + fallDown, digSpot), m.getValue() + Math.abs(digSpot-p)+1);
-              }
-            }
-          }
+        int result = Integer.MAX_VALUE;
+        for (Map.Entry<Integer, Integer> m : M.entrySet()) {
+            if (depth(m.getKey()) == r - 1) result = Math.min(m.getValue(), result);
+        }
 
-          //goRight
-          for (int digSpot = p ; digSpot < end(q)-fallRightDelta ;digSpot++) {
-            int fallDown = 1+fall(digDown+1, digSpot);
-            if (fallDown <= f) {
-              if (fallDown == 1) {
-                addToM(calcWalkingRange(digDown + 1, digSpot, p, digSpot), m.getValue() + Math.abs(digSpot-p)+1);
-              } else {
-                addToM(calcWalkingRange(digDown + fallDown, digSpot), m.getValue() + Math.abs(digSpot-p)+1);
-              }
-            }
-          }
-        }
-      }
+        if (result == Integer.MAX_VALUE) return -1;
+        return result;
+    }
+
+    private void addToM(int q, int i) {
+        Integer original = M.get(q);
+        if (original == null) M.put(q, i);
+        else M.put(q, Math.min(original, i));
     }
 
-    int result = Integer.MAX_VALUE;
-    for (Map.Entry<Integer, Integer> m : M.entrySet()) {
-      if (depth(m.getKey()) == r-1) result = Math.min(m.getValue(), result);
+    private int fall(int row, int column) {
+        int res = 0;
+        for (int p = row + 1; p < r; p++) {
+            if (grid[p][column] == AIR) res++;
+            else break;
+        }
+        return res;
+    }
+
+    private boolean stuck(int q) {
+        return start(q) == end(q);
+    }
+
+    private int depth(int q) {
+        return q % 50;
     }
 
-    if (result == Integer.MAX_VALUE) return -1;
-    return result;
-  }
-
-  private void addToM(int q, int i) {
-    Integer original = M.get(q);
-    if ( original == null ) M.put(q, i);
-    else M.put(q, Math.min(original, i));
-  }
-
-  private int fall(int row, int column) {
-    int res = 0;
-    for ( int p = row+1 ; p < r ; p++) {
-      if (grid[p][column] == AIR) res++;
-      else break;
+    private int start(int q) {
+        return q / (50 * 50);
     }
-    return res;
-  }
-
-  private boolean stuck(int q) {
-    return start(q) == end(q);
-  }
-
-  private int depth(int q) {
-    return q % 50;
-  }
 
-  private int start(int q) {
-    return q / (50*50);
-  }
-
-  private int end(int q) {
-    return (q / 50) % 50;
-  }
-
-  private int calcWalkingRange(int depth, int pos) {
-    return calcWalkingRange(depth, pos, Integer.MAX_VALUE, Integer.MIN_VALUE);
-  }
-
-  private int calcWalkingRange(int depth, int pos, int airOverrideStart, int airOverrideEnd) {
-    int left = pos, right = pos;
-    if (depth >= r) return (c-1)*50 + depth;
+    private int end(int q) {
+        return (q / 50) % 50;
+    }
 
-    while (left > 0) {
-      if (grid[depth][left-1] == ROCK && (left-1 < airOverrideStart || left-1 > airOverrideEnd)) break;
-      if (depth < r-1 && grid[depth+1][left-1] == AIR) {
-        left--;
-        break;
-      }
-      left--;
-    }
-    while (right < c-1) {
-      if (grid[depth][right+1] == ROCK && (right+1 < airOverrideStart || right+1 > airOverrideEnd)) break;
-      if (depth < r-1 && grid[depth+1][right+1] == AIR) {
-        right++;
-        break;
-      }
-      right++;
+    private int calcWalkingRange(int depth, int pos) {
+        return calcWalkingRange(depth, pos, Integer.MAX_VALUE, Integer.MIN_VALUE);
     }
 
-    return left *50*50 + right*50 + depth;
-  }
+    private int calcWalkingRange(int depth, int pos, int airOverrideStart, int airOverrideEnd) {
+        int left = pos, right = pos;
+        if (depth >= r) return (c - 1) * 50 + depth;
+
+        while (left > 0) {
+            if (grid[depth][left - 1] == ROCK && (left - 1 < airOverrideStart || left - 1 > airOverrideEnd)) break;
+            if (depth < r - 1 && grid[depth + 1][left - 1] == AIR) {
+                left--;
+                break;
+            }
+            left--;
+        }
+        while (right < c - 1) {
+            if (grid[depth][right + 1] == ROCK && (right + 1 < airOverrideStart || right + 1 > airOverrideEnd)) break;
+            if (depth < r - 1 && grid[depth + 1][right + 1] == AIR) {
+                right++;
+                break;
+            }
+            right++;
+        }
+
+        return left * 50 * 50 + right * 50 + depth;
+    }
 }
--- a/hotspot/test/compiler/5091921/Test6890943.sh	Wed Jul 05 19:52:35 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-#!/bin/sh
-# 
-# Copyright (c) 2011, 2013, 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.
-# 
-# 
-## some tests require path to find test source dir
-if [ "${TESTSRC}" = "" ]
-then
-  TESTSRC=${PWD}
-  echo "TESTSRC not set.  Using "${TESTSRC}" as default"
-fi
-echo "TESTSRC=${TESTSRC}"
-## Adding common setup Variables for running shell tests.
-. ${TESTSRC}/../../test_env.sh
-
-
-set -x
-
-cp ${TESTSRC}/Test6890943.java .
-cp ${TESTSRC}/input6890943.txt .
-cp ${TESTSRC}/output6890943.txt .
-cp ${TESTSRC}/Test6890943.sh .
-
-${COMPILEJAVA}/bin/javac ${TESTJAVACOPTS} -d . Test6890943.java
-
-${TESTJAVA}/bin/java -XX:-PrintVMOptions -XX:+IgnoreUnrecognizedVMOptions ${TESTVMOPTS} Test6890943 < input6890943.txt > pretest.out 2>&1
-
-# This test sometimes tickles an unrelated performance warning that interferes with diff.
-grep -v 'warning: Performance bug: SystemDictionary' pretest.out > test.out
-
-diff output6890943.txt test.out
-
-result=$?
-if [ $result -eq 0 ]
-then
-  echo "Passed"
-  exit 0
-else
-  echo "Failed"
-  exit 1
-fi
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/6589834/InlinedArrayCloneTestCase.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,86 @@
+/*
+ * Copyright (c) 2014, 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.
+ */
+
+public class InlinedArrayCloneTestCase implements Runnable {
+    private Test_ia32 executionController;
+
+    public InlinedArrayCloneTestCase(Test_ia32 executionController) {
+        this.executionController = executionController;
+    }
+
+    /*
+     * Please leave following two methods (invokeArrayClone and verifyArguments)
+     * static.
+     *
+     * It does not really matter if these methods are static or instance,
+     * original issue could be reproduced in both cases, but if these methods
+     * are static then it is much easier to understand that reproduced issue
+     * is actually interpreter's stack corruption.
+     *
+     * If these methods are non-static, then interpreter's stack will contain
+     * invalid 'this' pointer required for instance's method call and
+     * verifyArguments' call may throw NullPointerException. There was another
+     * issue w/ NPE after deoptimization addressed by JDK-6833129, so NPE looks
+     * a little bit confusing.
+     *
+     * If these methods are static then after deptimization we'll get incorrect
+     * arguments values in verifyArguments.
+     * Something like "2, -1289936896, 3, 4" instead of "1, 2, 3, 4".
+     * This information tells much more about actual issue comparing to NPE,
+     * so it's preferable to leave these methods static.
+     */
+    private static int verifyArguments(int i1, int i2, LoadedClass[] arr,
+            int i3, int i4) {
+        if (!(i1==1 && i2==2 && i3==3 && i4==4)) {
+            throw new RuntimeException(String.format(
+                    "Arguments have unexpected values: %d, %d, %d, %d",
+                    i1, i2, i3, i4));
+        }
+        return arr.length;
+    }
+
+    private static int invokeArrayClone(LoadedClass[] a) {
+        return InlinedArrayCloneTestCase.verifyArguments(1, 2, a.clone(), 3, 4);
+    }
+
+    @Override
+    public void run() {
+        LoadedClass[] array = executionController.getArray();
+        int length;
+
+        while (executionController.continueExecution()) {
+            try {
+                length = InlinedArrayCloneTestCase.invokeArrayClone(array);
+            } catch (Throwable e) {
+                e.printStackTrace();
+                executionController.setTestFailed();
+                return;
+            }
+            if (length != array.length) {
+                System.out.println(String.format("f(array) returned %d "
+                        + "instead of %d.", length, array.length));
+                executionController.setTestFailed();
+            }
+        }
+    }
+}
--- a/hotspot/test/compiler/6589834/Test_ia32.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/test/compiler/6589834/Test_ia32.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2014, 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,103 +24,116 @@
 /**
  * @test
  * @bug 6589834
- * @summary deoptimization problem with -XX:+DeoptimizeALot
- *
- * @run main Test_ia32
+ * @summary Safepoint placed between stack pointer increment and decrement leads
+ *          to interpreter's stack corruption after deoptimization.
+ * @library /testlibrary /testlibrary/whitebox
+ * @build ClassFileInstaller sun.hotspot.WhiteBox com.oracle.java.testlibrary.*
+ *        Test_ia32 InlinedArrayCloneTestCase
+ * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
+ *      -XX:+WhiteBoxAPI -XX:CompileOnly=InlinedArrayCloneTestCase
+ *      -XX:CompileCommand=dontinline,InlinedArrayCloneTestCase.invokeArrayClone
+ *      -XX:CompileCommand=inline,InlinedArrayCloneTestCase.verifyArguments
+ *      -XX:+IgnoreUnrecognizedVMOptions -XX:+VerifyStack Test_ia32
  */
 
-/***************************************************************************************
-NOTE: The bug shows up (with several "Bug!" message) even without the
-      flag -XX:+DeoptimizeALot. In a debug build, you may want to try
-      the flags -XX:+VerifyStack and -XX:+DeoptimizeALot to get more information.
-****************************************************************************************/
-import java.lang.reflect.Constructor;
+import java.lang.reflect.Method;
+
+import com.oracle.java.testlibrary.Asserts;
+import sun.hotspot.WhiteBox;
 
 public class Test_ia32 {
+    private static final int NUM_THREADS
+            = Math.min(100, 2 * Runtime.getRuntime().availableProcessors());
+    private static final int CLONE_LENGTH = 1000;
 
-    public static int NUM_THREADS = 100;
+    private static WhiteBox wb = WhiteBox.getWhiteBox();
+
+    private final LoadedClass[] ARRAY = new LoadedClass[Test_ia32.CLONE_LENGTH];
+    private volatile boolean doSpin = true;
+    private volatile boolean testFailed = false;
 
-    public static int CLONE_LENGTH = 1000;
+    public boolean continueExecution() {
+        return doSpin;
+    }
+
+    public void stopExecution() {
+        doSpin = false;
+    }
+
+    public boolean isTestFailed() {
+        return testFailed;
+    }
 
-    public static void main(String[] args) throws InterruptedException, ClassNotFoundException {
+    public void setTestFailed() {
+        this.testFailed = true;
+        stopExecution();
+    }
+
+    public LoadedClass[] getArray() {
+        return ARRAY;
+    }
+
+    public void runTest() {
+        Thread[] threads = new Thread[Test_ia32.NUM_THREADS];
+        Method method;
 
-        Reflector[] threads = new Reflector[NUM_THREADS];
+        try {
+            method = InlinedArrayCloneTestCase.class.getDeclaredMethod(
+                    "invokeArrayClone", LoadedClass[].class);
+        } catch (NoSuchMethodException e) {
+            throw new Error("Tested method not found", e);
+        }
+
+        Asserts.assertTrue(wb.isMethodCompilable(method),
+                "Method " + method.getName() + " should be compilable.");
+
         for (int i = 0; i < threads.length; i++) {
-            threads[i] = new Reflector();
+            threads[i] = new Thread(new InlinedArrayCloneTestCase(this));
             threads[i].start();
         }
 
-        System.out.println("Give Reflector.run() some time to compile...");
-        Thread.sleep(5000);
+        /*
+         * Wait until InlinedArrayCloneTestCase::invokeArrayClone is compiled.
+         */
+        while (!wb.isMethodCompiled(method)) {
+            Thread.yield();
+        }
 
-        System.out.println("Load RMISecurityException causing run() deoptimization");
-        ClassLoader.getSystemClassLoader().loadClass("java.rmi.RMISecurityException");
+        /*
+         * Load NotLoadedClass to cause deoptimization of
+         * InlinedArrayCloneTestCase::invokeArrayClone due to invalidated
+         * dependency.
+         */
+        try {
+            Class.forName("NotLoadedClass");
+        } catch (ClassNotFoundException e) {
+            throw new Error("Unable to load class that invalidates "
+                    + "CHA-dependency for method " + method.getName(), e);
+        }
 
-        for (Reflector thread : threads)
-            thread.requestStop();
+        stopExecution();
 
-        for (Reflector thread : threads)
+        for (Thread thread : threads) {
             try {
                 thread.join();
             } catch (InterruptedException e) {
-                System.out.println(e);
+                throw new Error("Fail to join thread " + thread, e);
             }
-
-    }
-
-}
-
-class Reflector extends Thread {
-
-    volatile boolean _doSpin = true;
-
-    Test_ia32[] _tests;
-
-    Reflector() {
-        _tests = new Test_ia32[Test_ia32.CLONE_LENGTH];
-        for (int i = 0; i < _tests.length; i++) {
-            _tests[i] = new Test_ia32();
-        }
-    }
-
-    static int g(int i1, int i2, Test_ia32[] arr, int i3, int i4) {
-
-        if (!(i1==1 && i2==2 && i3==3 && i4==4)) {
-            System.out.println("Bug!");
         }
 
-        return arr.length;
+        Asserts.assertFalse(isTestFailed(), "Test failed.");
     }
 
-    static int f(Test_ia32[] arr) {
-        return g(1, 2, arr.clone(), 3, 4);
+    public static void main(String[] args) {
+        new Test_ia32().runTest();
     }
-
-    @Override
-    public void run() {
-        Constructor[] ctrs = null;
-        Class<Test_ia32> klass = Test_ia32.class;
-        try {
-            ctrs = klass.getConstructors();
-        } catch (SecurityException e) {
-            System.out.println(e);
-        }
+}
 
-        try {
-            while (_doSpin) {
-                if (f(_tests) < 0)
-                    System.out.println("return value usage");
-            }
-        } catch (NullPointerException e) {
-            e.printStackTrace();
-        }
+class LoadedClass {
+}
 
-        System.out.println(this + " - stopped.");
-    }
-
-    public void requestStop() {
-        System.out.println(this + " - stop requested.");
-        _doSpin = false;
-    }
-
+@SuppressWarnings("unused")
+class NotLoadedClass extends LoadedClass {
 }
--- a/hotspot/test/compiler/8004051/Test8004051.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/test/compiler/8004051/Test8004051.java	Wed Jul 05 19:53:51 2017 +0200
@@ -28,7 +28,7 @@
  * @bug 8005722
  * @summary assert(_oprs_len[mode] < maxNumberOfOperands) failed: array overflow
  *
- * @run main/othervm -Xcomp -client Test8004051
+ * @run main/othervm -Xcomp Test8004051
  */
 
 public class Test8004051 {
--- a/hotspot/test/compiler/ciReplay/TestSA.sh	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/test/compiler/ciReplay/TestSA.sh	Wed Jul 05 19:53:51 2017 +0200
@@ -26,7 +26,7 @@
 ##
 ## @test
 ## @bug 8011675
-## @ignore 8032226, 8031978
+## @ignore 8031978
 ## @summary testing of ciReplay with using generated by SA replay.txt 
 ## @author igor.ignatyev@oracle.com
 ## @run shell TestSA.sh
--- a/hotspot/test/compiler/ciReplay/TestVM.sh	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/test/compiler/ciReplay/TestVM.sh	Wed Jul 05 19:53:51 2017 +0200
@@ -26,7 +26,6 @@
 ##
 ## @test
 ## @bug 8011675
-## @ignore 8031978
 ## @summary testing of ciReplay with using generated by VM replay.txt 
 ## @author igor.ignatyev@oracle.com
 ## @run shell TestVM.sh
--- a/hotspot/test/compiler/ciReplay/TestVM_no_comp_level.sh	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/test/compiler/ciReplay/TestVM_no_comp_level.sh	Wed Jul 05 19:53:51 2017 +0200
@@ -26,7 +26,6 @@
 ##
 ## @test
 ## @bug 8011675
-## @ignore 8031978
 ## @summary testing of ciReplay with using generated by VM replay.txt w/o comp_level
 ## @author igor.ignatyev@oracle.com
 ## @run shell TestVM_no_comp_level.sh
--- a/hotspot/test/compiler/ciReplay/common.sh	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/test/compiler/ciReplay/common.sh	Wed Jul 05 19:53:51 2017 +0200
@@ -1,6 +1,6 @@
 #!/bin/sh
 # 
-# Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 # 
 # This code is free software; you can redistribute it and/or modify it
@@ -223,21 +223,29 @@
             -XX:CICrashAt=1 \
             -XX:+CreateMinidumpOnCrash \
             -XX:+DumpReplayDataOnError \
+            -XX:-TransmitErrorReport \
+            -XX:+PreferInterpreterNativeStubs \
+            -XX:+PrintCompilation \
             -XX:ReplayDataFile=${replay_data} \
             -version"
     echo GENERATION OF REPLAY.TXT:
     echo $cmd
 
     ${cmd} > crash.out 2>&1
-    
+
+    exit_code=$?
+    if [ ${exit_code} -eq 0 ]
+    then
+        cat crash.out
+        test_fail 3 "CHECK :: CRASH" "JVM exits gracefully"
+    fi
+
     core_locations=`grep -i core crash.out | grep "location:" | \
             sed -e 's/.*location: //'`
-    echo CRASH OUTPUT:
-    cat crash.out    
-    
-    if [ "${core_locations}" = "" ]
+   
+    if [ -z "${core_locations}" ]
     then
-        test_fail 2 "CHECK :: CORE_LOCATION" "output doesn't contain the location of core file, see crash.out"
+        test_fail 4 "CHECK :: CORE_LOCATION" "output doesn't contain the location of core file, see crash.out"
     fi
 
     rm crash.out 
@@ -245,16 +253,19 @@
     # processing core locations for *nix
     if [ $VM_OS != "windows" ]
     then
-        # remove 'or' between '/core.<pid>' and 'core'
+        # remove 'or' between '<core_path>/core.<pid>' and 'core'
+        # and the rest of line -- ' (max size ...) . To ensure a full core ...'
         core_locations=`echo $core_locations | \
-                sed -e 's/\([^ ]*\) or \([^ ]*\)/\1 \2/'`
-        # add <core_path>/core.<pid> core.<pid>
+                sed -e 's/\([^ ]*\) or \([^ ]*\).*/\1 \2/'`
         core_with_dir=`echo $core_locations | awk '{print $1}'`
+        core_with_pid=`echo $core_locations | awk '{print $2}'`
         dir=`dirname $core_with_dir`
-        core_with_pid=`echo $core_locations | awk '{print $2}'`
-        if [ -n ${core_with_pid} ]
+        file=`basename $core_with_dir`
+        # add <core_path>/core.<pid> core
+        core_locations="'$core_with_dir' '$file'"
+        if [ -n "${core_with_pid}" ]
         then
-            core_locations="$core_locations $dir${FS}$core_with_pid $core_with_pid"
+            core_locations="$core_locations '$core_with_pid' '$dir${FS}$core_with_pid'"
         fi
     fi
 
--- a/hotspot/test/compiler/intrinsics/bmi/verifycode/BmiIntrinsicBase.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/test/compiler/intrinsics/bmi/verifycode/BmiIntrinsicBase.java	Wed Jul 05 19:53:51 2017 +0200
@@ -146,6 +146,10 @@
         }
 
         protected int countCpuInstructions(byte[] nativeCode) {
+            return countCpuInstructions(nativeCode, instrMask, instrPattern);
+        }
+
+        public static int countCpuInstructions(byte[] nativeCode, byte[] instrMask, byte[] instrPattern) {
             int count = 0;
             int patternSize = Math.min(instrMask.length, instrPattern.length);
             boolean found;
@@ -183,4 +187,21 @@
             return "UseBMI1Instructions";
         }
     }
+
+    abstract static class BmiTestCase_x64 extends BmiTestCase {
+        protected byte[] instrMask_x64;
+        protected byte[] instrPattern_x64;
+
+        protected BmiTestCase_x64(Method method) {
+            super(method);
+        }
+
+        protected int countCpuInstructions(byte[] nativeCode) {
+            int cnt = super.countCpuInstructions(nativeCode);
+            if (Platform.isX64()) { // on x64 platform the instruction we search for can be encoded in 2 different ways
+                cnt += countCpuInstructions(nativeCode, instrMask_x64, instrPattern_x64);
+            }
+            return cnt;
+        }
+    }
 }
--- a/hotspot/test/compiler/intrinsics/bmi/verifycode/LZcntTestI.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/test/compiler/intrinsics/bmi/verifycode/LZcntTestI.java	Wed Jul 05 19:53:51 2017 +0200
@@ -33,12 +33,15 @@
 
 import java.lang.reflect.Method;
 
-public class LZcntTestI extends BmiIntrinsicBase.BmiTestCase {
+public class LZcntTestI extends BmiIntrinsicBase.BmiTestCase_x64 {
 
     protected LZcntTestI(Method method) {
         super(method);
         instrMask = new byte[]{(byte) 0xFF, (byte) 0xFF, (byte) 0xFF};
         instrPattern = new byte[]{(byte) 0xF3, (byte) 0x0F, (byte) 0xBD};
+
+        instrMask_x64 = new byte[]{(byte) 0xFF, (byte) 0x00, (byte) 0xFF, (byte) 0xFF};
+        instrPattern_x64 = new byte[]{(byte) 0xF3, (byte) 0x00, (byte) 0x0F, (byte) 0xBD};
     }
 
     public static void main(String[] args) throws Exception {
--- a/hotspot/test/compiler/intrinsics/bmi/verifycode/LZcntTestL.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/test/compiler/intrinsics/bmi/verifycode/LZcntTestL.java	Wed Jul 05 19:53:51 2017 +0200
@@ -31,8 +31,6 @@
  *                   -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCountLeadingZerosInstruction LZcntTestL
  */
 
-import com.oracle.java.testlibrary.Platform;
-
 import java.lang.reflect.Method;
 
 public class LZcntTestL extends LZcntTestI {
@@ -40,10 +38,6 @@
     protected LZcntTestL(Method method) {
         super(method);
         isLongOperation = true;
-        if (Platform.isX64()) {
-            instrMask = new byte[]{(byte) 0xFF, (byte) 0x00, (byte) 0xFF, (byte) 0xFF};
-            instrPattern = new byte[]{(byte) 0xF3, (byte) 0x00, (byte) 0x0F, (byte) 0xBD};
-        }
     }
 
     public static void main(String[] args) throws Exception {
--- a/hotspot/test/compiler/intrinsics/bmi/verifycode/TZcntTestI.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/test/compiler/intrinsics/bmi/verifycode/TZcntTestI.java	Wed Jul 05 19:53:51 2017 +0200
@@ -33,12 +33,15 @@
 
 import java.lang.reflect.Method;
 
-public class TZcntTestI extends BmiIntrinsicBase.BmiTestCase {
+public class TZcntTestI extends BmiIntrinsicBase.BmiTestCase_x64 {
 
     protected TZcntTestI(Method method) {
         super(method);
         instrMask = new byte[]{(byte) 0xFF, (byte) 0xFF, (byte) 0xFF};
         instrPattern = new byte[]{(byte) 0xF3, (byte) 0x0F, (byte) 0xBC};
+
+        instrMask_x64 = new byte[]{(byte) 0xFF, (byte) 0x00, (byte) 0xFF, (byte) 0xFF};
+        instrPattern_x64 = new byte[]{(byte) 0xF3, (byte) 0x00, (byte) 0x0F, (byte) 0xBC};
     }
 
     public static void main(String[] args) throws Exception {
--- a/hotspot/test/compiler/intrinsics/bmi/verifycode/TZcntTestL.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/test/compiler/intrinsics/bmi/verifycode/TZcntTestL.java	Wed Jul 05 19:53:51 2017 +0200
@@ -31,8 +31,6 @@
  *                   -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCountTrailingZerosInstruction TZcntTestL
  */
 
-import com.oracle.java.testlibrary.Platform;
-
 import java.lang.reflect.Method;
 
 public class TZcntTestL extends TZcntTestI {
@@ -40,11 +38,6 @@
     protected TZcntTestL(Method method) {
         super(method);
         isLongOperation = true;
-        if (Platform.isX64()) {
-            instrMask = new byte[]{(byte) 0xFF, (byte) 0x00, (byte) 0xFF, (byte) 0xFF};
-            instrPattern = new byte[]{(byte) 0xF3, (byte) 0x00, (byte) 0x0F, (byte) 0xBC};
-        }
-        isLongOperation = true;
     }
 
     public static void main(String[] args) throws Exception {
--- a/hotspot/test/compiler/tiered/NonTieredLevelsTest.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/test/compiler/tiered/NonTieredLevelsTest.java	Wed Jul 05 19:53:51 2017 +0200
@@ -25,8 +25,8 @@
 
 /**
  * @test NonTieredLevelsTest
+ * @library /testlibrary /testlibrary/whitebox /compiler/whitebox
  * @ignore 8046268
- * @library /testlibrary /testlibrary/whitebox /compiler/whitebox
  * @build NonTieredLevelsTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  * @run main/othervm -Xbootclasspath/a:. -XX:-TieredCompilation
--- a/hotspot/test/compiler/tiered/TieredLevelsTest.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/test/compiler/tiered/TieredLevelsTest.java	Wed Jul 05 19:53:51 2017 +0200
@@ -23,8 +23,8 @@
 
 /**
  * @test TieredLevelsTest
+ * @library /testlibrary /testlibrary/whitebox /compiler/whitebox
  * @ignore 8046268
- * @library /testlibrary /testlibrary/whitebox /compiler/whitebox
  * @build TieredLevelsTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  * @run main/othervm -Xbootclasspath/a:. -XX:+TieredCompilation
--- a/hotspot/test/compiler/whitebox/ClearMethodStateTest.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/test/compiler/whitebox/ClearMethodStateTest.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, 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,9 +25,9 @@
 
 /*
  * @test ClearMethodStateTest
- * @ignore 8046268
  * @bug 8006683 8007288 8022832
  * @library /testlibrary /testlibrary/whitebox
+ * @ignore 8046268
  * @build ClearMethodStateTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  * @run main/othervm -Xbootclasspath/a:. -Xmixed -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,SimpleTestCase$Helper::* ClearMethodStateTest
--- a/hotspot/test/compiler/whitebox/CompilerWhiteBoxTest.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/test/compiler/whitebox/CompilerWhiteBoxTest.java	Wed Jul 05 19:53:51 2017 +0200
@@ -21,11 +21,8 @@
  * questions.
  */
 
-import com.sun.management.HotSpotDiagnosticMXBean;
-import com.sun.management.VMOption;
 import sun.hotspot.WhiteBox;
 import sun.hotspot.code.NMethod;
-import sun.management.ManagementFactoryHelper;
 
 import java.lang.reflect.Constructor;
 import java.lang.reflect.Executable;
@@ -98,15 +95,7 @@
      */
     protected static String getVMOption(String name) {
         Objects.requireNonNull(name);
-        HotSpotDiagnosticMXBean diagnostic
-                = ManagementFactoryHelper.getDiagnosticMXBean();
-        VMOption tmp;
-        try {
-            tmp = diagnostic.getVMOption(name);
-        } catch (IllegalArgumentException e) {
-            tmp = null;
-        }
-        return (tmp == null ? null : tmp.getValue());
+        return Objects.toString(WHITE_BOX.getVMFlag(name), null);
     }
 
     /**
@@ -174,7 +163,7 @@
      * @see #test()
      */
     protected final void runTest() {
-        if (ManagementFactoryHelper.getCompilationMXBean() == null) {
+        if (CompilerWhiteBoxTest.MODE.startsWith("interpreted ")) {
             System.err.println(
                     "Warning: test is not applicable in interpreted mode");
             return;
--- a/hotspot/test/compiler/whitebox/DeoptimizeAllTest.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/test/compiler/whitebox/DeoptimizeAllTest.java	Wed Jul 05 19:53:51 2017 +0200
@@ -23,9 +23,9 @@
 
 /*
  * @test DeoptimizeAllTest
- * @ignore 8046268
  * @bug 8006683 8007288 8022832
  * @library /testlibrary /testlibrary/whitebox
+ * @ignore 8046268
  * @build DeoptimizeAllTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,SimpleTestCase$Helper::* DeoptimizeAllTest
--- a/hotspot/test/compiler/whitebox/DeoptimizeMethodTest.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/test/compiler/whitebox/DeoptimizeMethodTest.java	Wed Jul 05 19:53:51 2017 +0200
@@ -23,9 +23,9 @@
 
 /*
  * @test DeoptimizeMethodTest
- * @ignore 8046268
  * @bug 8006683 8007288 8022832
  * @library /testlibrary /testlibrary/whitebox
+ * @ignore 8046268
  * @build DeoptimizeMethodTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,SimpleTestCase$Helper::* DeoptimizeMethodTest
--- a/hotspot/test/compiler/whitebox/EnqueueMethodForCompilationTest.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/test/compiler/whitebox/EnqueueMethodForCompilationTest.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, 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
@@ -23,9 +23,9 @@
 
 /*
  * @test EnqueueMethodForCompilationTest
- * @ignore 8046268
  * @bug 8006683 8007288 8022832
  * @library /testlibrary /testlibrary/whitebox
+ * @ignore 8046268
  * @build EnqueueMethodForCompilationTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  * @run main/othervm/timeout=600 -Xbootclasspath/a:. -Xmixed -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,SimpleTestCase$Helper::* EnqueueMethodForCompilationTest
--- a/hotspot/test/compiler/whitebox/GetNMethodTest.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/test/compiler/whitebox/GetNMethodTest.java	Wed Jul 05 19:53:51 2017 +0200
@@ -26,9 +26,9 @@
 
 /*
  * @test GetNMethodTest
- * @ignore 8046268
  * @bug 8038240
  * @library /testlibrary /testlibrary/whitebox
+ * @ignore 8046268
  * @build GetNMethodTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  * @run main/othervm -Xbootclasspath/a:. -Xmixed -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,SimpleTestCase$Helper::* GetNMethodTest
--- a/hotspot/test/compiler/whitebox/MakeMethodNotCompilableTest.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/test/compiler/whitebox/MakeMethodNotCompilableTest.java	Wed Jul 05 19:53:51 2017 +0200
@@ -23,9 +23,9 @@
 
 /*
  * @test MakeMethodNotCompilableTest
- * @ignore 8046268
  * @bug 8012322 8006683 8007288 8022832
  * @library /testlibrary /testlibrary/whitebox
+ * @ignore 8046268
  * @build MakeMethodNotCompilableTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  * @run main/othervm/timeout=2400 -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,SimpleTestCase$Helper::* MakeMethodNotCompilableTest
--- a/hotspot/test/runtime/whitebox/WBStackSize.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/test/runtime/whitebox/WBStackSize.java	Wed Jul 05 19:53:51 2017 +0200
@@ -39,7 +39,6 @@
  * Please file a test bug, if this is a problem.
  */
 
-import com.sun.management.HotSpotDiagnosticMXBean;
 import sun.hotspot.WhiteBox;
 
 public class WBStackSize {
@@ -81,8 +80,7 @@
     }
 
     public static void main(String[] args) {
-        HotSpotDiagnosticMXBean bean = sun.management.ManagementFactoryHelper.getDiagnosticMXBean();
-        long configStackSize = Long.valueOf(bean.getVMOption("ThreadStackSize").getValue()) * K;
+        long configStackSize = wb.getIntxVMFlag("ThreadStackSize") * K;
 
         System.out.println("ThreadStackSize VM option: " + configStackSize);
 
--- a/hotspot/test/testlibrary/whitebox/sun/hotspot/WhiteBox.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/test/testlibrary/whitebox/sun/hotspot/WhiteBox.java	Wed Jul 05 19:53:51 2017 +0200
@@ -25,6 +25,10 @@
 package sun.hotspot;
 
 import java.lang.reflect.Executable;
+import java.util.Arrays;
+import java.util.List;
+import java.util.function.Function;
+import java.util.stream.Stream;
 import java.security.BasicPermission;
 import sun.hotspot.parser.DiagnosticCommand;
 
@@ -171,4 +175,15 @@
   public native Long    getUint64VMFlag(String name);
   public native String  getStringVMFlag(String name);
   public native Double  getDoubleVMFlag(String name);
+  private final List<Function<String,Object>> flagsGetters = Arrays.asList(
+    this::getBooleanVMFlag, this::getIntxVMFlag, this::getUintxVMFlag,
+    this::getUint64VMFlag, this::getStringVMFlag, this::getDoubleVMFlag);
+
+  public Object getVMFlag(String name) {
+    return flagsGetters.stream()
+                       .map(f -> f.apply(name))
+                       .filter(x -> x != null)
+                       .findAny()
+                       .orElse(null);
+  }
 }
--- a/hotspot/test/testlibrary_tests/whitebox/vm_flags/VmFlagTest.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/hotspot/test/testlibrary_tests/whitebox/vm_flags/VmFlagTest.java	Wed Jul 05 19:53:51 2017 +0200
@@ -91,16 +91,20 @@
     }
 
     private void testPositive(T value, T expected) {
-        Asserts.assertEQ(getVMOptionAsString(), asString(getValue()));
+        String oldValue = getVMOptionAsString();
+        Asserts.assertEQ(oldValue, asString(getValue()));
+        Asserts.assertEQ(oldValue, asString(WHITE_BOX.getVMFlag(flagName)));
         setNewValue(value);
         String newValue = getVMOptionAsString();
         Asserts.assertEQ(newValue, asString(expected));
-        Asserts.assertEQ(getVMOptionAsString(), asString(getValue()));
+        Asserts.assertEQ(newValue, asString(getValue()));
+        Asserts.assertEQ(newValue, asString(WHITE_BOX.getVMFlag(flagName)));
     }
 
     private void testNegative(T value, T expected) {
         String oldValue = getVMOptionAsString();
         Asserts.assertEQ(oldValue, asString(getValue()));
+        Asserts.assertEQ(oldValue, asString(WHITE_BOX.getVMFlag(flagName)));
         setNewValue(value);
         String newValue = getVMOptionAsString();
         Asserts.assertEQ(oldValue, newValue);
--- a/jaxp/.hgtags	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxp/.hgtags	Wed Jul 05 19:53:51 2017 +0200
@@ -267,3 +267,4 @@
 82b94ff002c6e007a03bf0f364ca94b381e09135 jdk9-b22
 2e5b63006187bfc64d8eace374dbc2806267a160 jdk9-b23
 345af113f57206711f75089c3ebf84a36a789122 jdk9-b24
+73757f4b8aa353ca8937abc07e79e7ece4c011a1 jdk9-b25
--- a/jaxp/src/com/sun/org/apache/xerces/internal/dom/CoreDOMImplementationImpl.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/dom/CoreDOMImplementationImpl.java	Wed Jul 05 19:53:51 2017 +0200
@@ -3,11 +3,12 @@
  * DO NOT REMOVE OR ALTER!
  */
 /*
- * Copyright 1999-2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
  *
@@ -385,8 +386,18 @@
          * reference to the default error handler.
          */
         public LSSerializer createLSSerializer() {
-        return new DOMSerializerImpl();
-    }
+            try {
+                Class serializerClass = ObjectFactory.findProviderClass(
+                    "com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl",
+                    ObjectFactory.findClassLoader(), true);
+                return (LSSerializer) serializerClass.newInstance();
+            }
+            catch (Exception e) {}
+            // Fall back to Xerces' deprecated serializer if
+            // the Xalan based serializer is unavailable.
+            return new DOMSerializerImpl();
+        }
+
         /**
          * DOM Level 3 LS CR - Experimental.
          * Create a new empty input source.
--- a/jaxp/src/com/sun/org/apache/xml/internal/dtm/ref/sax2dtm/SAX2DTM2.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxp/src/com/sun/org/apache/xml/internal/dtm/ref/sax2dtm/SAX2DTM2.java	Wed Jul 05 19:53:51 2017 +0200
@@ -3145,7 +3145,11 @@
                                   m_data.elementAt(-dataIndex+1));
       }
     }
-    else if (DTM.ELEMENT_NODE == type || DTM.DOCUMENT_FRAGMENT_NODE == type
+    else if (DTM.ELEMENT_NODE == type)
+    {
+      return getStringValueX(nodeHandle);
+    }
+    else if (DTM.DOCUMENT_FRAGMENT_NODE == type
              || DTM.DOCUMENT_NODE == type)
     {
       return null;
--- a/jaxp/src/com/sun/org/apache/xml/internal/serialize/BaseMarkupSerializer.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxp/src/com/sun/org/apache/xml/internal/serialize/BaseMarkupSerializer.java	Wed Jul 05 19:53:51 2017 +0200
@@ -123,6 +123,11 @@
  * @author Sunitha Reddy, Sun Microsystems
  * @see Serializer
  * @see org.w3c.dom.ls.LSSerializer
+ *
+ * @deprecated As of JDK 1.9, Xerces 2.9.0, Xerces DOM L3 Serializer implementation
+ * is replaced by that of Xalan. Main class
+ * {@link com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl} is replaced
+ * by {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}.
  */
 public abstract class BaseMarkupSerializer
     implements ContentHandler, DocumentHandler, LexicalHandler,
--- a/jaxp/src/com/sun/org/apache/xml/internal/serialize/DOMSerializer.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxp/src/com/sun/org/apache/xml/internal/serialize/DOMSerializer.java	Wed Jul 05 19:53:51 2017 +0200
@@ -3,11 +3,12 @@
  * DO NOT REMOVE OR ALTER!
  */
 /*
- * Copyright 1999-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
  *
@@ -35,6 +36,11 @@
  *
  * @author <a href="mailto:Scott_Boag/CAM/Lotus@lotus.com">Scott Boag</a>
  * @author <a href="mailto:arkin@intalio.com">Assaf Arkin</a>
+ *
+ * @deprecated As of JDK 1.9, Xerces 2.9.0, Xerces DOM L3 Serializer implementation
+ * is replaced by that of Xalan. Main class
+ * {@link com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl} is replaced
+ * by {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}.
  */
 public interface DOMSerializer
 {
--- a/jaxp/src/com/sun/org/apache/xml/internal/serialize/DOMSerializerImpl.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxp/src/com/sun/org/apache/xml/internal/serialize/DOMSerializerImpl.java	Wed Jul 05 19:53:51 2017 +0200
@@ -72,6 +72,9 @@
  * @author Gopal Sharma, Sun Microsystems
  * @author Arun Yadav, Sun Microsystems
  * @author Sunitha Reddy, Sun Microsystems
+ *
+ * @deprecated As of JDK 1.9, Xerces 2.9.0, replaced by
+ * {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}
  */
 public class DOMSerializerImpl implements LSSerializer, DOMConfiguration {
 
--- a/jaxp/src/com/sun/org/apache/xml/internal/serialize/ElementState.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxp/src/com/sun/org/apache/xml/internal/serialize/ElementState.java	Wed Jul 05 19:53:51 2017 +0200
@@ -3,11 +3,12 @@
  * DO NOT REMOVE OR ALTER!
  */
 /*
- * Copyright 1999-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
  *
@@ -28,9 +29,13 @@
 /**
  * Holds the state of the currently serialized element.
  *
- *
  * @author <a href="mailto:arkin@intalio.com">Assaf Arkin</a>
  * @see BaseMarkupSerializer
+ *
+ * @deprecated As of JDK 1.9, Xerces 2.9.0, Xerces DOM L3 Serializer implementation
+ * is replaced by that of Xalan. Main class
+ * {@link com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl} is replaced
+ * by {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}.
  */
 public class ElementState
 {
--- a/jaxp/src/com/sun/org/apache/xml/internal/serialize/EncodingInfo.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxp/src/com/sun/org/apache/xml/internal/serialize/EncodingInfo.java	Wed Jul 05 19:53:51 2017 +0200
@@ -3,11 +3,12 @@
  * DO NOT REMOVE OR ALTER!
  */
 /*
- * Copyright 2000-2002,2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
  *
@@ -29,6 +30,10 @@
 /**
  * This class represents an encoding.
  *
+ * @deprecated As of JDK 1.9, Xerces 2.9.0, Xerces DOM L3 Serializer implementation
+ * is replaced by that of Xalan. Main class
+ * {@link com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl} is replaced
+ * by {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}.
  */
 public class EncodingInfo {
 
--- a/jaxp/src/com/sun/org/apache/xml/internal/serialize/Encodings.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxp/src/com/sun/org/apache/xml/internal/serialize/Encodings.java	Wed Jul 05 19:53:51 2017 +0200
@@ -3,11 +3,12 @@
  * DO NOT REMOVE OR ALTER!
  */
 /*
- * Copyright 1999-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
  *
@@ -36,6 +37,11 @@
  * for each encoding.
  *
  * @author <a href="mailto:arkin@intalio.com">Assaf Arkin</a>
+ *
+ * @deprecated As of JDK 1.9, Xerces 2.9.0, Xerces DOM L3 Serializer implementation
+ * is replaced by that of Xalan. Main class
+ * {@link com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl} is replaced
+ * by {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}.
  */
 public class Encodings
 {
--- a/jaxp/src/com/sun/org/apache/xml/internal/serialize/HTMLdtd.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxp/src/com/sun/org/apache/xml/internal/serialize/HTMLdtd.java	Wed Jul 05 19:53:51 2017 +0200
@@ -3,11 +3,12 @@
  * DO NOT REMOVE OR ALTER!
  */
 /*
- * Copyright 1999-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
  *
@@ -45,8 +46,12 @@
  * from value to name. A small entities resource is loaded into memory the
  * first time any of these methods is called for fast and efficient access.
  *
+ * @author <a href="mailto:arkin@intalio.com">Assaf Arkin</a>
  *
- * @author <a href="mailto:arkin@intalio.com">Assaf Arkin</a>
+ * @deprecated As of JDK 1.9, Xerces 2.9.0, Xerces DOM L3 Serializer implementation
+ * is replaced by that of Xalan. Main class
+ * {@link com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl} is replaced
+ * by {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}.
  */
 public final class HTMLdtd
 {
--- a/jaxp/src/com/sun/org/apache/xml/internal/serialize/IndentPrinter.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxp/src/com/sun/org/apache/xml/internal/serialize/IndentPrinter.java	Wed Jul 05 19:53:51 2017 +0200
@@ -3,11 +3,12 @@
  * DO NOT REMOVE OR ALTER!
  */
 /*
- * Copyright 1999-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
  *
@@ -32,6 +33,11 @@
  * wrapping.
  *
  * @author <a href="mailto:arkin@intalio.com">Assaf Arkin</a>
+ *
+ * @deprecated As of JDK 1.9, Xerces 2.9.0, Xerces DOM L3 Serializer implementation
+ * is replaced by that of Xalan. Main class
+ * {@link com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl} is replaced
+ * by {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}.
  */
 public class IndentPrinter
     extends Printer
--- a/jaxp/src/com/sun/org/apache/xml/internal/serialize/LineSeparator.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxp/src/com/sun/org/apache/xml/internal/serialize/LineSeparator.java	Wed Jul 05 19:53:51 2017 +0200
@@ -3,11 +3,12 @@
  * DO NOT REMOVE OR ALTER!
  */
 /*
- * Copyright 1999-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
  *
@@ -25,6 +26,11 @@
 /**
  * @author <a href="mailto:arkin@intalio..com">Assaf Arkin</a>
  * @see OutputFormat
+ *
+ * @deprecated As of JDK 1.9, Xerces 2.9.0, Xerces DOM L3 Serializer implementation
+ * is replaced by that of Xalan. Main class
+ * {@link com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl} is replaced
+ * by {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}.
  */
 public final class LineSeparator
 {
--- a/jaxp/src/com/sun/org/apache/xml/internal/serialize/Method.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxp/src/com/sun/org/apache/xml/internal/serialize/Method.java	Wed Jul 05 19:53:51 2017 +0200
@@ -3,11 +3,12 @@
  * DO NOT REMOVE OR ALTER!
  */
 /*
- * Copyright 1999-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
  *
@@ -25,6 +26,11 @@
 /**
  * @author <a href="mailto:arkin@intalio.com">Assaf Arkin</a>
  * @see OutputFormat
+ *
+ * @deprecated As of JDK 1.9, Xerces 2.9.0, Xerces DOM L3 Serializer implementation
+ * is replaced by that of Xalan. Main class
+ * {@link com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl} is replaced
+ * by {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}.
  */
 public final class Method
 {
--- a/jaxp/src/com/sun/org/apache/xml/internal/serialize/OutputFormat.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxp/src/com/sun/org/apache/xml/internal/serialize/OutputFormat.java	Wed Jul 05 19:53:51 2017 +0200
@@ -3,11 +3,12 @@
  * DO NOT REMOVE OR ALTER!
  */
 /*
- * Copyright 1999-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
  *
@@ -59,6 +60,11 @@
  * @see Serializer
  * @see Method
  * @see LineSeparator
+ *
+ * @deprecated As of JDK 1.9, Xerces 2.9.0, Xerces DOM L3 Serializer implementation
+ * is replaced by that of Xalan. Main class
+ * {@link com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl} is replaced
+ * by {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}.
  */
 public class OutputFormat
 {
--- a/jaxp/src/com/sun/org/apache/xml/internal/serialize/Printer.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxp/src/com/sun/org/apache/xml/internal/serialize/Printer.java	Wed Jul 05 19:53:51 2017 +0200
@@ -3,11 +3,12 @@
  * DO NOT REMOVE OR ALTER!
  */
 /*
- * Copyright 1999-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
  *
@@ -40,6 +41,11 @@
  * extending this class.
  *
  * @author <a href="mailto:arkin@intalio.com">Assaf Arkin</a>
+ *
+ * @deprecated As of JDK 1.9, Xerces 2.9.0, Xerces DOM L3 Serializer implementation
+ * is replaced by that of Xalan. Main class
+ * {@link com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl} is replaced
+ * by {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}.
  */
 public class Printer
 {
--- a/jaxp/src/com/sun/org/apache/xml/internal/serialize/Serializer.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxp/src/com/sun/org/apache/xml/internal/serialize/Serializer.java	Wed Jul 05 19:53:51 2017 +0200
@@ -3,11 +3,12 @@
  * DO NOT REMOVE OR ALTER!
  */
 /*
- * Copyright 1999-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
  *
@@ -60,6 +61,11 @@
  * @see ContentHandler
  * @see OutputFormat
  * @see DOMSerializer
+ *
+ * @deprecated As of JDK 1.9, Xerces 2.9.0, Xerces DOM L3 Serializer implementation
+ * is replaced by that of Xalan. Main class
+ * {@link com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl} is replaced
+ * by {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}.
  */
 public interface Serializer
 {
--- a/jaxp/src/com/sun/org/apache/xml/internal/serialize/SerializerFactory.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxp/src/com/sun/org/apache/xml/internal/serialize/SerializerFactory.java	Wed Jul 05 19:53:51 2017 +0200
@@ -3,11 +3,12 @@
  * DO NOT REMOVE OR ALTER!
  */
 /*
- * Copyright 1999-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
  *
@@ -34,6 +35,11 @@
  *
  * @author <a href="mailto:Scott_Boag/CAM/Lotus@lotus.com">Scott Boag</a>
  * @author <a href="mailto:arkin@intalio.com">Assaf Arkin</a>
+ *
+ * @deprecated As of JDK 1.9, Xerces 2.9.0, Xerces DOM L3 Serializer implementation
+ * is replaced by that of Xalan. Main class
+ * {@link com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl} is replaced
+ * by {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}.
  */
 public abstract class SerializerFactory
 {
--- a/jaxp/src/com/sun/org/apache/xml/internal/serialize/SerializerFactoryImpl.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxp/src/com/sun/org/apache/xml/internal/serialize/SerializerFactoryImpl.java	Wed Jul 05 19:53:51 2017 +0200
@@ -3,11 +3,12 @@
  * DO NOT REMOVE OR ALTER!
  */
 /*
- * Copyright 1999-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
  *
@@ -34,6 +35,11 @@
  *
  * @author <a href="mailto:Scott_Boag/CAM/Lotus@lotus.com">Scott Boag</a>
  * @author <a href="mailto:arkin@intalio.com">Assaf Arkin</a>
+ *
+ * @deprecated As of JDK 1.9, Xerces 2.9.0, Xerces DOM L3 Serializer implementation
+ * is replaced by that of Xalan. Main class
+ * {@link com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl} is replaced
+ * by {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}.
  */
 final class SerializerFactoryImpl
     extends SerializerFactory
--- a/jaxp/src/com/sun/org/apache/xml/internal/serialize/TextSerializer.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxp/src/com/sun/org/apache/xml/internal/serialize/TextSerializer.java	Wed Jul 05 19:53:51 2017 +0200
@@ -3,11 +3,12 @@
  * DO NOT REMOVE OR ALTER!
  */
 /*
- * Copyright 1999-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
  *
@@ -58,6 +59,11 @@
  *
  * @author <a href="mailto:arkin@intalio.com">Assaf Arkin</a>
  * @see Serializer
+ *
+ * @deprecated As of JDK 1.9, Xerces 2.9.0, Xerces DOM L3 Serializer implementation
+ * is replaced by that of Xalan. Main class
+ * {@link com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl} is replaced
+ * by {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}.
  */
 public class TextSerializer
     extends BaseMarkupSerializer
--- a/jaxp/src/com/sun/org/apache/xml/internal/serialize/XML11Serializer.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxp/src/com/sun/org/apache/xml/internal/serialize/XML11Serializer.java	Wed Jul 05 19:53:51 2017 +0200
@@ -73,10 +73,16 @@
  * boundaries, indent lines, and serialize elements on separate
  * lines. Line terminators will be regarded as spaces, and
  * spaces at beginning of line will be stripped.
+ *
  * @author <a href="mailto:arkin@intalio.com">Assaf Arkin</a>
  * @author <a href="mailto:rahul.srivastava@sun.com">Rahul Srivastava</a>
  * @author Elena Litani IBM
  * @see Serializer
+ *
+ * @deprecated As of JDK 1.9, Xerces 2.9.0, Xerces DOM L3 Serializer implementation
+ * is replaced by that of Xalan. Main class
+ * {@link com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl} is replaced
+ * by {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}.
  */
 public class XML11Serializer
 extends XMLSerializer {
--- a/jaxp/src/com/sun/org/apache/xml/internal/serialize/XMLSerializer.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxp/src/com/sun/org/apache/xml/internal/serialize/XMLSerializer.java	Wed Jul 05 19:53:51 2017 +0200
@@ -84,10 +84,16 @@
  * boundaries, indent lines, and serialize elements on separate
  * lines. Line terminators will be regarded as spaces, and
  * spaces at beginning of line will be stripped.
+ *
  * @author <a href="mailto:arkin@intalio.com">Assaf Arkin</a>
  * @author <a href="mailto:rahul.srivastava@sun.com">Rahul Srivastava</a>
  * @author Elena Litani IBM
  * @see Serializer
+ *
+ * @deprecated As of JDK 1.9, Xerces 2.9.0, Xerces DOM L3 Serializer implementation
+ * is replaced by that of Xalan. Main class
+ * {@link com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl} is replaced
+ * by {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}.
  */
 public class XMLSerializer
 extends BaseMarkupSerializer {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/DOM3Serializer.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,117 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the  "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/*
+ * $Id:  $
+ */
+
+package com.sun.org.apache.xml.internal.serializer;
+
+import java.io.IOException;
+
+import org.w3c.dom.Node;
+import org.w3c.dom.DOMErrorHandler;
+import org.w3c.dom.ls.LSSerializerFilter;
+
+/**
+ * Interface for a DOM serializer capable of serializing DOMs as specified in
+ * the DOM Level 3 Save Recommendation.
+ * <p>
+ * The DOM3Serializer is a facet of a serializer and is obtained from the
+ * asDOM3Serializer() method of the org.apache.xml.serializer.Serializer interface.
+ * A serializer may or may not support a level 3 DOM serializer, if it does not then the
+ * return value from asDOM3Serializer() is null.
+ * <p>
+ * Example:
+ * <pre>
+ * Document     doc;
+ * Serializer   ser;
+ * OutputStream os;
+ * DOMErrorHandler handler;
+ *
+ * ser = ...;
+ * os = ...;
+ * handler = ...;
+ *
+ * ser.setOutputStream( os );
+ * DOM3Serialzier dser = (DOM3Serialzier)ser.asDOM3Serializer();
+ * dser.setErrorHandler(handler);
+ * dser.serialize(doc);
+ * </pre>
+ *
+ * @see org.apache.xml.serializer.Serializer
+ *
+ * @xsl.usage general
+ *
+ */
+public interface DOM3Serializer {
+    /**
+     * Serializes the Level 3 DOM node. Throws an exception only if an I/O
+     * exception occured while serializing.
+     *
+     * This interface is a public API.
+     *
+     * @param node the Level 3 DOM node to serialize
+     * @throws IOException if an I/O exception occured while serializing
+     */
+    public void serializeDOM3(Node node) throws IOException;
+
+    /**
+     * Sets a DOMErrorHandler on the DOM Level 3 Serializer.
+     *
+     * This interface is a public API.
+     *
+     * @param handler the Level 3 DOMErrorHandler
+     */
+    public void setErrorHandler(DOMErrorHandler handler);
+
+    /**
+     * Returns a DOMErrorHandler set on the DOM Level 3 Serializer.
+     *
+     * This interface is a public API.
+     *
+     * @return A Level 3 DOMErrorHandler
+     */
+    public DOMErrorHandler getErrorHandler();
+
+    /**
+     * Sets a LSSerializerFilter on the DOM Level 3 Serializer to filter nodes
+     * during serialization.
+     *
+     * This interface is a public API.
+     *
+     * @param filter the Level 3 LSSerializerFilter
+     */
+    public void setNodeFilter(LSSerializerFilter filter);
+
+    /**
+     * Returns a LSSerializerFilter set on the DOM Level 3 Serializer to filter nodes
+     * during serialization.
+     *
+     * This interface is a public API.
+     *
+     * @return The Level 3 LSSerializerFilter
+     */
+    public LSSerializerFilter getNodeFilter();
+
+    /**
+     * Sets the new line character to be used during serialization
+     * @param newLine a String that is the end-of-line character sequence to be
+     * used in serialization.
+     */
+    public void setNewLine(String newLine);
+}
--- a/jaxp/src/com/sun/org/apache/xml/internal/serializer/EmptySerializer.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/EmptySerializer.java	Wed Jul 05 19:53:51 2017 +0200
@@ -786,4 +786,13 @@
         aMethodIsCalled();
 
     }
+
+    /**
+     * @see org.apache.xml.serializer.Serializer#asDOM3Serializer()
+     */
+    public Object asDOM3Serializer() throws IOException
+    {
+        couldThrowIOException();
+        return null;
+    }
 }
--- a/jaxp/src/com/sun/org/apache/xml/internal/serializer/Encodings.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/Encodings.java	Wed Jul 05 19:53:51 2017 +0200
@@ -153,6 +153,24 @@
     }
 
     /**
+     * Determines if the encoding specified was recognized by the
+     * serializer or not.
+     *
+     * @param encoding The encoding
+     * @return boolean - true if the encoding was recognized else false
+     */
+    public static boolean isRecognizedEncoding(String encoding)
+    {
+        EncodingInfo ei;
+
+        String normalizedEncoding = toUpperCaseFast(encoding);
+        ei = _encodingInfos.findEncoding(normalizedEncoding);
+        if (ei != null)
+            return true;
+        return false;
+    }
+
+    /**
      * A fast and cheap way to uppercase a String that is
      * only made of printable ASCII characters.
      * <p>
--- a/jaxp/src/com/sun/org/apache/xml/internal/serializer/SerializationHandler.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/SerializationHandler.java	Wed Jul 05 19:53:51 2017 +0200
@@ -3,9 +3,11 @@
  * DO NOT REMOVE OR ALTER!
  */
 /*
- * Copyright 2003-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the  "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
@@ -110,9 +112,29 @@
     public void setNamespaceMappings(NamespaceMappings mappings);
 
     /**
-     * Flush any pending events currently queued up in the serializer. This will
-     * flush any input that the serializer has which it has not yet sent as
-     * output.
+     * A SerializationHandler accepts SAX-like events, so
+     * it can accumulate attributes or namespace nodes after
+     * a startElement().
+     * <p>
+     * If the SerializationHandler has a Writer or OutputStream,
+     * a call to this method will flush such accumulated
+     * events as a closed start tag for an element.
+     * <p>
+     * If the SerializationHandler wraps a ContentHandler,
+     * a call to this method will flush such accumulated
+     * events as a SAX (not SAX-like) calls to
+     * startPrefixMapping() and startElement().
+     * <p>
+     * If one calls endDocument() then one need not call
+     * this method since a call to endDocument() will
+     * do what this method does. However, in some
+     * circumstances, such as with document fragments,
+     * endDocument() is not called and it may be
+     * necessary to call this method to flush
+     * any pending events.
+     * <p>
+     * For performance reasons this method should not be called
+     * very often.
      */
     public void flushPending() throws SAXException;
 
--- a/jaxp/src/com/sun/org/apache/xml/internal/serializer/Serializer.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/Serializer.java	Wed Jul 05 19:53:51 2017 +0200
@@ -3,9 +3,11 @@
  * DO NOT REMOVE OR ALTER!
  */
 /*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the  "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
@@ -220,4 +222,20 @@
      * @return True if serializer has been reset and can be reused
      */
     public boolean reset();
+
+    /**
+     * Return an Object into this serializer to be cast to a DOM3Serializer.
+     * Through the returned object the document to be serialized,
+     * a DOM (Level 3), can be provided to the serializer.
+     * If the serializer does not support casting to a {@link DOM3Serializer}
+     * interface, it should return null.
+     * <p>
+     * In principle only one of asDOM3Serializer() or asContentHander()
+     * should be called.
+     *
+     * @return An Object to be cast to a DOM3Serializer interface into this serializer,
+     *  or null if the serializer is not DOM capable
+     * @throws IOException An I/O exception occured
+     */
+    public Object asDOM3Serializer() throws IOException;
 }
--- a/jaxp/src/com/sun/org/apache/xml/internal/serializer/SerializerBase.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/SerializerBase.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1559,6 +1559,21 @@
     }
 
     /**
+     * Return a {@link DOM3Serializer} interface into this serializer. If the
+     * serializer does not support the {@link DOM3Serializer} interface, it should
+     * return null.
+     *
+     * @return A {@link DOM3Serializer} interface into this serializer,  or null
+     * if the serializer is not DOM capable
+     * @throws IOException An I/O exception occured
+     * @see org.apache.xml.serializer.Serializer#asDOM3Serializer()
+     */
+    public Object asDOM3Serializer() throws IOException
+    {
+        return new com.sun.org.apache.xml.internal.serializer.dom3.DOM3SerializerImpl(this);
+    }
+
+    /**
      * Get the default value of an xsl:output property,
      * which would be null only if no default value exists
      * for the property.
--- a/jaxp/src/com/sun/org/apache/xml/internal/serializer/SerializerFactory.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/SerializerFactory.java	Wed Jul 05 19:53:51 2017 +0200
@@ -136,7 +136,7 @@
         if (obj instanceof SerializationHandler)
         {
               // this is one of the supplied serializers
-            ser = (Serializer) cls.newInstance();
+            ser = (Serializer) obj;
             ser.setOutputFormat(format);
         }
         else
--- a/jaxp/src/com/sun/org/apache/xml/internal/serializer/ToStream.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/ToStream.java	Wed Jul 05 19:53:51 2017 +0200
@@ -537,7 +537,7 @@
                 if (OutputPropertiesFactory.S_KEY_INDENT_AMOUNT.equals(name)) {
                     setIndentAmount(Integer.parseInt(val));
                 } else if (OutputKeys.INDENT.equals(name)) {
-                    boolean b = "yes".equals(val) ? true : false;
+                    boolean b = val.endsWith("yes") ? true : false;
                     m_doIndent = b;
                 }
 
@@ -556,7 +556,7 @@
                 break;
             case 'o':
                 if (OutputKeys.OMIT_XML_DECLARATION.equals(name)) {
-                    boolean b = "yes".equals(val) ? true : false;
+                    boolean b = val.endsWith("yes") ? true : false;
                     this.m_shouldNotWriteXMLHeader = b;
                 }
                 break;
--- a/jaxp/src/com/sun/org/apache/xml/internal/serializer/ToUnknownStream.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/ToUnknownStream.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1335,4 +1335,12 @@
                 ch.length);
         }
     }
+
+    /**
+     * @see org.apache.xml.serializer.Serializer#asDOM3Serializer()
+     */
+    public Object asDOM3Serializer() throws IOException
+    {
+        return m_handler.asDOM3Serializer();
+    }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/dom3/DOM3SerializerImpl.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,150 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the  "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.sun.org.apache.xml.internal.serializer.dom3;
+
+import java.io.IOException;
+
+import com.sun.org.apache.xml.internal.serializer.DOM3Serializer;
+import com.sun.org.apache.xml.internal.serializer.SerializationHandler;
+import com.sun.org.apache.xml.internal.serializer.utils.WrappedRuntimeException;
+import org.w3c.dom.DOMErrorHandler;
+import org.w3c.dom.Node;
+import org.w3c.dom.ls.LSSerializerFilter;
+
+/**
+ * This class implements the DOM3Serializer interface.
+ *
+ * @xsl.usage internal
+ */
+public final class DOM3SerializerImpl implements DOM3Serializer {
+
+    /**
+     * Private class members
+     */
+    // The DOMErrorHandler
+    private DOMErrorHandler fErrorHandler;
+
+    // A LSSerializerFilter
+    private LSSerializerFilter fSerializerFilter;
+
+    // The end-of-line character sequence
+    private String fNewLine;
+
+    // A SerializationHandler ex. an instance of ToXMLStream
+    private SerializationHandler fSerializationHandler;
+
+    /**
+     * Constructor
+     *
+     * @param handler An instance of the SerializationHandler interface.
+     */
+    public DOM3SerializerImpl(SerializationHandler handler) {
+        fSerializationHandler = handler;
+    }
+
+    // Public memebers
+
+    /**
+     * Returns a DOMErrorHandler set on the DOM Level 3 Serializer.
+     *
+     * This interface is a public API.
+     *
+     * @return A Level 3 DOMErrorHandler
+     */
+    public DOMErrorHandler getErrorHandler() {
+        return fErrorHandler;
+    }
+
+    /**
+     * Returns a LSSerializerFilter set on the DOM Level 3 Serializer to filter nodes
+     * during serialization.
+     *
+     * This interface is a public API.
+     *
+     * @return The Level 3 LSSerializerFilter
+     */
+    public LSSerializerFilter getNodeFilter() {
+        return fSerializerFilter;
+    }
+
+
+    /**
+     * Serializes the Level 3 DOM node by creating an instance of DOM3TreeWalker
+     * which traverses the DOM tree and invokes handler events to serialize
+     * the DOM NOde. Throws an exception only if an I/O exception occured
+     * while serializing.
+     * This interface is a public API.
+     *
+     * @param node the Level 3 DOM node to serialize
+     * @throws IOException if an I/O exception occured while serializing
+     */
+    public void serializeDOM3(Node node) throws IOException {
+        try {
+            DOM3TreeWalker walker = new DOM3TreeWalker(fSerializationHandler,
+                    fErrorHandler, fSerializerFilter, fNewLine);
+
+            walker.traverse(node);
+        } catch (org.xml.sax.SAXException se) {
+            throw new WrappedRuntimeException(se);
+        }
+    }
+
+    /**
+     * Sets a DOMErrorHandler on the DOM Level 3 Serializer.
+     *
+     * This interface is a public API.
+     *
+     * @param handler the Level 3 DOMErrorHandler
+     */
+    public void setErrorHandler(DOMErrorHandler handler) {
+        fErrorHandler = handler;
+    }
+
+    /**
+     * Sets a LSSerializerFilter on the DOM Level 3 Serializer to filter nodes
+     * during serialization.
+     *
+     * This interface is a public API.
+     *
+     * @param filter the Level 3 LSSerializerFilter
+     */
+    public void setNodeFilter(LSSerializerFilter filter) {
+        fSerializerFilter = filter;
+    }
+
+    /**
+     * Sets a SerializationHandler on the DOM Serializer.
+     *
+     * This interface is a public API.
+     *
+     * @param handler An instance of SerializationHandler
+     */
+    public void setSerializationHandler(SerializationHandler handler) {
+        fSerializationHandler = handler;
+    }
+
+    /**
+     * Sets the new line character to be used during serialization
+     * @param newLine a String that is the end-of-line character sequence to be
+     * used in serialization.
+     */
+    public void setNewLine(String newLine) {
+        fNewLine = newLine;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/dom3/DOM3TreeWalker.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,2145 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the  "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/*
+ * $Id:  $
+ */
+
+package com.sun.org.apache.xml.internal.serializer.dom3;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.Writer;
+import java.util.Enumeration;
+import java.util.Hashtable;
+import java.util.Properties;
+
+import com.sun.org.apache.xml.internal.serializer.OutputPropertiesFactory;
+import com.sun.org.apache.xml.internal.serializer.SerializationHandler;
+import com.sun.org.apache.xml.internal.serializer.utils.MsgKey;
+import com.sun.org.apache.xml.internal.serializer.utils.Utils;
+import com.sun.org.apache.xerces.internal.util.XML11Char;
+import com.sun.org.apache.xerces.internal.util.XMLChar;
+import org.w3c.dom.Attr;
+import org.w3c.dom.CDATASection;
+import org.w3c.dom.Comment;
+import org.w3c.dom.DOMError;
+import org.w3c.dom.DOMErrorHandler;
+import org.w3c.dom.Document;
+import org.w3c.dom.DocumentType;
+import org.w3c.dom.Element;
+import org.w3c.dom.Entity;
+import org.w3c.dom.EntityReference;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.w3c.dom.ProcessingInstruction;
+import org.w3c.dom.Text;
+import org.w3c.dom.ls.LSSerializerFilter;
+import org.w3c.dom.traversal.NodeFilter;
+import org.xml.sax.Locator;
+import org.xml.sax.SAXException;
+import org.xml.sax.ext.LexicalHandler;
+import org.xml.sax.helpers.LocatorImpl;
+
+/**
+ * Built on org.apache.xml.serializer.TreeWalker and adds functionality to
+ * traverse and serialize a DOM Node (Level 2 or Level 3) as specified in
+ * the DOM Level 3 LS Recommedation by evaluating and applying DOMConfiguration
+ * parameters and filters if any during serialization.
+ *
+ * @xsl.usage internal
+ */
+final class DOM3TreeWalker {
+
+    /**
+     * The SerializationHandler, it extends ContentHandler and when
+     * this class is instantiated via the constructor provided, a
+     * SerializationHandler object is passed to it.
+     */
+    private SerializationHandler fSerializer = null;
+
+    /** We do not need DOM2Helper since DOM Level 3 LS applies to DOM Level 2 or newer */
+
+    /** Locator object for this TreeWalker          */
+    private LocatorImpl fLocator = new LocatorImpl();
+
+    /** ErrorHandler */
+    private DOMErrorHandler fErrorHandler = null;
+
+    /** LSSerializerFilter */
+    private LSSerializerFilter fFilter = null;
+
+    /** If the serializer is an instance of a LexicalHandler */
+    private LexicalHandler fLexicalHandler = null;
+
+    private int fWhatToShowFilter;
+
+    /** New Line character to use in serialization */
+    private String fNewLine = null;
+
+    /** DOMConfiguration Properties */
+    private Properties fDOMConfigProperties = null;
+
+    /** Keeps track if we are in an entity reference when entities=true */
+    private boolean fInEntityRef = false;
+
+    /** Stores the version of the XML document to be serialize */
+    private String fXMLVersion = null;
+
+    /** XML Version, default 1.0 */
+    private boolean fIsXMLVersion11 = false;
+
+    /** Is the Node a Level 3 DOM node */
+    private boolean fIsLevel3DOM = false;
+
+    /** DOM Configuration Parameters */
+    private int fFeatures = 0;
+
+    /** Flag indicating whether following text to be processed is raw text          */
+    boolean fNextIsRaw = false;
+
+    //
+    private static final String XMLNS_URI = "http://www.w3.org/2000/xmlns/";
+
+    //
+    private static final String XMLNS_PREFIX = "xmlns";
+
+    //
+    private static final String XML_URI = "http://www.w3.org/XML/1998/namespace";
+
+    //
+    private static final String XML_PREFIX = "xml";
+
+    /** stores namespaces in scope */
+    protected NamespaceSupport fNSBinder;
+
+    /** stores all namespace bindings on the current element */
+    protected NamespaceSupport fLocalNSBinder;
+
+    /** stores the current element depth */
+    private int fElementDepth = 0;
+
+    // ***********************************************************************
+    // DOMConfiguration paramter settings
+    // ***********************************************************************
+    // Parameter canonical-form, true [optional] - NOT SUPPORTED
+    private final static int CANONICAL = 0x1 << 0;
+
+    // Parameter cdata-sections, true [required] (default)
+    private final static int CDATA = 0x1 << 1;
+
+    // Parameter check-character-normalization, true [optional] - NOT SUPPORTED
+    private final static int CHARNORMALIZE = 0x1 << 2;
+
+    // Parameter comments, true [required] (default)
+    private final static int COMMENTS = 0x1 << 3;
+
+    // Parameter datatype-normalization, true [optional] - NOT SUPPORTED
+    private final static int DTNORMALIZE = 0x1 << 4;
+
+    // Parameter element-content-whitespace, true [required] (default) - value - false [optional] NOT SUPPORTED
+    private final static int ELEM_CONTENT_WHITESPACE = 0x1 << 5;
+
+    // Parameter entities, true [required] (default)
+    private final static int ENTITIES = 0x1 << 6;
+
+    // Parameter infoset, true [required] (default), false has no effect --> True has no effect for the serializer
+    private final static int INFOSET = 0x1 << 7;
+
+    // Parameter namespaces, true [required] (default)
+    private final static int NAMESPACES = 0x1 << 8;
+
+    // Parameter namespace-declarations, true [required] (default)
+    private final static int NAMESPACEDECLS = 0x1 << 9;
+
+    // Parameter normalize-characters, true [optional] - NOT SUPPORTED
+    private final static int NORMALIZECHARS = 0x1 << 10;
+
+    // Parameter split-cdata-sections, true [required] (default)
+    private final static int SPLITCDATA = 0x1 << 11;
+
+    // Parameter validate, true [optional] - NOT SUPPORTED
+    private final static int VALIDATE = 0x1 << 12;
+
+    // Parameter validate-if-schema, true [optional] - NOT SUPPORTED
+    private final static int SCHEMAVALIDATE = 0x1 << 13;
+
+    // Parameter split-cdata-sections, true [required] (default)
+    private final static int WELLFORMED = 0x1 << 14;
+
+    // Parameter discard-default-content, true [required] (default)
+    // Not sure how this will be used in level 2 Documents
+    private final static int DISCARDDEFAULT = 0x1 << 15;
+
+    // Parameter format-pretty-print, true [optional]
+    private final static int PRETTY_PRINT = 0x1 << 16;
+
+    // Parameter ignore-unknown-character-denormalizations, true [required] (default)
+    // We currently do not support XML 1.1 character normalization
+    private final static int IGNORE_CHAR_DENORMALIZE = 0x1 << 17;
+
+    // Parameter discard-default-content, true [required] (default)
+    private final static int XMLDECL = 0x1 << 18;
+
+    /**
+     * Constructor.
+     * @param   contentHandler serialHandler The implemention of the SerializationHandler interface
+     */
+    DOM3TreeWalker(
+        SerializationHandler serialHandler,
+        DOMErrorHandler errHandler,
+        LSSerializerFilter filter,
+        String newLine) {
+        fSerializer = serialHandler;
+        //fErrorHandler = errHandler == null ? new DOMErrorHandlerImpl() : errHandler; // Should we be using the default?
+        fErrorHandler = errHandler;
+        fFilter = filter;
+        fLexicalHandler = null;
+        fNewLine = newLine;
+
+        fNSBinder = new NamespaceSupport();
+        fLocalNSBinder = new NamespaceSupport();
+
+        fDOMConfigProperties = fSerializer.getOutputFormat();
+        fSerializer.setDocumentLocator(fLocator);
+        initProperties(fDOMConfigProperties);
+
+        try {
+            // Bug see Bugzilla  26741
+            fLocator.setSystemId(
+                System.getProperty("user.dir") + File.separator + "dummy.xsl");
+        } catch (SecurityException se) { // user.dir not accessible from applet
+
+        }
+    }
+
+    /**
+     * Perform a pre-order traversal non-recursive style.
+     *
+     * Note that TreeWalker assumes that the subtree is intended to represent
+     * a complete (though not necessarily well-formed) document and, during a
+     * traversal, startDocument and endDocument will always be issued to the
+     * SAX listener.
+     *
+     * @param pos Node in the tree where to start traversal
+     *
+     * @throws TransformerException
+     */
+    public void traverse(Node pos) throws org.xml.sax.SAXException {
+        this.fSerializer.startDocument();
+
+        // Determine if the Node is a DOM Level 3 Core Node.
+        if (pos.getNodeType() != Node.DOCUMENT_NODE) {
+            Document ownerDoc = pos.getOwnerDocument();
+            if (ownerDoc != null
+                && ownerDoc.getImplementation().hasFeature("Core", "3.0")) {
+                fIsLevel3DOM = true;
+            }
+        } else {
+            if (((Document) pos)
+                .getImplementation()
+                .hasFeature("Core", "3.0")) {
+                fIsLevel3DOM = true;
+            }
+        }
+
+        if (fSerializer instanceof LexicalHandler) {
+            fLexicalHandler = ((LexicalHandler) this.fSerializer);
+        }
+
+        if (fFilter != null)
+            fWhatToShowFilter = fFilter.getWhatToShow();
+
+        Node top = pos;
+
+        while (null != pos) {
+            startNode(pos);
+
+            Node nextNode = null;
+
+            nextNode = pos.getFirstChild();
+
+            while (null == nextNode) {
+                endNode(pos);
+
+                if (top.equals(pos))
+                    break;
+
+                nextNode = pos.getNextSibling();
+
+                if (null == nextNode) {
+                    pos = pos.getParentNode();
+
+                    if ((null == pos) || (top.equals(pos))) {
+                        if (null != pos)
+                            endNode(pos);
+
+                        nextNode = null;
+
+                        break;
+                    }
+                }
+            }
+
+            pos = nextNode;
+        }
+        this.fSerializer.endDocument();
+    }
+
+    /**
+     * Perform a pre-order traversal non-recursive style.
+
+     * Note that TreeWalker assumes that the subtree is intended to represent
+     * a complete (though not necessarily well-formed) document and, during a
+     * traversal, startDocument and endDocument will always be issued to the
+     * SAX listener.
+     *
+     * @param pos Node in the tree where to start traversal
+     * @param top Node in the tree where to end traversal
+     *
+     * @throws TransformerException
+     */
+    public void traverse(Node pos, Node top) throws org.xml.sax.SAXException {
+
+        this.fSerializer.startDocument();
+
+        // Determine if the Node is a DOM Level 3 Core Node.
+        if (pos.getNodeType() != Node.DOCUMENT_NODE) {
+            Document ownerDoc = pos.getOwnerDocument();
+            if (ownerDoc != null
+                && ownerDoc.getImplementation().hasFeature("Core", "3.0")) {
+                fIsLevel3DOM = true;
+            }
+        } else {
+            if (((Document) pos)
+                .getImplementation()
+                .hasFeature("Core", "3.0")) {
+                fIsLevel3DOM = true;
+            }
+        }
+
+        if (fSerializer instanceof LexicalHandler) {
+            fLexicalHandler = ((LexicalHandler) this.fSerializer);
+        }
+
+        if (fFilter != null)
+            fWhatToShowFilter = fFilter.getWhatToShow();
+
+        while (null != pos) {
+            startNode(pos);
+
+            Node nextNode = null;
+
+            nextNode = pos.getFirstChild();
+
+            while (null == nextNode) {
+                endNode(pos);
+
+                if ((null != top) && top.equals(pos))
+                    break;
+
+                nextNode = pos.getNextSibling();
+
+                if (null == nextNode) {
+                    pos = pos.getParentNode();
+
+                    if ((null == pos) || ((null != top) && top.equals(pos))) {
+                        nextNode = null;
+
+                        break;
+                    }
+                }
+            }
+
+            pos = nextNode;
+        }
+        this.fSerializer.endDocument();
+    }
+
+    /**
+     * Optimized dispatch of characters.
+     */
+    private final void dispatachChars(Node node)
+        throws org.xml.sax.SAXException {
+        if (fSerializer != null) {
+            this.fSerializer.characters(node);
+        } else {
+            String data = ((Text) node).getData();
+            this.fSerializer.characters(data.toCharArray(), 0, data.length());
+        }
+    }
+
+    /**
+     * Start processing given node
+     *
+     * @param node Node to process
+     *
+     * @throws org.xml.sax.SAXException
+     */
+    protected void startNode(Node node) throws org.xml.sax.SAXException {
+        if (node instanceof Locator) {
+            Locator loc = (Locator) node;
+            fLocator.setColumnNumber(loc.getColumnNumber());
+            fLocator.setLineNumber(loc.getLineNumber());
+            fLocator.setPublicId(loc.getPublicId());
+            fLocator.setSystemId(loc.getSystemId());
+        } else {
+            fLocator.setColumnNumber(0);
+            fLocator.setLineNumber(0);
+        }
+
+        switch (node.getNodeType()) {
+            case Node.DOCUMENT_TYPE_NODE :
+                serializeDocType((DocumentType) node, true);
+                break;
+            case Node.COMMENT_NODE :
+                serializeComment((Comment) node);
+                break;
+            case Node.DOCUMENT_FRAGMENT_NODE :
+                // Children are traversed
+                break;
+            case Node.DOCUMENT_NODE :
+                break;
+            case Node.ELEMENT_NODE :
+                serializeElement((Element) node, true);
+                break;
+            case Node.PROCESSING_INSTRUCTION_NODE :
+                serializePI((ProcessingInstruction) node);
+                break;
+            case Node.CDATA_SECTION_NODE :
+                serializeCDATASection((CDATASection) node);
+                break;
+            case Node.TEXT_NODE :
+                serializeText((Text) node);
+                break;
+            case Node.ENTITY_REFERENCE_NODE :
+                serializeEntityReference((EntityReference) node, true);
+                break;
+            default :
+                }
+    }
+
+    /**
+     * End processing of given node
+     *
+     *
+     * @param node Node we just finished processing
+     *
+     * @throws org.xml.sax.SAXException
+     */
+    protected void endNode(Node node) throws org.xml.sax.SAXException {
+
+        switch (node.getNodeType()) {
+            case Node.DOCUMENT_NODE :
+                break;
+            case Node.DOCUMENT_TYPE_NODE :
+                serializeDocType((DocumentType) node, false);
+                break;
+            case Node.ELEMENT_NODE :
+                serializeElement((Element) node, false);
+                break;
+            case Node.CDATA_SECTION_NODE :
+                break;
+            case Node.ENTITY_REFERENCE_NODE :
+                serializeEntityReference((EntityReference) node, false);
+                break;
+            default :
+                }
+    }
+
+    // ***********************************************************************
+    // Node serialization methods
+    // ***********************************************************************
+    /**
+     * Applies a filter on the node to serialize
+     *
+     * @param node The Node to serialize
+     * @return True if the node is to be serialized else false if the node
+     *         is to be rejected or skipped.
+     */
+    protected boolean applyFilter(Node node, int nodeType) {
+        if (fFilter != null && (fWhatToShowFilter & nodeType) != 0) {
+
+            short code = fFilter.acceptNode(node);
+            switch (code) {
+                case NodeFilter.FILTER_REJECT :
+                case NodeFilter.FILTER_SKIP :
+                    return false; // skip the node
+                default : // fall through..
+            }
+        }
+        return true;
+    }
+
+    /**
+     * Serializes a Document Type Node.
+     *
+     * @param node The Docuemnt Type Node to serialize
+     * @param bStart Invoked at the start or end of node.  Default true.
+     */
+    protected void serializeDocType(DocumentType node, boolean bStart)
+        throws SAXException {
+        // The DocType and internalSubset can not be modified in DOM and is
+        // considered to be well-formed as the outcome of successful parsing.
+        String docTypeName = node.getNodeName();
+        String publicId = node.getPublicId();
+        String systemId = node.getSystemId();
+        String internalSubset = node.getInternalSubset();
+
+        //DocumentType nodes are never passed to the filter
+
+        if (internalSubset != null && !"".equals(internalSubset)) {
+
+            if (bStart) {
+                try {
+                    // The Serializer does not provide a way to write out the
+                    // DOCTYPE internal subset via an event call, so we write it
+                    // out here.
+                    Writer writer = fSerializer.getWriter();
+                    StringBuffer dtd = new StringBuffer();
+
+                    dtd.append("<!DOCTYPE ");
+                    dtd.append(docTypeName);
+                    if (null != publicId) {
+                        dtd.append(" PUBLIC \"");
+                        dtd.append(publicId);
+                        dtd.append('\"');
+                    }
+
+                    if (null != systemId) {
+                        if (null == publicId) {
+                            dtd.append(" SYSTEM \"");
+                        } else {
+                            dtd.append(" \"");
+                        }
+                        dtd.append(systemId);
+                        dtd.append('\"');
+                    }
+
+                    dtd.append(" [ ");
+
+                    dtd.append(fNewLine);
+                    dtd.append(internalSubset);
+                    dtd.append("]>");
+                    dtd.append(fNewLine);
+
+                    writer.write(dtd.toString());
+                    writer.flush();
+
+                } catch (IOException e) {
+                    throw new SAXException(Utils.messages.createMessage(
+                            MsgKey.ER_WRITING_INTERNAL_SUBSET, null), e);
+                }
+            } // else if !bStart do nothing
+
+        } else {
+
+            if (bStart) {
+                if (fLexicalHandler != null) {
+                    fLexicalHandler.startDTD(docTypeName, publicId, systemId);
+                }
+            } else {
+                if (fLexicalHandler != null) {
+                    fLexicalHandler.endDTD();
+                }
+            }
+        }
+    }
+
+    /**
+     * Serializes a Comment Node.
+     *
+     * @param node The Comment Node to serialize
+     */
+    protected void serializeComment(Comment node) throws SAXException {
+        // comments=true
+        if ((fFeatures & COMMENTS) != 0) {
+            String data = node.getData();
+
+            // well-formed=true
+            if ((fFeatures & WELLFORMED) != 0) {
+                isCommentWellFormed(data);
+            }
+
+            if (fLexicalHandler != null) {
+                // apply the LSSerializer filter after the operations requested by the
+                // DOMConfiguration parameters have been applied
+                if (!applyFilter(node, NodeFilter.SHOW_COMMENT)) {
+                    return;
+                }
+
+                fLexicalHandler.comment(data.toCharArray(), 0, data.length());
+            }
+        }
+    }
+
+    /**
+     * Serializes an Element Node.
+     *
+     * @param node The Element Node to serialize
+     * @param bStart Invoked at the start or end of node.
+     */
+    protected void serializeElement(Element node, boolean bStart)
+        throws SAXException {
+        if (bStart) {
+            fElementDepth++;
+
+            // We use the Xalan specific startElement and starPrefixMapping calls
+            // (and addAttribute and namespaceAfterStartElement) as opposed to
+            // SAX specific, for performance reasons as they reduce the overhead
+            // of creating an AttList object upfront.
+
+            // well-formed=true
+            if ((fFeatures & WELLFORMED) != 0) {
+                isElementWellFormed(node);
+            }
+
+            // REVISIT: We apply the LSSerializer filter for elements before
+            // namesapce fixup
+            if (!applyFilter(node, NodeFilter.SHOW_ELEMENT)) {
+                return;
+            }
+
+            // namespaces=true, record and fixup namspaced element
+            if ((fFeatures & NAMESPACES) != 0) {
+                fNSBinder.pushContext();
+                fLocalNSBinder.reset();
+
+                recordLocalNSDecl(node);
+                fixupElementNS(node);
+            }
+
+            // Namespace normalization
+            fSerializer.startElement(
+                        node.getNamespaceURI(),
+                    node.getLocalName(),
+                    node.getNodeName());
+
+            serializeAttList(node);
+
+        } else {
+                fElementDepth--;
+
+            // apply the LSSerializer filter
+            if (!applyFilter(node, NodeFilter.SHOW_ELEMENT)) {
+                return;
+            }
+
+            this.fSerializer.endElement(
+                node.getNamespaceURI(),
+                node.getLocalName(),
+                node.getNodeName());
+            // since endPrefixMapping was not used by SerializationHandler it was removed
+            // for performance reasons.
+
+            if ((fFeatures & NAMESPACES) != 0 ) {
+                    fNSBinder.popContext();
+            }
+
+        }
+    }
+
+    /**
+     * Serializes the Attr Nodes of an Element.
+     *
+     * @param node The OwnerElement whose Attr Nodes are to be serialized.
+     */
+    protected void serializeAttList(Element node) throws SAXException {
+        NamedNodeMap atts = node.getAttributes();
+        int nAttrs = atts.getLength();
+
+        for (int i = 0; i < nAttrs; i++) {
+            Node attr = atts.item(i);
+
+            String localName = attr.getLocalName();
+            String attrName = attr.getNodeName();
+            String attrPrefix = attr.getPrefix() == null ? "" : attr.getPrefix();
+            String attrValue = attr.getNodeValue();
+
+            // Determine the Attr's type.
+            String type = null;
+            if (fIsLevel3DOM) {
+                type = ((Attr) attr).getSchemaTypeInfo().getTypeName();
+            }
+            type = type == null ? "CDATA" : type;
+
+            String attrNS = attr.getNamespaceURI();
+            if (attrNS !=null && attrNS.length() == 0) {
+                attrNS=null;
+                // we must remove prefix for this attribute
+                attrName=attr.getLocalName();
+            }
+
+            boolean isSpecified = ((Attr) attr).getSpecified();
+            boolean addAttr = true;
+            boolean applyFilter = false;
+            boolean xmlnsAttr =
+                attrName.equals("xmlns") || attrName.startsWith("xmlns:");
+
+            // well-formed=true
+            if ((fFeatures & WELLFORMED) != 0) {
+                isAttributeWellFormed(attr);
+            }
+
+            //-----------------------------------------------------------------
+            // start Attribute namespace fixup
+            //-----------------------------------------------------------------
+            // namespaces=true, normalize all non-namespace attributes
+            // Step 3. Attribute
+            if ((fFeatures & NAMESPACES) != 0 && !xmlnsAttr) {
+
+                        // If the Attr has a namespace URI
+                        if (attrNS != null) {
+                                attrPrefix = attrPrefix == null ? "" : attrPrefix;
+
+                                String declAttrPrefix = fNSBinder.getPrefix(attrNS);
+                                String declAttrNS = fNSBinder.getURI(attrPrefix);
+
+                                // attribute has no prefix (default namespace decl does not apply to
+                                // attributes)
+                                // OR
+                                // attribute prefix is not declared
+                                // OR
+                                // conflict: attribute has a prefix that conflicts with a binding
+                                if ("".equals(attrPrefix) || "".equals(declAttrPrefix)
+                                                || !attrPrefix.equals(declAttrPrefix)) {
+
+                                        // namespaceURI matches an in scope declaration of one or
+                                        // more prefixes
+                                        if (declAttrPrefix != null && !"".equals(declAttrPrefix)) {
+                                                // pick the prefix that was found and change attribute's
+                                                // prefix and nodeName.
+                                                attrPrefix = declAttrPrefix;
+
+                                                if (declAttrPrefix.length() > 0 ) {
+                                                        attrName = declAttrPrefix + ":" + localName;
+                                                } else {
+                                                        attrName = localName;
+                                                }
+                                        } else {
+                                                // The current prefix is not null and it has no in scope
+                                                // declaration
+                                                if (attrPrefix != null && !"".equals(attrPrefix)
+                                                                && declAttrNS == null) {
+                                                        // declare this prefix
+                                                        if ((fFeatures & NAMESPACEDECLS) != 0) {
+                                                                fSerializer.addAttribute(XMLNS_URI, attrPrefix,
+                                                                                XMLNS_PREFIX + ":" + attrPrefix, "CDATA",
+                                                                                attrNS);
+                                                                fNSBinder.declarePrefix(attrPrefix, attrNS);
+                                                                fLocalNSBinder.declarePrefix(attrPrefix, attrNS);
+                                                        }
+                                                } else {
+                                                        // find a prefix following the pattern "NS" +index
+                                                        // (starting at 1)
+                                                        // make sure this prefix is not declared in the current
+                                                        // scope.
+                                                        int counter = 1;
+                                                        attrPrefix = "NS" + counter++;
+
+                                                        while (fLocalNSBinder.getURI(attrPrefix) != null) {
+                                                                attrPrefix = "NS" + counter++;
+                                                        }
+                                                        // change attribute's prefix and Name
+                                                        attrName = attrPrefix + ":" + localName;
+
+                                                        // create a local namespace declaration attribute
+                                                        // Add the xmlns declaration attribute
+                                                        if ((fFeatures & NAMESPACEDECLS) != 0) {
+
+                                                                fSerializer.addAttribute(XMLNS_URI, attrPrefix,
+                                                                                XMLNS_PREFIX + ":" + attrPrefix, "CDATA",
+                                                                                attrNS);
+                                                        fNSBinder.declarePrefix(attrPrefix, attrNS);
+                                                        fLocalNSBinder.declarePrefix(attrPrefix, attrNS);
+                                                        }
+                                                }
+                                        }
+                                }
+
+                        } else { // if the Attr has no namespace URI
+                                // Attr has no localName
+                                if (localName == null) {
+                                        // DOM Level 1 node!
+                                        String msg = Utils.messages.createMessage(
+                                                        MsgKey.ER_NULL_LOCAL_ELEMENT_NAME,
+                                                        new Object[] { attrName });
+
+                                        if (fErrorHandler != null) {
+                                                fErrorHandler
+                                                                .handleError(new DOMErrorImpl(
+                                                                                DOMError.SEVERITY_ERROR, msg,
+                                                                                MsgKey.ER_NULL_LOCAL_ELEMENT_NAME, null,
+                                                                                null, null));
+                                        }
+
+                                } else { // uri=null and no colon
+                                        // attr has no namespace URI and no prefix
+                                        // no action is required, since attrs don't use default
+                                }
+                        }
+
+            }
+
+
+            // discard-default-content=true
+            // Default attr's are not passed to the filter and this contraint
+            // is applied only when discard-default-content=true
+            // What about default xmlns attributes???? check for xmlnsAttr
+            if ((((fFeatures & DISCARDDEFAULT) != 0) && isSpecified)
+                || ((fFeatures & DISCARDDEFAULT) == 0)) {
+                applyFilter = true;
+            } else {
+                addAttr = false;
+            }
+
+            if (applyFilter) {
+                // apply the filter for Attributes that are not default attributes
+                // or namespace decl attributes
+                if (fFilter != null
+                    && (fFilter.getWhatToShow() & NodeFilter.SHOW_ATTRIBUTE)
+                        != 0) {
+
+                    if (!xmlnsAttr) {
+                        short code = fFilter.acceptNode(attr);
+                        switch (code) {
+                            case NodeFilter.FILTER_REJECT :
+                            case NodeFilter.FILTER_SKIP :
+                                addAttr = false;
+                                break;
+                            default : //fall through..
+                        }
+                    }
+                }
+            }
+
+            // if the node is a namespace node
+            if (addAttr && xmlnsAttr) {
+                // If namespace-declarations=true, add the node , else don't add it
+                if ((fFeatures & NAMESPACEDECLS) != 0) {
+                        // The namespace may have been fixed up, in that case don't add it.
+                        if (localName != null && !"".equals(localName)) {
+                                fSerializer.addAttribute(attrNS, localName, attrName, type, attrValue);
+                        }
+                }
+            } else if (
+                addAttr && !xmlnsAttr) { // if the node is not a namespace node
+                // If namespace-declarations=true, add the node with the Attr nodes namespaceURI
+                // else add the node setting it's namespace to null or else the serializer will later
+                // attempt to add a xmlns attr for the prefixed attribute
+                if (((fFeatures & NAMESPACEDECLS) != 0) && (attrNS != null)) {
+                    fSerializer.addAttribute(
+                        attrNS,
+                        localName,
+                        attrName,
+                        type,
+                        attrValue);
+                } else {
+                    fSerializer.addAttribute(
+                        "",
+                        localName,
+                        attrName,
+                        type,
+                        attrValue);
+                }
+            }
+
+            //
+            if (xmlnsAttr && ((fFeatures & NAMESPACEDECLS) != 0)) {
+                int index;
+                // Use "" instead of null, as Xerces likes "" for the
+                // name of the default namespace.  Fix attributed
+                // to "Steven Murray" <smurray@ebt.com>.
+                String prefix =
+                    (index = attrName.indexOf(":")) < 0
+                        ? ""
+                        : attrName.substring(index + 1);
+
+                if (!"".equals(prefix)) {
+                    fSerializer.namespaceAfterStartElement(prefix, attrValue);
+                }
+            }
+        }
+
+    }
+
+    /**
+     * Serializes an ProcessingInstruction Node.
+     *
+     * @param node The ProcessingInstruction Node to serialize
+     */
+    protected void serializePI(ProcessingInstruction node)
+        throws SAXException {
+        ProcessingInstruction pi = node;
+        String name = pi.getNodeName();
+
+        // well-formed=true
+        if ((fFeatures & WELLFORMED) != 0) {
+            isPIWellFormed(node);
+        }
+
+        // apply the LSSerializer filter
+        if (!applyFilter(node, NodeFilter.SHOW_PROCESSING_INSTRUCTION)) {
+            return;
+        }
+
+        // String data = pi.getData();
+        if (name.equals("xslt-next-is-raw")) {
+            fNextIsRaw = true;
+        } else {
+            this.fSerializer.processingInstruction(name, pi.getData());
+        }
+    }
+
+    /**
+     * Serializes an CDATASection Node.
+     *
+     * @param node The CDATASection Node to serialize
+     */
+    protected void serializeCDATASection(CDATASection node)
+        throws SAXException {
+        // well-formed=true
+        if ((fFeatures & WELLFORMED) != 0) {
+            isCDATASectionWellFormed(node);
+        }
+
+        // cdata-sections = true
+        if ((fFeatures & CDATA) != 0) {
+
+            // split-cdata-sections = true
+            // Assumption: This parameter has an effect only when
+                        // cdata-sections=true
+            // ToStream, by default splits cdata-sections. Hence the check
+                        // below.
+            String nodeValue = node.getNodeValue();
+            int endIndex = nodeValue.indexOf("]]>");
+            if ((fFeatures & SPLITCDATA) != 0) {
+                if (endIndex >= 0) {
+                    // The first node split will contain the ]] markers
+                    String relatedData = nodeValue.substring(0, endIndex + 2);
+
+                    String msg =
+                        Utils.messages.createMessage(
+                            MsgKey.ER_CDATA_SECTIONS_SPLIT,
+                            null);
+
+                    if (fErrorHandler != null) {
+                        fErrorHandler.handleError(
+                            new DOMErrorImpl(
+                                DOMError.SEVERITY_WARNING,
+                                msg,
+                                MsgKey.ER_CDATA_SECTIONS_SPLIT,
+                                null,
+                                relatedData,
+                                null));
+                    }
+                }
+            } else {
+                if (endIndex >= 0) {
+                    // The first node split will contain the ]] markers
+                    String relatedData = nodeValue.substring(0, endIndex + 2);
+
+                    String msg =
+                        Utils.messages.createMessage(
+                            MsgKey.ER_CDATA_SECTIONS_SPLIT,
+                            null);
+
+                    if (fErrorHandler != null) {
+                        fErrorHandler.handleError(
+                            new DOMErrorImpl(
+                                DOMError.SEVERITY_ERROR,
+                                msg,
+                                MsgKey.ER_CDATA_SECTIONS_SPLIT));
+                    }
+                    // Report an error and return.  What error???
+                    return;
+                }
+            }
+
+            // apply the LSSerializer filter
+            if (!applyFilter(node, NodeFilter.SHOW_CDATA_SECTION)) {
+                return;
+            }
+
+            // splits the cdata-section
+            if (fLexicalHandler != null) {
+                fLexicalHandler.startCDATA();
+            }
+            dispatachChars(node);
+            if (fLexicalHandler != null) {
+                fLexicalHandler.endCDATA();
+            }
+        } else {
+            dispatachChars(node);
+        }
+    }
+
+    /**
+     * Serializes an Text Node.
+     *
+     * @param node The Text Node to serialize
+     */
+    protected void serializeText(Text node) throws SAXException {
+        if (fNextIsRaw) {
+            fNextIsRaw = false;
+            fSerializer.processingInstruction(
+                javax.xml.transform.Result.PI_DISABLE_OUTPUT_ESCAPING,
+                "");
+            dispatachChars(node);
+            fSerializer.processingInstruction(
+                javax.xml.transform.Result.PI_ENABLE_OUTPUT_ESCAPING,
+                "");
+        } else {
+            // keep track of dispatch or not to avoid duplicaiton of filter code
+            boolean bDispatch = false;
+
+            // well-formed=true
+            if ((fFeatures & WELLFORMED) != 0) {
+                isTextWellFormed(node);
+            }
+
+            // if the node is whitespace
+            // Determine the Attr's type.
+            boolean isElementContentWhitespace = false;
+            if (fIsLevel3DOM) {
+                isElementContentWhitespace =
+                       node.isElementContentWhitespace();
+            }
+
+            if (isElementContentWhitespace) {
+                // element-content-whitespace=true
+                if ((fFeatures & ELEM_CONTENT_WHITESPACE) != 0) {
+                    bDispatch = true;
+                }
+            } else {
+                bDispatch = true;
+            }
+
+            // apply the LSSerializer filter
+            if (!applyFilter(node, NodeFilter.SHOW_TEXT)) {
+                return;
+            }
+
+            if (bDispatch) {
+                dispatachChars(node);
+            }
+        }
+    }
+
+    /**
+     * Serializes an EntityReference Node.
+     *
+     * @param node The EntityReference Node to serialize
+     * @param bStart Inicates if called from start or endNode
+     */
+    protected void serializeEntityReference(
+        EntityReference node,
+        boolean bStart)
+        throws SAXException {
+        if (bStart) {
+            EntityReference eref = node;
+            // entities=true
+            if ((fFeatures & ENTITIES) != 0) {
+
+                // perform well-formedness and other checking only if
+                // entities = true
+
+                // well-formed=true
+                if ((fFeatures & WELLFORMED) != 0) {
+                    isEntityReferneceWellFormed(node);
+                }
+
+                // check "unbound-prefix-in-entity-reference" [fatal]
+                // Raised if the configuration parameter "namespaces" is set to true
+                if ((fFeatures & NAMESPACES) != 0) {
+                    checkUnboundPrefixInEntRef(node);
+                }
+
+                // The filter should not apply in this case, since the
+                // EntityReference is not being expanded.
+                // should we pass entity reference nodes to the filter???
+            }
+
+            if (fLexicalHandler != null) {
+
+                // startEntity outputs only Text but not Element, Attr, Comment
+                // and PI child nodes.  It does so by setting the m_inEntityRef
+                // in ToStream and using this to decide if a node is to be
+                // serialized or not.
+                fLexicalHandler.startEntity(eref.getNodeName());
+            }
+
+        } else {
+            EntityReference eref = node;
+            // entities=true or false,
+            if (fLexicalHandler != null) {
+                fLexicalHandler.endEntity(eref.getNodeName());
+            }
+        }
+    }
+
+
+    // ***********************************************************************
+    // Methods to check well-formedness
+    // ***********************************************************************
+    /**
+     * Taken from org.apache.xerces.dom.CoreDocumentImpl
+     *
+     * Check the string against XML's definition of acceptable names for
+     * elements and attributes and so on using the XMLCharacterProperties
+     * utility class
+     */
+    protected boolean isXMLName(String s, boolean xml11Version) {
+
+        if (s == null) {
+            return false;
+        }
+        if (!xml11Version)
+            return XMLChar.isValidName(s);
+        else
+            return XML11Char.isXML11ValidName(s);
+    }
+
+    /**
+     * Taken from org.apache.xerces.dom.CoreDocumentImpl
+     *
+     * Checks if the given qualified name is legal with respect
+     * to the version of XML to which this document must conform.
+     *
+     * @param prefix prefix of qualified name
+     * @param local local part of qualified name
+     */
+    protected boolean isValidQName(
+        String prefix,
+        String local,
+        boolean xml11Version) {
+
+        // check that both prefix and local part match NCName
+        if (local == null)
+            return false;
+        boolean validNCName = false;
+
+        if (!xml11Version) {
+            validNCName =
+                (prefix == null || XMLChar.isValidNCName(prefix))
+                    && XMLChar.isValidNCName(local);
+        } else {
+            validNCName =
+                (prefix == null || XML11Char.isXML11ValidNCName(prefix))
+                    && XML11Char.isXML11ValidNCName(local);
+        }
+
+        return validNCName;
+    }
+
+    /**
+     * Checks if a XML character is well-formed
+     *
+     * @param characters A String of characters to be checked for Well-Formedness
+     * @param refInvalidChar A reference to the character to be returned that was determined invalid.
+     */
+    protected boolean isWFXMLChar(String chardata, Character refInvalidChar) {
+        if (chardata == null || (chardata.length() == 0)) {
+            return true;
+        }
+
+        char[] dataarray = chardata.toCharArray();
+        int datalength = dataarray.length;
+
+        // version of the document is XML 1.1
+        if (fIsXMLVersion11) {
+            //we need to check all characters as per production rules of XML11
+            int i = 0;
+            while (i < datalength) {
+                if (XML11Char.isXML11Invalid(dataarray[i++])) {
+                    // check if this is a supplemental character
+                    char ch = dataarray[i - 1];
+                    if (XMLChar.isHighSurrogate(ch) && i < datalength) {
+                        char ch2 = dataarray[i++];
+                        if (XMLChar.isLowSurrogate(ch2)
+                            && XMLChar.isSupplemental(
+                                XMLChar.supplemental(ch, ch2))) {
+                            continue;
+                        }
+                    }
+                    // Reference to invalid character which is returned
+                    refInvalidChar = new Character(ch);
+                    return false;
+                }
+            }
+        } // version of the document is XML 1.0
+        else {
+            // we need to check all characters as per production rules of XML 1.0
+            int i = 0;
+            while (i < datalength) {
+                if (XMLChar.isInvalid(dataarray[i++])) {
+                    // check if this is a supplemental character
+                    char ch = dataarray[i - 1];
+                    if (XMLChar.isHighSurrogate(ch) && i < datalength) {
+                        char ch2 = dataarray[i++];
+                        if (XMLChar.isLowSurrogate(ch2)
+                            && XMLChar.isSupplemental(
+                                XMLChar.supplemental(ch, ch2))) {
+                            continue;
+                        }
+                    }
+                    // Reference to invalid character which is returned
+                    refInvalidChar = new Character(ch);
+                    return false;
+                }
+            }
+        } // end-else fDocument.isXMLVersion()
+
+        return true;
+    } // isXMLCharWF
+
+    /**
+     * Checks if a XML character is well-formed.  If there is a problem with
+     * the character a non-null Character is returned else null is returned.
+     *
+     * @param characters A String of characters to be checked for Well-Formedness
+     * @return Character A reference to the character to be returned that was determined invalid.
+     */
+    protected Character isWFXMLChar(String chardata) {
+        Character refInvalidChar;
+        if (chardata == null || (chardata.length() == 0)) {
+            return null;
+        }
+
+        char[] dataarray = chardata.toCharArray();
+        int datalength = dataarray.length;
+
+        // version of the document is XML 1.1
+        if (fIsXMLVersion11) {
+            //we need to check all characters as per production rules of XML11
+            int i = 0;
+            while (i < datalength) {
+                if (XML11Char.isXML11Invalid(dataarray[i++])) {
+                    // check if this is a supplemental character
+                    char ch = dataarray[i - 1];
+                    if (XMLChar.isHighSurrogate(ch) && i < datalength) {
+                        char ch2 = dataarray[i++];
+                        if (XMLChar.isLowSurrogate(ch2)
+                            && XMLChar.isSupplemental(
+                                XMLChar.supplemental(ch, ch2))) {
+                            continue;
+                        }
+                    }
+                    // Reference to invalid character which is returned
+                    refInvalidChar = new Character(ch);
+                    return refInvalidChar;
+                }
+            }
+        } // version of the document is XML 1.0
+        else {
+            // we need to check all characters as per production rules of XML 1.0
+            int i = 0;
+            while (i < datalength) {
+                if (XMLChar.isInvalid(dataarray[i++])) {
+                    // check if this is a supplemental character
+                    char ch = dataarray[i - 1];
+                    if (XMLChar.isHighSurrogate(ch) && i < datalength) {
+                        char ch2 = dataarray[i++];
+                        if (XMLChar.isLowSurrogate(ch2)
+                            && XMLChar.isSupplemental(
+                                XMLChar.supplemental(ch, ch2))) {
+                            continue;
+                        }
+                    }
+                    // Reference to invalid character which is returned
+                    refInvalidChar = new Character(ch);
+                    return refInvalidChar;
+                }
+            }
+        } // end-else fDocument.isXMLVersion()
+
+        return null;
+    } // isXMLCharWF
+
+    /**
+     * Checks if a comment node is well-formed
+     *
+     * @param data The contents of the comment node
+     * @return a boolean indiacating if the comment is well-formed or not.
+     */
+    protected void isCommentWellFormed(String data) {
+        if (data == null || (data.length() == 0)) {
+            return;
+        }
+
+        char[] dataarray = data.toCharArray();
+        int datalength = dataarray.length;
+
+        // version of the document is XML 1.1
+        if (fIsXMLVersion11) {
+            // we need to check all chracters as per production rules of XML11
+            int i = 0;
+            while (i < datalength) {
+                char c = dataarray[i++];
+                if (XML11Char.isXML11Invalid(c)) {
+                    // check if this is a supplemental character
+                    if (XMLChar.isHighSurrogate(c) && i < datalength) {
+                        char c2 = dataarray[i++];
+                        if (XMLChar.isLowSurrogate(c2)
+                            && XMLChar.isSupplemental(
+                                XMLChar.supplemental(c, c2))) {
+                            continue;
+                        }
+                    }
+                    String msg =
+                        Utils.messages.createMessage(
+                            MsgKey.ER_WF_INVALID_CHARACTER_IN_COMMENT,
+                            new Object[] { new Character(c)});
+
+                    if (fErrorHandler != null) {
+                        fErrorHandler.handleError(
+                            new DOMErrorImpl(
+                                DOMError.SEVERITY_FATAL_ERROR,
+                                msg,
+                                MsgKey.ER_WF_INVALID_CHARACTER,
+                                null,
+                                null,
+                                null));
+                    }
+                } else if (c == '-' && i < datalength && dataarray[i] == '-') {
+                    String msg =
+                        Utils.messages.createMessage(
+                            MsgKey.ER_WF_DASH_IN_COMMENT,
+                            null);
+
+                    if (fErrorHandler != null) {
+                        fErrorHandler.handleError(
+                            new DOMErrorImpl(
+                                DOMError.SEVERITY_FATAL_ERROR,
+                                msg,
+                                MsgKey.ER_WF_INVALID_CHARACTER,
+                                null,
+                                null,
+                                null));
+                    }
+                }
+            }
+        } // version of the document is XML 1.0
+        else {
+            // we need to check all chracters as per production rules of XML 1.0
+            int i = 0;
+            while (i < datalength) {
+                char c = dataarray[i++];
+                if (XMLChar.isInvalid(c)) {
+                    // check if this is a supplemental character
+                    if (XMLChar.isHighSurrogate(c) && i < datalength) {
+                        char c2 = dataarray[i++];
+                        if (XMLChar.isLowSurrogate(c2)
+                            && XMLChar.isSupplemental(
+                                XMLChar.supplemental(c, c2))) {
+                            continue;
+                        }
+                    }
+                    String msg =
+                        Utils.messages.createMessage(
+                            MsgKey.ER_WF_INVALID_CHARACTER_IN_COMMENT,
+                            new Object[] { new Character(c)});
+
+                    if (fErrorHandler != null) {
+                        fErrorHandler.handleError(
+                            new DOMErrorImpl(
+                                DOMError.SEVERITY_FATAL_ERROR,
+                                msg,
+                                MsgKey.ER_WF_INVALID_CHARACTER,
+                                null,
+                                null,
+                                null));
+                    }
+                } else if (c == '-' && i < datalength && dataarray[i] == '-') {
+                    String msg =
+                        Utils.messages.createMessage(
+                            MsgKey.ER_WF_DASH_IN_COMMENT,
+                            null);
+
+                    if (fErrorHandler != null) {
+                        fErrorHandler.handleError(
+                            new DOMErrorImpl(
+                                DOMError.SEVERITY_FATAL_ERROR,
+                                msg,
+                                MsgKey.ER_WF_INVALID_CHARACTER,
+                                null,
+                                null,
+                                null));
+                    }
+                }
+            }
+        }
+        return;
+    }
+
+    /**
+     * Checks if an element node is well-formed, by checking its Name for well-formedness.
+     *
+     * @param data The contents of the comment node
+     * @return a boolean indiacating if the comment is well-formed or not.
+     */
+    protected void isElementWellFormed(Node node) {
+        boolean isNameWF = false;
+        if ((fFeatures & NAMESPACES) != 0) {
+            isNameWF =
+                isValidQName(
+                    node.getPrefix(),
+                    node.getLocalName(),
+                    fIsXMLVersion11);
+        } else {
+            isNameWF = isXMLName(node.getNodeName(), fIsXMLVersion11);
+        }
+
+        if (!isNameWF) {
+            String msg =
+                Utils.messages.createMessage(
+                    MsgKey.ER_WF_INVALID_CHARACTER_IN_NODE_NAME,
+                    new Object[] { "Element", node.getNodeName()});
+
+            if (fErrorHandler != null) {
+                fErrorHandler.handleError(
+                    new DOMErrorImpl(
+                        DOMError.SEVERITY_FATAL_ERROR,
+                        msg,
+                        MsgKey.ER_WF_INVALID_CHARACTER_IN_NODE_NAME,
+                        null,
+                        null,
+                        null));
+            }
+        }
+    }
+
+    /**
+     * Checks if an attr node is well-formed, by checking it's Name and value
+     * for well-formedness.
+     *
+     * @param data The contents of the comment node
+     * @return a boolean indiacating if the comment is well-formed or not.
+     */
+    protected void isAttributeWellFormed(Node node) {
+        boolean isNameWF = false;
+        if ((fFeatures & NAMESPACES) != 0) {
+            isNameWF =
+                isValidQName(
+                    node.getPrefix(),
+                    node.getLocalName(),
+                    fIsXMLVersion11);
+        } else {
+            isNameWF = isXMLName(node.getNodeName(), fIsXMLVersion11);
+        }
+
+        if (!isNameWF) {
+            String msg =
+                Utils.messages.createMessage(
+                    MsgKey.ER_WF_INVALID_CHARACTER_IN_NODE_NAME,
+                    new Object[] { "Attr", node.getNodeName()});
+
+            if (fErrorHandler != null) {
+                fErrorHandler.handleError(
+                    new DOMErrorImpl(
+                        DOMError.SEVERITY_FATAL_ERROR,
+                        msg,
+                        MsgKey.ER_WF_INVALID_CHARACTER_IN_NODE_NAME,
+                        null,
+                        null,
+                        null));
+            }
+        }
+
+        // Check the Attr's node value
+        // WFC: No < in Attribute Values
+        String value = node.getNodeValue();
+        if (value.indexOf('<') >= 0) {
+            String msg =
+                Utils.messages.createMessage(
+                    MsgKey.ER_WF_LT_IN_ATTVAL,
+                    new Object[] {
+                        ((Attr) node).getOwnerElement().getNodeName(),
+                        node.getNodeName()});
+
+            if (fErrorHandler != null) {
+                fErrorHandler.handleError(
+                    new DOMErrorImpl(
+                        DOMError.SEVERITY_FATAL_ERROR,
+                        msg,
+                        MsgKey.ER_WF_LT_IN_ATTVAL,
+                        null,
+                        null,
+                        null));
+            }
+        }
+
+        // we need to loop through the children of attr nodes and check their values for
+        // well-formedness
+        NodeList children = node.getChildNodes();
+        for (int i = 0; i < children.getLength(); i++) {
+            Node child = children.item(i);
+            // An attribute node with no text or entity ref child for example
+            // doc.createAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns:ns");
+            // followes by
+            // element.setAttributeNodeNS(attribute);
+            // can potentially lead to this situation.  If the attribute
+            // was a prefix Namespace attribute declaration then then DOM Core
+            // should have some exception defined for this.
+            if (child == null) {
+                // we should probably report an error
+                continue;
+            }
+            switch (child.getNodeType()) {
+                case Node.TEXT_NODE :
+                    isTextWellFormed((Text) child);
+                    break;
+                case Node.ENTITY_REFERENCE_NODE :
+                    isEntityReferneceWellFormed((EntityReference) child);
+                    break;
+                default :
+            }
+        }
+
+        // TODO:
+        // WFC: Check if the attribute prefix is bound to
+        // http://www.w3.org/2000/xmlns/
+
+        // WFC: Unique Att Spec
+        // Perhaps pass a seen boolean value to this method.  serializeAttList will determine
+        // if the attr was seen before.
+    }
+
+    /**
+     * Checks if a PI node is well-formed, by checking it's Name and data
+     * for well-formedness.
+     *
+     * @param data The contents of the comment node
+     */
+    protected void isPIWellFormed(ProcessingInstruction node) {
+        // Is the PI Target a valid XML name
+        if (!isXMLName(node.getNodeName(), fIsXMLVersion11)) {
+            String msg =
+                Utils.messages.createMessage(
+                    MsgKey.ER_WF_INVALID_CHARACTER_IN_NODE_NAME,
+                    new Object[] { "ProcessingInstruction", node.getTarget()});
+
+            if (fErrorHandler != null) {
+                fErrorHandler.handleError(
+                    new DOMErrorImpl(
+                        DOMError.SEVERITY_FATAL_ERROR,
+                        msg,
+                        MsgKey.ER_WF_INVALID_CHARACTER_IN_NODE_NAME,
+                        null,
+                        null,
+                        null));
+            }
+        }
+
+        // Does the PI Data carry valid XML characters
+
+        // REVISIT: Should we check if the PI DATA contains a ?> ???
+        Character invalidChar = isWFXMLChar(node.getData());
+        if (invalidChar != null) {
+            String msg =
+                Utils.messages.createMessage(
+                    MsgKey.ER_WF_INVALID_CHARACTER_IN_PI,
+                    new Object[] { Integer.toHexString(Character.getNumericValue(invalidChar.charValue())) });
+
+            if (fErrorHandler != null) {
+                fErrorHandler.handleError(
+                    new DOMErrorImpl(
+                        DOMError.SEVERITY_FATAL_ERROR,
+                        msg,
+                        MsgKey.ER_WF_INVALID_CHARACTER,
+                        null,
+                        null,
+                        null));
+            }
+        }
+    }
+
+    /**
+     * Checks if an CDATASection node is well-formed, by checking it's data
+     * for well-formedness.  Note that the presence of a CDATA termination mark
+     * in the contents of a CDATASection is handled by the parameter
+     * spli-cdata-sections
+     *
+     * @param data The contents of the comment node
+     */
+    protected void isCDATASectionWellFormed(CDATASection node) {
+        // Does the data valid XML character data
+        Character invalidChar = isWFXMLChar(node.getData());
+        //if (!isWFXMLChar(node.getData(), invalidChar)) {
+        if (invalidChar != null) {
+            String msg =
+                Utils.messages.createMessage(
+                    MsgKey.ER_WF_INVALID_CHARACTER_IN_CDATA,
+                    new Object[] { Integer.toHexString(Character.getNumericValue(invalidChar.charValue())) });
+
+            if (fErrorHandler != null) {
+                fErrorHandler.handleError(
+                    new DOMErrorImpl(
+                        DOMError.SEVERITY_FATAL_ERROR,
+                        msg,
+                        MsgKey.ER_WF_INVALID_CHARACTER,
+                        null,
+                        null,
+                        null));
+            }
+        }
+    }
+
+    /**
+     * Checks if an Text node is well-formed, by checking if it contains invalid
+     * XML characters.
+     *
+     * @param data The contents of the comment node
+     */
+    protected void isTextWellFormed(Text node) {
+        // Does the data valid XML character data
+        Character invalidChar = isWFXMLChar(node.getData());
+        if (invalidChar != null) {
+            String msg =
+                Utils.messages.createMessage(
+                    MsgKey.ER_WF_INVALID_CHARACTER_IN_TEXT,
+                    new Object[] { Integer.toHexString(Character.getNumericValue(invalidChar.charValue())) });
+
+            if (fErrorHandler != null) {
+                fErrorHandler.handleError(
+                    new DOMErrorImpl(
+                        DOMError.SEVERITY_FATAL_ERROR,
+                        msg,
+                        MsgKey.ER_WF_INVALID_CHARACTER,
+                        null,
+                        null,
+                        null));
+            }
+        }
+    }
+
+    /**
+     * Checks if an EntityRefernece node is well-formed, by checking it's node name.  Then depending
+     * on whether it is referenced in Element content or in an Attr Node, checks if the EntityReference
+     * references an unparsed entity or a external entity and if so throws raises the
+     * appropriate well-formedness error.
+     *
+     * @param data The contents of the comment node
+     * @parent The parent of the EntityReference Node
+     */
+    protected void isEntityReferneceWellFormed(EntityReference node) {
+        // Is the EntityReference name a valid XML name
+        if (!isXMLName(node.getNodeName(), fIsXMLVersion11)) {
+            String msg =
+                Utils.messages.createMessage(
+                    MsgKey.ER_WF_INVALID_CHARACTER_IN_NODE_NAME,
+                    new Object[] { "EntityReference", node.getNodeName()});
+
+            if (fErrorHandler != null) {
+                fErrorHandler.handleError(
+                    new DOMErrorImpl(
+                        DOMError.SEVERITY_FATAL_ERROR,
+                        msg,
+                        MsgKey.ER_WF_INVALID_CHARACTER_IN_NODE_NAME,
+                        null,
+                        null,
+                        null));
+            }
+        }
+
+        // determine the parent node
+        Node parent = node.getParentNode();
+
+        // Traverse the declared entities and check if the nodeName and namespaceURI
+        // of the EntityReference matches an Entity.  If so, check the if the notationName
+        // is not null, if so, report an error.
+        DocumentType docType = node.getOwnerDocument().getDoctype();
+        if (docType != null) {
+            NamedNodeMap entities = docType.getEntities();
+            for (int i = 0; i < entities.getLength(); i++) {
+                Entity ent = (Entity) entities.item(i);
+
+                String nodeName =
+                    node.getNodeName() == null ? "" : node.getNodeName();
+                String nodeNamespaceURI =
+                    node.getNamespaceURI() == null
+                        ? ""
+                        : node.getNamespaceURI();
+                String entName =
+                    ent.getNodeName() == null ? "" : ent.getNodeName();
+                String entNamespaceURI =
+                    ent.getNamespaceURI() == null ? "" : ent.getNamespaceURI();
+                // If referenced in Element content
+                // WFC: Parsed Entity
+                if (parent.getNodeType() == Node.ELEMENT_NODE) {
+                    if (entNamespaceURI.equals(nodeNamespaceURI)
+                        && entName.equals(nodeName)) {
+
+                        if (ent.getNotationName() != null) {
+                            String msg =
+                                Utils.messages.createMessage(
+                                    MsgKey.ER_WF_REF_TO_UNPARSED_ENT,
+                                    new Object[] { node.getNodeName()});
+
+                            if (fErrorHandler != null) {
+                                fErrorHandler.handleError(
+                                    new DOMErrorImpl(
+                                        DOMError.SEVERITY_FATAL_ERROR,
+                                        msg,
+                                        MsgKey.ER_WF_REF_TO_UNPARSED_ENT,
+                                        null,
+                                        null,
+                                        null));
+                            }
+                        }
+                    }
+                } // end if WFC: Parsed Entity
+
+                // If referenced in an Attr value
+                // WFC: No External Entity References
+                if (parent.getNodeType() == Node.ATTRIBUTE_NODE) {
+                    if (entNamespaceURI.equals(nodeNamespaceURI)
+                        && entName.equals(nodeName)) {
+
+                        if (ent.getPublicId() != null
+                            || ent.getSystemId() != null
+                            || ent.getNotationName() != null) {
+                            String msg =
+                                Utils.messages.createMessage(
+                                    MsgKey.ER_WF_REF_TO_EXTERNAL_ENT,
+                                    new Object[] { node.getNodeName()});
+
+                            if (fErrorHandler != null) {
+                                fErrorHandler.handleError(
+                                    new DOMErrorImpl(
+                                        DOMError.SEVERITY_FATAL_ERROR,
+                                        msg,
+                                        MsgKey.ER_WF_REF_TO_EXTERNAL_ENT,
+                                        null,
+                                        null,
+                                        null));
+                            }
+                        }
+                    }
+                } //end if WFC: No External Entity References
+            }
+        }
+    } // isEntityReferneceWellFormed
+
+    /**
+     * If the configuration parameter "namespaces" is set to true, this methods
+     * checks if an entity whose replacement text contains unbound namespace
+     * prefixes is referenced in a location where there are no bindings for
+     * the namespace prefixes and if so raises a LSException with the error-type
+     * "unbound-prefix-in-entity-reference"
+     *
+     * @param Node, The EntityReference nodes whose children are to be checked
+     */
+    protected void checkUnboundPrefixInEntRef(Node node) {
+        Node child, next;
+        for (child = node.getFirstChild(); child != null; child = next) {
+            next = child.getNextSibling();
+
+            if (child.getNodeType() == Node.ELEMENT_NODE) {
+
+                //If a NamespaceURI is not declared for the current
+                //node's prefix, raise a fatal error.
+                String prefix = child.getPrefix();
+                if (prefix != null
+                                && fNSBinder.getURI(prefix) == null) {
+                    String msg =
+                        Utils.messages.createMessage(
+                            MsgKey.ER_ELEM_UNBOUND_PREFIX_IN_ENTREF,
+                            new Object[] {
+                                node.getNodeName(),
+                                child.getNodeName(),
+                                prefix });
+
+                    if (fErrorHandler != null) {
+                        fErrorHandler.handleError(
+                            new DOMErrorImpl(
+                                DOMError.SEVERITY_FATAL_ERROR,
+                                msg,
+                                MsgKey.ER_ELEM_UNBOUND_PREFIX_IN_ENTREF,
+                                null,
+                                null,
+                                null));
+                    }
+                }
+
+                NamedNodeMap attrs = child.getAttributes();
+
+                for (int i = 0; i < attrs.getLength(); i++) {
+                    String attrPrefix = attrs.item(i).getPrefix();
+                    if (attrPrefix != null
+                                && fNSBinder.getURI(attrPrefix) == null) {
+                        String msg =
+                            Utils.messages.createMessage(
+                                MsgKey.ER_ATTR_UNBOUND_PREFIX_IN_ENTREF,
+                                new Object[] {
+                                    node.getNodeName(),
+                                    child.getNodeName(),
+                                    attrs.item(i)});
+
+                        if (fErrorHandler != null) {
+                            fErrorHandler.handleError(
+                                new DOMErrorImpl(
+                                    DOMError.SEVERITY_FATAL_ERROR,
+                                    msg,
+                                    MsgKey.ER_ATTR_UNBOUND_PREFIX_IN_ENTREF,
+                                    null,
+                                    null,
+                                    null));
+                        }
+                    }
+                }
+            }
+
+            if (child.hasChildNodes()) {
+                checkUnboundPrefixInEntRef(child);
+            }
+        }
+    }
+
+    // ***********************************************************************
+    // Namespace normalization
+    // ***********************************************************************
+    /**
+     * Records local namespace declarations, to be used for normalization later
+     *
+     * @param Node, The element node, whose namespace declarations are to be recorded
+     */
+    protected void recordLocalNSDecl(Node node) {
+        NamedNodeMap atts = ((Element) node).getAttributes();
+        int length = atts.getLength();
+
+        for (int i = 0; i < length; i++) {
+            Node attr = atts.item(i);
+
+            String localName = attr.getLocalName();
+            String attrPrefix = attr.getPrefix();
+            String attrValue = attr.getNodeValue();
+            String attrNS = attr.getNamespaceURI();
+
+            localName =
+                localName == null
+                    || XMLNS_PREFIX.equals(localName) ? "" : localName;
+            attrPrefix = attrPrefix == null ? "" : attrPrefix;
+            attrValue = attrValue == null ? "" : attrValue;
+            attrNS = attrNS == null ? "" : attrNS;
+
+            // check if attribute is a namespace decl
+            if (XMLNS_URI.equals(attrNS)) {
+
+                // No prefix may be bound to http://www.w3.org/2000/xmlns/.
+                if (XMLNS_URI.equals(attrValue)) {
+                    String msg =
+                        Utils.messages.createMessage(
+                            MsgKey.ER_NS_PREFIX_CANNOT_BE_BOUND,
+                            new Object[] { attrPrefix, XMLNS_URI });
+
+                    if (fErrorHandler != null) {
+                        fErrorHandler.handleError(
+                            new DOMErrorImpl(
+                                DOMError.SEVERITY_ERROR,
+                                msg,
+                                MsgKey.ER_NS_PREFIX_CANNOT_BE_BOUND,
+                                null,
+                                null,
+                                null));
+                    }
+                } else {
+                    // store the namespace-declaration
+                        if (XMLNS_PREFIX.equals(attrPrefix) ) {
+                        // record valid decl
+                        if (attrValue.length() != 0) {
+                            fNSBinder.declarePrefix(localName, attrValue);
+                        } else {
+                            // Error; xmlns:prefix=""
+                        }
+                    } else { // xmlns
+                        // empty prefix is always bound ("" or some string)
+                        fNSBinder.declarePrefix("", attrValue);
+                    }
+                }
+
+            }
+        }
+    }
+
+    /**
+     * Fixes an element's namespace
+     *
+     * @param Node, The element node, whose namespace is to be fixed
+     */
+    protected void fixupElementNS(Node node) throws SAXException {
+        String namespaceURI = ((Element) node).getNamespaceURI();
+        String prefix = ((Element) node).getPrefix();
+        String localName = ((Element) node).getLocalName();
+
+        if (namespaceURI != null) {
+            //if ( Element's prefix/namespace pair (or default namespace,
+            // if no prefix) are within the scope of a binding )
+            prefix = prefix == null ? "" : prefix;
+            String inScopeNamespaceURI = fNSBinder.getURI(prefix);
+
+            if ((inScopeNamespaceURI != null
+                && inScopeNamespaceURI.equals(namespaceURI))) {
+                // do nothing, declaration in scope is inherited
+
+            } else {
+                // Create a local namespace declaration attr for this namespace,
+                // with Element's current prefix (or a default namespace, if
+                // no prefix). If there's a conflicting local declaration
+                // already present, change its value to use this namespace.
+
+                // Add the xmlns declaration attribute
+                //fNSBinder.pushNamespace(prefix, namespaceURI, fElementDepth);
+                if ((fFeatures & NAMESPACEDECLS) != 0) {
+                    if ("".equals(prefix) || "".equals(namespaceURI)) {
+                        ((Element)node).setAttributeNS(XMLNS_URI, XMLNS_PREFIX, namespaceURI);
+                    } else {
+                        ((Element)node).setAttributeNS(XMLNS_URI, XMLNS_PREFIX + ":" + prefix, namespaceURI);
+                    }
+                }
+                fLocalNSBinder.declarePrefix(prefix, namespaceURI);
+                fNSBinder.declarePrefix(prefix, namespaceURI);
+
+            }
+        } else {
+            // Element has no namespace
+            // DOM Level 1
+            if (localName == null || "".equals(localName)) {
+                //  DOM Level 1 node!
+                String msg =
+                    Utils.messages.createMessage(
+                        MsgKey.ER_NULL_LOCAL_ELEMENT_NAME,
+                        new Object[] { node.getNodeName()});
+
+                if (fErrorHandler != null) {
+                    fErrorHandler.handleError(
+                        new DOMErrorImpl(
+                            DOMError.SEVERITY_ERROR,
+                            msg,
+                            MsgKey.ER_NULL_LOCAL_ELEMENT_NAME,
+                            null,
+                            null,
+                            null));
+                }
+            } else {
+                namespaceURI = fNSBinder.getURI("");
+                if (namespaceURI !=null && namespaceURI.length() > 0) {
+                    ((Element)node).setAttributeNS(XMLNS_URI, XMLNS_PREFIX, "");
+                        fLocalNSBinder.declarePrefix("", "");
+                    fNSBinder.declarePrefix("", "");
+                }
+            }
+        }
+    }
+    /**
+     * This table is a quick lookup of a property key (String) to the integer that
+     * is the bit to flip in the fFeatures field, so the integers should have
+     * values 1,2,4,8,16...
+     *
+     */
+    private static final Hashtable s_propKeys = new Hashtable();
+    static {
+
+        // Initialize the mappings of property keys to bit values (Integer objects)
+        // or mappings to a String object "", which indicates we are interested
+        // in the property, but it does not have a simple bit value to flip
+
+        // cdata-sections
+        int i = CDATA;
+        Integer val = new Integer(i);
+        s_propKeys.put(
+            DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_CDATA_SECTIONS,
+            val);
+
+        // comments
+        int i1 = COMMENTS;
+        val = new Integer(i1);
+        s_propKeys.put(
+            DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_COMMENTS,
+            val);
+
+        // element-content-whitespace
+        int i2 = ELEM_CONTENT_WHITESPACE;
+        val = new Integer(i2);
+        s_propKeys.put(
+            DOMConstants.S_DOM3_PROPERTIES_NS
+                + DOMConstants.DOM_ELEMENT_CONTENT_WHITESPACE,
+            val);
+        int i3 = ENTITIES;
+
+        // entities
+        val = new Integer(i3);
+        s_propKeys.put(
+            DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_ENTITIES,
+            val);
+
+        // namespaces
+        int i4 = NAMESPACES;
+        val = new Integer(i4);
+        s_propKeys.put(
+            DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_NAMESPACES,
+            val);
+
+        // namespace-declarations
+        int i5 = NAMESPACEDECLS;
+        val = new Integer(i5);
+        s_propKeys.put(
+            DOMConstants.S_DOM3_PROPERTIES_NS
+                + DOMConstants.DOM_NAMESPACE_DECLARATIONS,
+            val);
+
+        // split-cdata-sections
+        int i6 = SPLITCDATA;
+        val = new Integer(i6);
+        s_propKeys.put(
+            DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_SPLIT_CDATA,
+            val);
+
+        // discard-default-content
+        int i7 = WELLFORMED;
+        val = new Integer(i7);
+        s_propKeys.put(
+            DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_WELLFORMED,
+            val);
+
+        // discard-default-content
+        int i8 = DISCARDDEFAULT;
+        val = new Integer(i8);
+        s_propKeys.put(
+            DOMConstants.S_DOM3_PROPERTIES_NS
+                + DOMConstants.DOM_DISCARD_DEFAULT_CONTENT,
+            val);
+
+        // We are interested in these properties, but they don't have a simple
+        // bit value to deal with.
+        s_propKeys.put(
+            DOMConstants.S_DOM3_PROPERTIES_NS
+                + DOMConstants.DOM_FORMAT_PRETTY_PRINT,
+            "");
+        s_propKeys.put(DOMConstants.S_XSL_OUTPUT_OMIT_XML_DECL, "");
+        s_propKeys.put(
+            DOMConstants.S_XERCES_PROPERTIES_NS + DOMConstants.S_XML_VERSION,
+            "");
+        s_propKeys.put(DOMConstants.S_XSL_OUTPUT_ENCODING, "");
+        s_propKeys.put(OutputPropertiesFactory.S_KEY_ENTITIES, "");
+    }
+
+    /**
+     * Initializes fFeatures based on the DOMConfiguration Parameters set.
+     *
+     * @param properties DOMConfiguraiton properties that were set and which are
+     * to be used while serializing the DOM.
+     */
+    protected void initProperties(Properties properties) {
+
+        for (Enumeration keys = properties.keys(); keys.hasMoreElements();) {
+
+            final String key = (String) keys.nextElement();
+
+            // caonical-form
+            // Other features will be enabled or disabled when this is set to true or false.
+
+            // error-handler; set via the constructor
+
+            // infoset
+            // Other features will be enabled or disabled when this is set to true
+
+            // A quick lookup for the given set of properties (cdata-sections ...)
+            final Object iobj = s_propKeys.get(key);
+            if (iobj != null) {
+                if (iobj instanceof Integer) {
+                    // Dealing with a property that has a simple bit value that
+                    // we need to set
+
+                    // cdata-sections
+                    // comments
+                    // element-content-whitespace
+                    // entities
+                    // namespaces
+                    // namespace-declarations
+                    // split-cdata-sections
+                    // well-formed
+                    // discard-default-content
+                    final int BITFLAG = ((Integer) iobj).intValue();
+                    if ((properties.getProperty(key).endsWith("yes"))) {
+                        fFeatures = fFeatures | BITFLAG;
+                    } else {
+                        fFeatures = fFeatures & ~BITFLAG;
+                    }
+                } else {
+                    // We are interested in the property, but it is not
+                    // a simple bit that we need to set.
+
+                    if ((DOMConstants.S_DOM3_PROPERTIES_NS
+                        + DOMConstants.DOM_FORMAT_PRETTY_PRINT)
+                        .equals(key)) {
+                        // format-pretty-print; set internally on the serializers via xsl:output properties in LSSerializer
+                        if ((properties.getProperty(key).endsWith("yes"))) {
+                            fSerializer.setIndent(true);
+                            fSerializer.setIndentAmount(4);
+                        } else {
+                            fSerializer.setIndent(false);
+                        }
+                    } else if (
+                        (DOMConstants.S_XSL_OUTPUT_OMIT_XML_DECL).equals(
+                            key)) {
+                        // omit-xml-declaration; set internally on the serializers via xsl:output properties in LSSerializer
+                        if ((properties.getProperty(key).endsWith("yes"))) {
+                            fSerializer.setOmitXMLDeclaration(true);
+                        } else {
+                            fSerializer.setOmitXMLDeclaration(false);
+                        }
+                    } else if (
+                        (
+                            DOMConstants.S_XERCES_PROPERTIES_NS
+                                + DOMConstants.S_XML_VERSION).equals(
+                            key)) {
+                        // Retreive the value of the XML Version attribute via the xml-version
+                        String version = properties.getProperty(key);
+                        if ("1.1".equals(version)) {
+                            fIsXMLVersion11 = true;
+                            fSerializer.setVersion(version);
+                        } else {
+                            fSerializer.setVersion("1.0");
+                        }
+                    } else if (
+                        (DOMConstants.S_XSL_OUTPUT_ENCODING).equals(key)) {
+                        // Retreive the value of the XML Encoding attribute
+                        String encoding = properties.getProperty(key);
+                        if (encoding != null) {
+                            fSerializer.setEncoding(encoding);
+                        }
+                    } else if ((OutputPropertiesFactory.S_KEY_ENTITIES).equals(key)) {
+                        // Retreive the value of the XML Encoding attribute
+                        String entities = properties.getProperty(key);
+                        if (DOMConstants.S_XSL_VALUE_ENTITIES.equals(entities)) {
+                            fSerializer.setDTDEntityExpansion(false);
+                        }
+                    } else {
+                        // We shouldn't get here, ever, now what?
+                    }
+                }
+            }
+        }
+        // Set the newLine character to use
+        if (fNewLine != null) {
+            fSerializer.setOutputProperty(OutputPropertiesFactory.S_KEY_LINE_SEPARATOR, fNewLine);
+        }
+    }
+
+} //TreeWalker
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/dom3/DOMConstants.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,134 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the  "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/*
+ * $Id:  $
+ */
+
+package com.sun.org.apache.xml.internal.serializer.dom3;
+
+/**
+ * DOM Constants used by the DOM Level 3 LSSerializer implementation.
+ *
+ * @xsl.usage internal
+ */
+final class DOMConstants {
+    //
+    // Constants: DOM Level 3 feature ids
+    //
+    public static final String DOM3_REC_URL = "http://www.w3.org/TR/DOM-Level-3-LS";
+
+    public static final String XERCES_URL = "http://xml.apache.org/xerces-2j";
+
+    // The namespace used to qualified DOM Level 3 DOMConfiguration parameters
+    public static final String S_DOM3_PROPERTIES_NS = "{"
+            + DOMConstants.DOM3_REC_URL + "}";
+
+    public static final String S_XERCES_PROPERTIES_NS = "{"
+            + DOMConstants.XERCES_URL + "}";
+
+    // xmlns namespaces
+    private static final String XMLNS_URI = "http://www.w3.org/2000/xmlns/";
+
+    // namespace prefix
+    private static final String XMLNS_PREFIX = "xmlns";
+
+    // ************************************************************************
+    // DOM Level 3 DOM Configuration parameter names
+    // ************************************************************************
+    // DOM Level 3 parameters defined in Core
+    public static final String DOM_CANONICAL_FORM = "canonical-form"; // Unsupported, we only appear to support this
+
+    public static final String DOM_CDATA_SECTIONS = "cdata-sections";
+
+    public static final String DOM_CHECK_CHAR_NORMALIZATION = "check-character-normalization"; // Unsupported
+
+    public static final String DOM_COMMENTS = "comments";
+
+    public static final String DOM_DATATYPE_NORMALIZATION = "datatype-normalization"; // Unsupported
+
+    public static final String DOM_ELEMENT_CONTENT_WHITESPACE = "element-content-whitespace";
+
+    public static final String DOM_ENTITIES = "entities";
+
+    public static final String DOM_INFOSET = "infoset";
+
+    public static final String DOM_NAMESPACES = "namespaces";
+
+    public static final String DOM_NAMESPACE_DECLARATIONS = "namespace-declarations";
+
+    public static final String DOM_NORMALIZE_CHARACTERS = "normalize-characters"; // Unsupported
+
+    public static final String DOM_SPLIT_CDATA = "split-cdata-sections";
+
+    public static final String DOM_VALIDATE_IF_SCHEMA = "validate-if-schema"; // Unsopported
+
+    public static final String DOM_VALIDATE = "validate"; // Unsopported
+
+    public static final String DOM_WELLFORMED = "well-formed";
+
+    // DOM Level 3 Save
+    public static final String DOM_DISCARD_DEFAULT_CONTENT = "discard-default-content";
+
+    public static final String DOM_FORMAT_PRETTY_PRINT = "format-pretty-print";
+
+    public static final String DOM_IGNORE_UNKNOWN_CHARACTER_DENORMALIZATIONS = "ignore-unknown-character-denormalizations"; // Unsupported
+
+    public static final String DOM_XMLDECL = "xml-declaration";
+
+    // DOM Properties
+    public static final String DOM_ERROR_HANDLER = "error-handler";
+
+    public static final String DOM_SCHEMA_TYPE = "schema-type"; // Unsupported
+
+    public static final String DOM_SCHEMA_LOCATION = "schema-location"; // Unsupported
+
+    // ************************************************************************
+
+    // XSL Output properties
+    // The xsl:output 'indent' property used in LSSerializer
+    public static final String S_XSL_OUTPUT_INDENT = "indent";
+
+    // The xsl:output 'indent' property used in LSSerializer
+    public static final String S_XSL_OUTPUT_ENCODING = "encoding";
+
+    // The xsl:output 'omit-xml-declaration' property used in LSSerializer
+    public static final String S_XSL_OUTPUT_OMIT_XML_DECL = "omit-xml-declaration";
+
+    // The xerces serializer specific 'omit-xml-declaration' property used in LSSerializer
+    public static final String S_XML_VERSION = "xml-version";
+
+    //
+    public static final String S_XSL_VALUE_ENTITIES = "com/sun/org/apache/xml/internal/serializer/XMLEntities";
+
+    // Parameter values
+    public static final String DOM3_EXPLICIT_TRUE = "explicit:yes";
+
+    public static final String DOM3_DEFAULT_TRUE = "default:yes";
+
+    public static final String DOM3_EXPLICIT_FALSE = "explicit:no";
+
+    public static final String DOM3_DEFAULT_FALSE = "default:no";
+
+    // DOM Exceptions
+    public static final String DOM_EXCEPTION_FEATURE_NOT_FOUND = "FEATURE_NOT_FOUND";
+
+    public static final String DOM_EXCEPTION_FEATURE_NOT_SUPPORTED = "FEATURE_NOT_SUPPORTED";
+
+    public static final String DOM_LSEXCEPTION_SERIALIZER_ERR = "SERIALIZER_ERROR";
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/dom3/DOMErrorHandlerImpl.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,66 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the  "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/*
+ * $Id:  $
+ */
+
+package com.sun.org.apache.xml.internal.serializer.dom3;
+
+import org.w3c.dom.DOMError;
+import org.w3c.dom.DOMErrorHandler;
+
+/**
+ * This is the default implementation of the ErrorHandler interface and is
+ * used if one is not provided.  The default implementation simply reports
+ * DOMErrors to System.err.
+ *
+ * @xsl.usage internal
+ */
+final class DOMErrorHandlerImpl implements DOMErrorHandler {
+
+    /**
+     * Default Constructor
+     */
+    DOMErrorHandlerImpl() {
+    }
+
+    /**
+     * Implementation of DOMErrorHandler.handleError that
+     * adds copy of error to list for later retrieval.
+     *
+     */
+    public boolean handleError(DOMError error) {
+        boolean fail = true;
+        String severity = null;
+        if (error.getSeverity() == DOMError.SEVERITY_WARNING) {
+            fail = false;
+            severity = "[Warning]";
+        } else if (error.getSeverity() == DOMError.SEVERITY_ERROR) {
+            severity = "[Error]";
+        } else if (error.getSeverity() == DOMError.SEVERITY_FATAL_ERROR) {
+            severity = "[Fatal Error]";
+        }
+
+        System.err.println(severity + ": " + error.getMessage() + "\t");
+        System.err.println("Type : " + error.getType() + "\t" + "Related Data: "
+                + error.getRelatedData() + "\t" + "Related Exception: "
+                + error.getRelatedException() );
+
+        return fail;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/dom3/DOMErrorImpl.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,176 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the  "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/*
+ * $Id:  $
+ */
+
+package com.sun.org.apache.xml.internal.serializer.dom3;
+
+import org.w3c.dom.DOMError;
+import org.w3c.dom.DOMLocator;
+
+/**
+ * Implementation of the DOM Level 3 DOMError interface.
+ *
+ * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#ERROR-Interfaces-DOMError'>DOMError Interface definition from Document Object Model (DOM) Level 3 Core Specification</a>.
+ *
+ * @xsl.usage internal
+ */
+
+final class DOMErrorImpl implements DOMError {
+
+    /** private data members */
+
+    // The DOMError Severity
+    private short fSeverity = DOMError.SEVERITY_WARNING;
+
+    // The Error message
+    private String fMessage = null;
+
+    //  A String indicating which related data is expected in relatedData.
+    private String fType;
+
+    // The platform related exception
+    private Exception fException = null;
+
+    //
+    private Object fRelatedData;
+
+    // The location of the exception
+    private DOMLocatorImpl fLocation = new DOMLocatorImpl();
+
+
+    //
+    // Constructors
+    //
+
+    /**
+     * Default constructor.
+     */
+    DOMErrorImpl () {
+    }
+
+    /**
+     * @param severity
+     * @param message
+     * @param type
+     */
+    DOMErrorImpl(short severity, String message, String type) {
+        fSeverity = severity;
+        fMessage = message;
+        fType = type;
+    }
+
+    /**
+     * @param severity
+     * @param message
+     * @param type
+     * @param exception
+     */
+    DOMErrorImpl(short severity, String message, String type,
+            Exception exception) {
+        fSeverity = severity;
+        fMessage = message;
+        fType = type;
+        fException = exception;
+    }
+
+    /**
+     * @param severity
+     * @param message
+     * @param type
+     * @param exception
+     * @param relatedData
+     * @param location
+     */
+    DOMErrorImpl(short severity, String message, String type,
+            Exception exception, Object relatedData, DOMLocatorImpl location) {
+        fSeverity = severity;
+        fMessage = message;
+        fType = type;
+        fException = exception;
+        fRelatedData = relatedData;
+        fLocation = location;
+    }
+
+
+    /**
+     * The severity of the error, either <code>SEVERITY_WARNING</code>,
+     * <code>SEVERITY_ERROR</code>, or <code>SEVERITY_FATAL_ERROR</code>.
+     *
+     * @return A short containing the DOMError severity
+     */
+    public short getSeverity() {
+        return fSeverity;
+    }
+
+    /**
+     * The DOMError message string.
+     *
+     * @return String
+     */
+    public String getMessage() {
+        return fMessage;
+    }
+
+    /**
+     * The location of the DOMError.
+     *
+     * @return A DOMLocator object containing the DOMError location.
+     */
+    public DOMLocator getLocation() {
+        return fLocation;
+    }
+
+    /**
+     * The related platform dependent exception if any.
+     *
+     * @return A java.lang.Exception
+     */
+    public Object getRelatedException(){
+        return fException;
+    }
+
+    /**
+     * Returns a String indicating which related data is expected in relatedData.
+     *
+     * @return A String
+     */
+    public String getType(){
+        return fType;
+    }
+
+    /**
+     * The related DOMError.type dependent data if any.
+     *
+     * @return java.lang.Object
+     */
+    public Object getRelatedData(){
+        return fRelatedData;
+    }
+
+    public void reset(){
+        fSeverity = DOMError.SEVERITY_WARNING;
+        fException = null;
+        fMessage = null;
+        fType = null;
+        fRelatedData = null;
+        fLocation = null;
+    }
+
+}// class DOMErrorImpl
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/dom3/DOMLocatorImpl.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,180 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the  "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/*
+ * $Id:  $
+ */
+
+package com.sun.org.apache.xml.internal.serializer.dom3;
+
+import org.w3c.dom.DOMLocator;
+import org.w3c.dom.Node;
+
+
+/**
+ * <code>DOMLocatorImpl</code> is an implementaion that describes a location (e.g.
+ * where an error occured).
+ * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification</a>.
+ * This class is a copy of the Xerces-2J class org.apache.xerces.dom.DOMLocatorImpl.java v 1.10
+ *
+ * @author Gopal Sharma, SUN Microsystems Inc.
+ * @version $Id:
+ *
+ * @xsl.usage internal
+ */
+final class DOMLocatorImpl implements DOMLocator {
+
+    //
+    // Data
+    //
+
+    /**
+     * The column number where the error occured,
+     * or -1 if there is no column number available.
+     */
+    private final int fColumnNumber;
+
+    /**
+     * The line number where the error occured,
+     * or -1 if there is no line number available.
+     */
+    private final int fLineNumber;
+
+    /** related data node*/
+    private final Node fRelatedNode;
+
+    /**
+     * The URI where the error occured,
+     * or null if there is no URI available.
+     */
+    private final String fUri;
+
+    /**
+     * The byte offset into the input source this locator is pointing to or -1
+     * if there is no byte offset available
+     */
+    private final int fByteOffset;
+
+    /**
+     * The UTF-16, as defined in [Unicode] and Amendment 1 of [ISO/IEC 10646],
+     * offset into the input source this locator is pointing to or -1 if there
+     * is no UTF-16 offset available.
+     */
+    private final int fUtf16Offset;
+
+    //
+    // Constructors
+    //
+
+    DOMLocatorImpl(){
+        fColumnNumber = -1;
+        fLineNumber = -1;
+        fRelatedNode = null;
+        fUri = null;
+        fByteOffset = -1;
+        fUtf16Offset = -1;
+    }
+
+    DOMLocatorImpl (int lineNumber, int columnNumber, String uri ){
+        fLineNumber = lineNumber ;
+        fColumnNumber = columnNumber ;
+        fUri = uri;
+
+        fRelatedNode = null;
+        fByteOffset = -1;
+        fUtf16Offset = -1;
+    } // DOMLocatorImpl (int lineNumber, int columnNumber, String uri )
+
+    DOMLocatorImpl (int lineNumber, int columnNumber, int utf16Offset, String uri ){
+        fLineNumber = lineNumber ;
+        fColumnNumber = columnNumber ;
+        fUri = uri;
+        fUtf16Offset = utf16Offset;
+
+
+        fRelatedNode = null;
+        fByteOffset = -1;
+    } // DOMLocatorImpl (int lineNumber, int columnNumber, int utf16Offset, String uri )
+
+    DOMLocatorImpl (int lineNumber, int columnNumber, int byteoffset, Node relatedData, String uri ){
+        fLineNumber = lineNumber ;
+        fColumnNumber = columnNumber ;
+        fByteOffset = byteoffset ;
+        fRelatedNode = relatedData ;
+        fUri = uri;
+
+        fUtf16Offset = -1;
+    } // DOMLocatorImpl (int lineNumber, int columnNumber, int offset, Node errorNode, String uri )
+
+    DOMLocatorImpl (int lineNumber, int columnNumber, int byteoffset, Node relatedData, String uri, int utf16Offset ){
+        fLineNumber = lineNumber ;
+        fColumnNumber = columnNumber ;
+        fByteOffset = byteoffset ;
+        fRelatedNode = relatedData ;
+        fUri = uri;
+        fUtf16Offset = utf16Offset;
+    } // DOMLocatorImpl (int lineNumber, int columnNumber, int offset, Node errorNode, String uri )
+
+
+    /**
+     * The line number where the error occured, or -1 if there is no line
+     * number available.
+     */
+    public int getLineNumber(){
+        return fLineNumber;
+    }
+
+    /**
+     * The column number where the error occured, or -1 if there is no column
+     * number available.
+     */
+    public int getColumnNumber(){
+        return fColumnNumber;
+    }
+
+
+    /**
+     * The URI where the error occured, or null if there is no URI available.
+     */
+    public String getUri(){
+        return fUri;
+    }
+
+
+    public Node getRelatedNode(){
+        return fRelatedNode;
+    }
+
+
+    /**
+     * The byte offset into the input source this locator is pointing to or -1
+     * if there is no byte offset available
+     */
+    public int getByteOffset(){
+        return fByteOffset;
+    }
+
+    /**
+     * The UTF-16, as defined in [Unicode] and Amendment 1 of [ISO/IEC 10646],
+     * offset into the input source this locator is pointing to or -1 if there
+     * is no UTF-16 offset available.
+     */
+    public int getUtf16Offset(){
+        return fUtf16Offset;
+    }
+
+}// class DOMLocatorImpl
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/dom3/DOMOutputImpl.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,177 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the  "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/*
+ * $Id:  $
+ */
+
+package com.sun.org.apache.xml.internal.serializer.dom3;
+
+import org.w3c.dom.ls.LSOutput;
+
+import java.io.Writer;
+import java.io.OutputStream;
+
+/**
+ * This is a copy of the Xerces-2J class org.apache.xerces.dom.DOMOutputImpl.java
+ *
+ * This class represents an output destination for data.
+ * This interface allows an application to encapsulate information about an
+ * output destination in a single object, which may include a URI, a byte stream
+ * (possibly with a specifiedencoding), a base URI, and/or a character stream.
+ * The exact definitions of a byte stream and a character stream are binding
+ * dependent.
+ * The application is expected to provide objects that implement this interface
+ * whenever such objects are needed. The application can either provide its
+ * own objects that implement this interface, or it can use the generic factory
+ * method DOMImplementationLS.createLSOutput() to create objects that
+ * implement this interface.
+ * The DOMSerializer will use the LSOutput object to determine where to
+ * serialize the output to. The DOMSerializer will look at the different
+ * outputs specified in the LSOutput in the following order to know which one
+ * to output to, the first one that data can be output to will be used:
+ * 1.LSOutput.characterStream
+ * 2.LSOutput.byteStream
+ * 3.LSOutput.systemId
+ * LSOutput objects belong to the application. The DOM implementation will
+ * never modify them (though it may make copies and modify the copies,
+ * if necessary).
+ *
+ *
+ * @author Arun Yadav, Sun Microsytems
+ * @author Gopal Sharma, Sun Microsystems
+ * @version $Id :
+ * @xsl.usage internal
+ */
+
+final class DOMOutputImpl implements LSOutput {
+
+    private Writer fCharStream = null;
+    private OutputStream fByteStream = null;
+    private String fSystemId = null;
+    private String fEncoding = null;
+
+    /**
+     * Default Constructor
+     */
+    DOMOutputImpl() {}
+
+    /**
+     * An attribute of a language and binding dependent type that represents a
+     * writable stream of bytes. If the application knows the character encoding
+     * of the byte stream, it should set the encoding attribute. Setting the
+     * encoding in this way will override any encoding specified in an XML
+     * declaration in the data.
+     */
+
+    public Writer getCharacterStream(){
+        return fCharStream;
+    };
+
+    /**
+     * An attribute of a language and binding dependent type that represents a
+     * writable stream of bytes. If the application knows the character encoding
+     * of the byte stream, it should set the encoding attribute. Setting the
+     * encoding in this way will override any encoding specified in an XML
+     * declaration in the data.
+     */
+
+    public void setCharacterStream(Writer characterStream){
+        fCharStream = characterStream;
+    };
+
+    /**
+     * Depending on the language binding in use, this attribute may not be
+     * available. An attribute of a language and binding dependent type that
+     * represents a writable stream to which 16-bit units can be output. The
+     * application must encode the stream using UTF-16 (defined in [Unicode] and
+     *  Amendment 1 of [ISO/IEC 10646]).
+     */
+
+    public OutputStream getByteStream(){
+        return fByteStream;
+    };
+
+    /**
+     * Depending on the language binding in use, this attribute may not be
+     * available. An attribute of a language and binding dependent type that
+     * represents a writable stream to which 16-bit units can be output. The
+     * application must encode the stream using UTF-16 (defined in [Unicode] and
+     *  Amendment 1 of [ISO/IEC 10646]).
+     */
+
+    public void setByteStream(OutputStream byteStream){
+        fByteStream = byteStream;
+    };
+
+    /**
+     * The system identifier, a URI reference [IETF RFC 2396], for this output
+     *  destination. If the application knows the character encoding of the
+     *  object pointed to by the system identifier, it can set the encoding
+     *  using the encoding attribute. If the system ID is a relative URI
+     *  reference (see section 5 in [IETF RFC 2396]), the behavior is
+     *  implementation dependent.
+     */
+
+    public String getSystemId(){
+        return fSystemId;
+    };
+
+    /**
+     * The system identifier, a URI reference [IETF RFC 2396], for this output
+     *  destination. If the application knows the character encoding of the
+     *  object pointed to by the system identifier, it can set the encoding
+     *  using the encoding attribute. If the system ID is a relative URI
+     *  reference (see section 5 in [IETF RFC 2396]), the behavior is
+     *  implementation dependent.
+     */
+
+    public void setSystemId(String systemId){
+        fSystemId = systemId;
+    };
+
+    /**
+     * The character encoding, if known. The encoding must be a string
+     * acceptable for an XML encoding declaration ([XML 1.0] section 4.3.3
+     * "Character Encoding in Entities"). This attribute has no effect when the
+     * application provides a character stream or string data. For other sources
+     * of input, an encoding specified by means of this attribute will override
+     * any encoding specified in the XML declaration or the Text declaration, or
+     * an encoding obtained from a higher level protocol, such as HTTP
+     * [IETF RFC 2616].
+     */
+
+    public String getEncoding(){
+        return fEncoding;
+    };
+
+    /**
+     * The character encoding, if known. The encoding must be a string
+     * acceptable for an XML encoding declaration ([XML 1.0] section 4.3.3
+     * "Character Encoding in Entities"). This attribute has no effect when the
+     * application provides a character stream or string data. For other sources
+     * of input, an encoding specified by means of this attribute will override
+     * any encoding specified in the XML declaration or the Text declaration, or
+     * an encoding obtained from a higher level protocol, such as HTTP
+     * [IETF RFC 2616].
+     */
+
+    public void setEncoding(String encoding){
+        fEncoding = encoding;
+    };
+
+}//DOMOutputImpl
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/dom3/DOMStringListImpl.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,99 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the  "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/*
+ * $Id:  $
+ */
+package com.sun.org.apache.xml.internal.serializer.dom3;
+
+import java.util.Vector;
+
+//import org.apache.xerces.dom3.DOMStringList;
+import org.w3c.dom.DOMStringList;
+
+/**
+ * This class implemets the DOM Level 3 Core interface DOMStringList.
+ *
+ * @xsl.usage internal
+ */
+final class DOMStringListImpl implements DOMStringList {
+
+    //A collection of DOMString values
+    private Vector fStrings;
+
+    /**
+     * Construct an empty list of DOMStringListImpl
+     */
+    DOMStringListImpl() {
+        fStrings = new Vector();
+    }
+
+    /**
+     * Construct an empty list of DOMStringListImpl
+     */
+    DOMStringListImpl(Vector params) {
+        fStrings = params;
+    }
+
+    /**
+     * Construct an empty list of DOMStringListImpl
+     */
+    DOMStringListImpl(String[] params ) {
+        fStrings = new Vector();
+        if (params != null) {
+            for (int i=0; i < params.length; i++) {
+                fStrings.add(params[i]);
+            }
+        }
+    }
+
+    /**
+     * @see org.apache.xerces.dom3.DOMStringList#item(int)
+     */
+    public String item(int index) {
+        try {
+            return (String) fStrings.elementAt(index);
+        } catch (ArrayIndexOutOfBoundsException e) {
+            return null;
+        }
+    }
+
+    /**
+     * @see org.apache.xerces.dom3.DOMStringList#getLength()
+     */
+    public int getLength() {
+        return fStrings.size();
+    }
+
+    /**
+     * @see org.apache.xerces.dom3.DOMStringList#contains(String)
+     */
+    public boolean contains(String param) {
+        return fStrings.contains(param) ;
+    }
+
+    /**
+     * DOM Internal:
+     * Add a <code>DOMString</code> to the list.
+     *
+     * @param domString A string to add to the list
+     */
+    public void add(String param) {
+        fStrings.add(param);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/dom3/LSSerializerImpl.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,1405 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the  "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/*
+ * $Id:  $
+ */
+
+package com.sun.org.apache.xml.internal.serializer.dom3;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.OutputStream;
+import java.io.OutputStreamWriter;
+import java.io.StringWriter;
+import java.io.UnsupportedEncodingException;
+import java.io.Writer;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.net.URLConnection;
+import java.util.Properties;
+
+import com.sun.org.apache.xml.internal.serializer.DOM3Serializer;
+import com.sun.org.apache.xml.internal.serializer.Encodings;
+import com.sun.org.apache.xml.internal.serializer.Serializer;
+import com.sun.org.apache.xml.internal.serializer.OutputPropertiesFactory;
+import com.sun.org.apache.xml.internal.serializer.SerializerFactory;
+import com.sun.org.apache.xml.internal.serializer.utils.MsgKey;
+import com.sun.org.apache.xml.internal.serializer.utils.Utils;
+import com.sun.org.apache.xml.internal.serializer.utils.SystemIDResolver;
+import org.w3c.dom.DOMConfiguration;
+import org.w3c.dom.DOMError;
+import org.w3c.dom.DOMErrorHandler;
+import org.w3c.dom.DOMException;
+import org.w3c.dom.DOMStringList;
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+import org.w3c.dom.ls.LSException;
+import org.w3c.dom.ls.LSOutput;
+import org.w3c.dom.ls.LSSerializer;
+import org.w3c.dom.ls.LSSerializerFilter;
+
+
+/**
+ * Implemenatation of DOM Level 3 org.w3c.ls.LSSerializer and
+ * org.w3c.dom.ls.DOMConfiguration.  Serialization is achieved by delegating
+ * serialization calls to <CODE>org.apache.xml.serializer.ToStream</CODE> or
+ * one of its derived classes depending on the serialization method, while walking
+ * the DOM in DOM3TreeWalker.
+ * @see <a href="http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407/load-save.html#LS-LSSerializer">org.w3c.dom.ls.LSSerializer</a>
+ * @see <a href="http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#DOMConfiguration">org.w3c.dom.DOMConfiguration</a>
+ *
+ * @version $Id:
+ *
+ * @xsl.usage internal
+ */
+final public class LSSerializerImpl implements DOMConfiguration, LSSerializer {
+
+    /** private data members */
+    private Serializer fXMLSerializer = null;
+
+    // Tracks DOMConfiguration features.
+    protected int fFeatures = 0;
+
+    // Common DOM serializer
+    private  DOM3Serializer fDOMSerializer = null;
+
+    // A filter set on the LSSerializer
+    private LSSerializerFilter fSerializerFilter = null;
+
+    // Stores the nodeArg parameter to speed up multiple writes of the same node.
+    private Node fVisitedNode = null;
+
+    // The end-of-line character sequence used in serialization.  "\n" is whats used on the web.
+    private String fEndOfLine = "\n";
+
+    // The DOMErrorhandler.
+    private DOMErrorHandler fDOMErrorHandler = null;
+
+    // The Configuration parameter to pass to the Underlying serilaizer.
+    private Properties fDOMConfigProperties = null;
+
+    // The encoding to use during serialization.
+    private String fEncoding;
+
+    // ************************************************************************
+    // DOM Level 3 DOM Configuration parameter names
+    // ************************************************************************
+    // Parameter canonical-form, true [optional] - NOT SUPPORTED
+    private final static int CANONICAL = 0x1 << 0;
+
+    // Parameter cdata-sections, true [required] (default)
+    private final static int CDATA = 0x1 << 1;
+
+    // Parameter check-character-normalization, true [optional] - NOT SUPPORTED
+    private final static int CHARNORMALIZE = 0x1 << 2;
+
+    // Parameter comments, true [required] (default)
+    private final static int COMMENTS = 0x1 << 3;
+
+    // Parameter datatype-normalization, true [optional] - NOT SUPPORTED
+    private final static int DTNORMALIZE = 0x1 << 4;
+
+    // Parameter element-content-whitespace, true [required] (default) - value - false [optional] NOT SUPPORTED
+    private final static int ELEM_CONTENT_WHITESPACE = 0x1 << 5;
+
+    // Parameter entities, true [required] (default)
+    private final static int ENTITIES = 0x1 << 6;
+
+    // Parameter infoset, true [required] (default), false has no effect --> True has no effect for the serializer
+    private final static int INFOSET = 0x1 << 7;
+
+    // Parameter namespaces, true [required] (default)
+    private final static int NAMESPACES = 0x1 << 8;
+
+    // Parameter namespace-declarations, true [required] (default)
+    private final static int NAMESPACEDECLS = 0x1 << 9;
+
+    // Parameter normalize-characters, true [optional] - NOT SUPPORTED
+    private final static int NORMALIZECHARS = 0x1 << 10;
+
+    // Parameter split-cdata-sections, true [required] (default)
+    private final static int SPLITCDATA = 0x1 << 11;
+
+    // Parameter validate, true [optional] - NOT SUPPORTED
+    private final static int VALIDATE = 0x1 << 12;
+
+    // Parameter validate-if-schema, true [optional] - NOT SUPPORTED
+    private final static int SCHEMAVALIDATE = 0x1 << 13;
+
+    // Parameter split-cdata-sections, true [required] (default)
+    private final static int WELLFORMED = 0x1 << 14;
+
+    // Parameter discard-default-content, true [required] (default)
+    // Not sure how this will be used in level 2 Documents
+    private final static int DISCARDDEFAULT = 0x1 << 15;
+
+    // Parameter format-pretty-print, true [optional]
+    private final static int PRETTY_PRINT = 0x1 << 16;
+
+    // Parameter ignore-unknown-character-denormalizations, true [required] (default)
+    // We currently do not support XML 1.1 character normalization
+    private final static int IGNORE_CHAR_DENORMALIZE = 0x1 << 17;
+
+    // Parameter discard-default-content, true [required] (default)
+    private final static int XMLDECL = 0x1 << 18;
+    // ************************************************************************
+
+    // Recognized parameters for which atleast one value can be set
+    private String fRecognizedParameters [] = {
+            DOMConstants.DOM_CANONICAL_FORM,
+            DOMConstants.DOM_CDATA_SECTIONS,
+            DOMConstants.DOM_CHECK_CHAR_NORMALIZATION,
+            DOMConstants.DOM_COMMENTS,
+            DOMConstants.DOM_DATATYPE_NORMALIZATION,
+            DOMConstants.DOM_ELEMENT_CONTENT_WHITESPACE,
+            DOMConstants.DOM_ENTITIES,
+            DOMConstants.DOM_INFOSET,
+            DOMConstants.DOM_NAMESPACES,
+            DOMConstants.DOM_NAMESPACE_DECLARATIONS,
+            //DOMConstants.DOM_NORMALIZE_CHARACTERS,
+            DOMConstants.DOM_SPLIT_CDATA,
+            DOMConstants.DOM_VALIDATE,
+            DOMConstants.DOM_VALIDATE_IF_SCHEMA,
+            DOMConstants.DOM_WELLFORMED,
+            DOMConstants.DOM_DISCARD_DEFAULT_CONTENT,
+            DOMConstants.DOM_FORMAT_PRETTY_PRINT,
+            DOMConstants.DOM_IGNORE_UNKNOWN_CHARACTER_DENORMALIZATIONS,
+            DOMConstants.DOM_XMLDECL,
+            DOMConstants.DOM_ERROR_HANDLER
+    };
+
+
+    /**
+     * Constructor:  Creates a LSSerializerImpl object.  The underlying
+     * XML 1.0 or XML 1.1 org.apache.xml.serializer.Serializer object is
+     * created and initialized the first time any of the write methods are
+     * invoked to serialize the Node.  Subsequent write methods on the same
+     * LSSerializerImpl object will use the previously created Serializer object.
+     */
+    public LSSerializerImpl () {
+        // set default parameters
+        fFeatures |= CDATA;
+        fFeatures |= COMMENTS;
+        fFeatures |= ELEM_CONTENT_WHITESPACE;
+        fFeatures |= ENTITIES;
+        fFeatures |= NAMESPACES;
+        fFeatures |= NAMESPACEDECLS;
+        fFeatures |= SPLITCDATA;
+        fFeatures |= WELLFORMED;
+        fFeatures |= DISCARDDEFAULT;
+        fFeatures |= XMLDECL;
+
+        // New OutputFormat properties
+        fDOMConfigProperties = new Properties();
+
+        // Initialize properties to be passed on the underlying serializer
+        initializeSerializerProps();
+
+        // Read output_xml.properties and System Properties to initialize properties
+        Properties  configProps = OutputPropertiesFactory.getDefaultMethodProperties("xml");
+
+        // change xml version from 1.0 to 1.1
+        //configProps.setProperty("version", "1.1");
+
+        // Get a serializer that seriailizes according to the properties,
+        // which in this case is to xml
+        fXMLSerializer = SerializerFactory.getSerializer(configProps);
+
+        // Initialize Serializer
+        fXMLSerializer.setOutputFormat(fDOMConfigProperties);
+    }
+
+    /**
+     * Initializes the underlying serializer's configuration depending on the
+     * default DOMConfiguration parameters. This method must be called before a
+     * node is to be serialized.
+     *
+     * @xsl.usage internal
+     */
+    public void initializeSerializerProps () {
+        // canonical-form
+        fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS
+                + DOMConstants.DOM_CANONICAL_FORM, DOMConstants.DOM3_DEFAULT_FALSE);
+
+        // cdata-sections
+        fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS
+                + DOMConstants.DOM_CDATA_SECTIONS, DOMConstants.DOM3_DEFAULT_TRUE);
+
+        // "check-character-normalization"
+        fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS
+                + DOMConstants.DOM_CHECK_CHAR_NORMALIZATION,
+                DOMConstants.DOM3_DEFAULT_FALSE);
+
+        // comments
+        fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS
+                + DOMConstants.DOM_COMMENTS, DOMConstants.DOM3_DEFAULT_TRUE);
+
+        // datatype-normalization
+        fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS
+                + DOMConstants.DOM_DATATYPE_NORMALIZATION,
+                DOMConstants.DOM3_DEFAULT_FALSE);
+
+        // element-content-whitespace
+        fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS
+                + DOMConstants.DOM_ELEMENT_CONTENT_WHITESPACE,
+                DOMConstants.DOM3_DEFAULT_TRUE);
+
+        // entities
+        fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS
+                + DOMConstants.DOM_ENTITIES, DOMConstants.DOM3_DEFAULT_TRUE);
+        // preserve entities
+        fDOMConfigProperties.setProperty(
+                OutputPropertiesFactory.S_KEY_ENTITIES, DOMConstants.S_XSL_VALUE_ENTITIES);
+
+        // error-handler
+        // Should we set our default ErrorHandler
+        /*
+         * if (fDOMConfig.getParameter(Constants.DOM_ERROR_HANDLER) != null) {
+         * fDOMErrorHandler =
+         * (DOMErrorHandler)fDOMConfig.getParameter(Constants.DOM_ERROR_HANDLER); }
+         */
+
+        // infoset
+        if ((fFeatures & INFOSET) != 0) {
+            fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS
+                    + DOMConstants.DOM_NAMESPACES, DOMConstants.DOM3_DEFAULT_TRUE);
+            fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS
+                    + DOMConstants.DOM_NAMESPACE_DECLARATIONS,
+                    DOMConstants.DOM3_DEFAULT_TRUE);
+            fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS
+                    + DOMConstants.DOM_COMMENTS, DOMConstants.DOM3_DEFAULT_TRUE);
+            fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS
+                    + DOMConstants.DOM_ELEMENT_CONTENT_WHITESPACE,
+                    DOMConstants.DOM3_DEFAULT_TRUE);
+            fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS
+                    + DOMConstants.DOM_WELLFORMED, DOMConstants.DOM3_DEFAULT_TRUE);
+            fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS
+                    + DOMConstants.DOM_ENTITIES, DOMConstants.DOM3_DEFAULT_FALSE);
+            // preserve entities
+            fDOMConfigProperties.setProperty(
+                    OutputPropertiesFactory.S_KEY_ENTITIES, "");
+            fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS
+                    + DOMConstants.DOM_CDATA_SECTIONS,
+                    DOMConstants.DOM3_DEFAULT_FALSE);
+            fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS
+                    + DOMConstants.DOM_VALIDATE_IF_SCHEMA,
+                    DOMConstants.DOM3_DEFAULT_FALSE);
+            fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS
+                    + DOMConstants.DOM_DATATYPE_NORMALIZATION,
+                    DOMConstants.DOM3_DEFAULT_FALSE);
+        }
+
+        // namespaces
+        fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS
+                + DOMConstants.DOM_NAMESPACES, DOMConstants.DOM3_DEFAULT_TRUE);
+
+        // namespace-declarations
+        fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS
+                + DOMConstants.DOM_NAMESPACE_DECLARATIONS,
+                DOMConstants.DOM3_DEFAULT_TRUE);
+
+        // normalize-characters
+        /*
+        fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS
+                + DOMConstants.DOM_NORMALIZE_CHARACTERS,
+                DOMConstants.DOM3_DEFAULT_FALSE);
+        */
+
+        // split-cdata-sections
+        fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS
+                + DOMConstants.DOM_SPLIT_CDATA, DOMConstants.DOM3_DEFAULT_TRUE);
+
+        // validate
+        fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS
+                + DOMConstants.DOM_VALIDATE, DOMConstants.DOM3_DEFAULT_FALSE);
+
+        // validate-if-schema
+        fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS
+                + DOMConstants.DOM_VALIDATE_IF_SCHEMA,
+                DOMConstants.DOM3_DEFAULT_FALSE);
+
+        // well-formed
+        fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS
+                + DOMConstants.DOM_WELLFORMED, DOMConstants.DOM3_DEFAULT_TRUE);
+
+        // pretty-print
+        fDOMConfigProperties.setProperty(
+                DOMConstants.S_XSL_OUTPUT_INDENT,
+                DOMConstants.DOM3_DEFAULT_FALSE);
+        fDOMConfigProperties.setProperty(
+                OutputPropertiesFactory.S_KEY_INDENT_AMOUNT, Integer.toString(4));
+
+        //
+
+        // discard-default-content
+        fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS
+                + DOMConstants.DOM_DISCARD_DEFAULT_CONTENT,
+                DOMConstants.DOM3_DEFAULT_TRUE);
+
+        // xml-declaration
+        fDOMConfigProperties.setProperty(DOMConstants.S_XSL_OUTPUT_OMIT_XML_DECL, "no");
+
+    }
+
+    // ************************************************************************
+    // DOMConfiguraiton implementation
+    // ************************************************************************
+
+    /**
+     * Checks if setting a parameter to a specific value is supported.
+     *
+     * @see org.w3c.dom.DOMConfiguration#canSetParameter(java.lang.String, java.lang.Object)
+     * @since DOM Level 3
+     * @param name A String containing the DOMConfiguration parameter name.
+     * @param value An Object specifying the value of the corresponding parameter.
+     */
+    public boolean canSetParameter(String name, Object value) {
+        if (value instanceof Boolean){
+            if ( name.equalsIgnoreCase(DOMConstants.DOM_CDATA_SECTIONS)
+                    || name.equalsIgnoreCase(DOMConstants.DOM_COMMENTS)
+                    || name.equalsIgnoreCase(DOMConstants.DOM_ENTITIES)
+                    || name.equalsIgnoreCase(DOMConstants.DOM_INFOSET)
+                    || name.equalsIgnoreCase(DOMConstants.DOM_ELEMENT_CONTENT_WHITESPACE)
+                    || name.equalsIgnoreCase(DOMConstants.DOM_NAMESPACES)
+                    || name.equalsIgnoreCase(DOMConstants.DOM_NAMESPACE_DECLARATIONS)
+                    || name.equalsIgnoreCase(DOMConstants.DOM_SPLIT_CDATA)
+                    || name.equalsIgnoreCase(DOMConstants.DOM_WELLFORMED)
+                    || name.equalsIgnoreCase(DOMConstants.DOM_DISCARD_DEFAULT_CONTENT)
+                    || name.equalsIgnoreCase(DOMConstants.DOM_FORMAT_PRETTY_PRINT)
+                    || name.equalsIgnoreCase(DOMConstants.DOM_XMLDECL)){
+                // both values supported
+                return true;
+            }
+            else if (name.equalsIgnoreCase(DOMConstants.DOM_CANONICAL_FORM)
+                    || name.equalsIgnoreCase(DOMConstants.DOM_CHECK_CHAR_NORMALIZATION)
+                    || name.equalsIgnoreCase(DOMConstants.DOM_DATATYPE_NORMALIZATION)
+                    || name.equalsIgnoreCase(DOMConstants.DOM_VALIDATE_IF_SCHEMA)
+                    || name.equalsIgnoreCase(DOMConstants.DOM_VALIDATE)
+                    // || name.equalsIgnoreCase(DOMConstants.DOM_NORMALIZE_CHARACTERS)
+                    ) {
+                // true is not supported
+                return !((Boolean)value).booleanValue();
+            }
+            else if (name.equalsIgnoreCase(DOMConstants.DOM_IGNORE_UNKNOWN_CHARACTER_DENORMALIZATIONS)) {
+                // false is not supported
+                return ((Boolean)value).booleanValue();
+            }
+        }
+        else if (name.equalsIgnoreCase(DOMConstants.DOM_ERROR_HANDLER) &&
+                value == null || value instanceof DOMErrorHandler){
+            return true;
+        }
+        return false;
+    }
+    /**
+     * This method returns the value of a parameter if known.
+     *
+     * @see org.w3c.dom.DOMConfiguration#getParameter(java.lang.String)
+     *
+     * @param name A String containing the DOMConfiguration parameter name
+     *             whose value is to be returned.
+     * @return Object The value of the parameter if known.
+     */
+    public Object getParameter(String name) throws DOMException {
+
+        if(name.equalsIgnoreCase(DOMConstants.DOM_NORMALIZE_CHARACTERS)){
+                      return null;
+        } else if (name.equalsIgnoreCase(DOMConstants.DOM_COMMENTS)) {
+            return ((fFeatures & COMMENTS) != 0) ? Boolean.TRUE : Boolean.FALSE;
+        } else if (name.equalsIgnoreCase(DOMConstants.DOM_CDATA_SECTIONS)) {
+            return ((fFeatures & CDATA) != 0) ? Boolean.TRUE : Boolean.FALSE;
+        } else if (name.equalsIgnoreCase(DOMConstants.DOM_ENTITIES)) {
+            return ((fFeatures & ENTITIES) != 0) ? Boolean.TRUE : Boolean.FALSE;
+        } else if (name.equalsIgnoreCase(DOMConstants.DOM_NAMESPACES)) {
+            return ((fFeatures & NAMESPACES) != 0) ? Boolean.TRUE : Boolean.FALSE;
+        } else if (name.equalsIgnoreCase(DOMConstants.DOM_NAMESPACE_DECLARATIONS)) {
+            return ((fFeatures & NAMESPACEDECLS) != 0) ? Boolean.TRUE : Boolean.FALSE;
+        } else if (name.equalsIgnoreCase(DOMConstants.DOM_SPLIT_CDATA)) {
+            return ((fFeatures & SPLITCDATA) != 0) ? Boolean.TRUE : Boolean.FALSE;
+        } else if (name.equalsIgnoreCase(DOMConstants.DOM_WELLFORMED)) {
+            return ((fFeatures & WELLFORMED) != 0) ? Boolean.TRUE : Boolean.FALSE;
+        }  else if (name.equalsIgnoreCase(DOMConstants.DOM_DISCARD_DEFAULT_CONTENT)) {
+            return ((fFeatures & DISCARDDEFAULT) != 0) ? Boolean.TRUE : Boolean.FALSE;
+        } else if (name.equalsIgnoreCase(DOMConstants.DOM_FORMAT_PRETTY_PRINT)) {
+            return ((fFeatures & PRETTY_PRINT) != 0) ? Boolean.TRUE : Boolean.FALSE;
+        } else if (name.equalsIgnoreCase(DOMConstants.DOM_XMLDECL)) {
+            return ((fFeatures & XMLDECL) != 0) ? Boolean.TRUE : Boolean.FALSE;
+        } else if (name.equalsIgnoreCase(DOMConstants.DOM_ELEMENT_CONTENT_WHITESPACE)) {
+            return ((fFeatures & ELEM_CONTENT_WHITESPACE) != 0) ? Boolean.TRUE : Boolean.FALSE;
+        } else if (name.equalsIgnoreCase(DOMConstants.DOM_IGNORE_UNKNOWN_CHARACTER_DENORMALIZATIONS)) {
+            return Boolean.TRUE;
+        } else if (name.equalsIgnoreCase(DOMConstants.DOM_CANONICAL_FORM)
+                || name.equalsIgnoreCase(DOMConstants.DOM_CHECK_CHAR_NORMALIZATION)
+                || name.equalsIgnoreCase(DOMConstants.DOM_DATATYPE_NORMALIZATION)
+                // || name.equalsIgnoreCase(DOMConstants.DOM_NORMALIZE_CHARACTERS)
+                || name.equalsIgnoreCase(DOMConstants.DOM_VALIDATE)
+                || name.equalsIgnoreCase(DOMConstants.DOM_VALIDATE_IF_SCHEMA)) {
+            return Boolean.FALSE;
+        } else if (name.equalsIgnoreCase(DOMConstants.DOM_INFOSET)){
+            if ((fFeatures & ENTITIES) == 0 &&
+                    (fFeatures & CDATA) == 0 &&
+                    (fFeatures & ELEM_CONTENT_WHITESPACE) != 0 &&
+                    (fFeatures & NAMESPACES) != 0 &&
+                    (fFeatures & NAMESPACEDECLS) != 0 &&
+                    (fFeatures & WELLFORMED) != 0 &&
+                    (fFeatures & COMMENTS) != 0) {
+                return Boolean.TRUE;
+            }
+            return Boolean.FALSE;
+        } else if (name.equalsIgnoreCase(DOMConstants.DOM_ERROR_HANDLER)) {
+            return fDOMErrorHandler;
+        } else if (
+                name.equalsIgnoreCase(DOMConstants.DOM_SCHEMA_LOCATION)
+                || name.equalsIgnoreCase(DOMConstants.DOM_SCHEMA_TYPE)) {
+            return null;
+        } else {
+            // Here we have to add the Xalan specific DOM Message Formatter
+            String msg = Utils.messages.createMessage(
+                    MsgKey.ER_FEATURE_NOT_FOUND,
+                    new Object[] { name });
+            throw new DOMException(DOMException.NOT_FOUND_ERR, msg);
+        }
+    }
+
+    /**
+     * This method returns a of the parameters supported by this DOMConfiguration object
+     * and for which at least one value can be set by the application
+     *
+     * @see org.w3c.dom.DOMConfiguration#getParameterNames()
+     *
+     * @return DOMStringList A list of DOMConfiguration parameters recognized
+     *                       by the serializer
+     */
+    public DOMStringList getParameterNames() {
+        return new DOMStringListImpl(fRecognizedParameters);
+    }
+
+    /**
+     * This method sets the value of the named parameter.
+     *
+     * @see org.w3c.dom.DOMConfiguration#setParameter(java.lang.String, java.lang.Object)
+     *
+     * @param name A String containing the DOMConfiguration parameter name.
+     * @param value An Object contaiing the parameters value to set.
+     */
+    public void setParameter(String name, Object value) throws DOMException {
+        // If the value is a boolean
+        if (value instanceof Boolean) {
+            boolean state = ((Boolean) value).booleanValue();
+
+            if (name.equalsIgnoreCase(DOMConstants.DOM_COMMENTS)) {
+                fFeatures = state ? fFeatures | COMMENTS : fFeatures
+                        & ~COMMENTS;
+                // comments
+                if (state) {
+                    fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS
+                            + DOMConstants.DOM_COMMENTS, DOMConstants.DOM3_EXPLICIT_TRUE);
+                } else {
+                    fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS
+                            + DOMConstants.DOM_COMMENTS, DOMConstants.DOM3_EXPLICIT_FALSE);
+                }
+            } else if (name.equalsIgnoreCase(DOMConstants.DOM_CDATA_SECTIONS)) {
+                fFeatures =  state ? fFeatures | CDATA : fFeatures
+                        & ~CDATA;
+                // cdata-sections
+                if (state) {
+                    fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS
+                            + DOMConstants.DOM_CDATA_SECTIONS, DOMConstants.DOM3_EXPLICIT_TRUE);
+                } else {
+                    fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS
+                            + DOMConstants.DOM_CDATA_SECTIONS, DOMConstants.DOM3_EXPLICIT_FALSE);
+                }
+            } else if (name.equalsIgnoreCase(DOMConstants.DOM_ENTITIES)) {
+                fFeatures = state ? fFeatures | ENTITIES : fFeatures
+                        & ~ENTITIES;
+                // entities
+                if (state) {
+                    fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS
+                            + DOMConstants.DOM_ENTITIES, DOMConstants.DOM3_EXPLICIT_TRUE);
+                    fDOMConfigProperties.setProperty(
+                            OutputPropertiesFactory.S_KEY_ENTITIES, DOMConstants.S_XSL_VALUE_ENTITIES);
+                } else {
+                    fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS
+                            + DOMConstants.DOM_ENTITIES, DOMConstants.DOM3_EXPLICIT_FALSE);
+                }
+            } else if (name.equalsIgnoreCase(DOMConstants.DOM_NAMESPACES)) {
+                fFeatures = state ? fFeatures | NAMESPACES : fFeatures
+                        & ~NAMESPACES;
+                // namespaces
+                if (state) {
+                    fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS
+                            + DOMConstants.DOM_NAMESPACES, DOMConstants.DOM3_EXPLICIT_TRUE);
+                } else {
+                    fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS
+                            + DOMConstants.DOM_NAMESPACES, DOMConstants.DOM3_EXPLICIT_FALSE);
+                }
+            } else if (name
+                    .equalsIgnoreCase(DOMConstants.DOM_NAMESPACE_DECLARATIONS)) {
+                fFeatures = state ? fFeatures | NAMESPACEDECLS
+                        : fFeatures & ~NAMESPACEDECLS;
+                // namespace-declarations
+                if (state) {
+                    fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS
+                            + DOMConstants.DOM_NAMESPACE_DECLARATIONS, DOMConstants.DOM3_EXPLICIT_TRUE);
+                } else {
+                    fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS
+                            + DOMConstants.DOM_NAMESPACE_DECLARATIONS, DOMConstants.DOM3_EXPLICIT_FALSE);
+                }
+            } else if (name.equalsIgnoreCase(DOMConstants.DOM_SPLIT_CDATA)) {
+                fFeatures = state ? fFeatures | SPLITCDATA : fFeatures
+                        & ~SPLITCDATA;
+                // split-cdata-sections
+                if (state) {
+                    fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS
+                            + DOMConstants.DOM_SPLIT_CDATA, DOMConstants.DOM3_EXPLICIT_TRUE);
+                } else {
+                    fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS
+                            + DOMConstants.DOM_SPLIT_CDATA, DOMConstants.DOM3_EXPLICIT_FALSE);
+                }
+            } else if (name.equalsIgnoreCase(DOMConstants.DOM_WELLFORMED)) {
+                fFeatures = state ? fFeatures | WELLFORMED : fFeatures
+                        & ~WELLFORMED;
+                // well-formed
+                if (state) {
+                    fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS
+                            + DOMConstants.DOM_WELLFORMED, DOMConstants.DOM3_EXPLICIT_TRUE);
+                } else {
+                    fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS
+                            + DOMConstants.DOM_WELLFORMED, DOMConstants.DOM3_EXPLICIT_FALSE);
+                }
+            } else if (name
+                    .equalsIgnoreCase(DOMConstants.DOM_DISCARD_DEFAULT_CONTENT)) {
+                fFeatures = state ? fFeatures | DISCARDDEFAULT
+                        : fFeatures & ~DISCARDDEFAULT;
+                // discard-default-content
+                if (state) {
+                    fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS
+                            + DOMConstants.DOM_DISCARD_DEFAULT_CONTENT, DOMConstants.DOM3_EXPLICIT_TRUE);
+                } else {
+                    fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS
+                            + DOMConstants.DOM_DISCARD_DEFAULT_CONTENT, DOMConstants.DOM3_EXPLICIT_FALSE);
+                }
+            } else if (name.equalsIgnoreCase(DOMConstants.DOM_FORMAT_PRETTY_PRINT)) {
+                fFeatures = state ? fFeatures | PRETTY_PRINT : fFeatures
+                        & ~PRETTY_PRINT;
+                if (state) {
+                    fDOMConfigProperties.setProperty(DOMConstants.S_XSL_OUTPUT_INDENT,DOMConstants.DOM3_EXPLICIT_TRUE);
+                    fDOMConfigProperties.setProperty(OutputPropertiesFactory.S_KEY_INDENT_AMOUNT, Integer.toString(4));
+                } else {
+                    fDOMConfigProperties.setProperty(DOMConstants.S_XSL_OUTPUT_INDENT,DOMConstants.DOM3_EXPLICIT_FALSE);
+                }
+            } else if (name.equalsIgnoreCase(DOMConstants.DOM_XMLDECL)) {
+                fFeatures = state ? fFeatures | XMLDECL : fFeatures
+                        & ~XMLDECL;
+                if (state) {
+                    fDOMConfigProperties.setProperty(DOMConstants.S_XSL_OUTPUT_OMIT_XML_DECL, "no");
+                } else {
+                    fDOMConfigProperties.setProperty(DOMConstants.S_XSL_OUTPUT_OMIT_XML_DECL, "yes");
+                }
+            } else if (name.equalsIgnoreCase(DOMConstants.DOM_ELEMENT_CONTENT_WHITESPACE)) {
+                fFeatures = state ? fFeatures | ELEM_CONTENT_WHITESPACE : fFeatures
+                        & ~ELEM_CONTENT_WHITESPACE;
+                // element-content-whitespace
+                if (state) {
+                    fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS
+                            + DOMConstants.DOM_ELEMENT_CONTENT_WHITESPACE, DOMConstants.DOM3_EXPLICIT_TRUE);
+                } else {
+                    fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS
+                            + DOMConstants.DOM_ELEMENT_CONTENT_WHITESPACE, DOMConstants.DOM3_EXPLICIT_FALSE);
+                }
+            } else if (name.equalsIgnoreCase(DOMConstants.DOM_IGNORE_UNKNOWN_CHARACTER_DENORMALIZATIONS)) {
+                // false is not supported
+                if (!state) {
+                    // Here we have to add the Xalan specific DOM Message Formatter
+                    String msg = Utils.messages.createMessage(
+                            MsgKey.ER_FEATURE_NOT_SUPPORTED,
+                            new Object[] { name });
+                    throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
+                } else {
+                    fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS
+                            + DOMConstants.DOM_IGNORE_UNKNOWN_CHARACTER_DENORMALIZATIONS, DOMConstants.DOM3_EXPLICIT_TRUE);
+                }
+            } else if (name.equalsIgnoreCase(DOMConstants.DOM_CANONICAL_FORM)
+                    || name.equalsIgnoreCase(DOMConstants.DOM_VALIDATE_IF_SCHEMA)
+                    || name.equalsIgnoreCase(DOMConstants.DOM_VALIDATE)
+                    || name.equalsIgnoreCase(DOMConstants.DOM_CHECK_CHAR_NORMALIZATION)
+                    || name.equalsIgnoreCase(DOMConstants.DOM_DATATYPE_NORMALIZATION)
+                    // || name.equalsIgnoreCase(DOMConstants.DOM_NORMALIZE_CHARACTERS)
+                    ) {
+                // true is not supported
+                if (state) {
+                    String msg = Utils.messages.createMessage(
+                            MsgKey.ER_FEATURE_NOT_SUPPORTED,
+                            new Object[] { name });
+                    throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
+                } else {
+                    if (name.equalsIgnoreCase(DOMConstants.DOM_CANONICAL_FORM)) {
+                        fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS
+                                + DOMConstants.DOM_CANONICAL_FORM, DOMConstants.DOM3_EXPLICIT_FALSE);
+                    } else if (name.equalsIgnoreCase(DOMConstants.DOM_VALIDATE_IF_SCHEMA)) {
+                        fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS
+                                + DOMConstants.DOM_VALIDATE_IF_SCHEMA, DOMConstants.DOM3_EXPLICIT_FALSE);
+                    } else if (name.equalsIgnoreCase(DOMConstants.DOM_VALIDATE)) {
+                        fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS
+                                + DOMConstants.DOM_VALIDATE, DOMConstants.DOM3_EXPLICIT_FALSE);
+                    } else if (name.equalsIgnoreCase(DOMConstants.DOM_VALIDATE_IF_SCHEMA)) {
+                        fDOMConfigProperties.setProperty(DOMConstants.DOM_CHECK_CHAR_NORMALIZATION
+                                + DOMConstants.DOM_CHECK_CHAR_NORMALIZATION, DOMConstants.DOM3_EXPLICIT_FALSE);
+                    } else if (name.equalsIgnoreCase(DOMConstants.DOM_DATATYPE_NORMALIZATION)) {
+                        fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS
+                                + DOMConstants.DOM_DATATYPE_NORMALIZATION, DOMConstants.DOM3_EXPLICIT_FALSE);
+                    } /* else if (name.equalsIgnoreCase(DOMConstants.DOM_NORMALIZE_CHARACTERS)) {
+                        fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS
+                                + DOMConstants.DOM_NORMALIZE_CHARACTERS, DOMConstants.DOM3_EXPLICIT_FALSE);
+                    } */
+                }
+            } else if (name.equalsIgnoreCase(DOMConstants.DOM_INFOSET)) {
+                if (state) {
+                    fFeatures &= ~ENTITIES;
+                    fFeatures &= ~CDATA;
+                    fFeatures &= ~SCHEMAVALIDATE;
+                    fFeatures &= ~DTNORMALIZE;
+                    fFeatures |= NAMESPACES;
+                    fFeatures |= NAMESPACEDECLS;
+                    fFeatures |= WELLFORMED;
+                    fFeatures |= ELEM_CONTENT_WHITESPACE;
+                    fFeatures |= COMMENTS;
+                }
+
+                // infoset
+                fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS
+                        + DOMConstants.DOM_NAMESPACES, DOMConstants.DOM3_EXPLICIT_TRUE);
+                fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS
+                        + DOMConstants.DOM_NAMESPACE_DECLARATIONS, DOMConstants.DOM3_EXPLICIT_TRUE);
+                fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS
+                        + DOMConstants.DOM_COMMENTS, DOMConstants.DOM3_EXPLICIT_TRUE);
+                fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS
+                        + DOMConstants.DOM_ELEMENT_CONTENT_WHITESPACE, DOMConstants.DOM3_EXPLICIT_TRUE);
+                fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS
+                        + DOMConstants.DOM_WELLFORMED, DOMConstants.DOM3_EXPLICIT_TRUE);
+
+                fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS
+                        + DOMConstants.DOM_ENTITIES, DOMConstants.DOM3_EXPLICIT_FALSE);
+                fDOMConfigProperties.setProperty(
+                        OutputPropertiesFactory.S_KEY_ENTITIES, "");
+
+                fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS
+                        + DOMConstants.DOM_CDATA_SECTIONS, DOMConstants.DOM3_EXPLICIT_FALSE);
+                fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS
+                        + DOMConstants.DOM_VALIDATE_IF_SCHEMA, DOMConstants.DOM3_EXPLICIT_FALSE);
+                fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS
+                        + DOMConstants.DOM_DATATYPE_NORMALIZATION, DOMConstants.DOM3_EXPLICIT_FALSE);
+            } else if (name.equalsIgnoreCase(DOMConstants.DOM_NORMALIZE_CHARACTERS)) {
+                String msg = Utils.messages.createMessage(
+                    MsgKey.ER_FEATURE_NOT_SUPPORTED,
+                    new Object[] { name });
+                throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
+            } else {
+                // Setting this to false has no effect
+            }
+        } // If the parameter value is not a boolean
+        else if (name.equalsIgnoreCase(DOMConstants.DOM_ERROR_HANDLER)) {
+            if (value == null || value instanceof DOMErrorHandler) {
+                fDOMErrorHandler = (DOMErrorHandler)value;
+            } else {
+                String msg = Utils.messages.createMessage(
+                        MsgKey.ER_TYPE_MISMATCH_ERR,
+                        new Object[] { name });
+                throw new DOMException(DOMException.TYPE_MISMATCH_ERR, msg);
+            }
+        } else if (
+                name.equalsIgnoreCase(DOMConstants.DOM_SCHEMA_LOCATION)
+                || name.equalsIgnoreCase(DOMConstants.DOM_SCHEMA_TYPE)
+                || name.equalsIgnoreCase(DOMConstants.DOM_NORMALIZE_CHARACTERS)
+                && value != null) {
+            String msg = Utils.messages.createMessage(
+                    MsgKey.ER_FEATURE_NOT_SUPPORTED,
+                    new Object[] { name });
+            throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
+        } else {
+            String msg = Utils.messages.createMessage(
+                    MsgKey.ER_FEATURE_NOT_FOUND,
+                    new Object[] { name });
+            throw new DOMException(DOMException.NOT_FOUND_ERR, msg);
+        }
+    }
+    // ************************************************************************
+
+
+    // ************************************************************************
+    // DOMConfiguraiton implementation
+    // ************************************************************************
+
+    /**
+     * Returns the DOMConfiguration of the LSSerializer.
+     *
+     * @see org.w3c.dom.ls.LSSerializer#getDomConfig()
+     * @since DOM Level 3
+     * @return A DOMConfiguration object.
+     */
+    public DOMConfiguration getDomConfig() {
+        return (DOMConfiguration)this;
+    }
+
+    /**
+     * Returns the DOMConfiguration of the LSSerializer.
+     *
+     * @see org.w3c.dom.ls.LSSerializer#getFilter()
+     * @since DOM Level 3
+     * @return A LSSerializerFilter object.
+     */
+    public LSSerializerFilter getFilter() {
+        return fSerializerFilter;
+    }
+
+    /**
+     * Returns the End-Of-Line sequence of characters to be used in the XML
+     * being serialized.  If none is set a default "\n" is returned.
+     *
+     * @see org.w3c.dom.ls.LSSerializer#getNewLine()
+     * @since DOM Level 3
+     * @return A String containing the end-of-line character sequence  used in
+     * serialization.
+     */
+    public String getNewLine() {
+        return fEndOfLine;
+    }
+
+    /**
+     * Set a LSSerilizerFilter on the LSSerializer.  When set, the filter is
+     * called before each node is serialized which depending on its implemention
+     * determines if the node is to be serialized or not.
+     *
+     * @see org.w3c.dom.ls.LSSerializer#setFilter
+     * @since DOM Level 3
+     * @param filter A LSSerializerFilter to be applied to the stream to serialize.
+     */
+    public void setFilter(LSSerializerFilter filter) {
+        fSerializerFilter = filter;
+    }
+
+    /**
+     * Sets the End-Of-Line sequence of characters to be used in the XML
+     * being serialized.  Setting this attribute to null will reset its
+     * value to the default value i.e. "\n".
+     *
+     * @see org.w3c.dom.ls.LSSerializer#setNewLine
+     * @since DOM Level 3
+     * @param newLine a String that is the end-of-line character sequence to be used in
+     * serialization.
+     */
+    public void setNewLine(String newLine) {
+        fEndOfLine = newLine !=null? newLine: fEndOfLine;
+    }
+
+    /**
+     * Serializes the specified node to the specified LSOutput and returns true if the Node
+     * was successfully serialized.
+     *
+     * @see org.w3c.dom.ls.LSSerializer#write(org.w3c.dom.Node, org.w3c.dom.ls.LSOutput)
+     * @since DOM Level 3
+     * @param nodeArg The Node to serialize.
+     * @throws org.w3c.dom.ls.LSException SERIALIZE_ERR: Raised if the
+     * LSSerializer was unable to serialize the node.
+     *
+     */
+    public boolean write(Node nodeArg, LSOutput destination) throws LSException {
+        // If the destination is null
+        if (destination == null) {
+            String msg = Utils.messages
+            .createMessage(
+                    MsgKey.ER_NO_OUTPUT_SPECIFIED,
+                    null);
+            if (fDOMErrorHandler != null) {
+                fDOMErrorHandler.handleError(new DOMErrorImpl(
+                        DOMError.SEVERITY_FATAL_ERROR, msg,
+                        MsgKey.ER_NO_OUTPUT_SPECIFIED));
+            }
+            throw new LSException(LSException.SERIALIZE_ERR, msg);
+        }
+
+        // If nodeArg is null, return false.  Should we throw and LSException instead?
+        if (nodeArg == null ) {
+            return false;
+        }
+
+        // Obtain a reference to the serializer to use
+        // Serializer serializer = getXMLSerializer(xmlVersion);
+        Serializer serializer = fXMLSerializer;
+        serializer.reset();
+
+        // If the node has not been seen
+        if ( nodeArg != fVisitedNode) {
+            // Determine the XML Document version of the Node
+            String xmlVersion = getXMLVersion(nodeArg);
+
+            // Determine the encoding: 1.LSOutput.encoding, 2.Document.inputEncoding, 3.Document.xmlEncoding.
+            fEncoding = destination.getEncoding();
+            if (fEncoding == null ) {
+                fEncoding = getInputEncoding(nodeArg);
+                fEncoding = fEncoding != null ? fEncoding : getXMLEncoding(nodeArg) == null? "UTF-8": getXMLEncoding(nodeArg);
+            }
+
+            // If the encoding is not recognized throw an exception.
+            // Note: The serializer defaults to UTF-8 when created
+            if (!Encodings.isRecognizedEncoding(fEncoding)) {
+                String msg = Utils.messages
+                .createMessage(
+                        MsgKey.ER_UNSUPPORTED_ENCODING,
+                        null);
+                if (fDOMErrorHandler != null) {
+                    fDOMErrorHandler.handleError(new DOMErrorImpl(
+                            DOMError.SEVERITY_FATAL_ERROR, msg,
+                            MsgKey.ER_UNSUPPORTED_ENCODING));
+                }
+                throw new LSException(LSException.SERIALIZE_ERR, msg);
+            }
+
+            serializer.getOutputFormat().setProperty("version", xmlVersion);
+
+            // Set the output encoding and xml version properties
+            fDOMConfigProperties.setProperty(DOMConstants.S_XERCES_PROPERTIES_NS + DOMConstants.S_XML_VERSION, xmlVersion);
+            fDOMConfigProperties.setProperty(DOMConstants.S_XSL_OUTPUT_ENCODING, fEncoding);
+
+            // If the node to be serialized is not a Document, Element, or Entity
+            // node
+            // then the XML declaration, or text declaration, should be never be
+            // serialized.
+            if ( (nodeArg.getNodeType() != Node.DOCUMENT_NODE
+                    || nodeArg.getNodeType() != Node.ELEMENT_NODE
+                    || nodeArg.getNodeType() != Node.ENTITY_NODE)
+                    && ((fFeatures & XMLDECL) != 0)) {
+                fDOMConfigProperties.setProperty(
+                        DOMConstants.S_XSL_OUTPUT_OMIT_XML_DECL,
+                        DOMConstants.DOM3_DEFAULT_FALSE);
+            }
+
+            fVisitedNode = nodeArg;
+        }
+
+        // Update the serializer properties
+        fXMLSerializer.setOutputFormat(fDOMConfigProperties);
+
+        //
+        try {
+
+            // The LSSerializer will use the LSOutput object to determine
+            // where to serialize the output to in the following order the
+            // first one that is not null and not an empty string will be
+            // used: 1.LSOutput.characterStream, 2.LSOutput.byteStream,
+            // 3. LSOutput.systemId
+            // 1.LSOutput.characterStream
+            Writer writer = destination.getCharacterStream();
+            if (writer == null ) {
+
+                // 2.LSOutput.byteStream
+                OutputStream outputStream = destination.getByteStream();
+                if ( outputStream == null) {
+
+                    // 3. LSOutput.systemId
+                    String uri = destination.getSystemId();
+                    if (uri == null) {
+                        String msg = Utils.messages
+                        .createMessage(
+                                MsgKey.ER_NO_OUTPUT_SPECIFIED,
+                                null);
+                        if (fDOMErrorHandler != null) {
+                            fDOMErrorHandler.handleError(new DOMErrorImpl(
+                                    DOMError.SEVERITY_FATAL_ERROR, msg,
+                                    MsgKey.ER_NO_OUTPUT_SPECIFIED));
+                        }
+                        throw new LSException(LSException.SERIALIZE_ERR, msg);
+
+                    } else {
+                        // Expand the System Id and obtain an absolute URI for it.
+                        String absoluteURI = SystemIDResolver.getAbsoluteURI(uri);
+
+                        URL url = new URL(absoluteURI);
+                        OutputStream urlOutStream = null;
+                        String protocol = url.getProtocol();
+                        String host = url.getHost();
+
+                        // For file protocols, there is no need to use a URL to get its
+                        // corresponding OutputStream
+
+                        // Scheme names consist of a sequence of characters. The lower case
+                        // letters "a"--"z", digits, and the characters plus ("+"), period
+                        // ("."), and hyphen ("-") are allowed. For resiliency, programs
+                        // interpreting URLs should treat upper case letters as equivalent to
+                        // lower case in scheme names (e.g., allow "HTTP" as well as "http").
+                        if (protocol.equalsIgnoreCase("file")
+                                && (host == null || host.length() == 0 || host.equals("localhost"))) {
+                            // do we also need to check for host.equals(hostname)
+                            urlOutStream = new FileOutputStream(new File(url.getPath()));
+
+                        } else {
+                            // This should support URL's whose schemes are mentioned in
+                            // RFC1738 other than file
+
+                            URLConnection urlCon = url.openConnection();
+                            urlCon.setDoInput(false);
+                            urlCon.setDoOutput(true);
+                            urlCon.setUseCaches(false);
+                            urlCon.setAllowUserInteraction(false);
+
+                            // When writing to a HTTP URI, a HTTP PUT is performed.
+                            if (urlCon instanceof HttpURLConnection) {
+                                HttpURLConnection httpCon = (HttpURLConnection) urlCon;
+                                httpCon.setRequestMethod("PUT");
+                            }
+                            urlOutStream = urlCon.getOutputStream();
+                        }
+                        // set the OutputStream to that obtained from the systemId
+                        serializer.setWriter(new OutputStreamWriter(urlOutStream));
+                    }
+                } else {
+                    // 2.LSOutput.byteStream
+                    serializer.setWriter(new OutputStreamWriter(outputStream, fEncoding));
+                }
+            } else {
+                // 1.LSOutput.characterStream
+                serializer.setWriter(writer);
+            }
+
+            // The associated media type by default is set to text/xml on
+            // org.apache.xml.serializer.SerializerBase.
+
+            // Get a reference to the serializer then lets you serilize a DOM
+            // Use this hack till Xalan support JAXP1.3
+            if (fDOMSerializer == null) {
+               fDOMSerializer = (DOM3Serializer)serializer.asDOM3Serializer();
+            }
+
+            // Set the error handler on the DOM3Serializer interface implementation
+            if (fDOMErrorHandler != null) {
+                fDOMSerializer.setErrorHandler(fDOMErrorHandler);
+            }
+
+            // Set the filter on the DOM3Serializer interface implementation
+            if (fSerializerFilter != null) {
+                fDOMSerializer.setNodeFilter(fSerializerFilter);
+            }
+
+            // Set the NewLine character to be used
+            fDOMSerializer.setNewLine(fEndOfLine);
+
+            // Serializer your DOM, where node is an org.w3c.dom.Node
+            // Assuming that Xalan's serializer can serialize any type of DOM node
+            fDOMSerializer.serializeDOM3(nodeArg);
+
+        } catch( UnsupportedEncodingException ue) {
+
+            String msg = Utils.messages
+            .createMessage(
+                    MsgKey.ER_UNSUPPORTED_ENCODING,
+                    null);
+            if (fDOMErrorHandler != null) {
+                fDOMErrorHandler.handleError(new DOMErrorImpl(
+                        DOMError.SEVERITY_FATAL_ERROR, msg,
+                        MsgKey.ER_UNSUPPORTED_ENCODING, ue));
+            }
+            throw new LSException(LSException.SERIALIZE_ERR, ue.getMessage());
+        } catch (LSException lse) {
+            // Rethrow LSException.
+            throw lse;
+        } catch (RuntimeException e) {
+            e.printStackTrace();
+            throw new LSException(LSException.SERIALIZE_ERR, e!=null?e.getMessage():"NULL Exception") ;
+        }  catch (Exception e) {
+            if (fDOMErrorHandler != null) {
+                fDOMErrorHandler.handleError(new DOMErrorImpl(
+                        DOMError.SEVERITY_FATAL_ERROR, e.getMessage(),
+                        null, e));
+            }
+            e.printStackTrace();
+            throw new LSException(LSException.SERIALIZE_ERR, e.toString());
+        }
+        return true;
+    }
+
+    /**
+     * Serializes the specified node and returns a String with the serialized
+     * data to the caller.
+     *
+     * @see org.w3c.dom.ls.LSSerializer#writeToString(org.w3c.dom.Node)
+     * @since DOM Level 3
+     * @param nodeArg The Node to serialize.
+     * @throws org.w3c.dom.ls.LSException SERIALIZE_ERR: Raised if the
+     * LSSerializer was unable to serialize the node.
+     *
+     */
+    public String writeToString(Node nodeArg) throws DOMException, LSException {
+        // return null is nodeArg is null.  Should an Exception be thrown instead?
+        if (nodeArg == null) {
+            return null;
+        }
+
+        // Should we reset the serializer configuration before each write operation?
+        // Obtain a reference to the serializer to use
+        Serializer serializer = fXMLSerializer;
+        serializer.reset();
+
+        if (nodeArg != fVisitedNode){
+            // Determine the XML Document version of the Node
+            String xmlVersion = getXMLVersion(nodeArg);
+
+            serializer.getOutputFormat().setProperty("version", xmlVersion);
+
+            // Set the output encoding and xml version properties
+            fDOMConfigProperties.setProperty(DOMConstants.S_XERCES_PROPERTIES_NS + DOMConstants.S_XML_VERSION, xmlVersion);
+            fDOMConfigProperties.setProperty(DOMConstants.S_XSL_OUTPUT_ENCODING, "UTF-16");
+
+            // If the node to be serialized is not a Document, Element, or Entity
+            // node
+            // then the XML declaration, or text declaration, should be never be
+            // serialized.
+            if  ((nodeArg.getNodeType() != Node.DOCUMENT_NODE
+                    || nodeArg.getNodeType() != Node.ELEMENT_NODE
+                    || nodeArg.getNodeType() != Node.ENTITY_NODE)
+                    && ((fFeatures & XMLDECL) != 0)) {
+                fDOMConfigProperties.setProperty(
+                        DOMConstants.S_XSL_OUTPUT_OMIT_XML_DECL,
+                        DOMConstants.DOM3_DEFAULT_FALSE);
+            }
+
+            fVisitedNode = nodeArg;
+        }
+        // Update the serializer properties
+        fXMLSerializer.setOutputFormat(fDOMConfigProperties);
+
+        // StringWriter to Output to
+        StringWriter output = new StringWriter();
+
+        //
+        try {
+
+            // Set the Serializer's Writer to a StringWriter
+            serializer.setWriter(output);
+
+            // Get a reference to the serializer then lets you serilize a DOM
+            // Use this hack till Xalan support JAXP1.3
+            if (fDOMSerializer == null) {
+                fDOMSerializer = (DOM3Serializer)serializer.asDOM3Serializer();
+            }
+
+            // Set the error handler on the DOM3Serializer interface implementation
+            if (fDOMErrorHandler != null) {
+                fDOMSerializer.setErrorHandler(fDOMErrorHandler);
+            }
+
+            // Set the filter on the DOM3Serializer interface implementation
+            if (fSerializerFilter != null) {
+                fDOMSerializer.setNodeFilter(fSerializerFilter);
+            }
+
+            // Set the NewLine character to be used
+            fDOMSerializer.setNewLine(fEndOfLine);
+
+            // Serializer your DOM, where node is an org.w3c.dom.Node
+            fDOMSerializer.serializeDOM3(nodeArg);
+        } catch (LSException lse) {
+            // Rethrow LSException.
+            throw lse;
+        } catch (RuntimeException e) {
+            e.printStackTrace();
+            throw new LSException(LSException.SERIALIZE_ERR, e.toString());
+        }  catch (Exception e) {
+            if (fDOMErrorHandler != null) {
+                fDOMErrorHandler.handleError(new DOMErrorImpl(
+                        DOMError.SEVERITY_FATAL_ERROR, e.getMessage(),
+                        null, e));
+            }
+            e.printStackTrace();
+            throw new LSException(LSException.SERIALIZE_ERR, e.toString());
+        }
+
+        // return the serialized string
+        return output.toString();
+    }
+
+    /**
+     * Serializes the specified node to the specified URI and returns true if the Node
+     * was successfully serialized.
+     *
+     * @see org.w3c.dom.ls.LSSerializer#writeToURI(org.w3c.dom.Node, String)
+     * @since DOM Level 3
+     * @param nodeArg The Node to serialize.
+     * @throws org.w3c.dom.ls.LSException SERIALIZE_ERR: Raised if the
+     * LSSerializer was unable to serialize the node.
+     *
+     */
+    public boolean writeToURI(Node nodeArg, String uri) throws LSException {
+        // If nodeArg is null, return false.  Should we throw and LSException instead?
+        if (nodeArg == null ) {
+            return false;
+        }
+
+        // Obtain a reference to the serializer to use
+        Serializer serializer = fXMLSerializer;
+        serializer.reset();
+
+        if (nodeArg != fVisitedNode) {
+            // Determine the XML Document version of the Node
+            String xmlVersion = getXMLVersion(nodeArg);
+
+            // Determine the encoding: 1.LSOutput.encoding,
+            // 2.Document.inputEncoding, 3.Document.xmlEncoding.
+            fEncoding = getInputEncoding(nodeArg);
+            if (fEncoding == null ) {
+                fEncoding = fEncoding != null ? fEncoding : getXMLEncoding(nodeArg) == null? "UTF-8": getXMLEncoding(nodeArg);
+            }
+
+            serializer.getOutputFormat().setProperty("version", xmlVersion);
+
+            // Set the output encoding and xml version properties
+            fDOMConfigProperties.setProperty(DOMConstants.S_XERCES_PROPERTIES_NS + DOMConstants.S_XML_VERSION, xmlVersion);
+            fDOMConfigProperties.setProperty(DOMConstants.S_XSL_OUTPUT_ENCODING, fEncoding);
+
+            // If the node to be serialized is not a Document, Element, or Entity
+            // node
+            // then the XML declaration, or text declaration, should be never be
+            // serialized.
+            if ( (nodeArg.getNodeType() != Node.DOCUMENT_NODE
+                    || nodeArg.getNodeType() != Node.ELEMENT_NODE
+                    || nodeArg.getNodeType() != Node.ENTITY_NODE)
+                    && ((fFeatures & XMLDECL) != 0))  {
+                fDOMConfigProperties.setProperty(
+                        DOMConstants.S_XSL_OUTPUT_OMIT_XML_DECL,
+                        DOMConstants.DOM3_DEFAULT_FALSE);
+            }
+
+            fVisitedNode = nodeArg;
+        }
+
+        // Update the serializer properties
+        fXMLSerializer.setOutputFormat(fDOMConfigProperties);
+
+        //
+        try {
+            // If the specified encoding is not supported an
+            // "unsupported-encoding" fatal error is raised. ??
+            if (uri == null) {
+                String msg = Utils.messages.createMessage(
+                        MsgKey.ER_NO_OUTPUT_SPECIFIED, null);
+                if (fDOMErrorHandler != null) {
+                    fDOMErrorHandler.handleError(new DOMErrorImpl(
+                            DOMError.SEVERITY_FATAL_ERROR, msg,
+                            MsgKey.ER_NO_OUTPUT_SPECIFIED));
+                }
+                throw new LSException(LSException.SERIALIZE_ERR, msg);
+
+            } else {
+                // REVISIT: Can this be used to get an absolute expanded URI
+                String absoluteURI = SystemIDResolver.getAbsoluteURI(uri);
+
+                URL url = new URL(absoluteURI);
+                OutputStream urlOutStream = null;
+                String protocol = url.getProtocol();
+                String host = url.getHost();
+
+                // For file protocols, there is no need to use a URL to get its
+                // corresponding OutputStream
+
+                // Scheme names consist of a sequence of characters. The lower
+                // case letters "a"--"z", digits, and the characters plus ("+"),
+                // period ("."), and hyphen ("-") are allowed. For resiliency,
+                // programs interpreting URLs should treat upper case letters as
+                // equivalent to lower case in scheme names
+                // (e.g., allow "HTTP" as well as "http").
+                if (protocol.equalsIgnoreCase("file")
+                        && (host == null || host.length() == 0 || host
+                                .equals("localhost"))) {
+                    // do we also need to check for host.equals(hostname)
+                    urlOutStream = new FileOutputStream(new File(url.getPath()));
+
+                } else {
+                    // This should support URL's whose schemes are mentioned in
+                    // RFC1738 other than file
+
+                    URLConnection urlCon = url.openConnection();
+                    urlCon.setDoInput(false);
+                    urlCon.setDoOutput(true);
+                    urlCon.setUseCaches(false);
+                    urlCon.setAllowUserInteraction(false);
+
+                    // When writing to a HTTP URI, a HTTP PUT is performed.
+                    if (urlCon instanceof HttpURLConnection) {
+                        HttpURLConnection httpCon = (HttpURLConnection) urlCon;
+                        httpCon.setRequestMethod("PUT");
+                    }
+                    urlOutStream = urlCon.getOutputStream();
+                }
+                // set the OutputStream to that obtained from the systemId
+                serializer.setWriter(new OutputStreamWriter(urlOutStream, fEncoding));
+            }
+
+            // Get a reference to the serializer then lets you serilize a DOM
+            // Use this hack till Xalan support JAXP1.3
+            if (fDOMSerializer == null) {
+                fDOMSerializer = (DOM3Serializer)serializer.asDOM3Serializer();
+            }
+
+            // Set the error handler on the DOM3Serializer interface implementation
+            if (fDOMErrorHandler != null) {
+                fDOMSerializer.setErrorHandler(fDOMErrorHandler);
+            }
+
+            // Set the filter on the DOM3Serializer interface implementation
+            if (fSerializerFilter != null) {
+                fDOMSerializer.setNodeFilter(fSerializerFilter);
+            }
+
+            // Set the NewLine character to be used
+            fDOMSerializer.setNewLine(fEndOfLine);
+
+            // Serializer your DOM, where node is an org.w3c.dom.Node
+            // Assuming that Xalan's serializer can serialize any type of DOM
+            // node
+            fDOMSerializer.serializeDOM3(nodeArg);
+
+        } catch (LSException lse) {
+            // Rethrow LSException.
+            throw lse;
+        } catch (RuntimeException e) {
+            e.printStackTrace();
+            throw new LSException(LSException.SERIALIZE_ERR, e.toString());
+        }  catch (Exception e) {
+            if (fDOMErrorHandler != null) {
+                fDOMErrorHandler.handleError(new DOMErrorImpl(
+                        DOMError.SEVERITY_FATAL_ERROR, e.getMessage(),
+                        null, e));
+            }
+            e.printStackTrace();
+            throw new LSException(LSException.SERIALIZE_ERR, e.toString());
+        }
+
+        return true;
+    }
+    // ************************************************************************
+
+
+    // ************************************************************************
+    // Implementaion methods
+    // ************************************************************************
+
+    /**
+     * Determines the XML Version of the Document Node to serialize.  If the Document Node
+     * is not a DOM Level 3 Node, then the default version returned is 1.0.
+     *
+     * @param  nodeArg The Node to serialize
+     * @return A String containing the version pseudo-attribute of the XMLDecl.
+     * @throws Throwable if the DOM implementation does not implement Document.getXmlVersion()
+     */
+    //protected String getXMLVersion(Node nodeArg) throws Throwable {
+    protected String getXMLVersion(Node nodeArg) {
+        Document doc = null;
+
+        // Determine the XML Version of the document
+        if (nodeArg != null) {
+            if (nodeArg.getNodeType() == Node.DOCUMENT_NODE) {
+                // The Document node is the Node argument
+                doc = (Document)nodeArg;
+            } else {
+                // The Document node is the Node argument's ownerDocument
+                doc = nodeArg.getOwnerDocument();
+            }
+
+            // Determine the DOM Version.
+            if (doc != null && doc.getImplementation().hasFeature("Core","3.0")) {
+                try {
+                    return doc.getXmlVersion();
+                } catch (AbstractMethodError e) {
+                    //ignore, impl does not support the method
+                }
+            }
+        }
+        // The version will be treated as "1.0" which may result in
+        // an ill-formed document being serialized.
+        // If nodeArg does not have an ownerDocument, treat this as XML 1.0
+        return "1.0";
+    }
+
+    /**
+     * Determines the XML Encoding of the Document Node to serialize.  If the Document Node
+     * is not a DOM Level 3 Node, then the default encoding "UTF-8" is returned.
+     *
+     * @param  nodeArg The Node to serialize
+     * @return A String containing the encoding pseudo-attribute of the XMLDecl.
+     * @throws Throwable if the DOM implementation does not implement Document.getXmlEncoding()
+     */
+    protected String getXMLEncoding(Node nodeArg) {
+        Document doc = null;
+
+        // Determine the XML Encoding of the document
+        if (nodeArg != null) {
+            if (nodeArg.getNodeType() == Node.DOCUMENT_NODE) {
+                // The Document node is the Node argument
+                doc = (Document)nodeArg;
+            } else {
+                // The Document node is the Node argument's ownerDocument
+                doc = nodeArg.getOwnerDocument();
+            }
+
+            // Determine the XML Version.
+            if (doc != null && doc.getImplementation().hasFeature("Core","3.0")) {
+                return doc.getXmlEncoding();
+            }
+        }
+        // The default encoding is UTF-8 except for the writeToString method
+        return "UTF-8";
+    }
+
+    /**
+     * Determines the Input Encoding of the Document Node to serialize.  If the Document Node
+     * is not a DOM Level 3 Node, then null is returned.
+     *
+     * @param  nodeArg The Node to serialize
+     * @return A String containing the input encoding.
+     */
+    protected String getInputEncoding(Node nodeArg)  {
+        Document doc = null;
+
+        // Determine the Input Encoding of the document
+        if (nodeArg != null) {
+            if (nodeArg.getNodeType() == Node.DOCUMENT_NODE) {
+                // The Document node is the Node argument
+                doc = (Document)nodeArg;
+            } else {
+                // The Document node is the Node argument's ownerDocument
+                doc = nodeArg.getOwnerDocument();
+            }
+
+            // Determine the DOM Version.
+            if (doc != null && doc.getImplementation().hasFeature("Core","3.0")) {
+                return doc.getInputEncoding();
+            }
+        }
+        // The default encoding returned is null
+        return null;
+    }
+
+    /**
+     * This method returns the LSSerializer's error handler.
+     *
+     * @return Returns the fDOMErrorHandler.
+     */
+    public DOMErrorHandler getErrorHandler() {
+        return fDOMErrorHandler;
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/dom3/NamespaceSupport.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,315 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the  "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/*
+ * $Id:  $
+ */
+
+package com.sun.org.apache.xml.internal.serializer.dom3;
+
+import java.util.Enumeration;
+import java.util.NoSuchElementException;
+
+/**
+ * Namespace support for XML document handlers. This class doesn't
+ * perform any error checking and assumes that all strings passed
+ * as arguments to methods are unique symbols. The SymbolTable class
+ * can be used for this purpose.
+ *
+ * Derived from org.apache.xerces.util.NamespaceSupport
+ *
+ * @author Andy Clark, IBM
+ *
+ * @version $Id: Exp $
+ */
+public class NamespaceSupport {
+
+        static final String PREFIX_XML = "xml".intern();
+
+        static final String PREFIX_XMLNS = "xmlns".intern();
+
+    /**
+     * The XML Namespace ("http://www.w3.org/XML/1998/namespace"). This is
+     * the Namespace URI that is automatically mapped to the "xml" prefix.
+     */
+    public final static String XML_URI = "http://www.w3.org/XML/1998/namespace".intern();
+
+    /**
+     * XML Information Set REC
+     * all namespace attributes (including those named xmlns,
+     * whose [prefix] property has no value) have a namespace URI of http://www.w3.org/2000/xmlns/
+     */
+    public final static String XMLNS_URI = "http://www.w3.org/2000/xmlns/".intern();
+
+        //
+    // Data
+    //
+
+    /**
+     * Namespace binding information. This array is composed of a
+     * series of tuples containing the namespace binding information:
+     * &lt;prefix, uri&gt;. The default size can be set to anything
+     * as long as it is a power of 2 greater than 1.
+     *
+     * @see #fNamespaceSize
+     * @see #fContext
+     */
+    protected String[] fNamespace = new String[16 * 2];
+
+    /** The top of the namespace information array. */
+    protected int fNamespaceSize;
+
+    // NOTE: The constructor depends on the initial context size
+    //       being at least 1. -Ac
+
+    /**
+     * Context indexes. This array contains indexes into the namespace
+     * information array. The index at the current context is the start
+     * index of declared namespace bindings and runs to the size of the
+     * namespace information array.
+     *
+     * @see #fNamespaceSize
+     */
+    protected int[] fContext = new int[8];
+
+    /** The current context. */
+    protected int fCurrentContext;
+
+    protected String[] fPrefixes = new String[16];
+
+    //
+    // Constructors
+    //
+
+    /** Default constructor. */
+    public NamespaceSupport() {
+    } // <init>()
+
+    //
+    // Public methods
+    //
+
+        /**
+         * @see org.apache.xerces.xni.NamespaceContext#reset()
+         */
+    public void reset() {
+
+        // reset namespace and context info
+        fNamespaceSize = 0;
+        fCurrentContext = 0;
+        fContext[fCurrentContext] = fNamespaceSize;
+
+        // bind "xml" prefix to the XML uri
+        fNamespace[fNamespaceSize++] = PREFIX_XML;
+        fNamespace[fNamespaceSize++] = XML_URI;
+        // bind "xmlns" prefix to the XMLNS uri
+        fNamespace[fNamespaceSize++] = PREFIX_XMLNS;
+        fNamespace[fNamespaceSize++] = XMLNS_URI;
+        ++fCurrentContext;
+
+    } // reset(SymbolTable)
+
+
+        /**
+         * @see org.apache.xerces.xni.NamespaceContext#pushContext()
+         */
+    public void pushContext() {
+
+        // extend the array, if necessary
+        if (fCurrentContext + 1 == fContext.length) {
+            int[] contextarray = new int[fContext.length * 2];
+            System.arraycopy(fContext, 0, contextarray, 0, fContext.length);
+            fContext = contextarray;
+        }
+
+        // push context
+        fContext[++fCurrentContext] = fNamespaceSize;
+
+    } // pushContext()
+
+
+        /**
+         * @see org.apache.xerces.xni.NamespaceContext#popContext()
+         */
+    public void popContext() {
+        fNamespaceSize = fContext[fCurrentContext--];
+    } // popContext()
+
+        /**
+         * @see org.apache.xerces.xni.NamespaceContext#declarePrefix(String, String)
+         */
+    public boolean declarePrefix(String prefix, String uri) {
+        // ignore "xml" and "xmlns" prefixes
+        if (prefix == PREFIX_XML || prefix == PREFIX_XMLNS) {
+            return false;
+        }
+
+        // see if prefix already exists in current context
+        for (int i = fNamespaceSize; i > fContext[fCurrentContext]; i -= 2) {
+            //if (fNamespace[i - 2] == prefix) {
+                if (fNamespace[i - 2].equals(prefix) )  {
+                // REVISIT: [Q] Should the new binding override the
+                //          previously declared binding or should it
+                //          it be ignored? -Ac
+                // NOTE:    The SAX2 "NamespaceSupport" helper allows
+                //          re-bindings with the new binding overwriting
+                //          the previous binding. -Ac
+                fNamespace[i - 1] = uri;
+                return true;
+            }
+        }
+
+        // resize array, if needed
+        if (fNamespaceSize == fNamespace.length) {
+            String[] namespacearray = new String[fNamespaceSize * 2];
+            System.arraycopy(fNamespace, 0, namespacearray, 0, fNamespaceSize);
+            fNamespace = namespacearray;
+        }
+
+        // bind prefix to uri in current context
+        fNamespace[fNamespaceSize++] = prefix;
+        fNamespace[fNamespaceSize++] = uri;
+
+        return true;
+
+    } // declarePrefix(String,String):boolean
+
+        /**
+         * @see org.apache.xerces.xni.NamespaceContext#getURI(String)
+         */
+    public String getURI(String prefix) {
+
+        // find prefix in current context
+        for (int i = fNamespaceSize; i > 0; i -= 2) {
+            //if (fNamespace[i - 2] == prefix) {
+                if (fNamespace[i - 2].equals(prefix) ) {
+                return fNamespace[i - 1];
+            }
+        }
+
+        // prefix not found
+        return null;
+
+    } // getURI(String):String
+
+
+        /**
+         * @see org.apache.xerces.xni.NamespaceContext#getPrefix(String)
+         */
+    public String getPrefix(String uri) {
+
+        // find uri in current context
+        for (int i = fNamespaceSize; i > 0; i -= 2) {
+            //if (fNamespace[i - 1] == uri) {
+                if (fNamespace[i - 1].equals(uri) ) {
+                //if (getURI(fNamespace[i - 2]) == uri)
+                        if (getURI(fNamespace[i - 2]).equals(uri) )
+                    return fNamespace[i - 2];
+            }
+        }
+
+        // uri not found
+        return null;
+
+    } // getPrefix(String):String
+
+
+        /**
+         * @see org.apache.xerces.xni.NamespaceContext#getDeclaredPrefixCount()
+         */
+    public int getDeclaredPrefixCount() {
+        return (fNamespaceSize - fContext[fCurrentContext]) / 2;
+    } // getDeclaredPrefixCount():int
+
+        /**
+         * @see org.apache.xerces.xni.NamespaceContext#getDeclaredPrefixAt(int)
+         */
+    public String getDeclaredPrefixAt(int index) {
+        return fNamespace[fContext[fCurrentContext] + index * 2];
+    } // getDeclaredPrefixAt(int):String
+
+        /**
+         * @see org.apache.xerces.xni.NamespaceContext#getAllPrefixes()
+         */
+        public Enumeration getAllPrefixes() {
+        int count = 0;
+        if (fPrefixes.length < (fNamespace.length/2)) {
+            // resize prefix array
+            String[] prefixes = new String[fNamespaceSize];
+            fPrefixes = prefixes;
+        }
+        String prefix = null;
+        boolean unique = true;
+        for (int i = 2; i < (fNamespaceSize-2); i += 2) {
+            prefix = fNamespace[i + 2];
+            for (int k=0;k<count;k++){
+                if (fPrefixes[k]==prefix){
+                    unique = false;
+                    break;
+                }
+            }
+            if (unique){
+                fPrefixes[count++] = prefix;
+            }
+            unique = true;
+        }
+                return new Prefixes(fPrefixes, count);
+        }
+
+    protected final class Prefixes implements Enumeration {
+        private String[] prefixes;
+        private int counter = 0;
+        private int size = 0;
+
+                /**
+                 * Constructor for Prefixes.
+                 */
+                public Prefixes(String [] prefixes, int size) {
+                        this.prefixes = prefixes;
+            this.size = size;
+                }
+
+       /**
+                 * @see java.util.Enumeration#hasMoreElements()
+                 */
+                public boolean hasMoreElements() {
+                        return (counter< size);
+                }
+
+                /**
+                 * @see java.util.Enumeration#nextElement()
+                 */
+                public Object nextElement() {
+            if (counter< size){
+                return fPrefixes[counter++];
+            }
+                        throw new NoSuchElementException("Illegal access to Namespace prefixes enumeration.");
+                }
+
+        public String toString(){
+            StringBuffer buf = new StringBuffer();
+            for (int i=0;i<size;i++){
+                buf.append(prefixes[i]);
+                buf.append(" ");
+            }
+
+            return buf.toString();
+        }
+
+}
+
+} // class NamespaceSupport
--- a/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/MsgKey.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/MsgKey.java	Wed Jul 05 19:53:51 2017 +0200
@@ -3,9 +3,11 @@
  * DO NOT REMOVE OR ALTER!
  */
 /*
- * Copyright 2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the  "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
@@ -99,4 +101,36 @@
     public static final String ER_FACTORY_PROPERTY_MISSING = "ER_FACTORY_PROPERTY_MISSING";
     public static final String ER_ENCODING_NOT_SUPPORTED = "ER_ENCODING_NOT_SUPPORTED";
 
+    // DOM Exceptions
+    public static final String ER_FEATURE_NOT_FOUND = "FEATURE_NOT_FOUND";
+    public static final String ER_FEATURE_NOT_SUPPORTED = "FEATURE_NOT_SUPPORTED";
+    public static final String ER_STRING_TOO_LONG = "DOMSTRING_SIZE_ERR";
+    public static final String ER_TYPE_MISMATCH_ERR = "TYPE_MISMATCH_ERR";
+
+    // DOM Level 3 load and save messages
+    public static final String ER_NO_OUTPUT_SPECIFIED = "no-output-specified";
+    public static final String ER_UNSUPPORTED_ENCODING = "unsupported-encoding";
+    public static final String ER_ELEM_UNBOUND_PREFIX_IN_ENTREF = "unbound-prefix-in-entity-reference";
+    public static final String ER_ATTR_UNBOUND_PREFIX_IN_ENTREF = "unbound-prefix-in-entity-reference";
+    public static final String ER_CDATA_SECTIONS_SPLIT = "cdata-sections-splitted";
+    public static final String ER_WF_INVALID_CHARACTER = "wf-invalid-character";
+    public static final String ER_WF_INVALID_CHARACTER_IN_NODE_NAME = "wf-invalid-character-in-node-name";
+
+    // DOM Level 3 Implementation specific Exceptions
+    public static final String ER_UNABLE_TO_SERIALIZE_NODE = "ER_UNABLE_TO_SERIALIZE_NODE";
+    public static final String ER_WARNING_WF_NOT_CHECKED = "ER_WARNING_WF_NOT_CHECKED";
+
+    public static final String ER_WF_INVALID_CHARACTER_IN_COMMENT = "ER_WF_INVALID_CHARACTER_IN_COMMENT";
+    public static final String ER_WF_INVALID_CHARACTER_IN_PI = "ER_WF_INVALID_CHARACTER_IN_PI";
+    public static final String ER_WF_INVALID_CHARACTER_IN_CDATA = "ER_WF_INVALID_CHARACTER_IN_CDATA";
+    public static final String ER_WF_INVALID_CHARACTER_IN_TEXT = "ER_WF_INVALID_CHARACTER_IN_TEXT";
+    public static final String ER_WF_DASH_IN_COMMENT = "ER_WF_DASH_IN_COMMENT";
+    public static final String ER_WF_LT_IN_ATTVAL = "ER_WF_LT_IN_ATTVAL";
+    public static final String ER_WF_REF_TO_UNPARSED_ENT = "ER_WF_REF_TO_UNPARSED_ENT";
+    public static final String ER_WF_REF_TO_EXTERNAL_ENT =  "ER_WF_REF_TO_EXTERNAL_ENT";
+    public static final String ER_NS_PREFIX_CANNOT_BE_BOUND =  "ER_NS_PREFIX_CANNOT_BE_BOUND";
+    public static final String ER_NULL_LOCAL_ELEMENT_NAME = "ER_NULL_LOCAL_ELEMENT_NAME";
+    public static final String ER_NULL_LOCAL_ATTR_NAME = "ER_NULL_LOCAL_ATTR_NAME";
+    public static final String ER_WRITING_INTERNAL_SUBSET = "ER_WRITING_INTERNAL_SUBSET";
+
 }
--- a/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages.java	Wed Jul 05 19:53:51 2017 +0200
@@ -3,9 +3,11 @@
  * DO NOT REMOVE OR ALTER!
  */
 /*
- * Copyright 2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the  "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
@@ -200,6 +202,97 @@
             {   MsgKey.ER_ENCODING_NOT_SUPPORTED,
                 "Warning:  The encoding ''{0}'' is not supported by the Java runtime." },
 
+             {MsgKey.ER_FEATURE_NOT_FOUND,
+             "The parameter ''{0}'' is not recognized."},
+
+             {MsgKey.ER_FEATURE_NOT_SUPPORTED,
+             "The parameter ''{0}'' is recognized but the requested value cannot be set."},
+
+             {MsgKey.ER_STRING_TOO_LONG,
+             "The resulting string is too long to fit in a DOMString: ''{0}''."},
+
+             {MsgKey.ER_TYPE_MISMATCH_ERR,
+             "The value type for this parameter name is incompatible with the expected value type."},
+
+             {MsgKey.ER_NO_OUTPUT_SPECIFIED,
+             "The output destination for data to be written to was null."},
+
+             {MsgKey.ER_UNSUPPORTED_ENCODING,
+             "An unsupported encoding is encountered."},
+
+             {MsgKey.ER_UNABLE_TO_SERIALIZE_NODE,
+             "The node could not be serialized."},
+
+             {MsgKey.ER_CDATA_SECTIONS_SPLIT,
+             "The CDATA Section contains one or more termination markers ']]>'."},
+
+             {MsgKey.ER_WARNING_WF_NOT_CHECKED,
+                 "An instance of the Well-Formedness checker could not be created.  The well-formed parameter was set to true but well-formedness checking can not be performed."
+             },
+
+             {MsgKey.ER_WF_INVALID_CHARACTER,
+                 "The node ''{0}'' contains invalid XML characters."
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_COMMENT,
+                 "An invalid XML character (Unicode: 0x{0}) was found in the comment."
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_PI,
+                 "An invalid XML character (Unicode: 0x{0}) was found in the processing instructiondata."
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_CDATA,
+                 "An invalid XML character (Unicode: 0x{0}) was found in the contents of the CDATASection."
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_TEXT,
+                 "An invalid XML character (Unicode: 0x{0}) was found in the node''s character data content."
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_NODE_NAME,
+                 "An invalid XML character(s) was found in the {0} node named ''{1}''."
+             },
+
+             { MsgKey.ER_WF_DASH_IN_COMMENT,
+                 "The string \"--\" is not permitted within comments."
+             },
+
+             {MsgKey.ER_WF_LT_IN_ATTVAL,
+                 "The value of attribute \"{1}\" associated with an element type \"{0}\" must not contain the ''<'' character."
+             },
+
+             {MsgKey.ER_WF_REF_TO_UNPARSED_ENT,
+                 "The unparsed entity reference \"&{0};\" is not permitted."
+             },
+
+             {MsgKey.ER_WF_REF_TO_EXTERNAL_ENT,
+                 "The external entity reference \"&{0};\" is not permitted in an attribute value."
+             },
+
+             {MsgKey.ER_NS_PREFIX_CANNOT_BE_BOUND,
+                 "The prefix \"{0}\" can not be bound to namespace \"{1}\"."
+             },
+
+             {MsgKey.ER_NULL_LOCAL_ELEMENT_NAME,
+                 "The local name of element \"{0}\" is null."
+             },
+
+             {MsgKey.ER_NULL_LOCAL_ATTR_NAME,
+                 "The local name of attr \"{0}\" is null."
+             },
+
+             { MsgKey.ER_ELEM_UNBOUND_PREFIX_IN_ENTREF,
+                 "The replacement text of the entity node \"{0}\" contains an element node \"{1}\" with an unbound prefix \"{2}\"."
+             },
+
+             { MsgKey.ER_ATTR_UNBOUND_PREFIX_IN_ENTREF,
+                 "The replacement text of the entity node \"{0}\" contains an attribute node \"{1}\" with an unbound prefix \"{2}\"."
+             },
+
+             { MsgKey.ER_WRITING_INTERNAL_SUBSET,
+                 "An error occured while writing the internal subset."
+             },
 
         };
 
--- a/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_ca.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_ca.java	Wed Jul 05 19:53:51 2017 +0200
@@ -3,9 +3,11 @@
  * DO NOT REMOVE OR ALTER!
  */
 /*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the  "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
@@ -122,7 +124,106 @@
         "Userinfo may not be specified if host is not specified"},
 
       { MsgKey.ER_SCHEME_REQUIRED,
-        "Scheme is required!"}
+        "Scheme is required!"},
+
+      /*
+       * Note to translators:  The words 'Properties' and
+       * 'SerializerFactory' in this message are Java class names
+       * and should not be translated.
+       */
+      {   MsgKey.ER_FACTORY_PROPERTY_MISSING,
+          "L''objecte de propietats passat a SerializerFactory no t\u00e9 cap propietat ''{0}''." },
+
+      {   MsgKey.ER_ENCODING_NOT_SUPPORTED,
+          "Av\u00eds: el temps d''execuci\u00f3 de Java no d\u00f3na suport a la codificaci\u00f3 ''{0}''." },
+
+       {MsgKey.ER_FEATURE_NOT_FOUND,
+       "El par\u00e0metre ''{0}'' no es reconeix."},
+
+       {MsgKey.ER_FEATURE_NOT_SUPPORTED,
+       "El par\u00e0metre ''{0}'' es reconeix per\u00f2 el valor sol\u00b7licitat no es pot establir."},
+
+       {MsgKey.ER_STRING_TOO_LONG,
+       "La cadena resultant \u00e9s massa llarga per cabre en una DOMString: ''{0}''."},
+
+       {MsgKey.ER_TYPE_MISMATCH_ERR,
+       "El tipus de valor per a aquest nom de par\u00e0metre \u00e9s incompatible amb el tipus de valor esperat."},
+
+       {MsgKey.ER_NO_OUTPUT_SPECIFIED,
+       "La destinaci\u00f3 de sortida per a les dades que s'ha d'escriure era nul\u00b7la."},
+
+       {MsgKey.ER_UNSUPPORTED_ENCODING,
+       "S'ha trobat una codificaci\u00f3 no suportada."},
+
+       {MsgKey.ER_UNABLE_TO_SERIALIZE_NODE,
+       "El node no s'ha pogut serialitzat."},
+
+       {MsgKey.ER_CDATA_SECTIONS_SPLIT,
+       "La secci\u00f3 CDATA cont\u00e9 un o m\u00e9s marcadors d'acabament ']]>'."},
+
+       {MsgKey.ER_WARNING_WF_NOT_CHECKED,
+           "No s'ha pogut crear cap inst\u00e0ncia per comprovar si t\u00e9 un format correcte o no. El par\u00e0metre del tipus ben format es va establir en cert, per\u00f2 la comprovaci\u00f3 de format no s'ha pogut realitzar."
+       },
+
+       {MsgKey.ER_WF_INVALID_CHARACTER,
+           "El node ''{0}'' cont\u00e9 car\u00e0cters XML no v\u00e0lids."
+       },
+
+       { MsgKey.ER_WF_INVALID_CHARACTER_IN_COMMENT,
+           "S''ha trobat un car\u00e0cter XML no v\u00e0lid (Unicode: 0x{0}) en el comentari."
+       },
+
+       { MsgKey.ER_WF_INVALID_CHARACTER_IN_PI,
+           "S''ha trobat un car\u00e0cter XML no v\u00e0lid (Unicode: 0x{0}) en les dades d''instrucci\u00f3 de proc\u00e9s."
+       },
+
+       { MsgKey.ER_WF_INVALID_CHARACTER_IN_CDATA,
+           "S''ha trobat un car\u00e0cter XML no v\u00e0lid (Unicode: 0x''{0})'' en els continguts de la CDATASection."
+       },
+
+       { MsgKey.ER_WF_INVALID_CHARACTER_IN_TEXT,
+           "S''ha trobat un car\u00e0cter XML no v\u00e0lid (Unicode: 0x''{0})'' en el contingut de dades de car\u00e0cter del node."
+       },
+
+       { MsgKey.ER_WF_INVALID_CHARACTER_IN_NODE_NAME,
+           "S''han trobat car\u00e0cters XML no v\u00e0lids al node {0} anomenat ''{1}''."
+       },
+
+       { MsgKey.ER_WF_DASH_IN_COMMENT,
+           "La cadena \"--\" no est\u00e0 permesa dins dels comentaris."
+       },
+
+       {MsgKey.ER_WF_LT_IN_ATTVAL,
+           "El valor d''atribut \"{1}\" associat amb un tipus d''element \"{0}\" no pot contenir el car\u00e0cter ''<''."
+       },
+
+       {MsgKey.ER_WF_REF_TO_UNPARSED_ENT,
+           "La refer\u00e8ncia de l''entitat no analitzada \"&{0};\" no est\u00e0 permesa."
+       },
+
+       {MsgKey.ER_WF_REF_TO_EXTERNAL_ENT,
+           "La refer\u00e8ncia externa de l''entitat \"&{0};\" no est\u00e0 permesa en un valor d''atribut."
+       },
+
+       {MsgKey.ER_NS_PREFIX_CANNOT_BE_BOUND,
+           "El prefix \"{0}\" no es pot vincular a l''espai de noms \"{1}\"."
+       },
+
+       {MsgKey.ER_NULL_LOCAL_ELEMENT_NAME,
+           "El nom local de l''element \"{0}\" \u00e9s nul."
+       },
+
+       {MsgKey.ER_NULL_LOCAL_ATTR_NAME,
+           "El nom local d''atr \"{0}\" \u00e9s nul."
+       },
+
+       { MsgKey.ER_ELEM_UNBOUND_PREFIX_IN_ENTREF,
+           "El text de recanvi del node de l''entitat \"{0}\" cont\u00e9 un node d''element \"{1}\" amb un prefix de no enlla\u00e7at \"{2}\"."
+       },
+
+       { MsgKey.ER_ATTR_UNBOUND_PREFIX_IN_ENTREF,
+           "El text de recanvi del node de l''entitat \"{0}\" cont\u00e9 un node d''atribut \"{1}\" amb un prefix de no enlla\u00e7at \"{2}\"."
+       },
 
     };
     return contents;
--- a/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_cs.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_cs.java	Wed Jul 05 19:53:51 2017 +0200
@@ -3,9 +3,11 @@
  * DO NOT REMOVE OR ALTER!
  */
 /*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the  "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
@@ -114,7 +116,106 @@
         "Nen\u00ed-li ur\u010den hostitel, nelze zadat \u00fadaje o u\u017eivateli."},
 
       { MsgKey.ER_SCHEME_REQUIRED,
-        "Je vy\u017eadov\u00e1no sch\u00e9ma!"}
+        "Je vy\u017eadov\u00e1no sch\u00e9ma!"},
+
+      /*
+       * Note to translators:  The words 'Properties' and
+       * 'SerializerFactory' in this message are Java class names
+       * and should not be translated.
+       */
+      {   MsgKey.ER_FACTORY_PROPERTY_MISSING,
+          "Objekt vlastnost\u00ed p\u0159edan\u00fd faktorii SerializerFactory neobsahuje vlastnost ''{0}''. " },
+
+      {   MsgKey.ER_ENCODING_NOT_SUPPORTED,
+          "Varov\u00e1n\u00ed: K\u00f3dov\u00e1n\u00ed ''{0}'' nen\u00ed v b\u011bhov\u00e9m prost\u0159ed\u00ed Java podporov\u00e1no." },
+
+       {MsgKey.ER_FEATURE_NOT_FOUND,
+       "Parametr ''{0}'' nebyl rozpozn\u00e1n."},
+
+       {MsgKey.ER_FEATURE_NOT_SUPPORTED,
+       "Parametr ''{0}'' byl rozpozn\u00e1n, ale nelze nastavit po\u017eadovanou hodnotu."},
+
+       {MsgKey.ER_STRING_TOO_LONG,
+       "V\u00fdsledn\u00fd \u0159et\u011bzec je p\u0159\u00edli\u0161 dlouh\u00fd pro \u0159et\u011bzec DOMString: ''{0}''."},
+
+       {MsgKey.ER_TYPE_MISMATCH_ERR,
+       "Typ hodnoty pro tento n\u00e1zev parametru nen\u00ed kompatibiln\u00ed s o\u010dek\u00e1van\u00fdm typem hodnoty."},
+
+       {MsgKey.ER_NO_OUTPUT_SPECIFIED,
+       "C\u00edlov\u00e9 um\u00edst\u011bn\u00ed v\u00fdstupu pro data ur\u010den\u00e1 k z\u00e1pisu je rovno hodnot\u011b Null. "},
+
+       {MsgKey.ER_UNSUPPORTED_ENCODING,
+       "Bylo nalezeno nepodporovan\u00e9 k\u00f3dov\u00e1n\u00ed."},
+
+       {MsgKey.ER_UNABLE_TO_SERIALIZE_NODE,
+       "Nelze prov\u00e9st serializaci uzlu. "},
+
+       {MsgKey.ER_CDATA_SECTIONS_SPLIT,
+       "Sekce CDATA obsahuje jednu nebo v\u00edce ukon\u010dovac\u00edch zna\u010dek ']]>'."},
+
+       {MsgKey.ER_WARNING_WF_NOT_CHECKED,
+           "Nelze vytvo\u0159it instanci modulu pro kontrolu spr\u00e1vn\u00e9ho utvo\u0159en\u00ed. Parametr spr\u00e1vn\u00e9ho utvo\u0159en\u00ed byl nastaven na hodnotu true, nepoda\u0159ilo se v\u0161ak zkontrolovat spr\u00e1vnost utvo\u0159en\u00ed. "
+       },
+
+       {MsgKey.ER_WF_INVALID_CHARACTER,
+           "Uzel ''{0}'' obsahuje neplatn\u00e9 znaky XML. "
+       },
+
+       { MsgKey.ER_WF_INVALID_CHARACTER_IN_COMMENT,
+           "V pozn\u00e1mce byl zji\u0161t\u011bn neplatn\u00fd znak XML (Unicode: 0x{0})."
+       },
+
+       { MsgKey.ER_WF_INVALID_CHARACTER_IN_PI,
+           "V datech instrukce zpracov\u00e1n\u00ed byl nalezen neplatn\u00fd znak XML (Unicode: 0x{0})."
+       },
+
+       { MsgKey.ER_WF_INVALID_CHARACTER_IN_CDATA,
+           "V odd\u00edlu CDATASection byl nalezen neplatn\u00fd znak XML (Unicode: 0x{0})."
+       },
+
+       { MsgKey.ER_WF_INVALID_CHARACTER_IN_TEXT,
+           "V obsahu znakov\u00fdch dat uzlu byl nalezen neplatn\u00fd znak XML (Unicode: 0x{0})."
+       },
+
+       { MsgKey.ER_WF_INVALID_CHARACTER_IN_NODE_NAME,
+           "V objektu {0} s n\u00e1zvem ''{1}'' byl nalezen neplatn\u00fd znak XML. "
+       },
+
+       { MsgKey.ER_WF_DASH_IN_COMMENT,
+           "V pozn\u00e1mk\u00e1ch nen\u00ed povolen \u0159et\u011bzec \"--\"."
+       },
+
+       {MsgKey.ER_WF_LT_IN_ATTVAL,
+           "Hodnota atributu \"{1}\" souvisej\u00edc\u00edho s typem prvku \"{0}\" nesm\u00ed obsahovat znak ''<''."
+       },
+
+       {MsgKey.ER_WF_REF_TO_UNPARSED_ENT,
+           "Odkaz na neanalyzovanou entitu \"&{0};\" nen\u00ed povolen."
+       },
+
+       {MsgKey.ER_WF_REF_TO_EXTERNAL_ENT,
+           "Extern\u00ed odkaz na entitu \"&{0};\" nen\u00ed v hodnot\u011b atributu povolen."
+       },
+
+       {MsgKey.ER_NS_PREFIX_CANNOT_BE_BOUND,
+           "P\u0159edpona \"{0}\" nesm\u00ed b\u00fdt v\u00e1zan\u00e1 k oboru n\u00e1zv\u016f \"{1}\"."
+       },
+
+       {MsgKey.ER_NULL_LOCAL_ELEMENT_NAME,
+           "Lok\u00e1ln\u00ed n\u00e1zev prvku \"{0}\" m\u00e1 hodnotu Null. "
+       },
+
+       {MsgKey.ER_NULL_LOCAL_ATTR_NAME,
+           "Lok\u00e1ln\u00ed n\u00e1zev atributu \"{0}\" m\u00e1 hodnotu Null. "
+       },
+
+       { MsgKey.ER_ELEM_UNBOUND_PREFIX_IN_ENTREF,
+           "Nov\u00fd text uzlu entity \"{0}\" obsahuje uzel prvku \"{1}\" s nesv\u00e1zanou p\u0159edponou \"{2}\"."
+       },
+
+       { MsgKey.ER_ATTR_UNBOUND_PREFIX_IN_ENTREF,
+           "Nov\u00fd text uzlu entity \"{0}\" obsahuje uzel atributu \"{1}\" s nesv\u00e1zanou p\u0159edponou \"{2}\". "
+       },
 
     };
     return contents;
--- a/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_de.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_de.java	Wed Jul 05 19:53:51 2017 +0200
@@ -3,9 +3,11 @@
  * DO NOT REMOVE OR ALTER!
  */
 /*
- * Copyright 2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the  "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
@@ -200,6 +202,93 @@
             {   MsgKey.ER_ENCODING_NOT_SUPPORTED,
                 "Warnung: Die Codierung \"{0}\" wird nicht von der Java-Laufzeit unterst\u00FCtzt." },
 
+             {MsgKey.ER_FEATURE_NOT_FOUND,
+             "Der Parameter ''{0}'' wird nicht erkannt."},
+
+             {MsgKey.ER_FEATURE_NOT_SUPPORTED,
+             "Der Parameter ''{0}'' wird erkannt, der angeforderte Wert kann jedoch nicht festgelegt werden."},
+
+             {MsgKey.ER_STRING_TOO_LONG,
+             "Die Ergebniszeichenfolge ist zu lang f\u00fcr eine DOM-Zeichenfolge: ''{0}''."},
+
+             {MsgKey.ER_TYPE_MISMATCH_ERR,
+             "Der Werttyp f\u00fcr diesen Parameternamen ist nicht kompatibel mit dem erwarteten Werttyp."},
+
+             {MsgKey.ER_NO_OUTPUT_SPECIFIED,
+             "Das Ausgabeziel f\u00fcr die zu schreibenden Daten war leer."},
+
+             {MsgKey.ER_UNSUPPORTED_ENCODING,
+             "Eine nicht unterst\u00fctzte Codierung wurde festgestellt."},
+
+             {MsgKey.ER_UNABLE_TO_SERIALIZE_NODE,
+             "Der Knoten konnte nicht serialisiert werden."},
+
+             {MsgKey.ER_CDATA_SECTIONS_SPLIT,
+             "Der Abschnitt CDATA enth\u00e4lt mindestens eine Beendigungsmarkierung ']]>'."},
+
+             {MsgKey.ER_WARNING_WF_NOT_CHECKED,
+                 "Eine Instanz des Pr\u00fcfprogramms f\u00fcr korrekte Formatierung konnte nicht erstellt werden.  F\u00fcr den korrekt formatierten Parameter wurde der Wert 'True' festgelegt, die Pr\u00fcfung auf korrekte Formatierung kann jedoch nicht durchgef\u00fchrt werden."
+             },
+
+             {MsgKey.ER_WF_INVALID_CHARACTER,
+                 "Der Knoten ''{0}'' enth\u00e4lt ung\u00fcltige XML-Zeichen."
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_COMMENT,
+                 "Im Kommentar wurde ein ung\u00fcltiges XML-Zeichen (Unicode: 0x{0}) gefunden."
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_PI,
+                 "In der Verarbeitungsanweisung wurde ein ung\u00fcltiges XML-Zeichen (Unicode: 0x{0}) gefunden."
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_CDATA,
+                 "Im Inhalt von CDATASection wurde ein ung\u00fcltiges XML-Zeichen (Unicode: 0x{0}) gefunden."
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_TEXT,
+                 "Ein ung\u00fcltiges XML-Zeichen  (Unicode: 0x{0}) wurde im Inhalt der Zeichendaten des Knotens gefunden."
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_NODE_NAME,
+                 "Ung\u00fcltige XML-Zeichen wurden gefunden in {0} im Knoten ''{1}''."
+             },
+
+             { MsgKey.ER_WF_DASH_IN_COMMENT,
+                 "Die Zeichenfolge \"--\" ist innerhalb von Kommentaren nicht zul\u00e4ssig."
+             },
+
+             {MsgKey.ER_WF_LT_IN_ATTVAL,
+                 "Der Wert des Attributs \"{1}\" mit einem Elementtyp \"{0}\" darf nicht das Zeichen ''<'' enthalten."
+             },
+
+             {MsgKey.ER_WF_REF_TO_UNPARSED_ENT,
+                 "Der syntaktisch nicht analysierte Entit\u00e4tenverweis \"&{0};\" ist nicht zul\u00e4ssig."
+             },
+
+             {MsgKey.ER_WF_REF_TO_EXTERNAL_ENT,
+                 "Der externe Entit\u00e4tenverweis \"&{0};\" ist in einem Attributwert nicht zul\u00e4ssig."
+             },
+
+             {MsgKey.ER_NS_PREFIX_CANNOT_BE_BOUND,
+                 "Das Pr\u00e4fix \"{0}\" kann nicht an den Namensbereich \"{1}\" gebunden werden."
+             },
+
+             {MsgKey.ER_NULL_LOCAL_ELEMENT_NAME,
+                 "Der lokale Name von Element \"{0}\" ist nicht angegeben."
+             },
+
+             {MsgKey.ER_NULL_LOCAL_ATTR_NAME,
+                 "Der lokale Name des Attributs \"{0}\" ist nicht angegeben."
+             },
+
+             { MsgKey.ER_ELEM_UNBOUND_PREFIX_IN_ENTREF,
+                 "Der Ersatztext des Entit\u00e4tenknotens \"{0}\" enth\u00e4lt einen Elementknoten \"{1}\" mit einem nicht gebundenen Pr\u00e4fix \"{2}\"."
+             },
+
+             { MsgKey.ER_ATTR_UNBOUND_PREFIX_IN_ENTREF,
+                 "Der Ersatztext des Entit\u00e4tenknotens \"{0}\" enth\u00e4lt einen Attributknoten \"{1}\" mit einem nicht gebundenen Pr\u00e4fix \"{2}\"."
+             },
 
         };
 
--- a/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_es.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_es.java	Wed Jul 05 19:53:51 2017 +0200
@@ -3,9 +3,11 @@
  * DO NOT REMOVE OR ALTER!
  */
 /*
- * Copyright 2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the  "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
@@ -198,8 +200,95 @@
                 "El objeto de propiedades transferido a SerializerFactory no tiene una propiedad ''{0}''." },
 
             {   MsgKey.ER_ENCODING_NOT_SUPPORTED,
-                "Advertencia: el tiempo de ejecuci\u00F3n de Java no soporta la codificaci\u00F3n ''{0}''." },
+                "Aviso: La codificaci\u00f3n ''{0}'' no est\u00e1 soportada por Java Runtime." },
+
+             {MsgKey.ER_FEATURE_NOT_FOUND,
+             "El par\u00e1metro ''{0}'' no se reconoce."},
+
+             {MsgKey.ER_FEATURE_NOT_SUPPORTED,
+             "Se reconoce el par\u00e1metro ''{0}'' pero no puede establecerse el valor solicitado."},
+
+             {MsgKey.ER_STRING_TOO_LONG,
+             "La serie producida es demasiado larga para ajustarse a DOMString: ''{0}''."},
+
+             {MsgKey.ER_TYPE_MISMATCH_ERR,
+             "El tipo de valor para este nombre de par\u00e1metro es incompatible con el tipo de valor esperado."},
+
+             {MsgKey.ER_NO_OUTPUT_SPECIFIED,
+             "El destino de salida de escritura de los datos es nulo."},
+
+             {MsgKey.ER_UNSUPPORTED_ENCODING,
+             "Se ha encontrado una codificaci\u00f3n no soportada."},
+
+             {MsgKey.ER_UNABLE_TO_SERIALIZE_NODE,
+             "No se ha podido serializar el nodo."},
+
+             {MsgKey.ER_CDATA_SECTIONS_SPLIT,
+             "La secci\u00f3n CDATA contiene uno o m\u00e1s marcadores ']]>' de terminaci\u00f3n."},
+
+             {MsgKey.ER_WARNING_WF_NOT_CHECKED,
+                 "No se ha podido crear una instancia del comprobador de gram\u00e1tica correcta.  El par\u00e1metro well-formed se ha establecido en true pero no se puede realizar la comprobaci\u00f3n de gram\u00e1tica correcta."
+             },
+
+             {MsgKey.ER_WF_INVALID_CHARACTER,
+                 "El nodo ''{0}'' contiene caracteres XML no v\u00e1lidos."
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_COMMENT,
+                 "Se ha encontrado un car\u00e1cter XML no v\u00e1lido (Unicode: 0x{0}) en el comentario."
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_PI,
+                 "Se ha encontrado un car\u00e1cter XML no v\u00e1lido (Unicode: 0x{0}) en los datos de la instrucci\u00f3n de proceso."
+             },
 
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_CDATA,
+                 "Se ha encontrado un car\u00e1cter XML no v\u00e1lido (Unicode: 0x{0}) en el contenido de CDATASection."
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_TEXT,
+                 "Se ha encontrado un car\u00e1cter XML no v\u00e1lido (Unicode: 0x{0}) en el contenido de datos de caracteres del nodo."
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_NODE_NAME,
+                 "Se ha encontrado un car\u00e1cter o caracteres XML no v\u00e1lidos en el nodo {0} denominado ''{1}''."
+             },
+
+             { MsgKey.ER_WF_DASH_IN_COMMENT,
+                 "No se permite la serie \"--\" dentro de los comentarios."
+             },
+
+             {MsgKey.ER_WF_LT_IN_ATTVAL,
+                 "El valor del atributo \"{1}\" asociado a un tipo de elemento \"{0}\" no debe contener el car\u00e1cter ''''<''''."
+             },
+
+             {MsgKey.ER_WF_REF_TO_UNPARSED_ENT,
+                 "No se permite la referencia de entidad no analizada \"&{0};\"."
+             },
+
+             {MsgKey.ER_WF_REF_TO_EXTERNAL_ENT,
+                 "La referencia de entidad externa \"&{0};\" no est\u00e1 permitida en un valor de atributo."
+             },
+
+             {MsgKey.ER_NS_PREFIX_CANNOT_BE_BOUND,
+                 "No se puede encontrar el prefijo \"{0}\" en el espacio de nombres \"{1}\"."
+             },
+
+             {MsgKey.ER_NULL_LOCAL_ELEMENT_NAME,
+                 "El nombre local del elemento \"{0}\" es null."
+             },
+
+             {MsgKey.ER_NULL_LOCAL_ATTR_NAME,
+                 "El nombre local del atributo \"{0}\" es null."
+             },
+
+             { MsgKey.ER_ELEM_UNBOUND_PREFIX_IN_ENTREF,
+                 "El texto de sustituci\u00f3n del nodo de entidad \"{0}\" contiene un nodo de elemento \"{1}\" con un prefijo no enlazado \"{2}\"."
+             },
+
+             { MsgKey.ER_ATTR_UNBOUND_PREFIX_IN_ENTREF,
+                 "El texto de sustituci\u00f3n del nodo de entidad \"{0}\" contiene un nodo de atributo \"{1}\" con un prefijo no enlazado \"{2}\"."
+             },
 
         };
 
--- a/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_fr.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_fr.java	Wed Jul 05 19:53:51 2017 +0200
@@ -3,9 +3,11 @@
  * DO NOT REMOVE OR ALTER!
  */
 /*
- * Copyright 2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the  "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
@@ -200,6 +202,93 @@
             {   MsgKey.ER_ENCODING_NOT_SUPPORTED,
                 "Avertissement : l''encodage ''{0}'' n''est pas pris en charge par l''ex\u00E9cution Java." },
 
+             {MsgKey.ER_FEATURE_NOT_FOUND,
+             "Le param\u00e8tre ''{0}'' n''est pas reconnu."},
+
+             {MsgKey.ER_FEATURE_NOT_SUPPORTED,
+             "Le param\u00e8tre ''{0}'' est reconnu mas la valeur demand\u00e9e ne peut pas \u00eatre d\u00e9finie."},
+
+             {MsgKey.ER_STRING_TOO_LONG,
+             "La cha\u00eene obtenue est trop longue pour un DOMString : ''{0}''."},
+
+             {MsgKey.ER_TYPE_MISMATCH_ERR,
+             "Le type de valeur de ce param\u00e8tre est incompatible avec le type de valeur attendu."},
+
+             {MsgKey.ER_NO_OUTPUT_SPECIFIED,
+             "La sortie de destination des donn\u00e9es \u00e0 \u00e9crire \u00e9tait vide."},
+
+             {MsgKey.ER_UNSUPPORTED_ENCODING,
+             "Codage non pris en charge."},
+
+             {MsgKey.ER_UNABLE_TO_SERIALIZE_NODE,
+             "Le noeud ne peut pas \u00eatre s\u00e9rialis\u00e9."},
+
+             {MsgKey.ER_CDATA_SECTIONS_SPLIT,
+             "La section CDATA contient un ou plusieurs marqueurs de fin ']]>'."},
+
+             {MsgKey.ER_WARNING_WF_NOT_CHECKED,
+                 "Aucune instance du programme de v\u00e9rification de la formation n'a pu \u00eatre cr\u00e9\u00e9e.  La valeur true a \u00e9t\u00e9 attribu\u00e9e au param\u00e8tre well-formed mais la v\u00e9rification de la formation n'a pas pu \u00eatre effectu\u00e9e."
+             },
+
+             {MsgKey.ER_WF_INVALID_CHARACTER,
+                 "Le noeud ''{0}'' contient des caract\u00e8res XML non valides."
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_COMMENT,
+                 "Un caract\u00e8re XML non valide (Unicode : 0x{0}) a \u00e9t\u00e9 trouv\u00e9 dans le commentaire."
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_PI,
+                 "Un caract\u00e8re XML non valide (Unicode : 0x{0}) a \u00e9t\u00e9 trouv\u00e9 dans les donn\u00e9es de l''instruction de traitement."
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_CDATA,
+                 "Un caract\u00e8re XML non valide (Unicode: 0x{0}) a \u00e9t\u00e9 trouv\u00e9 dans le contenu de la CDATASection"
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_TEXT,
+                 "Un caract\u00e8re XML non valide (Unicode : 0x{0}) a \u00e9t\u00e9 trouv\u00e9 dans le contenu des donn\u00e9es de type caract\u00e8res du noeud."
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_NODE_NAME,
+                 "Un ou plusieurs caract\u00e8res non valides ont \u00e9t\u00e9 trouv\u00e9s dans le noeud {0} nomm\u00e9 ''{1}''."
+             },
+
+             { MsgKey.ER_WF_DASH_IN_COMMENT,
+                 "La cha\u00eene \"--\" est interdite dans des commentaires."
+             },
+
+             {MsgKey.ER_WF_LT_IN_ATTVAL,
+                 "La valeur de l''attribut \"{1}\" associ\u00e9 \u00e0 un type d''\u00e9l\u00e9ment \"{0}\" ne doit pas contenir le caract\u00e8re ''<''."
+             },
+
+             {MsgKey.ER_WF_REF_TO_UNPARSED_ENT,
+                 "La r\u00e9f\u00e9rence d''entit\u00e9 non analys\u00e9e \"&{0};\" n''est pas admise."
+             },
+
+             {MsgKey.ER_WF_REF_TO_EXTERNAL_ENT,
+                 "La r\u00e9f\u00e9rence d''entit\u00e9 externe \"&{0};\" n''est pas admise dans une valeur d''attribut."
+             },
+
+             {MsgKey.ER_NS_PREFIX_CANNOT_BE_BOUND,
+                 "Le pr\u00e9fixe \"{0}\" ne peut pas \u00eatre li\u00e9 \u00e0 l''espace de noms \"{1}\"."
+             },
+
+             {MsgKey.ER_NULL_LOCAL_ELEMENT_NAME,
+                 "Le nom local de l''\u00e9l\u00e9ment \"{0}\" a une valeur null."
+             },
+
+             {MsgKey.ER_NULL_LOCAL_ATTR_NAME,
+                 "Le nom local de l''attribut \"{0}\" a une valeur null."
+             },
+
+             { MsgKey.ER_ELEM_UNBOUND_PREFIX_IN_ENTREF,
+                 "le texte de remplacement du noeud de l''entit\u00e9 \"{0}\" contaient un noeud d''\u00e9l\u00e9ment \"{1}\" avec un pr\u00e9fixe non li\u00e9 \"{2}\"."
+             },
+
+             { MsgKey.ER_ATTR_UNBOUND_PREFIX_IN_ENTREF,
+                 "Le texte de remplacement du noeud de l''entit\u00e9 \"{0}\" contient un noeud d''attribut \"{1}\" avec un pr\u00e9fixe non li\u00e9 \"{2}\"."
+             },
 
         };
 
--- a/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_it.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_it.java	Wed Jul 05 19:53:51 2017 +0200
@@ -3,9 +3,11 @@
  * DO NOT REMOVE OR ALTER!
  */
 /*
- * Copyright 2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the  "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
@@ -200,6 +202,93 @@
             {   MsgKey.ER_ENCODING_NOT_SUPPORTED,
                 "Avvertenza: la codifica ''{0}'' non \u00E8 supportata da Java Runtime." },
 
+             {MsgKey.ER_FEATURE_NOT_FOUND,
+             "Il parametro ''{0}'' non \u00e8 riconosciuto."},
+
+             {MsgKey.ER_FEATURE_NOT_SUPPORTED,
+             "Il parametro ''{0}'' \u00e8 riconosciuto ma non \u00e8 possibile impostare il valore richiesto."},
+
+             {MsgKey.ER_STRING_TOO_LONG,
+             "La stringa risultante \u00e8 troppo lunga per essere inserita in DOMString: ''{0}''."},
+
+             {MsgKey.ER_TYPE_MISMATCH_ERR,
+             "Il tipo di valore per questo nome di parametro non \u00e8 compatibile con il tipo di valore previsto."},
+
+             {MsgKey.ER_NO_OUTPUT_SPECIFIED,
+             "La destinazione di output in cui scrivere i dati era nulla."},
+
+             {MsgKey.ER_UNSUPPORTED_ENCODING,
+             "\u00c8 stata rilevata una codifica non supportata."},
+
+             {MsgKey.ER_UNABLE_TO_SERIALIZE_NODE,
+             "Impossibile serializzare il nodo."},
+
+             {MsgKey.ER_CDATA_SECTIONS_SPLIT,
+             "La Sezione CDATA contiene uno o pi\u00f9 markers di termine ']]>'."},
+
+             {MsgKey.ER_WARNING_WF_NOT_CHECKED,
+                 "Impossibile creare un'istanza del controllore Well-Formedness.  Il parametro well-formed \u00e8 stato impostato su true ma non \u00e8 possibile eseguire i controlli well-formedness."
+             },
+
+             {MsgKey.ER_WF_INVALID_CHARACTER,
+                 "Il nodo ''{0}'' contiene caratteri XML non validi."
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_COMMENT,
+                 "Trovato un carattere XML non valido (Unicode: 0x{0}) nel commento."
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_PI,
+                 "Carattere XML non valido (Unicode: 0x{0}) rilevato nell''elaborazione di instructiondata."
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_CDATA,
+                 "Carattere XML non valido (Unicode: 0x{0}) rilevato nel contenuto di CDATASection."
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_TEXT,
+                 "Carattere XML non valido (Unicode: 0x{0}) rilevato nel contenuto dati di caratteri del nodo. "
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_NODE_NAME,
+                 "Carattere XML non valido rilevato nel nodo {0} denominato ''{1}''."
+             },
+
+             { MsgKey.ER_WF_DASH_IN_COMMENT,
+                 "La stringa \"--\" non \u00e8 consentita nei commenti."
+             },
+
+             {MsgKey.ER_WF_LT_IN_ATTVAL,
+                 "Il valore dell''''attributo \"{1}\" associato con un tipo di elemento \"{0}\" non deve contenere il carattere ''<''."
+             },
+
+             {MsgKey.ER_WF_REF_TO_UNPARSED_ENT,
+                 "Il riferimento entit\u00e0 non analizzata \"&{0};\" non \u00e8 permesso."
+             },
+
+             {MsgKey.ER_WF_REF_TO_EXTERNAL_ENT,
+                 "Il riferimento all''''entit\u00e0 esterna \"&{0};\" non \u00e8 permesso in un valore attributo."
+             },
+
+             {MsgKey.ER_NS_PREFIX_CANNOT_BE_BOUND,
+                 "Il prefisso \"{0}\" non pu\u00f2 essere associato allo spazio nome \"{1}\"."
+             },
+
+             {MsgKey.ER_NULL_LOCAL_ELEMENT_NAME,
+                 "Il nome locale dell''''elemento \"{0}\" \u00e8 null."
+             },
+
+             {MsgKey.ER_NULL_LOCAL_ATTR_NAME,
+                 "Il nome locale dell''''attributo \"{0}\" \u00e8  null."
+             },
+
+             { MsgKey.ER_ELEM_UNBOUND_PREFIX_IN_ENTREF,
+                 "Il testo di sostituzione del nodo di entit\u00e0 \"{0}\" contiene un nodo di elemento \"{1}\" con un prefisso non associato \"{2}\"."
+             },
+
+             { MsgKey.ER_ATTR_UNBOUND_PREFIX_IN_ENTREF,
+                 "Il testo di sostituzione del nodo di entit\u00e0 \"{0}\" contiene un nodo di attributo \"{1}\" con un prefisso non associato \"{2}\"."
+             },
 
         };
 
--- a/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_ja.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_ja.java	Wed Jul 05 19:53:51 2017 +0200
@@ -3,9 +3,11 @@
  * DO NOT REMOVE OR ALTER!
  */
 /*
- * Copyright 2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the  "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
@@ -200,6 +202,93 @@
             {   MsgKey.ER_ENCODING_NOT_SUPPORTED,
                 "\u8B66\u544A:  \u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0''{0}''\u306F\u3001Java\u30E9\u30F3\u30BF\u30A4\u30E0\u3067\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002" },
 
+             {MsgKey.ER_FEATURE_NOT_FOUND,
+             "\u30d1\u30e9\u30e1\u30fc\u30bf\u30fc ''{0}'' \u306f\u8a8d\u8b58\u3055\u308c\u307e\u305b\u3093\u3002"},
+
+             {MsgKey.ER_FEATURE_NOT_SUPPORTED,
+             "\u30d1\u30e9\u30e1\u30fc\u30bf\u30fc ''{0}'' \u306f\u8a8d\u8b58\u3055\u308c\u307e\u3059\u304c\u3001\u8981\u6c42\u3055\u308c\u305f\u5024\u306f\u8a2d\u5b9a\u3067\u304d\u307e\u305b\u3093\u3002"},
+
+             {MsgKey.ER_STRING_TOO_LONG,
+             "\u7d50\u679c\u306e\u30b9\u30c8\u30ea\u30f3\u30b0\u304c\u9577\u3059\u304e\u308b\u305f\u3081\u3001DOMString \u5185\u306b\u53ce\u307e\u308a\u307e\u305b\u3093: ''{0}''\u3002"},
+
+             {MsgKey.ER_TYPE_MISMATCH_ERR,
+             "\u3053\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u30fc\u540d\u306e\u5024\u306e\u578b\u306f\u3001\u671f\u5f85\u3055\u308c\u308b\u5024\u306e\u578b\u3068\u4e0d\u9069\u5408\u3067\u3059\u3002"},
+
+             {MsgKey.ER_NO_OUTPUT_SPECIFIED,
+             "\u66f8\u304d\u8fbc\u307e\u308c\u308b\u30c7\u30fc\u30bf\u306e\u51fa\u529b\u5b9b\u5148\u304c\u30cc\u30eb\u3067\u3059\u3002"},
+
+             {MsgKey.ER_UNSUPPORTED_ENCODING,
+             "\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u306a\u3044\u30a8\u30f3\u30b3\u30fc\u30c9\u304c\u691c\u51fa\u3055\u308c\u307e\u3057\u305f\u3002"},
+
+             {MsgKey.ER_UNABLE_TO_SERIALIZE_NODE,
+             "\u30ce\u30fc\u30c9\u3092\u76f4\u5217\u5316\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f\u3002"},
+
+             {MsgKey.ER_CDATA_SECTIONS_SPLIT,
+             "CDATA \u30bb\u30af\u30b7\u30e7\u30f3\u306b 1 \u3064\u4ee5\u4e0a\u306e\u7d42\u4e86\u30de\u30fc\u30ab\u30fc ']]>' \u304c\u542b\u307e\u308c\u3066\u3044\u307e\u3059\u3002"},
+
+             {MsgKey.ER_WARNING_WF_NOT_CHECKED,
+                 "\u6574\u5f62\u5f0f\u6027\u30c1\u30a7\u30c3\u30ab\u30fc\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u4f5c\u6210\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f\u3002  well-formed \u30d1\u30e9\u30e1\u30fc\u30bf\u30fc\u306e\u8a2d\u5b9a\u306f true \u3067\u3057\u305f\u304c\u3001\u6574\u5f62\u5f0f\u6027\u306e\u691c\u67fb\u306f\u5b9f\u884c\u3067\u304d\u307e\u305b\u3093\u3002"
+             },
+
+             {MsgKey.ER_WF_INVALID_CHARACTER,
+                 "\u30ce\u30fc\u30c9 ''{0}'' \u306b\u7121\u52b9\u306a XML \u6587\u5b57\u304c\u3042\u308a\u307e\u3059\u3002"
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_COMMENT,
+                 "\u30b3\u30e1\u30f3\u30c8\u306e\u4e2d\u306b\u7121\u52b9\u306a XML \u6587\u5b57 (Unicode: 0x{0}) \u304c\u898b\u3064\u304b\u308a\u307e\u3057\u305f\u3002"
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_PI,
+                 "\u51e6\u7406\u547d\u4ee4\u30c7\u30fc\u30bf\u306e\u4e2d\u306b\u7121\u52b9\u306a XML \u6587\u5b57 (Unicode: 0x{0}) \u304c\u898b\u3064\u304b\u308a\u307e\u3057\u305f\u3002"
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_CDATA,
+                 "CDATA \u30bb\u30af\u30b7\u30e7\u30f3\u306e\u4e2d\u306b\u7121\u52b9\u306a XML \u6587\u5b57 (Unicode: 0x{0}) \u304c\u898b\u3064\u304b\u308a\u307e\u3057\u305f\u3002"
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_TEXT,
+                 "\u30ce\u30fc\u30c9\u306e\u6587\u5b57\u30c7\u30fc\u30bf\u306e\u5185\u5bb9\u306b\u7121\u52b9\u306a XML \u6587\u5b57 (Unicode: 0x{0}) \u304c\u898b\u3064\u304b\u308a\u307e\u3057\u305f\u3002"
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_NODE_NAME,
+                 "''{1}'' \u3068\u3044\u3046\u540d\u524d\u306e {0} \u30ce\u30fc\u30c9\u306e\u4e2d\u306b\u7121\u52b9\u306a XML \u6587\u5b57\u304c\u898b\u3064\u304b\u308a\u307e\u3057\u305f\u3002"
+             },
+
+             { MsgKey.ER_WF_DASH_IN_COMMENT,
+                 "\u30b9\u30c8\u30ea\u30f3\u30b0 \"--\" \u306f\u30b3\u30e1\u30f3\u30c8\u5185\u3067\u306f\u4f7f\u7528\u3067\u304d\u307e\u305b\u3093\u3002"
+             },
+
+             {MsgKey.ER_WF_LT_IN_ATTVAL,
+                 "\u8981\u7d20\u578b \"{0}\" \u306b\u95a2\u9023\u3057\u305f\u5c5e\u6027 \"{1}\" \u306e\u5024\u306b\u306f ''<'' \u6587\u5b57\u3092\u542b\u3081\u3066\u306f\u3044\u3051\u307e\u305b\u3093\u3002"
+             },
+
+             {MsgKey.ER_WF_REF_TO_UNPARSED_ENT,
+                 "\u89e3\u6790\u5bfe\u8c61\u5916\u5b9f\u4f53\u53c2\u7167 \"&{0};\" \u306f\u8a31\u53ef\u3055\u308c\u307e\u305b\u3093\u3002"
+             },
+
+             {MsgKey.ER_WF_REF_TO_EXTERNAL_ENT,
+                 "\u5c5e\u6027\u5024\u3067\u306e\u5916\u90e8\u5b9f\u4f53\u53c2\u7167 \"&{0};\" \u306f\u8a31\u53ef\u3055\u308c\u307e\u305b\u3093\u3002"
+             },
+
+             {MsgKey.ER_NS_PREFIX_CANNOT_BE_BOUND,
+                 "\u63a5\u982d\u90e8 \"{0}\" \u306f\u540d\u524d\u7a7a\u9593 \"{1}\" \u306b\u7d50\u5408\u3067\u304d\u307e\u305b\u3093\u3002"
+             },
+
+             {MsgKey.ER_NULL_LOCAL_ELEMENT_NAME,
+                 "\u8981\u7d20 \"{0}\" \u306e\u30ed\u30fc\u30ab\u30eb\u540d\u304c\u30cc\u30eb\u3067\u3059\u3002"
+             },
+
+             {MsgKey.ER_NULL_LOCAL_ATTR_NAME,
+                 "\u5c5e\u6027 \"{0}\" \u306e\u30ed\u30fc\u30ab\u30eb\u540d\u304c\u30cc\u30eb\u3067\u3059\u3002"
+             },
+
+             { MsgKey.ER_ELEM_UNBOUND_PREFIX_IN_ENTREF,
+                 "\u5b9f\u4f53\u30ce\u30fc\u30c9 \"{0}\" \u306e\u7f6e\u63db\u30c6\u30ad\u30b9\u30c8\u306b\u3001\u672a\u7d50\u5408\u306e\u63a5\u982d\u90e8 \"{2}\" \u3092\u6301\u3064\u8981\u7d20\u30ce\u30fc\u30c9 \"{1}\" \u304c\u542b\u307e\u308c\u3066\u3044\u307e\u3059\u3002"
+             },
+
+             { MsgKey.ER_ATTR_UNBOUND_PREFIX_IN_ENTREF,
+                 "\u5b9f\u4f53\u30ce\u30fc\u30c9 \"{0}\" \u306e\u7f6e\u63db\u30c6\u30ad\u30b9\u30c8\u306b\u3001\u672a\u7d50\u5408\u306e\u63a5\u982d\u90e8 \"{2}\" \u3092\u6301\u3064\u5c5e\u6027\u30ce\u30fc\u30c9 \"{1}\" \u304c\u542b\u307e\u308c\u3066\u3044\u307e\u3059\u3002"
+             },
 
         };
 
--- a/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_ko.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_ko.java	Wed Jul 05 19:53:51 2017 +0200
@@ -3,9 +3,11 @@
  * DO NOT REMOVE OR ALTER!
  */
 /*
- * Copyright 2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the  "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
@@ -200,6 +202,93 @@
             {   MsgKey.ER_ENCODING_NOT_SUPPORTED,
                 "\uACBD\uACE0: \uC778\uCF54\uB529 ''{0}''\uC740(\uB294) Java \uB7F0\uD0C0\uC784\uC5D0 \uC9C0\uC6D0\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4." },
 
+             {MsgKey.ER_FEATURE_NOT_FOUND,
+             "''{0}'' \ub9e4\uac1c\ubcc0\uc218\ub97c \uc778\uc2dd\ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4."},
+
+             {MsgKey.ER_FEATURE_NOT_SUPPORTED,
+             "''{0}'' \ub9e4\uac1c\ubcc0\uc218\ub294 \uc778\uc2dd\ud560 \uc218 \uc788\uc73c\ub098 \uc694\uccad\ub41c \uac12\uc744 \uc124\uc815\ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4."},
+
+             {MsgKey.ER_STRING_TOO_LONG,
+             "\uacb0\uacfc \ubb38\uc790\uc5f4\uc774 \ub108\ubb34 \uae38\uc5b4 DOMString\uc5d0 \ub9de\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4: ''{0}'' "},
+
+             {MsgKey.ER_TYPE_MISMATCH_ERR,
+             "\uc774 \ub9e4\uac1c\ubcc0\uc218 \uc774\ub984\uc5d0 \ub300\ud55c \uac12 \uc720\ud615\uc774 \uc608\uc0c1 \uac12 \uc720\ud615\uacfc \ud638\ud658\ub418\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4."},
+
+             {MsgKey.ER_NO_OUTPUT_SPECIFIED,
+             "\ub370\uc774\ud130\ub97c \uae30\ub85d\ud560 \ucd9c\ub825 \ub300\uc0c1\uc774 \ub110(null)\uc785\ub2c8\ub2e4."},
+
+             {MsgKey.ER_UNSUPPORTED_ENCODING,
+             "\uc9c0\uc6d0\ub418\uc9c0 \uc54a\ub294 \uc778\ucf54\ub529\uc774 \ubc1c\uacac\ub418\uc5c8\uc2b5\ub2c8\ub2e4."},
+
+             {MsgKey.ER_UNABLE_TO_SERIALIZE_NODE,
+             "\ub178\ub4dc\ub97c \uc9c1\ub82c\ud654\ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4."},
+
+             {MsgKey.ER_CDATA_SECTIONS_SPLIT,
+             "CDATA \uc139\uc158\uc5d0 \uc885\ub8cc \ud45c\uc2dc \ubb38\uc790\uc778 ']]>'\uac00 \ud558\ub098 \uc774\uc0c1 \ud3ec\ud568\ub418\uc5b4 \uc788\uc2b5\ub2c8\ub2e4."},
+
+             {MsgKey.ER_WARNING_WF_NOT_CHECKED,
+                 "Well-Formedness \uac80\uc0ac\uae30\uc758 \uc778\uc2a4\ud134\uc2a4\ub97c \uc791\uc131\ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4. Well-Formed \ub9e4\uac1c\ubcc0\uc218\uac00 true\ub85c \uc124\uc815\ub418\uc5c8\uc9c0\ub9cc Well-Formedness \uac80\uc0ac\ub97c \uc218\ud589\ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4."
+             },
+
+             {MsgKey.ER_WF_INVALID_CHARACTER,
+                 "''{0}'' \ub178\ub4dc\uc5d0 \uc720\ud6a8\ud558\uc9c0 \uc54a\uc740 XML \ubb38\uc790\uac00 \uc788\uc2b5\ub2c8\ub2e4."
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_COMMENT,
+                 "\uc124\uba85\uc5d0 \uc720\ud6a8\ud558\uc9c0 \uc54a\uc740 XML \ubb38\uc790(Unicode: 0x{0})\uac00 \uc788\uc2b5\ub2c8\ub2e4. "
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_PI,
+                 "\ucc98\ub9ac \uba85\ub839\uc5b4 \ub370\uc774\ud130\uc5d0 \uc720\ud6a8\ud558\uc9c0 \uc54a\uc740 XML \ubb38\uc790(Unicode: 0x{0})\uac00 \uc788\uc2b5\ub2c8\ub2e4 "
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_CDATA,
+                 "CDATASection\uc758 \ub0b4\uc6a9\uc5d0 \uc720\ud6a8\ud558\uc9c0 \uc54a\uc740 XML \ubb38\uc790(Unicode: 0x{0})\uac00 \uc788\uc2b5\ub2c8\ub2e4. "
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_TEXT,
+                 "\ub178\ub4dc\uc758 \ubb38\uc790 \ub370\uc774\ud130 \ub0b4\uc6a9\uc5d0 \uc720\ud6a8\ud558\uc9c0 \uc54a\uc740 XML \ubb38\uc790(Unicode: 0x{0})\uac00 \uc788\uc2b5\ub2c8\ub2e4. "
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_NODE_NAME,
+                 "\uc774\ub984\uc774 ''{1}''\uc778 {0} \ub178\ub4dc\uc5d0 \uc720\ud6a8\ud558\uc9c0 \uc54a\uc740 XML \ubb38\uc790\uac00 \uc788\uc2b5\ub2c8\ub2e4. "
+             },
+
+             { MsgKey.ER_WF_DASH_IN_COMMENT,
+                 "\uc124\uba85 \ub0b4\uc5d0\uc11c\ub294 \"--\" \ubb38\uc790\uc5f4\uc774 \ud5c8\uc6a9\ub418\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4."
+             },
+
+             {MsgKey.ER_WF_LT_IN_ATTVAL,
+                 "\"{0}\" \uc694\uc18c \uc720\ud615\uacfc \uc5f0\uad00\ub41c \"{1}\" \uc18d\uc131\uac12\uc5d0 ''<'' \ubb38\uc790\uac00 \ud3ec\ud568\ub418\uba74 \uc548\ub429\ub2c8\ub2e4."
+             },
+
+             {MsgKey.ER_WF_REF_TO_UNPARSED_ENT,
+                 "\"&{0};\"\uc758 \uad6c\ubd84 \ubd84\uc11d\ub418\uc9c0 \uc54a\uc740 \uc5d4\ud2f0\ud2f0 \ucc38\uc870\ub294 \ud5c8\uc6a9\ub418\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4. "
+             },
+
+             {MsgKey.ER_WF_REF_TO_EXTERNAL_ENT,
+                 "\uc18d\uc131\uac12\uc5d0\ub294 \"&{0};\" \uc678\ubd80 \uc5d4\ud2f0\ud2f0 \ucc38\uc870\uac00 \ud5c8\uc6a9\ub418\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4. "
+             },
+
+             {MsgKey.ER_NS_PREFIX_CANNOT_BE_BOUND,
+                 "\"{0}\" \uc811\ub450\ubd80\ub97c \"{1}\" \uc774\ub984 \uacf5\uac04\uc5d0 \ubc14\uc778\ub4dc\ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4."
+             },
+
+             {MsgKey.ER_NULL_LOCAL_ELEMENT_NAME,
+                 "\"{0}\" \uc694\uc18c\uc758 \ub85c\uceec \uc774\ub984\uc774 \ub110(null)\uc785\ub2c8\ub2e4."
+             },
+
+             {MsgKey.ER_NULL_LOCAL_ATTR_NAME,
+                 "\"{0}\" \uc18d\uc131\uc758 \ub85c\uceec \uc774\ub984\uc774 \ub110(null)\uc785\ub2c8\ub2e4."
+             },
+
+             { MsgKey.ER_ELEM_UNBOUND_PREFIX_IN_ENTREF,
+                 "\"{0}\" \uc5d4\ud2f0\ud2f0 \ub178\ub4dc\uc758 \ub300\uccb4 \ud14d\uc2a4\ud2b8\uc5d0 \ubc14\uc778\ub4dc\ub418\uc9c0 \uc54a\uc740 \uc811\ub450\ubd80 \"{2}\"\uc744(\ub97c) \uac16\ub294 \"{1}\" \uc694\uc18c \ub178\ub4dc\uac00 \uc788\uc2b5\ub2c8\ub2e4."
+             },
+
+             { MsgKey.ER_ATTR_UNBOUND_PREFIX_IN_ENTREF,
+                 "\"{0}\" \uc5d4\ud2f0\ud2f0 \ub178\ub4dc\uc758 \ub300\uccb4 \ud14d\uc2a4\ud2b8\uc5d0 \ubc14\uc778\ub4dc\ub418\uc9c0 \uc54a\uc740 \uc811\ub450\ubd80 \"{2}\"\uc744(\ub97c) \uac16\ub294 \"{1}\" \uc18d\uc131 \ub178\ub4dc\uac00 \uc788\uc2b5\ub2c8\ub2e4."
+             },
 
         };
 
--- a/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_pt_BR.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_pt_BR.java	Wed Jul 05 19:53:51 2017 +0200
@@ -3,9 +3,11 @@
  * DO NOT REMOVE OR ALTER!
  */
 /*
- * Copyright 2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the  "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
@@ -200,6 +202,93 @@
             {   MsgKey.ER_ENCODING_NOT_SUPPORTED,
                 "Advert\u00EAncia: a codifica\u00E7\u00E3o ''{0}'' n\u00E3o \u00E9 suportada pelo Java runtime." },
 
+             {MsgKey.ER_FEATURE_NOT_FOUND,
+             "O par\u00e2metro ''{0}'' n\u00e3o \u00e9 reconhecido."},
+
+             {MsgKey.ER_FEATURE_NOT_SUPPORTED,
+             "O par\u00e2metro ''{0}'' \u00e9 reconhecido, mas o valor pedido n\u00e3o pode ser definido. "},
+
+             {MsgKey.ER_STRING_TOO_LONG,
+             "A cadeia resultante \u00e9 muito longa para caber em uma DOMString: ''{0}''. "},
+
+             {MsgKey.ER_TYPE_MISMATCH_ERR,
+             "O tipo de valor para este nome de par\u00e2metro \u00e9 incompat\u00edvel com o tipo de valor esperado. "},
+
+             {MsgKey.ER_NO_OUTPUT_SPECIFIED,
+             "O destino de sa\u00edda para os dados a serem gravados era nulo. "},
+
+             {MsgKey.ER_UNSUPPORTED_ENCODING,
+             "Uma codifica\u00e7\u00e3o n\u00e3o suportada foi encontrada. "},
+
+             {MsgKey.ER_UNABLE_TO_SERIALIZE_NODE,
+             "O n\u00f3 n\u00e3o p\u00f4de ser serializado."},
+
+             {MsgKey.ER_CDATA_SECTIONS_SPLIT,
+             "A Se\u00e7\u00e3o CDATA cont\u00e9m um ou mais marcadores de t\u00e9rmino ']]>'."},
+
+             {MsgKey.ER_WARNING_WF_NOT_CHECKED,
+                 "Uma inst\u00e2ncia do verificador Well-Formedness n\u00e3o p\u00f4de ser criada. O par\u00e2metro well-formed foi definido como true, mas a verifica\u00e7\u00e3o well-formedness n\u00e3o pode ser executada."
+             },
+
+             {MsgKey.ER_WF_INVALID_CHARACTER,
+                 "O n\u00f3 ''{0}'' cont\u00e9m caracteres XML inv\u00e1lidos. "
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_COMMENT,
+                 "Um caractere XML inv\u00e1lido (Unicode: 0x{0}) foi encontrado no coment\u00e1rio. "
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_PI,
+                 "Um caractere XML inv\u00e1lido (Unicode: 0x{0}) foi encontrado no processo instructiondata."
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_CDATA,
+                 "Um caractere XML inv\u00e1lido (Unicode: 0x{0}) foi encontrado nos conte\u00fados do CDATASection. "
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_TEXT,
+                 "Um caractere XML inv\u00e1lido (Unicode: 0x{0}) foi encontrado no conte\u00fado dos dados de caractere dos n\u00f3s. "
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_NODE_NAME,
+                 "Um caractere inv\u00e1lido foi encontrado no {0} do n\u00f3 denominado ''{1}''."
+             },
+
+             { MsgKey.ER_WF_DASH_IN_COMMENT,
+                 "A cadeia \"--\" n\u00e3o \u00e9 permitida dentro dos coment\u00e1rios. "
+             },
+
+             {MsgKey.ER_WF_LT_IN_ATTVAL,
+                 "O valor do atributo \"{1}\" associado a um tipo de elemento \"{0}\" n\u00e3o deve conter o caractere ''<''. "
+             },
+
+             {MsgKey.ER_WF_REF_TO_UNPARSED_ENT,
+                 "A refer\u00eancia de entidade n\u00e3o analisada \"&{0};\" n\u00e3o \u00e9 permitida. "
+             },
+
+             {MsgKey.ER_WF_REF_TO_EXTERNAL_ENT,
+                 "A refer\u00eancia de entidade externa \"&{0};\" n\u00e3o \u00e9 permitida em um valor de atributo. "
+             },
+
+             {MsgKey.ER_NS_PREFIX_CANNOT_BE_BOUND,
+                 "O prefixo \"{0}\" n\u00e3o pode ser vinculado ao espa\u00e7o de nomes \"{1}\"."
+             },
+
+             {MsgKey.ER_NULL_LOCAL_ELEMENT_NAME,
+                 "O nome local do elemento \"{0}\" \u00e9 nulo."
+             },
+
+             {MsgKey.ER_NULL_LOCAL_ATTR_NAME,
+                 "O nome local do atributo \"{0}\" \u00e9 nulo."
+             },
+
+             { MsgKey.ER_ELEM_UNBOUND_PREFIX_IN_ENTREF,
+                 "O texto de substitui\u00e7\u00e3o do n\u00f3 de entidade \"{0}\" cont\u00e9m um n\u00f3 de elemento \"{1}\" com um prefixo n\u00e3o vinculado \"{2}\"."
+             },
+
+             { MsgKey.ER_ATTR_UNBOUND_PREFIX_IN_ENTREF,
+                 "O texto de substitui\u00e7\u00e3o do n\u00f3 de entidade \"{0}\" cont\u00e9m um n\u00f3 de atributo \"{1}\" com um prefixo n\u00e3o vinculado \"{2}\"."
+             },
 
         };
 
--- a/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_zh_TW.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_zh_TW.java	Wed Jul 05 19:53:51 2017 +0200
@@ -3,9 +3,11 @@
  * DO NOT REMOVE OR ALTER!
  */
 /*
- * Copyright 2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the  "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
@@ -200,6 +202,93 @@
             {   MsgKey.ER_ENCODING_NOT_SUPPORTED,
                 "\u8B66\u544A:  Java Runtime \u4E0D\u652F\u63F4\u7DE8\u78BC ''{0}''\u3002" },
 
+             {MsgKey.ER_FEATURE_NOT_FOUND,
+             "\u7121\u6cd5\u8fa8\u8b58\u53c3\u6578 ''{0}''\u3002"},
+
+             {MsgKey.ER_FEATURE_NOT_SUPPORTED,
+             "\u53ef\u8fa8\u8b58 ''{0}'' \u53c3\u6578\uff0c\u4f46\u6240\u8981\u6c42\u7684\u503c\u7121\u6cd5\u8a2d\u5b9a\u3002"},
+
+             {MsgKey.ER_STRING_TOO_LONG,
+             "\u7d50\u679c\u5b57\u4e32\u904e\u9577\uff0c\u7121\u6cd5\u7f6e\u5165 DOMString: ''{0}'' \u4e2d\u3002"},
+
+             {MsgKey.ER_TYPE_MISMATCH_ERR,
+             "\u9019\u500b\u53c3\u6578\u540d\u7a31\u7684\u503c\u985e\u578b\u8207\u671f\u671b\u503c\u985e\u578b\u4e0d\u76f8\u5bb9\u3002"},
+
+             {MsgKey.ER_NO_OUTPUT_SPECIFIED,
+             "\u8cc7\u6599\u8981\u5beb\u5165\u7684\u8f38\u51fa\u76ee\u7684\u5730\u70ba\u7a7a\u503c\u3002"},
+
+             {MsgKey.ER_UNSUPPORTED_ENCODING,
+             "\u767c\u73fe\u4e0d\u652f\u63f4\u7684\u7de8\u78bc\u3002"},
+
+             {MsgKey.ER_UNABLE_TO_SERIALIZE_NODE,
+             "\u7bc0\u9ede\u7121\u6cd5\u5e8f\u5217\u5316\u3002"},
+
+             {MsgKey.ER_CDATA_SECTIONS_SPLIT,
+             "CDATA \u5340\u6bb5\u5305\u542b\u4e00\u6216\u591a\u500b\u7d42\u6b62\u6a19\u8a18 ']]>'\u3002"},
+
+             {MsgKey.ER_WARNING_WF_NOT_CHECKED,
+                 "\u7121\u6cd5\u5efa\u7acb\u300c\u5f62\u5f0f\u5b8c\u6574\u300d\u6aa2\u67e5\u7a0b\u5f0f\u7684\u5be6\u4f8b\u3002Well-formed \u53c3\u6578\u96d6\u8a2d\u70ba true\uff0c\u4f46\u7121\u6cd5\u57f7\u884c\u5f62\u5f0f\u5b8c\u6574\u6aa2\u67e5\u3002"
+             },
+
+             {MsgKey.ER_WF_INVALID_CHARACTER,
+                 "\u7bc0\u9ede ''{0}'' \u5305\u542b\u7121\u6548\u7684 XML \u5b57\u5143\u3002"
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_COMMENT,
+                 "\u5728\u8a3b\u89e3\u4e2d\u767c\u73fe\u7121\u6548\u7684 XML \u5b57\u5143 (Unicode: 0x{0})\u3002"
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_PI,
+                 "\u5728\u8655\u7406\u7a0b\u5e8f instructiondata \u4e2d\u767c\u73fe\u7121\u6548\u7684 XML \u5b57\u5143 (Unicode: 0x{0})\u3002"
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_CDATA,
+                 "\u5728 CDATASection \u7684\u5167\u5bb9\u4e2d\u767c\u73fe\u7121\u6548\u7684 XML \u5b57\u5143 (Unicode: 0x{0})\u3002"
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_TEXT,
+                 "\u5728\u7bc0\u9ede\u7684\u5b57\u5143\u8cc7\u6599\u5167\u5bb9\u4e2d\u767c\u73fe\u7121\u6548\u7684 XML \u5b57\u5143 (Unicode: 0x{0})\u3002"
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_NODE_NAME,
+                 "\u5728\u540d\u70ba ''{1}'' \u7684 ''{0}'' \u4e2d\u767c\u73fe\u7121\u6548\u7684 XML \u5b57\u5143\u3002"
+             },
+
+             { MsgKey.ER_WF_DASH_IN_COMMENT,
+                 "\u8a3b\u89e3\u4e2d\u4e0d\u5141\u8a31\u4f7f\u7528\u5b57\u4e32 \"--\"\u3002"
+             },
+
+             {MsgKey.ER_WF_LT_IN_ATTVAL,
+                 "\u8207\u5143\u7d20\u985e\u578b \"{0}\" \u76f8\u95dc\u806f\u7684\u5c6c\u6027 \"{1}\" \u503c\u4e0d\u53ef\u5305\u542b ''<'' \u5b57\u5143\u3002"
+             },
+
+             {MsgKey.ER_WF_REF_TO_UNPARSED_ENT,
+                 "\u4e0d\u5141\u8a31\u4f7f\u7528\u672a\u5256\u6790\u7684\u5be6\u9ad4\u53c3\u7167 \"&{0};\"\u3002"
+             },
+
+             {MsgKey.ER_WF_REF_TO_EXTERNAL_ENT,
+                 "\u5c6c\u6027\u503c\u4e2d\u4e0d\u5141\u8a31\u4f7f\u7528\u5916\u90e8\u5be6\u9ad4\u53c3\u7167 \"&{0};\"\u3002"
+             },
+
+             {MsgKey.ER_NS_PREFIX_CANNOT_BE_BOUND,
+                 "\u5b57\u9996 \"{0}\" \u7121\u6cd5\u9023\u7d50\u5230\u540d\u7a31\u7a7a\u9593 \"{1}\"\u3002"
+             },
+
+             {MsgKey.ER_NULL_LOCAL_ELEMENT_NAME,
+                 "\u5143\u7d20 \"{0}\" \u7684\u672c\u7aef\u540d\u7a31\u662f\u7a7a\u503c\u3002"
+             },
+
+             {MsgKey.ER_NULL_LOCAL_ATTR_NAME,
+                 "\u5c6c\u6027 \"{0}\" \u7684\u672c\u7aef\u540d\u7a31\u662f\u7a7a\u503c\u3002"
+             },
+
+             { MsgKey.ER_ELEM_UNBOUND_PREFIX_IN_ENTREF,
+                 "\u5be6\u9ad4\u7bc0\u9ede \"{0}\" \u7684\u53d6\u4ee3\u6587\u5b57\u5305\u542b\u9644\u6709\u5df2\u5207\u65b7\u9023\u7d50\u5b57\u9996 \"{2}\" \u7684\u5143\u7d20\u7bc0\u9ede \"{1}\"\u3002"
+             },
+
+             { MsgKey.ER_ATTR_UNBOUND_PREFIX_IN_ENTREF,
+                 "\u5be6\u9ad4\u7bc0\u9ede \"{0}\" \u7684\u53d6\u4ee3\u6587\u5b57\u5305\u542b\u9644\u6709\u5df2\u5207\u65b7\u9023\u7d50\u5b57\u9996 \"{2}\" \u7684\u5c6c\u6027\u7bc0\u9ede \"{1}\"\u3002"
+             },
 
         };
 
--- a/jaxp/src/org/w3c/dom/ranges/DocumentRange.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxp/src/org/w3c/dom/ranges/DocumentRange.java	Wed Jul 05 19:53:51 2017 +0200
@@ -43,7 +43,7 @@
 
 /**
  * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Traversal-Range-20001113'>Document Object Model (DOM) Level 2 Traversal and Range Specification</a>.
- * @since DOM Level 2
+ * @since 1.9, DOM Level 2
  */
 public interface DocumentRange {
     /**
--- a/jaxp/src/org/w3c/dom/ranges/Range.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxp/src/org/w3c/dom/ranges/Range.java	Wed Jul 05 19:53:51 2017 +0200
@@ -47,7 +47,7 @@
 
 /**
  * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Traversal-Range-20001113'>Document Object Model (DOM) Level 2 Traversal and Range Specification</a>.
- * @since DOM Level 2
+ * @since 1.9, DOM Level 2
  */
 public interface Range {
     /**
--- a/jaxp/src/org/w3c/dom/ranges/RangeException.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxp/src/org/w3c/dom/ranges/RangeException.java	Wed Jul 05 19:53:51 2017 +0200
@@ -45,7 +45,7 @@
  * Range operations may throw a <code>RangeException</code> as specified in
  * their method descriptions.
  * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Traversal-Range-20001113'>Document Object Model (DOM) Level 2 Traversal and Range Specification</a>.
- * @since DOM Level 2
+ * @since 1.9, DOM Level 2
  */
 public class RangeException extends RuntimeException {
     public RangeException(short code, String message) {
--- a/jaxp/src/org/w3c/dom/traversal/DocumentTraversal.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxp/src/org/w3c/dom/traversal/DocumentTraversal.java	Wed Jul 05 19:53:51 2017 +0200
@@ -53,7 +53,7 @@
  * Traversal feature, <code>DocumentTraversal</code> will be implemented by
  * the same objects that implement the Document interface.
  * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Traversal-Range-20001113'>Document Object Model (DOM) Level 2 Traversal and Range Specification</a>.
- * @since DOM Level 2
+ * @since 1.9, DOM Level 2
  */
 public interface DocumentTraversal {
     /**
--- a/jaxp/src/org/w3c/dom/traversal/NodeFilter.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxp/src/org/w3c/dom/traversal/NodeFilter.java	Wed Jul 05 19:53:51 2017 +0200
@@ -59,7 +59,7 @@
  * filter may be used with a number of different kinds of traversals,
  * encouraging code reuse.
  * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Traversal-Range-20001113'>Document Object Model (DOM) Level 2 Traversal and Range Specification</a>.
- * @since DOM Level 2
+ * @since 1.9, DOM Level 2
  */
 public interface NodeFilter {
     // Constants returned by acceptNode
--- a/jaxp/src/org/w3c/dom/traversal/NodeIterator.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxp/src/org/w3c/dom/traversal/NodeIterator.java	Wed Jul 05 19:53:51 2017 +0200
@@ -55,7 +55,7 @@
  * <code>NodeIterators</code> are created by calling
  * <code>DocumentTraversal</code><code>.createNodeIterator()</code>.
  * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Traversal-Range-20001113'>Document Object Model (DOM) Level 2 Traversal and Range Specification</a>.
- * @since DOM Level 2
+ * @since 1.9, DOM Level 2
  */
 public interface NodeIterator {
     /**
--- a/jaxp/src/org/w3c/dom/traversal/TreeWalker.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxp/src/org/w3c/dom/traversal/TreeWalker.java	Wed Jul 05 19:53:51 2017 +0200
@@ -60,7 +60,7 @@
  * nodes will be siblings and appear as direct children of the root node, no
  * matter how deeply nested the structure of the original document.
  * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Traversal-Range-20001113'>Document Object Model (DOM) Level 2 Traversal and Range Specification</a>.
- * @since DOM Level 2
+ * @since 1.9, DOM Level 2
  */
 public interface TreeWalker {
     /**
--- a/jaxws/.hgtags	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/.hgtags	Wed Jul 05 19:53:51 2017 +0200
@@ -270,3 +270,4 @@
 7f5e5902cde75fd9335c52f469491f061fe0239e jdk9-b22
 ce19e0403ec8a80223cc47320c905b2a4d45881d jdk9-b23
 0b35542d6bf32af23a9fc59a37c52aa091fee388 jdk9-b24
+ab8726a0fcde897e4cfd1ea581ed90b0d8a7cbb7 jdk9-b25
--- a/jaxws/src/share/jaf_classes/javax/activation/CommandMap.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaf_classes/javax/activation/CommandMap.java	Wed Jul 05 19:53:51 2017 +0200
@@ -127,7 +127,7 @@
      * @param mimeType  the MIME type
      * @param ds        a DataSource for the data
      * @return the CommandInfo classes that represent the command Beans.
-     * @since   JAF 1.1
+     * @since   1.6, JAF 1.1
      */
     public CommandInfo[] getPreferredCommands(String mimeType, DataSource ds) {
         return getPreferredCommands(mimeType);
@@ -155,7 +155,7 @@
      * @param mimeType  the MIME type
      * @param ds        a DataSource for the data
      * @return the CommandInfo objects representing all the commands.
-     * @since   JAF 1.1
+     * @since   1.6, JAF 1.1
      */
     public CommandInfo[] getAllCommands(String mimeType, DataSource ds) {
         return getAllCommands(mimeType);
@@ -183,7 +183,7 @@
      * @param cmdName   the command name
      * @param ds        a DataSource for the data
      * @return the CommandInfo corresponding to the command.
-     * @since   JAF 1.1
+     * @since   1.6, JAF 1.1
      */
     public CommandInfo getCommand(String mimeType, String cmdName,
                                 DataSource ds) {
@@ -215,7 +215,7 @@
      * @param mimeType  the MIME type
      * @param ds        a DataSource for the data
      * @return          the DataContentHandler for the MIME type
-     * @since   JAF 1.1
+     * @since   1.6, JAF 1.1
      */
     public DataContentHandler createDataContentHandler(String mimeType,
                                 DataSource ds) {
@@ -228,7 +228,7 @@
      * null is returned.
      *
      * @return          array of MIME types as strings, or null if not supported
-     * @since   JAF 1.1
+     * @since   1.6, JAF 1.1
      */
     public String[] getMimeTypes() {
         return null;
--- a/jaxws/src/share/jaf_classes/javax/activation/MailcapCommandMap.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaf_classes/javax/activation/MailcapCommandMap.java	Wed Jul 05 19:53:51 2017 +0200
@@ -603,7 +603,7 @@
      * Get all the MIME types known to this command map.
      *
      * @return          array of MIME types as strings
-     * @since   JAF 1.1
+     * @since   1.6, JAF 1.1
      */
     public synchronized String[] getMimeTypes() {
         List mtList = new ArrayList();
@@ -639,7 +639,7 @@
      * MIME type are returned.
      *
      * @return          array of native command entries
-     * @since   JAF 1.1
+     * @since   1.6, JAF 1.1
      */
     public synchronized String[] getNativeCommands(String mimeType) {
         List cmdList = new ArrayList();
--- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/DatatypeConverterImpl.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/DatatypeConverterImpl.java	Wed Jul 05 19:53:51 2017 +0200
@@ -58,7 +58,7 @@
  * This class is responsible for whitespace normalization.
  *
  * @author <ul><li>Ryan Shoemaker, Martin Grebac</li></ul>
- * @since JAXB1.0
+ * @since JAXB 1.0
  * @deprecated in JAXB 2.2.4 - use javax.xml.bind.DatatypeConverterImpl instead
  * or let us know why you can't
  */
--- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/api/Messages.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/api/Messages.java	Wed Jul 05 19:53:51 2017 +0200
@@ -31,7 +31,7 @@
 /**
  * Formats error messages.
  *
- * @since JAXB2.1.10
+ * @since JAXB 2.1.10
  */
 
 enum Messages {
--- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/marshaller/Messages.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/marshaller/Messages.java	Wed Jul 05 19:53:51 2017 +0200
@@ -31,7 +31,7 @@
 /**
  * Formats error messages.
  *
- * @since JAXB1.0
+ * @since JAXB 1.0
  */
 public class Messages
 {
--- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/marshaller/XMLWriter.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/marshaller/XMLWriter.java	Wed Jul 05 19:53:51 2017 +0200
@@ -249,7 +249,7 @@
  *
  * @author David Megginson, david@megginson.com
  * @version 0.2
- * @since JAXB1.0
+ * @since JAXB 1.0
  * @see org.xml.sax.XMLFilter
  * @see org.xml.sax.ContentHandler
  */
--- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/unmarshaller/DOMScanner.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/unmarshaller/DOMScanner.java	Wed Jul 05 19:53:51 2017 +0200
@@ -55,7 +55,7 @@
  * classes like this.
  *
  * @author <ul><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li></ul>
- * @since JAXB1.0
+ * @since JAXB 1.0
  */
 public class DOMScanner implements LocatorEx,InfosetScanner/*<Node> --- but can't do this to protect 1.0 clients, or can I? */
 {
--- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/unmarshaller/Messages.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/unmarshaller/Messages.java	Wed Jul 05 19:53:51 2017 +0200
@@ -31,7 +31,7 @@
 /**
  * Formats error messages.
  *
- * @since JAXB1.0
+ * @since JAXB 1.0
  */
 public class Messages
 {
--- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/util/AttributesImpl.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/util/AttributesImpl.java	Wed Jul 05 19:53:51 2017 +0200
@@ -62,7 +62,7 @@
  * AttributeList} interface, it also includes a much more efficient
  * implementation using a single array rather than a set of Vectors.</p>
  *
- * @since JAXB1.0
+ * @since JAXB 1.0
  * @since SAX 2.0
  * @author David Megginson
  * @version 2.0.1 (sax2r2)
--- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/txw2/output/XMLWriter.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/txw2/output/XMLWriter.java	Wed Jul 05 19:53:51 2017 +0200
@@ -262,7 +262,7 @@
  *
  * @author David Megginson, david@megginson.com
  * @version 0.2
- * @since JAXB1.0
+ * @since JAXB 1.0
  * @see org.xml.sax.XMLFilter
  * @see org.xml.sax.ContentHandler
  */
--- a/jaxws/src/share/jaxws_classes/javax/annotation/Generated.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/annotation/Generated.java	Wed Jul 05 19:53:51 2017 +0200
@@ -43,7 +43,7 @@
  * <p>The comment element is a place holder for any comments that the code
  * generator may want to include in the generated code.</p>
  *
- * @since Common Annotations 1.0
+ * @since 1.6, Common Annotations 1.0
  */
 
 @Documented
--- a/jaxws/src/share/jaxws_classes/javax/annotation/PostConstruct.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/annotation/PostConstruct.java	Wed Jul 05 19:53:51 2017 +0200
@@ -70,9 +70,10 @@
  * <li>If the method throws an unchecked exception the class MUST NOT be put into
  * service except in the case of EJBs where the EJB can handle exceptions and
  * even recover from them.</li></ul>
- * @since Common Annotations 1.0
+ *
  * @see javax.annotation.PreDestroy
  * @see javax.annotation.Resource
+ * @since 1.6, Common Annotations 1.0
  */
 @Documented
 @Retention (RUNTIME)
--- a/jaxws/src/share/jaxws_classes/javax/annotation/PreDestroy.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/annotation/PreDestroy.java	Wed Jul 05 19:53:51 2017 +0200
@@ -72,7 +72,7 @@
  *
  * @see javax.annotation.PostConstruct
  * @see javax.annotation.Resource
- * @since Common Annotations 1.0
+ * @since 1.6, Common Annotations 1.0
  */
 
 @Documented
--- a/jaxws/src/share/jaxws_classes/javax/annotation/Resource.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/annotation/Resource.java	Wed Jul 05 19:53:51 2017 +0200
@@ -48,7 +48,7 @@
  * appear on private fields and methods of superclasses; the container
  * is required to perform injection in these cases as well.
  *
- * @since Common Annotations 1.0
+ * @since 1.6, Common Annotations 1.0
  */
 @Target({TYPE, FIELD, METHOD})
 @Retention(RUNTIME)
@@ -66,7 +66,7 @@
      * The name of the resource that the reference points to. It can
      * link to any compatible resource using the global JNDI names.
      *
-     * @since Common Annotations 1.1
+     * @since 1.7, Common Annotations 1.1
      */
 
     String lookup() default "";
--- a/jaxws/src/share/jaxws_classes/javax/annotation/Resources.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/annotation/Resources.java	Wed Jul 05 19:53:51 2017 +0200
@@ -32,7 +32,7 @@
  * This class is used to allow multiple resources declarations.
  *
  * @see javax.annotation.Resource
- * @since Common Annotations 1.0
+ * @since 1.6, Common Annotations 1.0
  */
 
 @Documented
--- a/jaxws/src/share/jaxws_classes/javax/jws/HandlerChain.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/jws/HandlerChain.java	Wed Jul 05 19:53:51 2017 +0200
@@ -28,6 +28,9 @@
 import java.lang.annotation.*;
 import static java.lang.annotation.ElementType.*;
 
+/**
+ * @since 1.6
+ */
 @Retention(value=RetentionPolicy.RUNTIME)
 @Target({TYPE, METHOD, FIELD})
 public @interface HandlerChain {
--- a/jaxws/src/share/jaxws_classes/javax/jws/Oneway.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/jws/Oneway.java	Wed Jul 05 19:53:51 2017 +0200
@@ -27,6 +27,9 @@
 import java.lang.annotation.*;
 import static java.lang.annotation.ElementType.*;
 
+/**
+ * @since 1.6
+ */
 @Retention(value=RetentionPolicy.RUNTIME)
 @Target({METHOD})
 public @interface Oneway {
--- a/jaxws/src/share/jaxws_classes/javax/jws/WebMethod.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/jws/WebMethod.java	Wed Jul 05 19:53:51 2017 +0200
@@ -27,6 +27,9 @@
 import java.lang.annotation.*;
 import static java.lang.annotation.ElementType.*;
 
+/**
+ * @since 1.6
+ */
 @Retention(value=RetentionPolicy.RUNTIME)
 @Target({METHOD})
 public @interface WebMethod {
--- a/jaxws/src/share/jaxws_classes/javax/jws/WebParam.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/jws/WebParam.java	Wed Jul 05 19:53:51 2017 +0200
@@ -27,6 +27,9 @@
 import java.lang.annotation.*;
 import static java.lang.annotation.ElementType.*;
 
+/**
+ * @since 1.6
+ */
 @Retention(value=RetentionPolicy.RUNTIME)
 @Target({PARAMETER})
 public @interface WebParam {
--- a/jaxws/src/share/jaxws_classes/javax/jws/WebResult.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/jws/WebResult.java	Wed Jul 05 19:53:51 2017 +0200
@@ -27,6 +27,9 @@
 import java.lang.annotation.*;
 import static java.lang.annotation.ElementType.*;
 
+/**
+ * @since 1.6
+ */
 @Retention(value=RetentionPolicy.RUNTIME)
 @Target({METHOD})
 public @interface WebResult {
--- a/jaxws/src/share/jaxws_classes/javax/jws/WebService.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/jws/WebService.java	Wed Jul 05 19:53:51 2017 +0200
@@ -27,6 +27,9 @@
 import java.lang.annotation.*;
 import static java.lang.annotation.ElementType.*;
 
+/**
+ * @since 1.6
+ */
 @Retention(value=RetentionPolicy.RUNTIME)
 @Target({TYPE})
 public @interface WebService {
--- a/jaxws/src/share/jaxws_classes/javax/jws/soap/InitParam.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/jws/soap/InitParam.java	Wed Jul 05 19:53:51 2017 +0200
@@ -25,7 +25,8 @@
 
 package javax.jws.soap;
 
-/*
+/**
+ * @since 1.6
  * @Deprecated
  */
 @Deprecated public @interface InitParam {
--- a/jaxws/src/share/jaxws_classes/javax/jws/soap/SOAPBinding.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/jws/soap/SOAPBinding.java	Wed Jul 05 19:53:51 2017 +0200
@@ -27,6 +27,9 @@
 import java.lang.annotation.*;
 import static java.lang.annotation.ElementType.*;
 
+/**
+ * @since 1.6
+ */
 @Retention(value=RetentionPolicy.RUNTIME)
 @Target({TYPE,METHOD})
 public @interface SOAPBinding {
--- a/jaxws/src/share/jaxws_classes/javax/jws/soap/SOAPMessageHandler.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/jws/soap/SOAPMessageHandler.java	Wed Jul 05 19:53:51 2017 +0200
@@ -25,7 +25,8 @@
 
 package javax.jws.soap;
 
-/*
+/**
+ * @since 1.6
  * @Deprecated
  */
 @Deprecated public @interface SOAPMessageHandler {
--- a/jaxws/src/share/jaxws_classes/javax/jws/soap/SOAPMessageHandlers.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/jws/soap/SOAPMessageHandlers.java	Wed Jul 05 19:53:51 2017 +0200
@@ -27,7 +27,8 @@
 import java.lang.annotation.*;
 import static java.lang.annotation.ElementType.*;
 
-/*
+/**
+ * @since 1.6
  * @Deprecated
  */
 @Retention(value=RetentionPolicy.RUNTIME)
--- a/jaxws/src/share/jaxws_classes/javax/xml/bind/Binder.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/Binder.java	Wed Jul 05 19:53:51 2017 +0200
@@ -76,7 +76,7 @@
  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
  *     Joseph Fialli
  *
- * @since JAXB 2.0
+ * @since 1.6, JAXB 2.0
  */
 public abstract class Binder<XmlNode> {
     /**
@@ -153,7 +153,7 @@
      *     binding.
      * @throws IllegalArgumentException
      *      If any of the input parameters are null
-     * @since JAXB2.0
+     * @since 1.6, JAXB 2.0
      */
     public abstract <T> JAXBElement<T>
         unmarshal( XmlNode xmlNode, Class<T> declaredType )
--- a/jaxws/src/share/jaxws_classes/javax/xml/bind/DataBindingException.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/DataBindingException.java	Wed Jul 05 19:53:51 2017 +0200
@@ -34,7 +34,7 @@
  * is a checked exception.
  *
  * @see JAXB
- * @since JAXB2.1
+ * @since 1.6, JAXB 2.1
  */
 public class DataBindingException extends RuntimeException {
     public DataBindingException(String message, Throwable cause) {
--- a/jaxws/src/share/jaxws_classes/javax/xml/bind/DatatypeConverter.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/DatatypeConverter.java	Wed Jul 05 19:53:51 2017 +0200
@@ -88,7 +88,7 @@
  * @see DatatypeConverterInterface
  * @see ParseConversionEvent
  * @see PrintConversionEvent
- * @since JAXB1.0
+ * @since 1.6, JAXB 1.0
  */
 
 final public class DatatypeConverter {
--- a/jaxws/src/share/jaxws_classes/javax/xml/bind/DatatypeConverterImpl.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/DatatypeConverterImpl.java	Wed Jul 05 19:53:51 2017 +0200
@@ -49,7 +49,7 @@
  * This class is responsible for whitespace normalization.
  *
  * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li></ul>
- * @since JAXB2.1
+ * @since JAXB 2.1
  */
 final class DatatypeConverterImpl implements DatatypeConverterInterface {
 
--- a/jaxws/src/share/jaxws_classes/javax/xml/bind/DatatypeConverterInterface.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/DatatypeConverterInterface.java	Wed Jul 05 19:53:51 2017 +0200
@@ -78,7 +78,7 @@
  * @see DatatypeConverter
  * @see ParseConversionEvent
  * @see PrintConversionEvent
- * @since JAXB1.0
+ * @since 1.6, JAXB 1.0
  */
 
 public interface DatatypeConverterInterface {
--- a/jaxws/src/share/jaxws_classes/javax/xml/bind/Element.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/Element.java	Wed Jul 05 19:53:51 2017 +0200
@@ -35,7 +35,7 @@
  * and 5.7.1 "Bind to Java Element Interface" of the specification.
  *
  * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems, Inc.</li></ul>
- * @since JAXB1.0
+ * @since 1.6, JAXB 1.0
  */
 
 public interface Element {
--- a/jaxws/src/share/jaxws_classes/javax/xml/bind/JAXB.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/JAXB.java	Wed Jul 05 19:53:51 2017 +0200
@@ -92,7 +92,7 @@
  * a non-null value.
  *
  * @author Kohsuke Kawaguchi
- * @since 2.1
+ * @since 1.6, JAXB 2.1
  */
 public final class JAXB {
     /**
--- a/jaxws/src/share/jaxws_classes/javax/xml/bind/JAXBContext.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/JAXBContext.java	Wed Jul 05 19:53:51 2017 +0200
@@ -257,7 +257,7 @@
  * @see Marshaller
  * @see Unmarshaller
  * @see S 7.4.1 "Named Packages" in Java Language Specification</a>
- * @since JAXB1.0
+ * @since 1.6, JAXB 1.0
  */
 public abstract class JAXBContext {
 
@@ -423,7 +423,7 @@
      *   <li>failure to locate a value for the context factory provider property</li>
      *   <li>mixing schema derived packages from different providers on the same contextPath</li>
      * </ol>
-     * @since JAXB2.0
+     * @since 1.6, JAXB 2.0
      */
     public static JAXBContext newInstance( String contextPath, ClassLoader classLoader, Map<String,?>  properties  )
         throws JAXBException {
@@ -497,7 +497,7 @@
 //     * @throws IllegalArgumentException
 //     *      if the parameter contains {@code null} (i.e., {@code newInstance(null);})
 //     *
-//     * @since JAXB2.0
+//     * @since JAXB 2.0
 //     */
 //    public static JAXBContext newInstance( Source[] externalBindings, Class... classesToBeBound )
 //        throws JAXBException {
@@ -576,7 +576,7 @@
      * @throws IllegalArgumentException
      *      if the parameter contains {@code null} (i.e., {@code newInstance(null);})
      *
-     * @since JAXB2.0
+     * @since 1.6, JAXB 2.0
      */
     public static JAXBContext newInstance( Class... classesToBeBound )
         throws JAXBException {
@@ -622,7 +622,7 @@
      * @throws IllegalArgumentException
      *      if the parameter contains {@code null} (i.e., {@code newInstance(null,someMap);})
      *
-     * @since JAXB2.0
+     * @since 1.6, JAXB 2.0
      */
     public static JAXBContext newInstance( Class[] classesToBeBound, Map<String,?> properties )
         throws JAXBException {
@@ -692,7 +692,7 @@
      *      if DOM API corresponding to <tt>domType</tt> is not supported by
      *      the implementation.
      *
-     * @since JAXB2.0
+     * @since 1.6, JAXB 2.0
      */
     public <T> Binder<T> createBinder(Class<T> domType) {
         // to make JAXB 1.0 implementations work, this method must not be
@@ -705,7 +705,7 @@
      *
      * @return always a new valid <tt>Binder</tt> object.
      *
-     * @since JAXB2.0
+     * @since 1.6, JAXB 2.0
      */
     public Binder<Node> createBinder() {
         return createBinder(Node.class);
@@ -722,7 +722,7 @@
      *      Calling this method on JAXB 1.0 implementations will throw
      *      an UnsupportedOperationException.
      *
-     * @since JAXB2.0
+     * @since 1.6, JAXB 2.0
      */
     public JAXBIntrospector createJAXBIntrospector() {
         // to make JAXB 1.0 implementations work, this method must not be
@@ -744,7 +744,7 @@
      *      Calling this method on JAXB 1.0 implementations will throw
      *      an UnsupportedOperationException.
      *
-     * @since JAXB 2.0
+     * @since 1.6, JAXB 2.0
      */
     public void generateSchema(SchemaOutputResolver outputResolver) throws IOException  {
         // to make JAXB 1.0 implementations work, this method must not be
--- a/jaxws/src/share/jaxws_classes/javax/xml/bind/JAXBElement.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/JAXBElement.java	Wed Jul 05 19:53:51 2017 +0200
@@ -58,7 +58,7 @@
  * </p>
  *
  * @author Kohsuke Kawaguchi, Joe Fialli
- * @since JAXB 2.0
+ * @since 1.6, JAXB 2.0
  */
 
 public class JAXBElement<T> implements Serializable {
--- a/jaxws/src/share/jaxws_classes/javax/xml/bind/JAXBException.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/JAXBException.java	Wed Jul 05 19:53:51 2017 +0200
@@ -34,7 +34,7 @@
  * @see JAXBContext
  * @see Marshaller
  * @see Unmarshaller
- * @since JAXB1.0
+ * @since 1.6, JAXB 1.0
  */
 public class JAXBException extends Exception {
 
--- a/jaxws/src/share/jaxws_classes/javax/xml/bind/JAXBIntrospector.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/JAXBIntrospector.java	Wed Jul 05 19:53:51 2017 +0200
@@ -41,7 +41,7 @@
  * {@link JAXBContext#createJAXBIntrospector()}.
  *
  * @see JAXBContext#createJAXBIntrospector()
- * @since JAXB2.0
+ * @since 1.6, JAXB 2.0
  */
 public abstract class JAXBIntrospector {
 
--- a/jaxws/src/share/jaxws_classes/javax/xml/bind/JAXBPermission.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/JAXBPermission.java	Wed Jul 05 19:53:51 2017 +0200
@@ -73,7 +73,7 @@
  * @see java.lang.SecurityManager
  *
  * @author Joe Fialli
- * @since JAXB 2.2
+ * @since 1.7, JAXB 2.2
  */
 
 /* code was borrowed originally from java.lang.RuntimePermission. */
--- a/jaxws/src/share/jaxws_classes/javax/xml/bind/MarshalException.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/MarshalException.java	Wed Jul 05 19:53:51 2017 +0200
@@ -38,7 +38,7 @@
  * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li></ul>
  * @see JAXBException
  * @see Marshaller
- * @since JAXB1.0
+ * @since 1.6, JAXB 1.0
  */
 public class MarshalException extends JAXBException {
 
--- a/jaxws/src/share/jaxws_classes/javax/xml/bind/Marshaller.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/Marshaller.java	Wed Jul 05 19:53:51 2017 +0200
@@ -311,7 +311,7 @@
  * @see JAXBContext
  * @see Validator
  * @see Unmarshaller
- * @since JAXB1.0
+ * @since 1.6, JAXB 1.0
  */
 public interface Marshaller {
 
@@ -421,7 +421,7 @@
      *      Marshalling a JAXB element</a>.
      * @throws IllegalArgumentException
      *      If any of the method parameters are null
-     * @since JAXB2.1
+     * @since 1.6, JAXB 2.1
      */
     public void marshal( Object jaxbElement, File output )
         throws JAXBException;
@@ -515,7 +515,7 @@
      *      Marshalling a JAXB element</a>.
      * @throws IllegalArgumentException
      *      If any of the method parameters are null
-     * @since JAXB 2.0
+     * @since 1.6, JAXB 2.0
      */
     public void marshal( Object jaxbElement, javax.xml.stream.XMLStreamWriter writer )
         throws JAXBException;
@@ -539,7 +539,7 @@
      *      Marshalling a JAXB element</a>.
      * @throws IllegalArgumentException
      *      If any of the method parameters are null
-     * @since JAXB 2.0
+     * @since 1.6, JAXB 2.0
      */
     public void marshal( Object jaxbElement, javax.xml.stream.XMLEventWriter writer )
         throws JAXBException;
@@ -655,7 +655,7 @@
      *      if the adapter parameter is null.
      * @throws UnsupportedOperationException
      *      if invoked agains a JAXB 1.0 implementation.
-     * @since JAXB 2.0
+     * @since 1.6, JAXB 2.0
      */
     public void setAdapter( XmlAdapter adapter );
 
@@ -684,7 +684,7 @@
      *      if the type parameter is null.
      * @throws UnsupportedOperationException
      *      if invoked agains a JAXB 1.0 implementation.
-     * @since JAXB 2.0
+     * @since 1.6, JAXB 2.0
      */
     public <A extends XmlAdapter> void setAdapter( Class<A> type, A adapter );
 
@@ -697,7 +697,7 @@
      *      if the type parameter is null.
      * @throws UnsupportedOperationException
      *      if invoked agains a JAXB 1.0 implementation.
-     * @since JAXB 2.0
+     * @since 1.6, JAXB 2.0
      */
     public <A extends XmlAdapter> A getAdapter( Class<A> type );
 
@@ -730,7 +730,7 @@
      * @throws UnsupportedOperationException could be thrown if this method is
      *         invoked on an Marshaller created from a JAXBContext referencing
      *         JAXB 1.0 mapped classes
-     * @since JAXB2.0
+     * @since 1.6, JAXB 2.0
      */
     public void setSchema( Schema schema );
 
@@ -745,7 +745,7 @@
      * @throws UnsupportedOperationException could be thrown if this method is
      *         invoked on an Marshaller created from a JAXBContext referencing
      *         JAXB 1.0 mapped classes
-     * @since JAXB2.0
+     * @since 1.6, JAXB 2.0
      */
     public Schema getSchema();
 
@@ -766,7 +766,7 @@
      *
      * @see Marshaller#setListener(Listener)
      * @see Marshaller#getListener()
-     * @since JAXB2.0
+     * @since 1.6, JAXB 2.0
      */
     public static abstract class Listener {
         /**
@@ -807,7 +807,7 @@
      * One can unregister current Listener by setting listener to <tt>null</tt>.
      *
      * @param listener an instance of a class that implements {@link Listener}
-     * @since JAXB2.0
+     * @since 1.6, JAXB 2.0
      */
     public void setListener(Listener listener);
 
@@ -815,7 +815,7 @@
      * <p>Return {@link Listener} registered with this {@link Marshaller}.
      *
      * @return registered {@link Listener} or <code>null</code> if no Listener is registered with this Marshaller.
-     * @since JAXB2.0
+     * @since 1.6, JAXB 2.0
      */
     public Listener getListener();
 }
--- a/jaxws/src/share/jaxws_classes/javax/xml/bind/NotIdentifiableEvent.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/NotIdentifiableEvent.java	Wed Jul 05 19:53:51 2017 +0200
@@ -32,7 +32,7 @@
  * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems, Inc.</li></ul>
  * @see Validator
  * @see ValidationEventHandler
- * @since JAXB1.0
+ * @since 1.6, JAXB 1.0
  */
 public interface NotIdentifiableEvent extends ValidationEvent {
 
--- a/jaxws/src/share/jaxws_classes/javax/xml/bind/ParseConversionEvent.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/ParseConversionEvent.java	Wed Jul 05 19:53:51 2017 +0200
@@ -33,7 +33,7 @@
  * @see ValidationEvent
  * @see ValidationEventHandler
  * @see Unmarshaller
- * @since JAXB1.0
+ * @since 1.6, JAXB 1.0
  */
 public interface ParseConversionEvent extends ValidationEvent {
 
--- a/jaxws/src/share/jaxws_classes/javax/xml/bind/PrintConversionEvent.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/PrintConversionEvent.java	Wed Jul 05 19:53:51 2017 +0200
@@ -33,7 +33,7 @@
  * @see ValidationEvent
  * @see ValidationEventHandler
  * @see Marshaller
- * @since JAXB1.0
+ * @since 1.6, JAXB 1.0
  */
 public interface PrintConversionEvent extends ValidationEvent {
 
--- a/jaxws/src/share/jaxws_classes/javax/xml/bind/PropertyException.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/PropertyException.java	Wed Jul 05 19:53:51 2017 +0200
@@ -35,7 +35,7 @@
  * @see JAXBContext
  * @see Validator
  * @see Unmarshaller
- * @since JAXB1.0
+ * @since 1.6, JAXB 1.0
  */
 public class PropertyException extends JAXBException {
 
--- a/jaxws/src/share/jaxws_classes/javax/xml/bind/SchemaOutputResolver.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/SchemaOutputResolver.java	Wed Jul 05 19:53:51 2017 +0200
@@ -42,6 +42,7 @@
  *
  * @author
  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+ * @since 1.6
  */
 public abstract class SchemaOutputResolver {
     /**
--- a/jaxws/src/share/jaxws_classes/javax/xml/bind/TypeConstraintException.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/TypeConstraintException.java	Wed Jul 05 19:53:51 2017 +0200
@@ -42,7 +42,7 @@
  *
  * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems, Inc.</li></ul>
  * @see ValidationEvent
- * @since JAXB1.0
+ * @since 1.6, JAXB 1.0
  */
 
 public class TypeConstraintException extends java.lang.RuntimeException {
--- a/jaxws/src/share/jaxws_classes/javax/xml/bind/UnmarshalException.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/UnmarshalException.java	Wed Jul 05 19:53:51 2017 +0200
@@ -40,7 +40,7 @@
  * @see JAXBException
  * @see Unmarshaller
  * @see ValidationEventHandler
- * @since JAXB1.0
+ * @since 1.6, JAXB 1.0
  */
 public class UnmarshalException extends JAXBException {
 
--- a/jaxws/src/share/jaxws_classes/javax/xml/bind/Unmarshaller.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/Unmarshaller.java	Wed Jul 05 19:53:51 2017 +0200
@@ -404,7 +404,7 @@
  * @see JAXBContext
  * @see Marshaller
  * @see Validator
- * @since JAXB1.0
+ * @since 1.6, JAXB 1.0
  */
 public interface Unmarshaller {
 
@@ -474,7 +474,7 @@
      *     binding.  See <a href="#unmarshalEx">Unmarshalling XML Data</a>
      * @throws IllegalArgumentException
      *      If the InputStream parameter is null
-     * @since JAXB2.0
+     * @since 1.6, JAXB 2.0
      */
     public Object unmarshal( Reader reader ) throws JAXBException;
 
@@ -571,7 +571,7 @@
      *     binding.  See <a href="#unmarshalEx">Unmarshalling XML Data</a>
      * @throws IllegalArgumentException
      *      If any parameter is null
-     * @since JAXB2.0
+     * @since 1.6, JAXB 2.0
      */
     public <T> JAXBElement<T> unmarshal( org.w3c.dom.Node node, Class<T> declaredType ) throws JAXBException;
 
@@ -660,7 +660,7 @@
      *     binding.  See <a href="#unmarshalEx">Unmarshalling XML Data</a>
      * @throws IllegalArgumentException
      *      If any parameter is null
-     * @since JAXB2.0
+     * @since 1.6, JAXB 2.0
      */
     public <T> JAXBElement<T> unmarshal( javax.xml.transform.Source source, Class<T> declaredType )
         throws JAXBException;
@@ -696,7 +696,7 @@
      * @throws IllegalStateException
      *      If <tt>reader</tt> is not pointing to a START_DOCUMENT or
      *      START_ELEMENT  event.
-     * @since JAXB2.0
+     * @since 1.6, JAXB 2.0
      * @see #unmarshal(javax.xml.stream.XMLStreamReader, Class)
      */
     public Object unmarshal( javax.xml.stream.XMLStreamReader reader )
@@ -731,7 +731,7 @@
      *     binding.  See <a href="#unmarshalEx">Unmarshalling XML Data</a>
      * @throws IllegalArgumentException
      *      If any parameter is null
-     * @since JAXB2.0
+     * @since 1.6, JAXB 2.0
      */
     public <T> JAXBElement<T> unmarshal( javax.xml.stream.XMLStreamReader reader, Class<T> declaredType ) throws JAXBException;
 
@@ -766,7 +766,7 @@
      * @throws IllegalStateException
      *      If <tt>reader</tt> is not pointing to a START_DOCUMENT or
      *      START_ELEMENT event.
-     * @since JAXB2.0
+     * @since 1.6, JAXB 2.0
      * @see #unmarshal(javax.xml.stream.XMLEventReader, Class)
      */
     public Object unmarshal( javax.xml.stream.XMLEventReader reader )
@@ -802,7 +802,7 @@
      *     binding.  See <a href="#unmarshalEx">Unmarshalling XML Data</a>
      * @throws IllegalArgumentException
      *      If any parameter is null
-     * @since JAXB2.0
+     * @since 1.6, JAXB 2.0
      */
     public <T> JAXBElement<T> unmarshal( javax.xml.stream.XMLEventReader reader, Class<T> declaredType ) throws JAXBException;
 
@@ -962,7 +962,7 @@
      * @throws UnsupportedOperationException could be thrown if this method is
      *         invoked on an Unmarshaller created from a JAXBContext referencing
      *         JAXB 1.0 mapped classes
-     * @since JAXB2.0
+     * @since 1.6, JAXB 2.0
      */
     public void setSchema( javax.xml.validation.Schema schema );
 
@@ -986,7 +986,7 @@
      * @throws UnsupportedOperationException could be thrown if this method is
      *         invoked on an Unmarshaller created from a JAXBContext referencing
      *         JAXB 1.0 mapped classes
-     * @since JAXB2.0
+     * @since 1.6, JAXB 2.0
      */
     public javax.xml.validation.Schema getSchema();
 
@@ -1001,7 +1001,7 @@
      *      if the adapter parameter is null.
      * @throws UnsupportedOperationException
      *      if invoked agains a JAXB 1.0 implementation.
-     * @since JAXB2.0
+     * @since 1.6, JAXB 2.0
      */
     public void setAdapter( XmlAdapter adapter );
 
@@ -1030,7 +1030,7 @@
      *      if the type parameter is null.
      * @throws UnsupportedOperationException
      *      if invoked agains a JAXB 1.0 implementation.
-     * @since JAXB2.0
+     * @since 1.6, JAXB 2.0
      */
     public <A extends XmlAdapter> void setAdapter( Class<A> type, A adapter );
 
@@ -1043,7 +1043,7 @@
      *      if the type parameter is null.
      * @throws UnsupportedOperationException
      *      if invoked agains a JAXB 1.0 implementation.
-     * @since JAXB2.0
+     * @since 1.6, JAXB 2.0
      */
     public <A extends XmlAdapter> A getAdapter( Class<A> type );
 
@@ -1081,7 +1081,7 @@
      * (@link #setListener(Listener)}
      * (@link #getListener()}
      *
-     * @since JAXB2.0
+     * @since 1.6, JAXB 2.0
      */
     public static abstract class Listener {
         /**
@@ -1128,7 +1128,7 @@
      * One can unregister current Listener by setting listener to <tt>null</tt>.
      *
      * @param listener  provides unmarshal event callbacks for this {@link Unmarshaller}
-     * @since JAXB2.0
+     * @since 1.6, JAXB 2.0
      */
     public void     setListener(Listener listener);
 
@@ -1136,7 +1136,7 @@
      * <p>Return {@link Listener} registered with this {@link Unmarshaller}.
      *
      * @return registered {@link Listener} or <code>null</code> if no Listener is registered with this Unmarshaller.
-     * @since JAXB2.0
+     * @since 1.6, JAXB 2.0
      */
     public Listener getListener();
 }
--- a/jaxws/src/share/jaxws_classes/javax/xml/bind/UnmarshallerHandler.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/UnmarshallerHandler.java	Wed Jul 05 19:53:51 2017 +0200
@@ -57,7 +57,7 @@
  *
  * @author <ul><li>Kohsuke KAWAGUCHI, Sun Microsystems, Inc.</li></ul>
  * @see Unmarshaller#getUnmarshallerHandler()
- * @since JAXB1.0
+ * @since 1.6, JAXB 1.0
  */
 public interface UnmarshallerHandler extends ContentHandler
 {
--- a/jaxws/src/share/jaxws_classes/javax/xml/bind/ValidationEvent.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/ValidationEvent.java	Wed Jul 05 19:53:51 2017 +0200
@@ -34,7 +34,7 @@
  * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems, Inc.</li></ul>
  * @see Validator
  * @see ValidationEventHandler
- * @since JAXB1.0
+ * @since 1.6, JAXB 1.0
  */
 public interface ValidationEvent {
 
--- a/jaxws/src/share/jaxws_classes/javax/xml/bind/ValidationEventHandler.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/ValidationEventHandler.java	Wed Jul 05 19:53:51 2017 +0200
@@ -65,7 +65,7 @@
  * @see Marshaller
  * @see ValidationEvent
  * @see javax.xml.bind.util.ValidationEventCollector
- * @since JAXB1.0
+ * @since 1.6, JAXB 1.0
  */
 public interface ValidationEventHandler {
     /**
--- a/jaxws/src/share/jaxws_classes/javax/xml/bind/ValidationEventLocator.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/ValidationEventLocator.java	Wed Jul 05 19:53:51 2017 +0200
@@ -40,7 +40,7 @@
  * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems, Inc.</li></ul>
  * @see Validator
  * @see ValidationEvent
- * @since JAXB1.0
+ * @since 1.6, JAXB 1.0
  */
 public interface ValidationEventLocator {
 
--- a/jaxws/src/share/jaxws_classes/javax/xml/bind/ValidationException.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/ValidationException.java	Wed Jul 05 19:53:51 2017 +0200
@@ -38,7 +38,7 @@
  * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li></ul>
  * @see JAXBException
  * @see Validator
- * @since JAXB1.0
+ * @since 1.6, JAXB 1.0
  */
 public class ValidationException extends JAXBException {
 
--- a/jaxws/src/share/jaxws_classes/javax/xml/bind/Validator.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/Validator.java	Wed Jul 05 19:53:51 2017 +0200
@@ -154,7 +154,7 @@
  * @see ValidationEventHandler
  * @see ValidationEvent
  * @see javax.xml.bind.util.ValidationEventCollector
- * @since JAXB1.0
+ * @since 1.6, JAXB 1.0
  * @deprecated since JAXB 2.0
  */
 public interface Validator {
--- a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/DomHandler.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/DomHandler.java	Wed Jul 05 19:53:51 2017 +0200
@@ -49,7 +49,7 @@
  * be called from applications.
  *
  * @author Kohsuke Kawaguchi
- * @since JAXB2.0
+ * @since 1.6, JAXB 2.0
  */
 public interface DomHandler<ElementT,ResultT extends Result> {
     /**
--- a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/W3CDomHandler.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/W3CDomHandler.java	Wed Jul 05 19:53:51 2017 +0200
@@ -40,7 +40,7 @@
  * {@link DomHandler} implementation for W3C DOM (<code>org.w3c.dom</code> package.)
  *
  * @author Kohsuke Kawaguchi
- * @since JAXB2.0
+ * @since 1.6, JAXB 2.0
  */
 public class W3CDomHandler implements DomHandler<Element,DOMResult> {
 
--- a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlAccessOrder.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlAccessOrder.java	Wed Jul 05 19:53:51 2017 +0200
@@ -30,7 +30,7 @@
  * fields in a JAXB bound class.
  *
  * @author Sekhar Vajjhala, Sun Microsystems, Inc.
- * @since JAXB2.0
+ * @since 1.6, JAXB 2.0
  * @see XmlAccessorOrder
  */
 
--- a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlAccessType.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlAccessType.java	Wed Jul 05 19:53:51 2017 +0200
@@ -32,7 +32,7 @@
  * properties.
  *
  * @author Sekhar Vajjhala, Sun Microsystems, Inc.
- * @since JAXB2.0
+ * @since 1.6, JAXB 2.0
  * @see XmlAccessorType
  */
 
--- a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlAccessorOrder.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlAccessorOrder.java	Wed Jul 05 19:53:51 2017 +0200
@@ -70,7 +70,7 @@
  *    following annotations at the package level: {@link XmlJavaTypeAdapter}.
  *
  * @author Sekhar Vajjhala, Sun Microsystems, Inc.
- * @since JAXB2.0
+ * @since 1.6, JAXB 2.0
  * @see XmlAccessOrder
  */
 
--- a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlAccessorType.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlAccessorType.java	Wed Jul 05 19:53:51 2017 +0200
@@ -84,7 +84,7 @@
  *    following annotations at the package level: {@link XmlJavaTypeAdapter}.
  *
  * @author Sekhar Vajjhala, Sun Microsystems, Inc.
- * @since JAXB2.0
+ * @since 1.6, JAXB 2.0
  * @see XmlAccessType
  */
 
--- a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlAnyAttribute.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlAnyAttribute.java	Wed Jul 05 19:53:51 2017 +0200
@@ -66,7 +66,7 @@
  * map's key. The key's value is the String value of the attribute.
  *
  * @author Kohsuke Kawaguchi, Sun Microsystems, Inc.
- * @since JAXB2.0
+ * @since 1.6, JAXB 2.0
  */
 @Retention(RUNTIME)
 @Target({FIELD,METHOD})
--- a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlAnyElement.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlAnyElement.java	Wed Jul 05 19:53:51 2017 +0200
@@ -243,7 +243,7 @@
  * </pre>
  *
  * @author Kohsuke Kawaguchi
- * @since JAXB2.0
+ * @since 1.6, JAXB 2.0
  */
 @Retention(RUNTIME)
 @Target({FIELD,METHOD})
--- a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlAttachmentRef.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlAttachmentRef.java	Wed Jul 05 19:53:51 2017 +0200
@@ -66,7 +66,7 @@
  * The above binding supports WS-I AP 1.0 <a href="http://www.ws-i.org/Profiles/AttachmentsProfile-1.0-2004-08-24.html#Referencing_Attachments_from_the_SOAP_Envelope">WS-I Attachments Profile Version 1.0.</a>
  *
  * @author Kohsuke Kawaguchi
- * @since JAXB2.0
+ * @since 1.6, JAXB 2.0
  */
 @Retention(RUNTIME)
 @Target({FIELD,METHOD,PARAMETER})
--- a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlAttribute.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlAttribute.java	Wed Jul 05 19:53:51 2017 +0200
@@ -122,7 +122,7 @@
  * </pre>
  * @author Sekhar Vajjhala, Sun Microsystems, Inc.
  * @see XmlType
- * @since JAXB2.0
+ * @since 1.6, JAXB 2.0
  */
 
 @Retention(RUNTIME) @Target({FIELD, METHOD})
--- a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlElement.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlElement.java	Wed Jul 05 19:53:51 2017 +0200
@@ -134,7 +134,7 @@
  *
  * <p>
  * @author Sekhar Vajjhala, Sun Microsystems, Inc.
- * @since JAXB2.0
+ * @since 1.6, JAXB 2.0
  */
 
 @Retention(RUNTIME) @Target({FIELD, METHOD, PARAMETER})
--- a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlElementDecl.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlElementDecl.java	Wed Jul 05 19:53:51 2017 +0200
@@ -130,7 +130,7 @@
  * name "foo".
  *
  * @see XmlRegistry
- * @since JAXB 2.0
+ * @since 1.6, JAXB 2.0
  */
 @Retention(RUNTIME)
 @Target({METHOD})
--- a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlElementRef.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlElementRef.java	Wed Jul 05 19:53:51 2017 +0200
@@ -216,7 +216,7 @@
  *
  * @author <ul><li>Kohsuke Kawaguchi, Sun Microsystems,Inc. </li><li>Sekhar Vajjhala, Sun Microsystems, Inc.</li></ul>
  * @see XmlElementRefs
- * @since JAXB2.0
+ * @since 1.6, JAXB 2.0
  */
 @Retention(RUNTIME)
 @Target({FIELD,METHOD})
@@ -284,7 +284,7 @@
      * For compatibility with JAXB 2.1, this property defaults to <tt>true</tt>,
      * despite the fact that {@link XmlElement#required()} defaults to false.
      *
-     * @since 2.2
+     * @since 1.7, JAXB 2.2
      */
     boolean required() default true;
 }
--- a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlElementRefs.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlElementRefs.java	Wed Jul 05 19:53:51 2017 +0200
@@ -50,7 +50,7 @@
  *
  * @see XmlElementWrapper
  * @see XmlElementRef
- * @since JAXB2.0
+ * @since 1.6, JAXB 2.0
  */
 @Retention(RUNTIME)
 @Target({FIELD,METHOD})
--- a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlElementWrapper.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlElementWrapper.java	Wed Jul 05 19:53:51 2017 +0200
@@ -87,7 +87,7 @@
  * @see XmlElements
  * @see XmlElementRef
  * @see XmlElementRefs
- * @since JAXB2.0
+ * @since 1.6, JAXB 2.0
  *
  */
 
@@ -139,7 +139,7 @@
      * simply a mechanism to let users express their application constraints
      * better.
      *
-     * @since JAXB 2.1
+     * @since 1.6, JAXB 2.1
      */
     boolean required() default false;
 }
--- a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlElements.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlElements.java	Wed Jul 05 19:53:51 2017 +0200
@@ -166,7 +166,7 @@
  * @see XmlElementRef
  * @see XmlElementRefs
  * @see XmlJavaTypeAdapter
- * @since JAXB2.0
+ * @since 1.6, JAXB 2.0
  */
 @Retention(RUNTIME) @Target({FIELD,METHOD})
 public @interface XmlElements {
--- a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlEnum.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlEnum.java	Wed Jul 05 19:53:51 2017 +0200
@@ -62,7 +62,7 @@
  *
  * <p><b>Examples:</b> See examples in {@link XmlEnumValue}
  *
- * @since JAXB2.0
+ * @since 1.6, JAXB 2.0
  */
 
 @Retention(RUNTIME) @Target({TYPE})
--- a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlEnumValue.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlEnumValue.java	Wed Jul 05 19:53:51 2017 +0200
@@ -114,7 +114,7 @@
  *     &lt;/xs:simpleType>
  * </pre>
  *
- * @since JAXB 2.0
+ * @since 1.6, JAXB 2.0
  */
 @Retention(RUNTIME)
 @Target({FIELD})
--- a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlID.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlID.java	Wed Jul 05 19:53:51 2017 +0200
@@ -87,7 +87,7 @@
  *
  * @author Sekhar Vajjhala, Sun Microsystems, Inc.
  * @see XmlIDREF
- * @since JAXB2.0
+ * @since 1.6, JAXB 2.0
  */
 
 @Retention(RUNTIME) @Target({FIELD, METHOD})
--- a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlIDREF.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlIDREF.java	Wed Jul 05 19:53:51 2017 +0200
@@ -243,7 +243,7 @@
  * </pre>
  * @author Sekhar Vajjhala, Sun Microsystems, Inc.
  * @see XmlID
- * @since JAXB2.0
+ * @since 1.6, JAXB 2.0
  */
 
 @Retention(RUNTIME) @Target({FIELD, METHOD})
--- a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlInlineBinaryData.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlInlineBinaryData.java	Wed Jul 05 19:53:51 2017 +0200
@@ -51,7 +51,7 @@
  * ever called for the property. The binary data will always be inlined.
  *
  * @author Joseph Fialli
- * @since JAXB2.0
+ * @since 1.6, JAXB 2.0
  */
 @Retention(RUNTIME)
 @Target({FIELD,METHOD,TYPE})
--- a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlList.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlList.java	Wed Jul 05 19:53:51 2017 +0200
@@ -104,7 +104,7 @@
  *  </ul>
  *
  * @author <ul><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Sekhar Vajjhala, Sun Microsystems, Inc.</li></ul>
- * @since JAXB2.0
+ * @since 1.6, JAXB 2.0
  */
 @Retention(RUNTIME) @Target({FIELD,METHOD,PARAMETER})
 public @interface XmlList {
--- a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlMimeType.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlMimeType.java	Wed Jul 05 19:53:51 2017 +0200
@@ -47,7 +47,7 @@
  * the value of the attribute takes precedence and that will control the marshalling.
  *
  * @author Kohsuke Kawaguchi
- * @since JAXB2.0
+ * @since 1.6, JAXB 2.0
  */
 @Retention(RUNTIME)
 @Target({FIELD,METHOD,PARAMETER})
--- a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlMixed.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlMixed.java	Wed Jul 05 19:53:51 2017 +0200
@@ -124,7 +124,7 @@
  * <p>See "Package Specification" in javax.xml.bind.package javadoc for
  * additional common information.</p>
  * @author Kohsuke Kawaguchi
- * @since JAXB2.0
+ * @since 1.6, JAXB 2.0
  */
 @Retention(RUNTIME)
 @Target({FIELD,METHOD})
--- a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlNs.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlNs.java	Wed Jul 05 19:53:51 2017 +0200
@@ -42,7 +42,7 @@
  *
  * <p><b>Example:</b>See <tt>XmlSchema</tt> annotation type for an example.
  * @author Sekhar Vajjhala, Sun Microsystems, Inc.
- * @since JAXB2.0
+ * @since 1.6, JAXB 2.0
  */
 
 @Retention(RUNTIME) @Target({})
--- a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlNsForm.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlNsForm.java	Wed Jul 05 19:53:51 2017 +0200
@@ -61,6 +61,6 @@
  * </table>
  *
  * @author Sekhar Vajjhala, Sun Microsystems, Inc.
- * @since JAXB2.0
+ * @since 1.6, JAXB 2.0
  */
 public enum XmlNsForm {UNQUALIFIED, QUALIFIED, UNSET}
--- a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlRegistry.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlRegistry.java	Wed Jul 05 19:53:51 2017 +0200
@@ -34,7 +34,7 @@
  * Marks a class that has {@link XmlElementDecl}s.
  *
  * @author <ul><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Sekhar Vajjhala, Sun Microsystems, Inc.</li></ul>
- * @since JAXB 2.0
+ * @since 1.6, JAXB 2.0
  * @see XmlElementDecl
  */
 @Retention(RUNTIME)
--- a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlRootElement.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlRootElement.java	Wed Jul 05 19:53:51 2017 +0200
@@ -155,7 +155,7 @@
  * </pre>
  *
  * @author Sekhar Vajjhala, Sun Microsystems, Inc.
- * @since JAXB2.0
+ * @since 1.6, JAXB 2.0
  */
 @Retention(RUNTIME)
 @Target({TYPE})
--- a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlSchema.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlSchema.java	Wed Jul 05 19:53:51 2017 +0200
@@ -114,7 +114,7 @@
  * </pre>
 
  * @author Sekhar Vajjhala, Sun Microsystems, Inc.
- * @since JAXB2.0
+ * @since 1.6, JAXB 2.0
  */
 
 @Retention(RUNTIME) @Target(PACKAGE)
@@ -191,7 +191,7 @@
      * such attribute), for example so that the user can specify a local
      * copy of the resource through the command line interface.
      *
-     * @since JAXB2.1
+     * @since 1.6, JAXB 2.1
      */
     String location() default NO_LOCATION;
 
--- a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlSchemaType.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlSchemaType.java	Wed Jul 05 19:53:51 2017 +0200
@@ -83,7 +83,7 @@
  *     }
  * </pre>
  *
- * @since JAXB2.0
+ * @since 1.6, JAXB 2.0
  */
 
 @Retention(RUNTIME) @Target({FIELD,METHOD,PACKAGE})
--- a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlSchemaTypes.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlSchemaTypes.java	Wed Jul 05 19:53:51 2017 +0200
@@ -50,7 +50,7 @@
  *
  * @author <ul><li>Sekhar Vajjhala, Sun Microsystems, Inc.</li></ul>
  * @see XmlSchemaType
- * @since JAXB2.0
+ * @since 1.6, JAXB 2.0
  */
 @Retention(RUNTIME) @Target({PACKAGE})
 public @interface XmlSchemaTypes {
--- a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlSeeAlso.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlSeeAlso.java	Wed Jul 05 19:53:51 2017 +0200
@@ -70,7 +70,7 @@
  * correctly bind <tt>Dog</tt> and <tt>Cat</tt>.
  *
  * @author Kohsuke Kawaguchi
- * @since JAXB2.1
+ * @since 1.6, JAXB 2.1
  */
 @Target({ElementType.TYPE})
 @Retention(RUNTIME)
--- a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlTransient.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlTransient.java	Wed Jul 05 19:53:51 2017 +0200
@@ -88,7 +88,7 @@
  * </pre>
  *
  * @author Sekhar Vajjhala, Sun Microsystems, Inc.
- * @since JAXB2.0
+ * @since 1.6, JAXB 2.0
  */
 
 @Retention(RUNTIME) @Target({FIELD, METHOD, TYPE})
--- a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlType.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlType.java	Wed Jul 05 19:53:51 2017 +0200
@@ -379,7 +379,7 @@
  * @see XmlAttribute
  * @see XmlValue
  * @see XmlSchema
- * @since JAXB2.0
+ * @since 1.6, JAXB 2.0
  */
 
 @Retention(RUNTIME) @Target({TYPE})
--- a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlValue.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlValue.java	Wed Jul 05 19:53:51 2017 +0200
@@ -124,7 +124,7 @@
  *
  * @author Sekhar Vajjhala, Sun Microsystems, Inc.
  * @see XmlType
- * @since JAXB2.0
+ * @since 1.6, JAXB 2.0
  */
 
 @Retention(RUNTIME) @Target({FIELD, METHOD})
--- a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/adapters/CollapsedStringAdapter.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/adapters/CollapsedStringAdapter.java	Wed Jul 05 19:53:51 2017 +0200
@@ -35,7 +35,7 @@
  * sequnce of tab, CR, LF, and SP by a single whitespace character ' '.
  *
  * @author Kohsuke Kawaguchi
- * @since JAXB 2.0
+ * @since 1.6, JAXB 2.0
  */
 public class CollapsedStringAdapter extends XmlAdapter<String,String> {
     /**
--- a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/adapters/HexBinaryAdapter.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/adapters/HexBinaryAdapter.java	Wed Jul 05 19:53:51 2017 +0200
@@ -34,7 +34,7 @@
  * This {@link XmlAdapter} binds <tt>byte[]</tt> to the hexBinary representation in XML.
  *
  * @author Kohsuke Kawaguchi
- * @since JAXB 2.0
+ * @since 1.6, JAXB 2.0
  */
 public final class HexBinaryAdapter extends XmlAdapter<String,byte[]> {
     public byte[] unmarshal(String s) {
--- a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/adapters/NormalizedStringAdapter.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/adapters/NormalizedStringAdapter.java	Wed Jul 05 19:53:51 2017 +0200
@@ -35,7 +35,7 @@
  * as specified in <a href="http://www.w3.org/TR/xmlschema-2/#rf-whiteSpace">the whitespace facet 'replace'</a>
  *
  * @author Kohsuke Kawaguchi, Martin Grebac
- * @since JAXB 2.0
+ * @since 1.6, JAXB 2.0
  */
 public final class NormalizedStringAdapter extends XmlAdapter<String,String> {
     /**
--- a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/adapters/XmlAdapter.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/adapters/XmlAdapter.java	Wed Jul 05 19:53:51 2017 +0200
@@ -160,7 +160,7 @@
  *
  * @author <ul><li>Sekhar Vajjhala, Sun Microsystems Inc.</li> <li> Kohsuke Kawaguchi, Sun Microsystems Inc.</li></ul>
  * @see XmlJavaTypeAdapter
- * @since JAXB 2.0
+ * @since 1.6, JAXB 2.0
  */
 public abstract class XmlAdapter<ValueType,BoundType> {
 
--- a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/adapters/XmlJavaTypeAdapter.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/adapters/XmlJavaTypeAdapter.java	Wed Jul 05 19:53:51 2017 +0200
@@ -86,7 +86,7 @@
  * <p><b> Example: </b> See example in {@link XmlAdapter}
  *
  * @author <ul><li>Sekhar Vajjhala, Sun Microsystems Inc.</li> <li> Kohsuke Kawaguchi, Sun Microsystems Inc.</li></ul>
- * @since JAXB2.0
+ * @since 1.6, JAXB 2.0
  * @see XmlAdapter
  */
 
--- a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/adapters/XmlJavaTypeAdapters.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/adapters/XmlJavaTypeAdapters.java	Wed Jul 05 19:53:51 2017 +0200
@@ -51,7 +51,7 @@
  *
  * @author <ul><li>Sekhar Vajjhala, Sun Microsystems, Inc.</li></ul>
  * @see XmlJavaTypeAdapter
- * @since JAXB2.0
+ * @since 1.6, JAXB 2.0
  */
 @Retention(RUNTIME) @Target({PACKAGE})
 public @interface XmlJavaTypeAdapters {
--- a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/package.html	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/package.html	Wed Jul 05 19:53:51 2017 +0200
@@ -279,7 +279,7 @@
         </table>
 
         <!-- Put @see and @since tags down here. -->
-        @since JAXB 2.0
+        @since 1.6, JAXB 2.0
     </body>
 </html>
 
--- a/jaxws/src/share/jaxws_classes/javax/xml/bind/attachment/AttachmentMarshaller.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/attachment/AttachmentMarshaller.java	Wed Jul 05 19:53:51 2017 +0200
@@ -50,7 +50,7 @@
  * @author Marc Hadley
  * @author Kohsuke Kawaguchi
  * @author Joseph Fialli
- * @since JAXB 2.0
+ * @since 1.6, JAXB 2.0
  *
  * @see Marshaller#setAttachmentMarshaller(AttachmentMarshaller)
  *
--- a/jaxws/src/share/jaxws_classes/javax/xml/bind/attachment/AttachmentUnmarshaller.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/attachment/AttachmentUnmarshaller.java	Wed Jul 05 19:53:51 2017 +0200
@@ -56,7 +56,7 @@
  * @author Kohsuke Kawaguchi
  * @author Joseph Fialli
  *
- * @since JAXB 2.0
+ * @since 1.6, JAXB 2.0
  *
  * @see javax.xml.bind.Unmarshaller#setAttachmentUnmarshaller(AttachmentUnmarshaller)
  *
--- a/jaxws/src/share/jaxws_classes/javax/xml/bind/attachment/package.html	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/attachment/package.html	Wed Jul 05 19:53:51 2017 +0200
@@ -61,7 +61,7 @@
         </ul>
 
         <!-- Put @see and @since tags down here. -->
-        @since JAXB 2.0
+        @since 1.6, JAXB 2.0
     </body>
 </html>
 
--- a/jaxws/src/share/jaxws_classes/javax/xml/bind/helpers/AbstractMarshallerImpl.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/helpers/AbstractMarshallerImpl.java	Wed Jul 05 19:53:51 2017 +0200
@@ -62,7 +62,7 @@
  *
  * @author <ul><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li></ul>
  * @see javax.xml.bind.Marshaller
- * @since JAXB1.0
+ * @since 1.6, JAXB 1.0
  */
 public abstract class AbstractMarshallerImpl implements Marshaller
 {
--- a/jaxws/src/share/jaxws_classes/javax/xml/bind/helpers/AbstractUnmarshallerImpl.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/helpers/AbstractUnmarshallerImpl.java	Wed Jul 05 19:53:51 2017 +0200
@@ -68,7 +68,7 @@
  *         <li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li>
  *         </ul>
  * @see javax.xml.bind.Unmarshaller
- * @since JAXB1.0
+ * @since 1.6, JAXB 1.0
  */
 public abstract class AbstractUnmarshallerImpl implements Unmarshaller
 {
--- a/jaxws/src/share/jaxws_classes/javax/xml/bind/helpers/DefaultValidationEventHandler.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/helpers/DefaultValidationEventHandler.java	Wed Jul 05 19:53:51 2017 +0200
@@ -52,7 +52,7 @@
  * @see javax.xml.bind.Unmarshaller
  * @see javax.xml.bind.Validator
  * @see javax.xml.bind.ValidationEventHandler
- * @since JAXB1.0
+ * @since 1.6, JAXB 1.0
  */
 public class DefaultValidationEventHandler implements ValidationEventHandler {
 
--- a/jaxws/src/share/jaxws_classes/javax/xml/bind/helpers/NotIdentifiableEventImpl.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/helpers/NotIdentifiableEventImpl.java	Wed Jul 05 19:53:51 2017 +0200
@@ -41,7 +41,7 @@
  * @see javax.xml.bind.ValidationEventHandler
  * @see javax.xml.bind.ValidationEvent
  * @see javax.xml.bind.ValidationEventLocator
- * @since JAXB1.0
+ * @since 1.6, JAXB 1.0
  */
 public class NotIdentifiableEventImpl
     extends ValidationEventImpl
--- a/jaxws/src/share/jaxws_classes/javax/xml/bind/helpers/ParseConversionEventImpl.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/helpers/ParseConversionEventImpl.java	Wed Jul 05 19:53:51 2017 +0200
@@ -42,7 +42,7 @@
  * @see javax.xml.bind.ValidationEventHandler
  * @see javax.xml.bind.ValidationEvent
  * @see javax.xml.bind.ValidationEventLocator
- * @since JAXB1.0
+ * @since 1.6, JAXB 1.0
  */
 public class ParseConversionEventImpl
     extends ValidationEventImpl
--- a/jaxws/src/share/jaxws_classes/javax/xml/bind/helpers/PrintConversionEventImpl.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/helpers/PrintConversionEventImpl.java	Wed Jul 05 19:53:51 2017 +0200
@@ -42,7 +42,7 @@
  * @see javax.xml.bind.ValidationEventHandler
  * @see javax.xml.bind.ValidationEvent
  * @see javax.xml.bind.ValidationEventLocator
- * @since JAXB1.0
+ * @since 1.6, JAXB 1.0
  */
 public class PrintConversionEventImpl
     extends ValidationEventImpl
--- a/jaxws/src/share/jaxws_classes/javax/xml/bind/helpers/ValidationEventImpl.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/helpers/ValidationEventImpl.java	Wed Jul 05 19:53:51 2017 +0200
@@ -43,7 +43,7 @@
  * @see javax.xml.bind.ValidationEventHandler
  * @see javax.xml.bind.ValidationEvent
  * @see javax.xml.bind.ValidationEventLocator
- * @since JAXB1.0
+ * @since 1.6, JAXB 1.0
  */
 public class ValidationEventImpl implements ValidationEvent
 {
--- a/jaxws/src/share/jaxws_classes/javax/xml/bind/helpers/ValidationEventLocatorImpl.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/helpers/ValidationEventLocatorImpl.java	Wed Jul 05 19:53:51 2017 +0200
@@ -47,7 +47,7 @@
  * @see javax.xml.bind.ValidationEventHandler
  * @see javax.xml.bind.ValidationEvent
  * @see javax.xml.bind.ValidationEventLocator
- * @since JAXB1.0
+ * @since 1.6, JAXB 1.0
  */
 public class ValidationEventLocatorImpl implements ValidationEventLocator
 {
--- a/jaxws/src/share/jaxws_classes/javax/xml/bind/util/JAXBResult.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/util/JAXBResult.java	Wed Jul 05 19:53:51 2017 +0200
@@ -71,6 +71,7 @@
  *
  * @author
  *      Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+ * @since 1.6
  */
 public class JAXBResult extends SAXResult {
 
--- a/jaxws/src/share/jaxws_classes/javax/xml/bind/util/JAXBSource.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/util/JAXBSource.java	Wed Jul 05 19:53:51 2017 +0200
@@ -87,6 +87,7 @@
  *
  * @author
  *      Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+ * @since 1.6
  */
 public class JAXBSource extends SAXSource {
 
--- a/jaxws/src/share/jaxws_classes/javax/xml/bind/util/ValidationEventCollector.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/util/ValidationEventCollector.java	Wed Jul 05 19:53:51 2017 +0200
@@ -45,7 +45,7 @@
  * @see javax.xml.bind.ValidationEventHandler
  * @see javax.xml.bind.ValidationEvent
  * @see javax.xml.bind.ValidationEventLocator
- * @since JAXB1.0
+ * @since 1.6, JAXB 1.0
  */
 public class ValidationEventCollector implements ValidationEventHandler
 {
--- a/jaxws/src/share/jaxws_classes/javax/xml/soap/AttachmentPart.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/soap/AttachmentPart.java	Wed Jul 05 19:53:51 2017 +0200
@@ -114,6 +114,8 @@
  * <PRE>
  *     ap1.clearContent();
  * </PRE>
+ *
+ * @since 1.6
  */
 
 public abstract class AttachmentPart {
@@ -190,7 +192,7 @@
      *      <code>AttachmentPart</code> object or if there was a data
      *      transformation error.
      *
-     * @since SAAJ 1.3
+     * @since 1.6, SAAJ 1.3
      * @see #getRawContentBytes
      */
     public abstract InputStream getRawContent() throws SOAPException;
@@ -208,7 +210,7 @@
      *      <code>AttachmentPart</code> object or if there was a data
      *      transformation error.
      *
-     * @since SAAJ 1.3
+     * @since 1.6, SAAJ 1.3
      */
     public abstract byte[] getRawContentBytes() throws SOAPException;
 
@@ -225,7 +227,7 @@
      *      <code>AttachmentPart</code> object or if there was a data
      *      transformation error.
      *
-     * @since SAAJ 1.3
+     * @since 1.6, SAAJ 1.3
      */
     public abstract InputStream getBase64Content() throws SOAPException;
 
@@ -267,7 +269,7 @@
      *
      * @exception SOAPException if an there is an error in setting the content
      * @exception NullPointerException if <code>content</code> is null
-     * @since SAAJ 1.3
+     * @since 1.6, SAAJ 1.3
      */
     public abstract void setRawContent(InputStream content, String contentType) throws SOAPException;
 
@@ -285,7 +287,7 @@
      *
      * @exception SOAPException if an there is an error in setting the content
      * or content is null
-     * @since SAAJ 1.3
+     * @since 1.6, SAAJ 1.3
      */
     public abstract void setRawContentBytes(
         byte[] content, int offset, int len,  String contentType)
@@ -309,7 +311,7 @@
      * @exception SOAPException if an there is an error in setting the content
      * @exception NullPointerException if <code>content</code> is null
      *
-     * @since SAAJ 1.3
+     * @since 1.6, SAAJ 1.3
      */
     public abstract void setBase64Content(
         InputStream content, String contentType) throws SOAPException;
--- a/jaxws/src/share/jaxws_classes/javax/xml/soap/Detail.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/soap/Detail.java	Wed Jul 05 19:53:51 2017 +0200
@@ -56,6 +56,8 @@
  *    d.addDetailEntry(name);
  *    Iterator it = d.getDetailEntries();
  * </PRE>
+ *
+ * @since 1.6
  */
 public interface Detail extends SOAPFaultElement {
 
@@ -85,7 +87,7 @@
      * DetailEntry object to this Detail object.
      *
      * @see Detail#addDetailEntry(Name name)
-     * @since SAAJ 1.3
+     * @since 1.6, SAAJ 1.3
      */
     public DetailEntry addDetailEntry(QName qname) throws SOAPException;
 
--- a/jaxws/src/share/jaxws_classes/javax/xml/soap/DetailEntry.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/soap/DetailEntry.java	Wed Jul 05 19:53:51 2017 +0200
@@ -30,6 +30,8 @@
  * a <code>SOAPFault</code> object.  A <code>DetailEntry</code> object,
  * which carries information about errors related to the <code>SOAPBody</code>
  * object that contains it, is application-specific.
+ *
+ * @since 1.6
  */
 public interface DetailEntry extends SOAPElement {
 
--- a/jaxws/src/share/jaxws_classes/javax/xml/soap/MessageFactory.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/soap/MessageFactory.java	Wed Jul 05 19:53:51 2017 +0200
@@ -63,6 +63,8 @@
  *        This method can be used internally by a service implementation to
  *        create a message that is a response to a request.
  * </UL>
+ *
+ * @since 1.6
  */
 public abstract class MessageFactory {
 
@@ -140,7 +142,7 @@
      * @exception SOAPException if there was an error in creating the
      *            specified implementation of  <code>MessageFactory</code>.
      * @see SAAJMetaFactory
-     * @since SAAJ 1.3
+     * @since 1.6, SAAJ 1.3
      */
     public static MessageFactory newInstance(String protocol) throws SOAPException {
         return SAAJMetaFactory.getInstance().newMessageFactory(protocol);
--- a/jaxws/src/share/jaxws_classes/javax/xml/soap/MimeHeader.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/soap/MimeHeader.java	Wed Jul 05 19:53:51 2017 +0200
@@ -32,6 +32,7 @@
  * object.
  *
  * @see MimeHeaders
+ * @since 1.6
  */
 public class MimeHeader {
 
--- a/jaxws/src/share/jaxws_classes/javax/xml/soap/MimeHeaders.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/soap/MimeHeaders.java	Wed Jul 05 19:53:51 2017 +0200
@@ -39,6 +39,7 @@
  * API.
  * @see SOAPMessage#getAttachments
  * @see AttachmentPart
+ * @since 1.6
  */
 public class MimeHeaders {
     private Vector headers;
--- a/jaxws/src/share/jaxws_classes/javax/xml/soap/Name.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/soap/Name.java	Wed Jul 05 19:53:51 2017 +0200
@@ -73,6 +73,7 @@
  * in favor of <code>javax.xml.namespace.QName<code>
  * @see SOAPEnvelope#createName(String, String, String) SOAPEnvelope.createName
  * @see SOAPFactory#createName(String, String, String) SOAPFactory.createName
+ * @since 1.6
  */
 public interface Name {
     /**
--- a/jaxws/src/share/jaxws_classes/javax/xml/soap/Node.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/soap/Node.java	Wed Jul 05 19:53:51 2017 +0200
@@ -30,6 +30,8 @@
  * This interface extnends the standard DOM Node interface with methods for
  * getting and setting the value of a node, for
  * getting and setting the parent of a node, and for removing a node.
+ *
+ * @since 1.6
  */
 public interface Node extends org.w3c.dom.Node {
     /**
@@ -61,7 +63,7 @@
      *              node and either has more than one child node or has a child
      *              node that is not a <code>Text</code> node.
      *
-     * @since SAAJ 1.2
+     * @since 1.6, SAAJ 1.2
      */
     public void setValue(String value);
 
--- a/jaxws/src/share/jaxws_classes/javax/xml/soap/SAAJMetaFactory.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/soap/SAAJMetaFactory.java	Wed Jul 05 19:53:51 2017 +0200
@@ -38,7 +38,7 @@
 * class.
 *
 * @author SAAJ RI Development Team
-* @since SAAJ 1.3
+* @since 1.6, SAAJ 1.3
 */
 
 public abstract class SAAJMetaFactory {
--- a/jaxws/src/share/jaxws_classes/javax/xml/soap/SAAJResult.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/soap/SAAJResult.java	Wed Jul 05 19:53:51 2017 +0200
@@ -35,7 +35,7 @@
  *
  * @author XWS-Security Development Team
  *
- * @since SAAJ 1.3
+ * @since 1.6, SAAJ 1.3
  */
 public class SAAJResult extends DOMResult {
 
@@ -53,7 +53,7 @@
      *
      * @throws SOAPException if there is a problem creating a <code>SOAPMessage</code>
      *
-     * @since SAAJ 1.3
+     * @since 1.6, SAAJ 1.3
      */
     public SAAJResult() throws SOAPException {
         this(MessageFactory.newInstance().createMessage());
@@ -79,7 +79,7 @@
      * @throws SOAPException if a <code>SOAPMessage</code> supporting the
      *             specified protocol cannot be created
      *
-     * @since SAAJ 1.3
+     * @since 1.6, SAAJ 1.3
      */
     public SAAJResult(String protocol) throws SOAPException {
         this(MessageFactory.newInstance(protocol).createMessage());
@@ -99,7 +99,7 @@
      *                  populated as a result of some transformation or
      *                  marshalling operation
      *
-     * @since SAAJ 1.3
+     * @since 1.6, SAAJ 1.3
      */
     public SAAJResult(SOAPMessage message) {
         super(message.getSOAPPart());
@@ -116,7 +116,7 @@
      *
      * @param rootNode - the root to which the results will be appended
      *
-     * @since SAAJ 1.3
+     * @since 1.6, SAAJ 1.3
      */
     public SAAJResult(SOAPElement rootNode) {
         super(rootNode);
@@ -125,7 +125,7 @@
 
     /**
      * @return the resulting Tree that was created under the specified root Node.
-     * @since SAAJ 1.3
+     * @since 1.6, SAAJ 1.3
      */
     public javax.xml.soap.Node getResult() {
         return (javax.xml.soap.Node)super.getNode().getFirstChild();
--- a/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPBody.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPBody.java	Wed Jul 05 19:53:51 2017 +0200
@@ -42,6 +42,7 @@
  * error information, is an example of a <code>SOAPBodyElement</code> object.
  *
  * @see SOAPFault
+ * @since 1.6
  */
 public interface SOAPBody extends SOAPElement {
 
@@ -90,7 +91,7 @@
      * @exception SOAPException if there is a SOAP error
      * @see SOAPFault#setFaultCode
      * @see SOAPFault#setFaultString
-     * @since SAAJ 1.2
+     * @since 1.6, SAAJ 1.2
      */
     public SOAPFault addFault(Name faultCode, String faultString, Locale locale) throws SOAPException;
 
@@ -127,7 +128,7 @@
      * @see SOAPFault#setFaultString
      * @see SOAPBody#addFault(Name faultCode, String faultString, Locale locale)
      *
-     * @since SAAJ 1.3
+     * @since 1.6, SAAJ 1.3
      */
     public SOAPFault addFault(QName faultCode, String faultString, Locale locale)
         throws SOAPException;
@@ -164,7 +165,7 @@
      *                if there is a SOAP error
      * @see SOAPFault#setFaultCode
      * @see SOAPFault#setFaultString
-     * @since SAAJ 1.2
+     * @since 1.6, SAAJ 1.2
      */
     public SOAPFault addFault(Name faultCode, String faultString)
         throws SOAPException;
@@ -202,7 +203,7 @@
      * @see SOAPFault#setFaultCode
      * @see SOAPFault#setFaultString
      * @see SOAPBody#addFault(Name faultCode, String faultString)
-     * @since SAAJ 1.3
+     * @since 1.6, SAAJ 1.3
      */
     public SOAPFault addFault(QName faultCode, String faultString)
         throws SOAPException;
@@ -252,7 +253,7 @@
      * @exception SOAPException
      *                if a SOAP error occurs
      * @see SOAPBody#addBodyElement(Name)
-     * @since SAAJ 1.3
+     * @since 1.6, SAAJ 1.3
      */
     public SOAPBodyElement addBodyElement(QName qname) throws SOAPException;
 
@@ -272,7 +273,7 @@
      *         that was added.
      * @exception SOAPException
      *                if the <code>Document</code> cannot be added
-     * @since SAAJ 1.2
+     * @since 1.6, SAAJ 1.2
      */
     public SOAPBodyElement addDocument(org.w3c.dom.Document document)
         throws SOAPException;
@@ -290,7 +291,7 @@
      *                if there is not exactly one child <code>SOAPElement</code> of the <code>
      *              <code>SOAPBody</code>.
      *
-     * @since SAAJ 1.3
+     * @since 1.6, SAAJ 1.3
      */
     public org.w3c.dom.Document extractContentAsDocument()
         throws SOAPException;
--- a/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPBodyElement.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPBodyElement.java	Wed Jul 05 19:53:51 2017 +0200
@@ -38,6 +38,8 @@
  * <PRE>
  *    SOAPBodyElement sbe = sb.addBodyElement(myName);
  * </PRE>
+ *
+ * @since 1.6
  */
 public interface SOAPBodyElement extends SOAPElement {
 }
--- a/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPConnection.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPConnection.java	Wed Jul 05 19:53:51 2017 +0200
@@ -45,6 +45,8 @@
  * directly to a URL following the request/response paradigm.  That is,
  * messages are sent using the method <code>call</code>, which sends the
  * message and then waits until it gets a reply.
+ *
+ * @since 1.6
  */
 public abstract class SOAPConnection {
 
@@ -78,7 +80,7 @@
      * @return the <code>SOAPMessage</code> object that is the response to the
      *                  get message request
      * @throws SOAPException if there is a SOAP error
-     * @since SAAJ 1.3
+     * @since 1.6, SAAJ 1.3
      */
     public SOAPMessage get(Object to)
                                 throws SOAPException {
--- a/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPConnectionFactory.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPConnectionFactory.java	Wed Jul 05 19:53:51 2017 +0200
@@ -32,6 +32,8 @@
  * SAAJ communication infrastructure. Otherwise {@link SOAPConnection} objects
  * can be created by calling <code>createConnection()</code> on the newly
  * created <code>SOAPConnectionFactory</code> object.
+ *
+ * @since 1.6
  */
 public abstract class SOAPConnectionFactory {
     /**
--- a/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPConstants.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPConstants.java	Wed Jul 05 19:53:51 2017 +0200
@@ -29,6 +29,8 @@
 
 /**
  * The definition of constants pertaining to the SOAP protocol.
+ *
+ * @since 1.6
  */
 public interface SOAPConstants {
     /**
@@ -41,7 +43,7 @@
      * argument version of <code>createMessage</code>, an
      * <code>UnsupportedOperationException</code>.
      *
-     * @since  SAAJ 1.3
+     * @since  1.6, SAAJ 1.3
      */
     public static final String DYNAMIC_SOAP_PROTOCOL = "Dynamic Protocol";
 
@@ -49,7 +51,7 @@
      * Used to create <code>MessageFactory</code> instances that create
      * <code>SOAPMessages</code> whose behavior supports the SOAP 1.1  specification.
      *
-     * @since  SAAJ 1.3
+     * @since  1.6, SAAJ 1.3
      */
     public static final String SOAP_1_1_PROTOCOL = "SOAP 1.1 Protocol";
 
@@ -58,26 +60,26 @@
      * <code>SOAPMessages</code> whose behavior supports the SOAP 1.2
      * specification
      *
-     * @since  SAAJ 1.3
+     * @since  1.6, SAAJ 1.3
      */
     public static final String SOAP_1_2_PROTOCOL = "SOAP 1.2 Protocol";
 
     /**
      * The default protocol: SOAP 1.1 for backwards compatibility.
      *
-     * @since SAAJ 1.3
+     * @since 1.6, SAAJ 1.3
      */
     public static final String DEFAULT_SOAP_PROTOCOL = SOAP_1_1_PROTOCOL;
 
     /**
      * The namespace identifier for the SOAP 1.1 envelope.
-     * @since SAAJ 1.3
+     * @since 1.6, SAAJ 1.3
      */
     public static final String
                 URI_NS_SOAP_1_1_ENVELOPE = "http://schemas.xmlsoap.org/soap/envelope/";
     /**
      * The namespace identifier for the SOAP 1.2 envelope.
-     * @since SAAJ 1.3
+     * @since 1.6, SAAJ 1.3
      */
     public static final String
                 URI_NS_SOAP_1_2_ENVELOPE = "http://www.w3.org/2003/05/soap-envelope";
@@ -102,21 +104,21 @@
 
     /**
      * The namespace identifier for the SOAP 1.2 encoding.
-     * @since SAAJ 1.3
+     * @since 1.6, SAAJ 1.3
      */
     public static final String
         URI_NS_SOAP_1_2_ENCODING = "http://www.w3.org/2003/05/soap-encoding";
 
     /**
      * The media type  of the <code>Content-Type</code> MIME header in SOAP 1.1.
-     * @since SAAJ 1.3
+     * @since 1.6, SAAJ 1.3
      */
     public static final String
         SOAP_1_1_CONTENT_TYPE = "text/xml";
 
     /**
      * The media type  of the <code>Content-Type</code> MIME header in SOAP 1.2.
-     * @since SAAJ 1.3
+     * @since 1.6, SAAJ 1.3
      */
     public static final String
         SOAP_1_2_CONTENT_TYPE = "application/soap+xml";
@@ -137,21 +139,21 @@
      * The URI identifying the next application processing a SOAP request as the intended
      * role for a SOAP 1.2 header entry (see section 2.2 of part 1 of the SOAP 1.2
      * specification).
-     * @since SAAJ 1.3
+     * @since 1.6, SAAJ 1.3
      */
     public static final String
         URI_SOAP_1_2_ROLE_NEXT = URI_NS_SOAP_1_2_ENVELOPE + "/role/next";
 
     /**
      * The URI specifying the role None in SOAP 1.2.
-     * @since SAAJ 1.3
+     * @since 1.6, SAAJ 1.3
      */
     public static final String
         URI_SOAP_1_2_ROLE_NONE = URI_NS_SOAP_1_2_ENVELOPE + "/role/none";
 
     /**
      * The URI identifying the ultimate receiver of the SOAP 1.2 message.
-     * @since SAAJ 1.3
+     * @since 1.6, SAAJ 1.3
      */
     public static final String
         URI_SOAP_1_2_ROLE_ULTIMATE_RECEIVER =
@@ -159,41 +161,41 @@
 
     /**
      * The default namespace prefix for http://www.w3.org/2003/05/soap-envelope
-     * @since SAAJ 1.3
+     * @since 1.6, SAAJ 1.3
      */
     public static final String SOAP_ENV_PREFIX = "env";
 
     /**
      * SOAP 1.2 VersionMismatch Fault
-     * @since SAAJ 1.3
+     * @since 1.6, SAAJ 1.3
      */
     public static final QName SOAP_VERSIONMISMATCH_FAULT =
          new QName(URI_NS_SOAP_1_2_ENVELOPE, "VersionMismatch", SOAP_ENV_PREFIX);
 
     /**
      * SOAP 1.2 MustUnderstand Fault
-     * @since SAAJ 1.3
+     * @since 1.6, SAAJ 1.3
      */
     public static final QName SOAP_MUSTUNDERSTAND_FAULT =
          new QName(URI_NS_SOAP_1_2_ENVELOPE, "MustUnderstand", SOAP_ENV_PREFIX);
 
     /**
      * SOAP 1.2 DataEncodingUnknown Fault
-     * @since SAAJ 1.3
+     * @since 1.6, SAAJ 1.3
      */
     public static final QName SOAP_DATAENCODINGUNKNOWN_FAULT =
          new QName(URI_NS_SOAP_1_2_ENVELOPE, "DataEncodingUnknown", SOAP_ENV_PREFIX);
 
     /**
      * SOAP 1.2 Sender Fault
-     * @since SAAJ 1.3
+     * @since 1.6, SAAJ 1.3
      */
     public static final QName SOAP_SENDER_FAULT =
          new QName(URI_NS_SOAP_1_2_ENVELOPE, "Sender", SOAP_ENV_PREFIX);
 
     /**
      * SOAP 1.2 Receiver Fault
-     * @since SAAJ 1.3
+     * @since 1.6, SAAJ 1.3
      */
     public static final QName SOAP_RECEIVER_FAULT =
          new QName(URI_NS_SOAP_1_2_ENVELOPE, "Receiver", SOAP_ENV_PREFIX);
--- a/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPElement.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPElement.java	Wed Jul 05 19:53:51 2017 +0200
@@ -40,6 +40,8 @@
  * objects of the correct type. See {@link #getChildElements()} and
  * {@link <a HREF="package-summary.html#package_description">javax.xml.soap<a>}
  * for details.
+ *
+ * @since 1.6
  */
 public interface SOAPElement extends Node, org.w3c.dom.Element {
 
@@ -74,7 +76,7 @@
      * @exception SOAPException if there is an error in creating the
      *                          <code>SOAPElement</code> object
      * @see SOAPElement#addChildElement(Name)
-     * @since SAAJ 1.3
+     * @since 1.6, SAAJ 1.3
      */
     public SOAPElement addChildElement(QName qname) throws SOAPException;
 
@@ -173,7 +175,7 @@
      * is also useful for recycling portions of a document within a SOAP
      * message.
      *
-     * @since SAAJ 1.2
+     * @since 1.6, SAAJ 1.2
      */
     public abstract void removeContents();
 
@@ -224,7 +226,7 @@
                                 an attribute with <code>QName</code>
                                 <code>qname</code> on this SOAPElement.
      * @see SOAPElement#addAttribute(Name, String)
-     * @since SAAJ 1.3
+     * @since 1.6, SAAJ 1.3
      */
     public SOAPElement addAttribute(QName qname, String value)
         throws SOAPException;
@@ -261,7 +263,7 @@
      * @return a <code>String</code> giving the value of the specified
      *         attribute, Null if there is no such attribute
      * @see SOAPElement#getAttributeValue(Name)
-     * @since SAAJ 1.3
+     * @since 1.6, SAAJ 1.3
      */
     public String getAttributeValue(QName qname);
 
@@ -287,7 +289,7 @@
      *
      * @return an iterator over the QNames of the attributes
      * @see SOAPElement#getAllAttributes()
-     * @since SAAJ 1.3
+     * @since 1.6, SAAJ 1.3
      */
     public Iterator getAllAttributesAsQNames();
 
@@ -322,7 +324,7 @@
      * @return an iterator over the namespace prefixes are within scope of this
      *         <code>SOAPElement</code> object
      *
-     * @since SAAJ 1.2
+     * @since 1.6, SAAJ 1.2
      */
     public Iterator getVisibleNamespacePrefixes();
 
@@ -348,7 +350,7 @@
      *
      * @exception SOAPException if the <code>QName</code> cannot be created.
      *
-     * @since SAAJ 1.3
+     * @since 1.6, SAAJ 1.3
      */
     public QName createQName(String localName, String prefix)
         throws SOAPException;
@@ -366,7 +368,7 @@
      * @return a <code>QName</code> object with the qname of this
      *         <code>SOAPElement</code> object
      * @see SOAPElement#getElementName()
-     * @since SAAJ 1.3
+     * @since 1.6, SAAJ 1.3
      */
     public QName getElementQName();
 
@@ -386,7 +388,7 @@
     *                          is not allowed.
     * @return The renamed Node
     *
-    * @since SAAJ 1.3
+    * @since 1.6, SAAJ 1.3
     */
    public SOAPElement setElementQName(QName newName) throws SOAPException;
 
@@ -409,7 +411,7 @@
      * @return <code>true</code> if the attribute was
      *         removed successfully; <code>false</code> if it was not
      * @see SOAPElement#removeAttribute(Name)
-     * @since SAAJ 1.3
+     * @since 1.6, SAAJ 1.3
      */
     public boolean removeAttribute(QName qname);
 
@@ -496,7 +498,7 @@
      *         in this <code>SOAPElement</code> object with the
      *         specified qname
      * @see SOAPElement#getChildElements(Name)
-     * @since SAAJ 1.3
+     * @since 1.6, SAAJ 1.3
      */
     public Iterator getChildElements(QName qname);
 
--- a/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPElementFactory.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPElementFactory.java	Wed Jul 05 19:53:51 2017 +0200
@@ -37,6 +37,7 @@
  * inserted.
  * @deprecated - Use <code>javax.xml.soap.SOAPFactory</code> for creating SOAPElements.
  * @see javax.xml.soap.SOAPFactory
+ * @since 1.6
  */
 public class SOAPElementFactory {
 
--- a/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPEnvelope.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPEnvelope.java	Wed Jul 05 19:53:51 2017 +0200
@@ -93,6 +93,8 @@
  *     Name name = se.createName("GetLastTradePrice", "WOMBAT",
  *                                "http://www.wombat.org/trader");
  * </PRE>
+ *
+ * @since 1.6
  */
 public interface SOAPEnvelope extends SOAPElement {
 
--- a/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPException.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPException.java	Wed Jul 05 19:53:51 2017 +0200
@@ -39,6 +39,8 @@
  * the provider.  Reasons for embedding a <code>Throwable</code>
  * object include problems such as input/output errors or a parsing
  * problem, such as an error in parsing a header.
+ *
+ * @since 1.6
  */
 public class SOAPException extends Exception {
     private Throwable cause;
--- a/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPFactory.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPFactory.java	Wed Jul 05 19:53:51 2017 +0200
@@ -43,6 +43,7 @@
  * <code>javax.xml.soap.Detail</code> objects as well as
  * <code>java.xml.soap.Name</code> objects.
  *
+ * @since 1.6
  */
 public abstract class SOAPFactory {
 
@@ -77,7 +78,7 @@
      * @exception SOAPException if there is an error in creating the
      *            <code>SOAPElement</code> object
      *
-     * @since SAAJ 1.3
+     * @since 1.6, SAAJ 1.3
      */
     public SOAPElement createElement(Element domElement) throws SOAPException {
         throw new UnsupportedOperationException("createElement(org.w3c.dom.Element) must be overridden by all subclasses of SOAPFactory.");
@@ -120,7 +121,7 @@
      * @exception SOAPException if there is an error in creating the
      *            <code>SOAPElement</code> object
      * @see SOAPFactory#createElement(Name)
-     * @since SAAJ 1.3
+     * @since 1.6, SAAJ 1.3
      */
     public  SOAPElement createElement(QName qname) throws SOAPException {
         throw new UnsupportedOperationException("createElement(QName) must be overridden by all subclasses of SOAPFactory.");
@@ -188,7 +189,7 @@
      *@param faultCode the FaultCode for the fault
      *@return a <code>SOAPFault</code> object
      *@throws SOAPException if there is a SOAP error
-     *@since SAAJ 1.3
+     *@since 1.6, SAAJ 1.3
      */
     public abstract SOAPFault createFault(String reasonText, QName faultCode) throws SOAPException;
 
@@ -196,7 +197,7 @@
      *Creates a new default <code>SOAPFault</code> object
      *@return a <code>SOAPFault</code> object
      *@throws SOAPException if there is a SOAP error
-     *@since SAAJ 1.3
+     *@since 1.6, SAAJ 1.3
      */
     public abstract SOAPFault createFault() throws SOAPException;
 
@@ -290,7 +291,7 @@
      * @exception SOAPException if there was an error creating the
      *            specified <code>SOAPFactory</code>
      * @see SAAJMetaFactory
-     * @since SAAJ 1.3
+     * @since 1.6, SAAJ 1.3
      */
     public static SOAPFactory newInstance(String protocol)
         throws SOAPException {
--- a/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPFault.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPFault.java	Wed Jul 05 19:53:51 2017 +0200
@@ -42,6 +42,8 @@
  * Depending on the <code>protocol</code> specified while creating the
  * <code>MessageFactory</code> instance,  a <code>SOAPFault</code> has
  * sub-elements as defined in the SOAP 1.1/SOAP 1.2 specification.
+ *
+ * @since 1.6
  */
 public interface SOAPFault extends SOAPBodyElement {
 
@@ -72,7 +74,7 @@
      * @exception SOAPException if there was an error in adding the
      *            <i>faultcode</i> element to the underlying XML tree.
      *
-     * @since SAAJ 1.2
+     * @since 1.6, SAAJ 1.2
      */
     public void setFaultCode(Name faultCodeQName) throws SOAPException;
 
@@ -91,7 +93,7 @@
      * @see #setFaultCode(Name)
      * @see #getFaultCodeAsQName()
      *
-     * @since SAAJ 1.3
+     * @since 1.6, SAAJ 1.3
      */
     public void setFaultCode(QName faultCodeQName) throws SOAPException;
 
@@ -128,7 +130,7 @@
      * @return a <code>Name</code> representing the faultcode
      * @see #setFaultCode(Name)
      *
-     * @since SAAJ 1.2
+     * @since 1.6, SAAJ 1.2
      */
     public Name getFaultCodeAsName();
 
@@ -141,7 +143,7 @@
      *
      * @see #setFaultCode(QName)
      *
-     * @since SAAJ 1.3
+     * @since 1.6, SAAJ 1.3
      */
     public QName getFaultCodeAsQName();
 
@@ -158,7 +160,7 @@
      * @exception UnsupportedOperationException if this message does not
      *      support the SOAP 1.2 concept of Subcode.
      *
-     * @since SAAJ 1.3
+     * @since 1.6, SAAJ 1.3
      */
     public Iterator getFaultSubcodes();
 
@@ -171,7 +173,7 @@
      * @exception UnsupportedOperationException if this message does not
      *      support the SOAP 1.2 concept of Subcode.
      *
-     * @since SAAJ 1.3
+     * @since 1.6, SAAJ 1.3
      */
     public void removeAllFaultSubcodes();
 
@@ -187,7 +189,7 @@
      * @exception UnsupportedOperationException if this message does not
      *      support the SOAP 1.2 concept of Subcode.
      *
-     * @since SAAJ 1.3
+     * @since 1.6, SAAJ 1.3
      */
     public void appendFaultSubcode(QName subcode) throws SOAPException;
 
@@ -270,7 +272,7 @@
      * @exception SOAPException if there was an error in adding the
      *            <code>faultString</code> to the underlying XML tree.
      *
-     * @since SAAJ 1.2
+     * @since 1.6, SAAJ 1.2
      */
     public void setFaultString(String faultString, Locale locale)
         throws SOAPException;
@@ -315,7 +317,7 @@
      *          the fault string or <code>null</code> if no locale was specified
      * @see #setFaultString(String, Locale)
      *
-     * @since SAAJ 1.2
+     * @since 1.6, SAAJ 1.2
      */
     public Locale getFaultStringLocale();
 
@@ -327,7 +329,7 @@
      * @return true if this <code>SOAPFault</code> has a <code>Detail</code>
      * subelement and false otherwise.
      *
-     * @since SAAJ 1.3
+     * @since 1.6, SAAJ 1.3
      */
     public boolean hasDetail();
 
@@ -377,7 +379,7 @@
      * @exception UnsupportedOperationException if this message does not
      *      support the SOAP 1.2 concept of Fault Reason.
      *
-     * @since SAAJ 1.3
+     * @since 1.6, SAAJ 1.3
      */
     public Iterator getFaultReasonLocales() throws SOAPException;
 
@@ -393,7 +395,7 @@
      * @exception UnsupportedOperationException if this message does not
      *      support the SOAP 1.2 concept of Fault Reason.
      *
-     * @since SAAJ 1.3
+     * @since 1.6, SAAJ 1.3
      */
     public Iterator getFaultReasonTexts() throws SOAPException;
 
@@ -414,7 +416,7 @@
      * @exception UnsupportedOperationException if this message does not
      *      support the SOAP 1.2 concept of Fault Reason.
      *
-     * @since SAAJ 1.3
+     * @since 1.6, SAAJ 1.3
      */
     public String getFaultReasonText(Locale locale) throws SOAPException;
 
@@ -441,7 +443,7 @@
      * @exception UnsupportedOperationException if this message does not
      *      support the SOAP 1.2 concept of Fault Reason.
      *
-     * @since SAAJ 1.3
+     * @since 1.6, SAAJ 1.3
      */
     public void addFaultReasonText(String text, java.util.Locale locale)
         throws SOAPException;
@@ -457,7 +459,7 @@
      * @exception UnsupportedOperationException if this message does not
      *      support the SOAP 1.2 concept of Fault Node.
      *
-     * @since SAAJ 1.3
+     * @since 1.6, SAAJ 1.3
      */
     public String getFaultNode();
 
@@ -472,7 +474,7 @@
      *      support the SOAP 1.2 concept of Fault Node.
      *
      *
-     * @since SAAJ 1.3
+     * @since 1.6, SAAJ 1.3
      */
     public void setFaultNode(String uri) throws SOAPException;
 
@@ -487,7 +489,7 @@
      * @exception UnsupportedOperationException if this message does not
      *      support the SOAP 1.2 concept of Fault Role.
      *
-     * @since SAAJ 1.3
+     * @since 1.6, SAAJ 1.3
      */
     public String getFaultRole();
 
@@ -504,7 +506,7 @@
      * @exception UnsupportedOperationException if this message does not
      *      support the SOAP 1.2 concept of Fault Role.
      *
-     * @since SAAJ 1.3
+     * @since 1.6, SAAJ 1.3
      */
     public void setFaultRole(String uri) throws SOAPException;
 
--- a/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPFaultElement.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPFaultElement.java	Wed Jul 05 19:53:51 2017 +0200
@@ -32,6 +32,8 @@
  * <P>
  * Content is added to a <code>SOAPFaultElement</code> using the
  * <code>SOAPElement</code> method <code>addTextNode</code>.
+ *
+ * @since 1.6
  */
 public interface SOAPFaultElement extends SOAPElement {
 }
--- a/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPHeader.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPHeader.java	Wed Jul 05 19:53:51 2017 +0200
@@ -66,6 +66,7 @@
  * </PRE>
  *
  * @see SOAPHeaderElement
+ * @since 1.6
  */
 public interface SOAPHeader extends SOAPElement {
     /**
@@ -92,7 +93,7 @@
      *          inserted into this <code>SOAPHeader</code> object
      * @exception SOAPException if a SOAP error occurs
      * @see SOAPHeader#addHeaderElement(Name)
-     * @since SAAJ 1.3
+     * @since 1.6, SAAJ 1.3
      */
     public SOAPHeaderElement addHeaderElement(QName qname)
         throws SOAPException;
@@ -115,7 +116,7 @@
      * @see #extractHeaderElements
      * @see SOAPConstants#URI_SOAP_ACTOR_NEXT
      *
-     * @since SAAJ 1.2
+     * @since 1.6, SAAJ 1.2
      */
     public Iterator examineMustUnderstandHeaderElements(String actor);
 
@@ -180,7 +181,7 @@
      *          inserted into this <code>SOAPHeader</code> object
      * @exception SOAPException if a SOAP error occurs.
      * @exception UnsupportedOperationException if this is a SOAP 1.1 Header.
-     * @since SAAJ 1.3
+     * @since 1.6, SAAJ 1.3
      */
     public SOAPHeaderElement addNotUnderstoodHeaderElement(QName name)
         throws SOAPException;
@@ -196,7 +197,7 @@
      * @return the new <code>SOAPHeaderElement</code> object that was
      *          inserted into this <code>SOAPHeader</code> object
      * @exception SOAPException if a SOAP error occurs.
-     * @since SAAJ 1.3
+     * @since 1.6, SAAJ 1.3
      */
     public SOAPHeaderElement addUpgradeHeaderElement(Iterator supportedSOAPURIs)
         throws SOAPException;
@@ -211,7 +212,7 @@
      * @return the new <code>SOAPHeaderElement</code> object that was
      *          inserted into this <code>SOAPHeader</code> object
      * @exception SOAPException if a SOAP error occurs.
-     * @since SAAJ 1.3
+     * @since 1.6, SAAJ 1.3
      */
     public SOAPHeaderElement addUpgradeHeaderElement(String[] supportedSoapUris)
         throws SOAPException;
@@ -226,7 +227,7 @@
      * @return the new <code>SOAPHeaderElement</code> object that was
      *          inserted into this <code>SOAPHeader</code> object
      * @exception SOAPException if a SOAP error occurs.
-     * @since SAAJ 1.3
+     * @since 1.6, SAAJ 1.3
      */
     public SOAPHeaderElement addUpgradeHeaderElement(String supportedSoapUri)
         throws SOAPException;
@@ -240,7 +241,7 @@
      *          <code>SOAPHeader</code>
      * @see #extractAllHeaderElements
      *
-     * @since SAAJ 1.2
+     * @since 1.6, SAAJ 1.2
      */
     public Iterator examineAllHeaderElements();
 
@@ -255,7 +256,7 @@
      *
      * @see #examineAllHeaderElements
      *
-     * @since SAAJ 1.2
+     * @since 1.6, SAAJ 1.2
      */
     public Iterator extractAllHeaderElements();
 
--- a/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPHeaderElement.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPHeaderElement.java	Wed Jul 05 19:53:51 2017 +0200
@@ -33,6 +33,8 @@
  * <P>
  * A <code>SOAPHeaderElement</code> object can have other
  * <code>SOAPElement</code> objects as its children.
+ *
+ * @since 1.6
  */
 public interface SOAPHeaderElement extends SOAPElement {
 
@@ -65,7 +67,7 @@
      * @exception UnsupportedOperationException if this message does not
      *      support the SOAP 1.2 concept of Fault Role.
      *
-     * @since SAAJ 1.3
+     * @since 1.6, SAAJ 1.3
      */
     public void setRole(String uri) throws SOAPException;
 
@@ -89,7 +91,7 @@
      * @exception UnsupportedOperationException if this message does not
      *      support the SOAP 1.2 concept of Fault Role.
      *
-     * @since SAAJ 1.3
+     * @since 1.6, SAAJ 1.3
      */
     public String getRole();
 
@@ -143,7 +145,7 @@
      * @see #setMustUnderstand
      * @see #getRelay
      *
-     * @since SAAJ 1.3
+     * @since 1.6, SAAJ 1.3
      */
     public void setRelay(boolean relay) throws SOAPException;
 
@@ -160,7 +162,7 @@
      * @see #getMustUnderstand
      * @see #setRelay
      *
-     * @since SAAJ 1.3
+     * @since 1.6, SAAJ 1.3
      */
     public boolean getRelay();
 }
--- a/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPMessage.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPMessage.java	Wed Jul 05 19:53:51 2017 +0200
@@ -100,6 +100,7 @@
  *
  * @see MessageFactory
  * @see AttachmentPart
+ * @since 1.6
  */
 public abstract class SOAPMessage {
     /**
@@ -108,7 +109,7 @@
          * supported values. The default is "utf-8".
          *
          * @see SOAPMessage#setProperty(String, Object) SOAPMessage.setProperty
-         * @since SAAJ 1.2
+         * @since 1.6, SAAJ 1.2
          */
     public static final String CHARACTER_SET_ENCODING =
         "javax.xml.soap.character-set-encoding";
@@ -119,7 +120,7 @@
      * "false".
      *
      * @see SOAPMessage#setProperty(String, Object) SOAPMessage.setProperty
-     * @since SAAJ 1.2
+     * @since 1.6, SAAJ 1.2
      */
     public static final String WRITE_XML_DECLARATION =
         "javax.xml.soap.write-xml-declaration";
@@ -163,7 +164,7 @@
          *         object
          * @exception SOAPException
          *               if the SOAP Body does not exist or cannot be retrieved
-         * @since SAAJ 1.2
+         * @since 1.6, SAAJ 1.2
          */
     public SOAPBody getSOAPBody() throws SOAPException {
         throw new UnsupportedOperationException("getSOAPBody must be overridden by all subclasses of SOAPMessage");
@@ -178,7 +179,7 @@
          *         object
          * @exception SOAPException
          *               if the SOAP Header does not exist or cannot be retrieved
-         * @since SAAJ 1.2
+         * @since 1.6, SAAJ 1.2
          */
     public SOAPHeader getSOAPHeader() throws SOAPException {
         throw new UnsupportedOperationException("getSOAPHeader must be overridden by all subclasses of SOAPMessage");
@@ -230,7 +231,7 @@
      * @param headers
      *           a <code>MimeHeaders</code> object containing the MIME
      *           headers for which to search
-     * @since SAAJ 1.3
+     * @since 1.6, SAAJ 1.3
      */
     public abstract void removeAttachments(MimeHeaders headers);
 
@@ -258,7 +259,7 @@
      * @throws SOAPException if there is an error in the attempt to access the
      *          attachment
      *
-     * @since SAAJ 1.3
+     * @since 1.6, SAAJ 1.3
      */
     public abstract AttachmentPart getAttachment(SOAPElement element) throws SOAPException;
 
@@ -432,7 +433,7 @@
      *           the value to be associated with the specified property
      * @exception SOAPException
      *               if the property name is not recognized.
-     * @since SAAJ 1.2
+     * @since 1.6, SAAJ 1.2
      */
     public void setProperty(String property, Object value)
         throws SOAPException {
@@ -448,7 +449,7 @@
      *         if no such property exists.
      * @exception SOAPException
      *               if the property name is not recognized.
-     * @since SAAJ 1.2
+     * @since 1.6, SAAJ 1.2
      */
     public Object getProperty(String property) throws SOAPException {
         throw new UnsupportedOperationException("getProperty must be overridden by all subclasses of SOAPMessage");
--- a/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPPart.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPPart.java	Wed Jul 05 19:53:51 2017 +0200
@@ -64,6 +64,8 @@
  * The <code>SOAPPart</code> method <code>getEnvelope</code> can be used
  * to retrieve the <code>SOAPEnvelope</code> object.
  * <P>
+ *
+ * @since 1.6
  */
 public abstract class SOAPPart implements org.w3c.dom.Document, Node {
 
--- a/jaxws/src/share/jaxws_classes/javax/xml/soap/Text.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/soap/Text.java	Wed Jul 05 19:53:51 2017 +0200
@@ -29,6 +29,7 @@
  * A representation of a node whose value is text.  A <code>Text</code> object
  * may represent text that is content or text that is a comment.
  *
+ * @since 1.6
  */
 public interface Text extends Node, org.w3c.dom.Text {
 
--- a/jaxws/src/share/jaxws_classes/javax/xml/ws/Action.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/Action.java	Wed Jul 05 19:53:51 2017 +0200
@@ -118,7 +118,7 @@
  *
  * @see FaultAction
  *
- * @since JAX-WS 2.1
+ * @since 1.6, JAX-WS 2.1
  */
 
 @Documented
--- a/jaxws/src/share/jaxws_classes/javax/xml/ws/AsyncHandler.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/AsyncHandler.java	Wed Jul 05 19:53:51 2017 +0200
@@ -29,7 +29,7 @@
  * clients that wish to receive callback notification of the completion of
  * service endpoint operations invoked asynchronously.
  *
- *  @since JAX-WS 2.0
+ *  @since 1.6, JAX-WS 2.0
 **/
 public interface AsyncHandler<T> {
 
--- a/jaxws/src/share/jaxws_classes/javax/xml/ws/Binding.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/Binding.java	Wed Jul 05 19:53:51 2017 +0200
@@ -29,7 +29,7 @@
 /** The <code>Binding</code> interface is the base interface
  *  for JAX-WS protocol bindings.
  *
- *  @since JAX-WS 2.0
+ *  @since 1.6, JAX-WS 2.0
 **/
 public interface Binding {
 
@@ -61,7 +61,7 @@
      * @return String The binding identifier for the port.
      *    Never returns <code>null</code>
      *
-     * @since JAX-WS 2.1
+     * @since 1.6, JAX-WS 2.1
      */
     String getBindingID();
 }
--- a/jaxws/src/share/jaxws_classes/javax/xml/ws/BindingProvider.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/BindingProvider.java	Wed Jul 05 19:53:51 2017 +0200
@@ -33,7 +33,7 @@
  * protocol binding and associated context objects for request and
  * response message processing.
  *
- * @since JAX-WS 2.0
+ * @since 1.6, JAX-WS 2.0
  *
  * @see javax.xml.ws.Binding
  **/
@@ -154,7 +154,7 @@
      *
      * @see W3CEndpointReference
      *
-     * @since JAX-WS 2.1
+     * @since 1.6, JAX-WS 2.1
      */
     public EndpointReference getEndpointReference();
 
@@ -176,7 +176,7 @@
      * @throws java.lang.UnsupportedOperationException If this
      * <code>BindingProvider</code> uses the XML/HTTP binding.
      *
-     * @since JAX-WS 2.1
+     * @since 1.6, JAX-WS 2.1
      */
     public <T extends EndpointReference> T getEndpointReference(Class<T> clazz);
 }
--- a/jaxws/src/share/jaxws_classes/javax/xml/ws/BindingType.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/BindingType.java	Wed Jul 05 19:53:51 2017 +0200
@@ -39,7 +39,7 @@
  *  This annotation may be overriden programmatically or via
  *  deployment descriptors, depending on the platform in use.
  *
- *  @since JAX-WS 2.0
+ *  @since 1.6, JAX-WS 2.0
  *
  **/
 @Target(ElementType.TYPE)
--- a/jaxws/src/share/jaxws_classes/javax/xml/ws/Dispatch.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/Dispatch.java	Wed Jul 05 19:53:51 2017 +0200
@@ -33,7 +33,7 @@
  *  class acts as a factory for the creation of <code>Dispatch</code>
  *  instances.
  *
- *  @since JAX-WS 2.0
+ *  @since 1.6, JAX-WS 2.0
 **/
 public interface Dispatch<T> extends BindingProvider {
 
--- a/jaxws/src/share/jaxws_classes/javax/xml/ws/Endpoint.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/Endpoint.java	Wed Jul 05 19:53:51 2017 +0200
@@ -61,7 +61,7 @@
  * as possible instead of generating new ones based on the annotations
  * present on the implementor.
  *
- * @since JAX-WS 2.0
+ * @since 1.6, JAX-WS 2.0
  *
  * @see javax.xml.ws.Binding
  * @see javax.xml.ws.BindingType
@@ -119,7 +119,7 @@
      *
      *
      * @return The newly created endpoint.
-     * @since JAX-WS 2.2
+     * @since 1.7, JAX-WS 2.2
      *
      */
     public static Endpoint create(Object implementor, WebServiceFeature ... features) {
@@ -166,7 +166,7 @@
      *        </code> parameter will have their default values.
      *
      * @return The newly created endpoint.
-     * @since JAX-WS 2.2
+     * @since 1.7, JAX-WS 2.2
      */
     public static Endpoint create(String bindingId, Object implementor, WebServiceFeature ... features) {
         return Provider.provider().createEndpoint(bindingId, implementor, features);
@@ -266,7 +266,7 @@
      *          If a <code>java.lang.SecurityManger</code>
      *          is being used and the application doesn't have the
      *          <code>WebServicePermission("publishEndpoint")</code> permission.
-     * @since JAX-WS 2.2
+     * @since 1.7, JAX-WS 2.2
      */
     public static Endpoint publish(String address, Object implementor, WebServiceFeature ... features) {
         return Provider.provider().createAndPublishEndpoint(address, implementor, features);
@@ -330,7 +330,7 @@
      *          If a <code>java.lang.SecurityManger</code>
      *          is being used and the application doesn't have the
      *          <code>WebServicePermission("publishEndpoint")</code> permission.
-     * @since JAX-WS 2.2
+     * @since 1.7, JAX-WS 2.2
      */
     public void publish(HttpContext serverContext) {
         throw new UnsupportedOperationException("JAX-WS 2.2 implementation must override this default behaviour.");
@@ -446,7 +446,7 @@
      *
      * @see W3CEndpointReference
      *
-     * @since JAX-WS 2.1
+     * @since 1.6, JAX-WS 2.1
      **/
     public abstract EndpointReference getEndpointReference(Element... referenceParameters);
 
@@ -472,7 +472,7 @@
      * uses the XML/HTTP binding.
      *
      *
-     * @since JAX-WS 2.1
+     * @since 1.6, JAX-WS 2.1
      **/
     public abstract <T extends EndpointReference> T getEndpointReference(Class<T> clazz,
             Element... referenceParameters);
@@ -490,7 +490,7 @@
      * @throws java.lang.IllegalStateException
      *        If the endpoint has been published already or it has been stopped.
      *
-     * @since JAX-WS 2.2
+     * @since 1.7, JAX-WS 2.2
      */
     public void setEndpointContext(EndpointContext ctxt) {
         throw new UnsupportedOperationException("JAX-WS 2.2 implementation must override this default behaviour.");
--- a/jaxws/src/share/jaxws_classes/javax/xml/ws/EndpointContext.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/EndpointContext.java	Wed Jul 05 19:53:51 2017 +0200
@@ -42,7 +42,7 @@
  * before {@link Endpoint#publish} methods.
  *
  * @author Jitendra Kotamraju
- * @since JAX-WS 2.2
+ * @since 1.7, JAX-WS 2.2
  */
 public abstract class EndpointContext {
 
--- a/jaxws/src/share/jaxws_classes/javax/xml/ws/EndpointReference.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/EndpointReference.java	Wed Jul 05 19:53:51 2017 +0200
@@ -81,7 +81,7 @@
  *
  * @see W3CEndpointReference
  * @see Service
- * @since JAX-WS 2.1
+ * @since 1.6, JAX-WS 2.1
  */
 @XmlTransient // to treat this class like Object as far as databinding is concerned (proposed JAXB 2.1 feature)
 public abstract class EndpointReference {
--- a/jaxws/src/share/jaxws_classes/javax/xml/ws/FaultAction.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/FaultAction.java	Wed Jul 05 19:53:51 2017 +0200
@@ -145,7 +145,7 @@
  *   &lt;/definitions>
  * </pre>
  *
- * @since JAX-WS 2.1
+ * @since 1.6, JAX-WS 2.1
  */
 
 @Documented
--- a/jaxws/src/share/jaxws_classes/javax/xml/ws/Holder.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/Holder.java	Wed Jul 05 19:53:51 2017 +0200
@@ -30,7 +30,7 @@
 /**
  * Holds a value of type <code>T</code>.
  *
- * @since JAX-WS 2.0
+ * @since 1.6, JAX-WS 2.0
  */
 public final class Holder<T> implements Serializable {
 
--- a/jaxws/src/share/jaxws_classes/javax/xml/ws/LogicalMessage.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/LogicalMessage.java	Wed Jul 05 19:53:51 2017 +0200
@@ -32,7 +32,7 @@
  *  protocol agnostic XML message and contains methods that
  *  provide access to the payload of the message.
  *
- *  @since JAX-WS 2.0
+ *  @since 1.6, JAX-WS 2.0
 **/
 public interface LogicalMessage {
 
--- a/jaxws/src/share/jaxws_classes/javax/xml/ws/ProtocolException.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/ProtocolException.java	Wed Jul 05 19:53:51 2017 +0200
@@ -30,7 +30,7 @@
  *  are used to communicate protocol level fault information to clients and may
  *  be used on the server to control the protocol specific fault representation.
  *
- *  @since JAX-WS 2.0
+ *  @since 1.6, JAX-WS 2.0
 **/
 public class ProtocolException extends WebServiceException {
     /**
--- a/jaxws/src/share/jaxws_classes/javax/xml/ws/Provider.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/Provider.java	Wed Jul 05 19:53:51 2017 +0200
@@ -38,7 +38,7 @@
  *  the <code>Provider</code> instance will receive entire protocol messages
  *  or just message payloads.
  *
- *  @since JAX-WS 2.0
+ *  @since 1.6, JAX-WS 2.0
  *
  *  @see javax.xml.transform.Source
  *  @see javax.xml.soap.SOAPMessage
--- a/jaxws/src/share/jaxws_classes/javax/xml/ws/RequestWrapper.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/RequestWrapper.java	Wed Jul 05 19:53:51 2017 +0200
@@ -40,7 +40,7 @@
  * overloading conflicts in document literal mode. Only the <code>className</code>
  * is required in this case.
  *
- *  @since JAX-WS 2.0
+ *  @since 1.6, JAX-WS 2.0
  **/
 
 @Target(ElementType.METHOD)
@@ -65,7 +65,7 @@
     /**
      * wsdl:part name for the wrapper part
      *
-     * @since JAX-WS 2.2
+     * @since 1.7, JAX-WS 2.2
      */
     public String partName() default "";
 
--- a/jaxws/src/share/jaxws_classes/javax/xml/ws/RespectBinding.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/RespectBinding.java	Wed Jul 05 19:53:51 2017 +0200
@@ -54,7 +54,7 @@
  *
  * @see RespectBindingFeature
  *
- * @since JAX-WS 2.1
+ * @since 1.6, JAX-WS 2.1
  */
 @Target({ElementType.TYPE, ElementType.METHOD, ElementType.FIELD})
 @Retention(RetentionPolicy.RUNTIME)
--- a/jaxws/src/share/jaxws_classes/javax/xml/ws/RespectBindingFeature.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/RespectBindingFeature.java	Wed Jul 05 19:53:51 2017 +0200
@@ -80,7 +80,7 @@
  *
  * @see AddressingFeature
  *
- * @since JAX-WS 2.1
+ * @since 1.6, JAX-WS 2.1
  */
 public final class RespectBindingFeature extends WebServiceFeature {
     /**
--- a/jaxws/src/share/jaxws_classes/javax/xml/ws/Response.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/Response.java	Wed Jul 05 19:53:51 2017 +0200
@@ -39,7 +39,7 @@
  *  {@link WebServiceException} that represents the error that occured during the
  *  asynchronous method invocation.</p>
  *
- *  @since JAX-WS 2.0
+ *  @since 1.6, JAX-WS 2.0
 **/
 public interface Response<T> extends Future<T> {
     /** Gets the contained response context.
--- a/jaxws/src/share/jaxws_classes/javax/xml/ws/ResponseWrapper.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/ResponseWrapper.java	Wed Jul 05 19:53:51 2017 +0200
@@ -39,7 +39,7 @@
  * overloading conflicts in document literal mode. Only the <code>className</code>
  * is required in this case.
  *
- *  @since JAX-WS 2.0
+ *  @since 1.6, JAX-WS 2.0
 **/
 
 @Target(ElementType.METHOD)
@@ -65,7 +65,7 @@
     /**
      * wsdl:part name for the wrapper part
      *
-     * @since JAX-WS 2.2
+     * @since 1.7, JAX-WS 2.2
      */
     public String partName() default "";
 
--- a/jaxws/src/share/jaxws_classes/javax/xml/ws/Service.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/Service.java	Wed Jul 05 19:53:51 2017 +0200
@@ -57,7 +57,7 @@
  * can be enabled by creating a <code>ThreadPoolExecutor</code> and
  * registering it with the service.
  *
- * @since JAX-WS 2.0
+ * @since 1.6, JAX-WS 2.0
  *
  * @see javax.xml.ws.spi.Provider
  * @see javax.xml.ws.handler.HandlerResolver
@@ -153,7 +153,7 @@
      * @see java.lang.reflect.InvocationHandler
      * @see WebServiceFeature
      *
-     * @since JAX-WS 2.1
+     * @since 1.6, JAX-WS 2.1
      **/
     public <T> T getPort(QName portName,
             Class<T> serviceEndpointInterface, WebServiceFeature... features) {
@@ -219,7 +219,7 @@
      *
      * @see WebServiceFeature
      *
-     * @since JAX-WS 2.1
+     * @since 1.6, JAX-WS 2.1
      **/
     public <T> T getPort(Class<T> serviceEndpointInterface,
             WebServiceFeature... features) {
@@ -297,7 +297,7 @@
      *                      with this port or is unsupported.
      *                  </UL>
      *
-     * @since JAX-WS 2.1
+     * @since 1.6, JAX-WS 2.1
      **/
     public <T> T getPort(EndpointReference endpointReference,
            Class<T> serviceEndpointInterface, WebServiceFeature... features) {
@@ -381,7 +381,7 @@
      * @see javax.xml.soap.SOAPMessage
      * @see WebServiceFeature
      *
-     * @since JAX-WS 2.1
+     * @since 1.6, JAX-WS 2.1
      **/
     public <T> Dispatch<T> createDispatch(QName portName, Class<T> type,
             Service.Mode mode, WebServiceFeature... features) {
@@ -456,7 +456,7 @@
      * @see javax.xml.soap.SOAPMessage
      * @see WebServiceFeature
      *
-     * @since JAX-WS 2.1
+     * @since 1.6, JAX-WS 2.1
      **/
     public <T> Dispatch<T> createDispatch(EndpointReference endpointReference,
             Class<T> type, Service.Mode mode,
@@ -514,7 +514,7 @@
      * @see javax.xml.bind.JAXBContext
      * @see WebServiceFeature
      *
-     * @since JAX-WS 2.1
+     * @since 1.6, JAX-WS 2.1
      **/
     public Dispatch<Object> createDispatch(QName portName,
             JAXBContext context, Service.Mode mode, WebServiceFeature... features) {
@@ -587,7 +587,7 @@
      * @see javax.xml.bind.JAXBContext
      * @see WebServiceFeature
      *
-     * @since JAX-WS 2.1
+     * @since 1.6, JAX-WS 2.1
     **/
     public Dispatch<Object> createDispatch(EndpointReference endpointReference,
             JAXBContext context, Service.Mode mode,
@@ -722,7 +722,7 @@
      *        it must throw a WebServiceException.
      * @throws WebServiceException If any error in creation of the
      *                    specified service.
-     * @since JAX-WS 2.2
+     * @since 1.7, JAX-WS 2.2
      **/
     public static Service create(
             java.net.URL wsdlDocumentLocation,
@@ -752,7 +752,7 @@
      * @throws WebServiceException If any error in creation of the
      *                    specified service
      *
-     * @since JAX-WS 2.2
+     * @since 1.7, JAX-WS 2.2
      */
     public static Service create(QName serviceName, WebServiceFeature ... features) {
         return new Service(null, serviceName, features);
--- a/jaxws/src/share/jaxws_classes/javax/xml/ws/ServiceMode.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/ServiceMode.java	Wed Jul 05 19:53:51 2017 +0200
@@ -36,7 +36,7 @@
  * Used to indicate whether a {@link Provider} implementation wishes to work
  * with entire protocol messages or just with protocol message payloads.
  *
- *  @since JAX-WS 2.0
+ *  @since 1.6, JAX-WS 2.0
 **/
 @Target({ElementType.TYPE})
 @Retention(RetentionPolicy.RUNTIME)
--- a/jaxws/src/share/jaxws_classes/javax/xml/ws/WebEndpoint.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/WebEndpoint.java	Wed Jul 05 19:53:51 2017 +0200
@@ -41,7 +41,7 @@
  *  determined based on the value of the <code>WebServiceClient</code>
  *  annotation on the generated service interface itself.
  *
- *  @since JAX-WS 2.0
+ *  @since 1.6, JAX-WS 2.0
  *
  *  @see javax.xml.ws.WebServiceClient
 **/
--- a/jaxws/src/share/jaxws_classes/javax/xml/ws/WebFault.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/WebFault.java	Wed Jul 05 19:53:51 2017 +0200
@@ -36,7 +36,7 @@
  * to the local and namespace name of the fault element and the name
  * of the fault bean.
  *
- *  @since JAX-WS 2.0
+ *  @since 1.6, JAX-WS 2.0
 **/
 @Target({ElementType.TYPE})
 @Retention(RetentionPolicy.RUNTIME)
@@ -60,7 +60,7 @@
 
   /**
    *  wsdl:Message's name. Default name is the exception's class name.
-   *  @since JAX-WS 2.2
+   *  @since 1.7, JAX-WS 2.2
    */
   public String messageName() default "";
 
--- a/jaxws/src/share/jaxws_classes/javax/xml/ws/WebServiceClient.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/WebServiceClient.java	Wed Jul 05 19:53:51 2017 +0200
@@ -40,7 +40,7 @@
  *  element represents the Web service for which the generated
  *  service interface provides a client view.
  *
- *  @since JAX-WS 2.0
+ *  @since 1.6, JAX-WS 2.0
 **/
 @Target({ElementType.TYPE})
 @Retention(RetentionPolicy.RUNTIME)
--- a/jaxws/src/share/jaxws_classes/javax/xml/ws/WebServiceContext.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/WebServiceContext.java	Wed Jul 05 19:53:51 2017 +0200
@@ -41,7 +41,7 @@
  *  into an endpoint implementation class using the
  *  <code>Resource</code> annotation.
  *
- *  @since JAX-WS 2.0
+ *  @since 1.6, JAX-WS 2.0
  *
  *  @see javax.annotation.Resource
  **/
@@ -120,7 +120,7 @@
      *
      * @see W3CEndpointReference
      *
-     * @since JAX-WS 2.1
+     * @since 1.6, JAX-WS 2.1
      */
     public EndpointReference getEndpointReference(Element... referenceParameters);
 
@@ -144,7 +144,7 @@
      * @throws WebServiceException If the <code>clazz</code> type of
      * <code>EndpointReference</code> is not supported.
      *
-     * @since JAX-WS 2.1
+     * @since 1.6, JAX-WS 2.1
      **/
     public <T extends EndpointReference> T getEndpointReference(Class<T> clazz,
             Element... referenceParameters);
--- a/jaxws/src/share/jaxws_classes/javax/xml/ws/WebServiceException.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/WebServiceException.java	Wed Jul 05 19:53:51 2017 +0200
@@ -28,7 +28,7 @@
 /** The <code>WebServiceException</code> class is the base
  *  exception class for all JAX-WS API runtime exceptions.
  *
- *  @since JAX-WS 2.0
+ *  @since 1.6, JAX-WS 2.0
 **/
 
 public class WebServiceException extends java.lang.RuntimeException {
--- a/jaxws/src/share/jaxws_classes/javax/xml/ws/WebServiceFeature.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/WebServiceFeature.java	Wed Jul 05 19:53:51 2017 +0200
@@ -44,7 +44,7 @@
  * @see javax.xml.ws.soap.AddressingFeature
  * @see javax.xml.ws.soap.MTOMFeature
  *
- * @since 2.1
+ * @since 1.6, JAX-WS 2.1
  */
 public abstract class WebServiceFeature {
    /**
--- a/jaxws/src/share/jaxws_classes/javax/xml/ws/WebServicePermission.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/WebServicePermission.java	Wed Jul 05 19:53:51 2017 +0200
@@ -55,6 +55,7 @@
  * @see java.security.Permissions
  * @see java.lang.SecurityManager
  * @see java.net.SocketPermission
+ * @since 1.6
  */
 public final class WebServicePermission extends BasicPermission {
 
--- a/jaxws/src/share/jaxws_classes/javax/xml/ws/WebServiceProvider.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/WebServiceProvider.java	Wed Jul 05 19:53:51 2017 +0200
@@ -33,7 +33,7 @@
 /**
  * Used to annotate a Provider implementation class.
  *
- * @since JAX-WS 2.0
+ * @since 1.6, JAX-WS 2.0
  * @see javax.xml.ws.Provider
  */
 @Target(ElementType.TYPE)
--- a/jaxws/src/share/jaxws_classes/javax/xml/ws/WebServiceRef.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/WebServiceRef.java	Wed Jul 05 19:53:51 2017 +0200
@@ -75,7 +75,7 @@
  * @see javax.annotation.Resource
  * @see WebServiceFeatureAnnotation
  *
- * @since JAX-WS 2.0
+ * @since 1.6, JAX-WS 2.0
  *
 **/
 
@@ -143,7 +143,7 @@
      * A portable JNDI lookup name that resolves to the target
      * web service reference.
      *
-     * @since JAX-WS 2.2
+     * @since 1.7, JAX-WS 2.2
      */
     String lookup() default "";
 
--- a/jaxws/src/share/jaxws_classes/javax/xml/ws/WebServiceRefs.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/WebServiceRefs.java	Wed Jul 05 19:53:51 2017 +0200
@@ -69,7 +69,7 @@
  * </code></pre>
  *
  * @see WebServiceRef
- * @since 2.0
+ * @since 1.6, JAX-WS 2.0
  */
 
 @Documented
--- a/jaxws/src/share/jaxws_classes/javax/xml/ws/handler/Handler.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/handler/Handler.java	Wed Jul 05 19:53:51 2017 +0200
@@ -31,7 +31,7 @@
 /** The <code>Handler</code> interface
  *  is the base interface for JAX-WS handlers.
  *
- *  @since JAX-WS 2.0
+ *  @since 1.6, JAX-WS 2.0
 **/
 public interface Handler<C extends MessageContext> {
 
--- a/jaxws/src/share/jaxws_classes/javax/xml/ws/handler/HandlerResolver.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/handler/HandlerResolver.java	Wed Jul 05 19:53:51 2017 +0200
@@ -39,7 +39,7 @@
  *
  *  @see javax.xml.ws.Service#setHandlerResolver
  *
- *  @since JAX-WS 2.0
+ *  @since 1.6, JAX-WS 2.0
 **/
 public interface HandlerResolver {
 
--- a/jaxws/src/share/jaxws_classes/javax/xml/ws/handler/LogicalHandler.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/handler/LogicalHandler.java	Wed Jul 05 19:53:51 2017 +0200
@@ -28,7 +28,7 @@
 /** The <code>LogicalHandler</code> extends
  *  Handler to provide typesafety for the message context parameter.
  *
- *  @since JAX-WS 2.0
+ *  @since 1.6, JAX-WS 2.0
 **/
 public interface LogicalHandler<C extends LogicalMessageContext> extends Handler<C> {
 }
--- a/jaxws/src/share/jaxws_classes/javax/xml/ws/handler/LogicalMessageContext.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/handler/LogicalMessageContext.java	Wed Jul 05 19:53:51 2017 +0200
@@ -32,7 +32,7 @@
  *  provide access to a the contained message as a protocol neutral
  *  LogicalMessage
  *
- *  @since JAX-WS 2.0
+ *  @since 1.6, JAX-WS 2.0
 **/
 public interface LogicalMessageContext
                     extends MessageContext {
--- a/jaxws/src/share/jaxws_classes/javax/xml/ws/handler/MessageContext.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/handler/MessageContext.java	Wed Jul 05 19:53:51 2017 +0200
@@ -36,7 +36,7 @@
  * enable handlers in a handler chain to share processing related
  * state.
  *
- * @since JAX-WS 2.0
+ * @since 1.6, JAX-WS 2.0
  */
 public interface MessageContext extends Map<String, Object> {
 
@@ -168,7 +168,7 @@
      * wsa:IsReferenceParameter="true" attribute.
      * <p>Type: List&lt;Element>
      *
-     * @since JAX-WS 2.1
+     * @since 1.6, JAX-WS 2.1
      */
     public static final String REFERENCE_PARAMETERS =
             "javax.xml.ws.reference.parameters";
--- a/jaxws/src/share/jaxws_classes/javax/xml/ws/handler/PortInfo.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/handler/PortInfo.java	Wed Jul 05 19:53:51 2017 +0200
@@ -35,7 +35,7 @@
  *  This interface is never implemented by an application,
  *  only by a JAX-WS implementation.
  *
- *  @since JAX-WS 2.0
+ *  @since 1.6, JAX-WS 2.0
 **/
 public interface PortInfo {
 
--- a/jaxws/src/share/jaxws_classes/javax/xml/ws/handler/soap/SOAPHandler.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/handler/soap/SOAPHandler.java	Wed Jul 05 19:53:51 2017 +0200
@@ -33,7 +33,7 @@
  *  to provide typesafety for the message context parameter and add a method
  *  to obtain access to the headers that may be processed by the handler.
  *
- *  @since JAX-WS 2.0
+ *  @since 1.6, JAX-WS 2.0
 **/
 public interface SOAPHandler<T extends SOAPMessageContext>
     extends Handler<T> {
--- a/jaxws/src/share/jaxws_classes/javax/xml/ws/handler/soap/SOAPMessageContext.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/handler/soap/SOAPMessageContext.java	Wed Jul 05 19:53:51 2017 +0200
@@ -38,7 +38,7 @@
  *
  *  @see javax.xml.soap.SOAPMessage
  *
- *  @since JAX-WS 2.0
+ *  @since 1.6, JAX-WS 2.0
 **/
 public interface SOAPMessageContext
                     extends javax.xml.ws.handler.MessageContext {
--- a/jaxws/src/share/jaxws_classes/javax/xml/ws/http/HTTPBinding.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/http/HTTPBinding.java	Wed Jul 05 19:53:51 2017 +0200
@@ -31,7 +31,7 @@
 /** The <code>HTTPBinding</code> interface is an
  *  abstraction for the XML/HTTP binding.
  *
- *  @since JAX-WS 2.0
+ *  @since 1.6, JAX-WS 2.0
 **/
 public interface HTTPBinding extends Binding {
 
--- a/jaxws/src/share/jaxws_classes/javax/xml/ws/http/HTTPException.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/http/HTTPException.java	Wed Jul 05 19:53:51 2017 +0200
@@ -32,7 +32,7 @@
  *  <p>Since there is no standard format for faults or exceptions
  *  in XML/HTTP messaging, only the HTTP status code is captured.
  *
- *  @since JAX-WS 2.0
+ *  @since 1.6, JAX-WS 2.0
 **/
 public class HTTPException extends javax.xml.ws.ProtocolException  {
 
--- a/jaxws/src/share/jaxws_classes/javax/xml/ws/soap/Addressing.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/soap/Addressing.java	Wed Jul 05 19:53:51 2017 +0200
@@ -57,7 +57,7 @@
  * This annotation's behaviour is defined by the corresponding feature
  * {@link AddressingFeature}.
  *
- * @since JAX-WS 2.1
+ * @since 1.6, JAX-WS 2.1
  */
 @Target({ElementType.TYPE, ElementType.METHOD, ElementType.FIELD})
 @Retention(RetentionPolicy.RUNTIME)
@@ -106,7 +106,7 @@
      * <a href="http://www.w3.org/TR/ws-addr-metadata/#wspolicynonanonresponses">
      * 3.1.3 NonAnonymousResponses Assertion</a> in the generated WSDL.
      *
-     * @since JAX-WS 2.2
+     * @since 1.7, JAX-WS 2.2
      */
     Responses responses() default Responses.ALL;
 
--- a/jaxws/src/share/jaxws_classes/javax/xml/ws/soap/AddressingFeature.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/soap/AddressingFeature.java	Wed Jul 05 19:53:51 2017 +0200
@@ -112,7 +112,7 @@
  * for more information on WS-Addressing.
  *
  * @see Addressing
- * @since JAX-WS 2.1
+ * @since 1.6, JAX-WS 2.1
  */
 
 public final class AddressingFeature extends WebServiceFeature {
@@ -151,7 +151,7 @@
      * <a href="http://www.w3.org/TR/ws-addr-metadata/#wspolicynonanonresponses">
      * 3.1.3 NonAnonymousResponses Assertion</a> in the generated WSDL.
      *
-     * @since JAX-WS 2.2
+     * @since 1.7, JAX-WS 2.2
      */
     public enum Responses {
         /**
@@ -229,7 +229,7 @@
      * @param required true means requires the use of ws-addressing .
      * @param responses specifies what type of responses are required
      *
-     * @since JAX-WS 2.2
+     * @since 1.7, JAX-WS 2.2
      */
     public AddressingFeature(boolean enabled, boolean required, Responses responses) {
         this.enabled = enabled;
@@ -268,7 +268,7 @@
      *         {@link Responses#NON_ANONYMOUS} when endpoint requires the use
      * of only non-anonymous responses
      *
-     * @since JAX-WS 2.2
+     * @since 1.7, JAX-WS 2.2
      */
     public Responses getResponses() {
         return responses;
--- a/jaxws/src/share/jaxws_classes/javax/xml/ws/soap/MTOM.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/soap/MTOM.java	Wed Jul 05 19:53:51 2017 +0200
@@ -54,7 +54,7 @@
  * This annotation's behaviour is defined by the corresponding feature
  * {@link MTOMFeature}.
  *
- * @since JAX-WS 2.1
+ * @since 1.6, JAX-WS 2.1
  */
 @Target({ElementType.TYPE, ElementType.METHOD, ElementType.FIELD})
 @Retention(RetentionPolicy.RUNTIME)
--- a/jaxws/src/share/jaxws_classes/javax/xml/ws/soap/MTOMFeature.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/soap/MTOMFeature.java	Wed Jul 05 19:53:51 2017 +0200
@@ -54,7 +54,7 @@
  * The {@link #threshold} property can be used to set the threshold
  * value used to determine when binary data should be XOP encoded.
  *
- * @since JAX-WS 2.1
+ * @since 1.6, JAX-WS 2.1
  */
 public final class MTOMFeature extends WebServiceFeature {
     /**
--- a/jaxws/src/share/jaxws_classes/javax/xml/ws/soap/SOAPBinding.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/soap/SOAPBinding.java	Wed Jul 05 19:53:51 2017 +0200
@@ -34,7 +34,7 @@
 /** The <code>SOAPBinding</code> interface is an abstraction for
  *  the SOAP binding.
  *
- *  @since JAX-WS 2.0
+ *  @since 1.6, JAX-WS 2.0
 **/
 public interface SOAPBinding extends Binding {
 
--- a/jaxws/src/share/jaxws_classes/javax/xml/ws/soap/SOAPFaultException.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/soap/SOAPFaultException.java	Wed Jul 05 19:53:51 2017 +0200
@@ -48,7 +48,7 @@
  *  @see javax.xml.ws.soap.SOAPBinding#getSOAPFactory
  *  @see javax.xml.ws.ProtocolException
  *
- *  @since JAX-WS 2.0
+ *  @since 1.6, JAX-WS 2.0
  **/
 public class SOAPFaultException extends javax.xml.ws.ProtocolException  {
 
--- a/jaxws/src/share/jaxws_classes/javax/xml/ws/spi/Invoker.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/spi/Invoker.java	Wed Jul 05 19:53:51 2017 +0200
@@ -43,7 +43,7 @@
  *
  * @see Provider#createEndpoint(String, Class, Invoker, WebServiceFeature...)
  * @author Jitendra Kotamraju
- * @since JAX-WS 2.2
+ * @since 1.7, JAX-WS 2.2
  */
 
 public abstract class Invoker {
--- a/jaxws/src/share/jaxws_classes/javax/xml/ws/spi/Provider.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/spi/Provider.java	Wed Jul 05 19:53:51 2017 +0200
@@ -41,7 +41,7 @@
  * <code>Endpoint</code> objects.
  * <p>
  *
- * @since JAX-WS 2.0
+ * @since 1.6, JAX-WS 2.0
  */
 public abstract class Provider {
 
@@ -161,7 +161,7 @@
      *        it must throw a WebServiceException.
      * @return The newly created service delegate.
      *
-     * @since JAX-WS 2.2
+     * @since 1.7, JAX-WS 2.2
      */
     public ServiceDelegate createServiceDelegate(
             java.net.URL wsdlDocumentLocation,
@@ -218,7 +218,7 @@
      * @throws NullPointerException If the <code>null</code>
      * <code>eprInfoset</code> value is given.
      *
-     * @since JAX-WS 2.1
+     * @since 1.6, JAX-WS 2.1
      **/
     public abstract EndpointReference readEndpointReference(javax.xml.transform.Source eprInfoset);
 
@@ -271,7 +271,7 @@
      *
      * @see WebServiceFeature
      *
-     * @since JAX-WS 2.1
+     * @since 1.6, JAX-WS 2.1
      **/
     public abstract <T> T getPort(EndpointReference endpointReference,
             Class<T> serviceEndpointInterface,
@@ -333,7 +333,7 @@
      * @throws WebServiceException If an error occurs while creating the
      *                             <code>W3CEndpointReference</code>.
      *
-     * @since JAX-WS 2.1
+     * @since 1.6, JAX-WS 2.1
      */
     public abstract W3CEndpointReference createW3CEndpointReference(String address, QName serviceName, QName portName,
             List<Element> metadata, String wsdlDocumentLocation, List<Element> referenceParameters);
@@ -407,7 +407,7 @@
      *     </ul>
      * @throws WebServiceException If an error occurs while creating the
      *                             <code>W3CEndpointReference</code>.
-     * @since JAX-WS 2.2
+     * @since 1.7, JAX-WS 2.2
      */
     public W3CEndpointReference createW3CEndpointReference(String address,
             QName interfaceName, QName serviceName, QName portName,
@@ -434,7 +434,7 @@
      *        endpoint.  Supported features not in the <code>features
      *        </code> parameter will have their default values.
      * @return The newly created endpoint.
-     * @since JAX-WS 2.2
+     * @since 1.7, JAX-WS 2.2
      */
     public Endpoint createAndPublishEndpoint(String address,
             Object implementor, WebServiceFeature ... features) {
@@ -455,7 +455,7 @@
      *        endpoint.  Supported features not in the <code>features
      *        </code> parameter will have their default values.
      * @return The newly created endpoint.
-     * @since JAX-WS 2.2
+     * @since 1.7, JAX-WS 2.2
      */
     public Endpoint createEndpoint(String bindingId, Object implementor,
             WebServiceFeature ... features) {
@@ -478,7 +478,7 @@
      *        endpoint.  Supported features not in the <code>features
      *        </code> parameter will have their default values.
      * @return The newly created endpoint.
-     * @since JAX-WS 2.2
+     * @since 1.7, JAX-WS 2.2
      */
     public Endpoint createEndpoint(String bindingId, Class<?> implementorClass,
             Invoker invoker, WebServiceFeature ... features) {
--- a/jaxws/src/share/jaxws_classes/javax/xml/ws/spi/ServiceDelegate.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/spi/ServiceDelegate.java	Wed Jul 05 19:53:51 2017 +0200
@@ -47,7 +47,7 @@
  * @see javax.xml.ws.Service
  * @see javax.xml.ws.spi.Provider
  *
- * @since JAX-WS 2.0
+ * @since 1.6, JAX-WS 2.0
  */
 public abstract class ServiceDelegate {
 
@@ -119,7 +119,7 @@
      * @see java.lang.reflect.InvocationHandler
      * @see WebServiceFeature
      *
-     * @since JAX-WS 2.1
+     * @since 1.6, JAX-WS 2.1
      **/
     public abstract <T> T getPort(QName portName,
             Class<T> serviceEndpointInterface, WebServiceFeature... features);
@@ -194,7 +194,7 @@
      *                      with this port or is unsupported.
      *                  </UL>
      *
-     * @since JAX-WS 2.1
+     * @since 1.6, JAX-WS 2.1
      **/
     public abstract <T> T getPort(EndpointReference endpointReference,
            Class<T> serviceEndpointInterface, WebServiceFeature... features);
@@ -256,7 +256,7 @@
      *
      * @see WebServiceFeature
      *
-     * @since JAX-WS 2.1
+     * @since 1.6, JAX-WS 2.1
      **/
     public abstract <T> T getPort(Class<T> serviceEndpointInterface,
             WebServiceFeature... features);
@@ -334,7 +334,7 @@
      * @see javax.xml.soap.SOAPMessage
      * @see WebServiceFeature
      *
-     * @since JAX-WS 2.1
+     * @since 1.6, JAX-WS 2.1
      **/
     public abstract <T> Dispatch<T> createDispatch(QName portName, Class<T> type,
             Service.Mode mode, WebServiceFeature... features);
@@ -406,7 +406,7 @@
      * @see javax.xml.soap.SOAPMessage
      * @see WebServiceFeature
      *
-     * @since JAX-WS 2.1
+     * @since 1.6, JAX-WS 2.1
      **/
     public abstract <T> Dispatch<T> createDispatch(EndpointReference endpointReference,
             Class<T> type, Service.Mode mode,
@@ -462,7 +462,7 @@
      * @see javax.xml.bind.JAXBContext
      * @see WebServiceFeature
      *
-     * @since JAX-WS 2.1
+     * @since 1.6, JAX-WS 2.1
      **/
     public abstract Dispatch<Object> createDispatch(QName portName,
             JAXBContext context, Service.Mode mode, WebServiceFeature... features);
@@ -532,7 +532,7 @@
      * @see javax.xml.bind.JAXBContext
      * @see WebServiceFeature
      *
-     * @since JAX-WS 2.1
+     * @since 1.6, JAX-WS 2.1
     **/
     public abstract Dispatch<Object> createDispatch(EndpointReference endpointReference,
             JAXBContext context, Service.Mode mode,
--- a/jaxws/src/share/jaxws_classes/javax/xml/ws/spi/WebServiceFeatureAnnotation.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/spi/WebServiceFeatureAnnotation.java	Wed Jul 05 19:53:51 2017 +0200
@@ -65,7 +65,7 @@
  * @see MTOM
  * @see RespectBinding
  *
- * @since JAX-WS 2.1
+ * @since 1.6, JAX-WS 2.1
  */
 @Target(ElementType.ANNOTATION_TYPE)
 @Retention(RetentionPolicy.RUNTIME)
--- a/jaxws/src/share/jaxws_classes/javax/xml/ws/spi/http/HttpContext.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/spi/http/HttpContext.java	Wed Jul 05 19:53:51 2017 +0200
@@ -37,7 +37,7 @@
  * web service requests to corresponding HttpContext objects.
  *
  * @author Jitendra Kotamraju
- * @since JAX-WS 2.2
+ * @since 1.7, JAX-WS 2.2
  */
 public abstract class HttpContext {
 
--- a/jaxws/src/share/jaxws_classes/javax/xml/ws/spi/http/HttpExchange.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/spi/http/HttpExchange.java	Wed Jul 05 19:53:51 2017 +0200
@@ -46,7 +46,7 @@
  * is undefined.
  *
  * @author Jitendra Kotamraju
- * @since JAX-WS 2.2
+ * @since 1.7, JAX-WS 2.2
  */
 public abstract class HttpExchange {
 
--- a/jaxws/src/share/jaxws_classes/javax/xml/ws/spi/http/HttpHandler.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/spi/http/HttpHandler.java	Wed Jul 05 19:53:51 2017 +0200
@@ -36,7 +36,7 @@
  * {@link Endpoint#publish(HttpContext) }
  *
  * @author Jitendra Kotamraju
- * @since JAX-WS 2.2
+ * @since 1.7, JAX-WS 2.2
  */
 public abstract class HttpHandler {
     /**
--- a/jaxws/src/share/jaxws_classes/javax/xml/ws/spi/http/package-info.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/spi/http/package-info.java	Wed Jul 05 19:53:51 2017 +0200
@@ -90,6 +90,6 @@
   </pre>
 
   @author Jitendra Kotamraju
-  @since JAX-WS 2.2
+  @since 1.7, JAX-WS 2.2
  */
 package javax.xml.ws.spi.http;
--- a/jaxws/src/share/jaxws_classes/javax/xml/ws/wsaddressing/W3CEndpointReference.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/wsaddressing/W3CEndpointReference.java	Wed Jul 05 19:53:51 2017 +0200
@@ -61,7 +61,7 @@
  * WS-Addressing</a>
  * for more information on WS-Addressing EndpointReferences.
  *
- * @since JAX-WS 2.1
+ * @since 1.6, JAX-WS 2.1
  */
 
 // XmlRootElement allows this class to be marshalled on its own
--- a/jaxws/src/share/jaxws_classes/javax/xml/ws/wsaddressing/W3CEndpointReferenceBuilder.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/wsaddressing/W3CEndpointReferenceBuilder.java	Wed Jul 05 19:53:51 2017 +0200
@@ -62,7 +62,7 @@
  * <code>endpointName</code> (if specified) MUST match a service and port
  * in the WSDL document.
  *
- * @since JAX-WS 2.1
+ * @since 1.6, JAX-WS 2.1
  */
 public final class W3CEndpointReferenceBuilder {
     /**
@@ -110,6 +110,7 @@
      * @return A <code>W3CEndpointReferenceBuilder</code> instance with
      *   the <code>interfaceName</code> as <code>wsam:InterfaceName</code>
      *   element added to the <code>wsa:Metadata</code> element
+     * @since 1.7
      */
     public W3CEndpointReferenceBuilder interfaceName(QName interfaceName) {
         this.interfaceName = interfaceName;
@@ -253,7 +254,7 @@
      * @throws java.lang.IllegalArgumentException if <code>element</code>
      * is <code>null</code>.
      *
-     * @since JAX-WS 2.2
+     * @since 1.7, JAX-WS 2.2
      */
     public W3CEndpointReferenceBuilder element(Element element) {
         if (element == null) {
@@ -277,7 +278,7 @@
      * @throws java.lang.IllegalArgumentException if <code>name</code>
      *   or <code>value</code> is <code>null</code>.
      *
-     * @since JAX-WS 2.2
+     * @since 1.7, JAX-WS 2.2
      */
     public W3CEndpointReferenceBuilder attribute(QName name, String value) {
         if (name == null || value == null) {
--- a/jdk/.hgtags	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/.hgtags	Wed Jul 05 19:53:51 2017 +0200
@@ -267,3 +267,4 @@
 85bcf0f99edc08873614afbe5a5563e13ce13c83 jdk9-b22
 9febf9dbc0a4b15323f2dbd29931cfbf086332b4 jdk9-b23
 875450e7ef8dde8f59db662ec1351ea30b8cb35d jdk9-b24
+a31efe49556a7c12f9ea2c9ee8b4fae8aa67723a jdk9-b25
--- a/jdk/make/CopyFiles.gmk	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/make/CopyFiles.gmk	Wed Jul 05 19:53:51 2017 +0200
@@ -122,7 +122,7 @@
 
 ##########################################################################################
 #
-# Copy flavormap.properties, cursor.properties and cursors gif files to LIBDIR
+# Copy cursor.properties and cursors gif files to LIBDIR
 #
 ifneq ($(OPENJDK_TARGET_OS), macosx)
   OPENJDK_TARGET_OS_LIB_SRC = $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/lib
@@ -130,11 +130,6 @@
   OPENJDK_TARGET_OS_LIB_SRC = $(JDK_TOPDIR)/src/macosx/lib
 endif
 
-$(LIBDIR)/flavormap.properties: $(OPENJDK_TARGET_OS_LIB_SRC)/flavormap.properties
-	$(call install-file)
-
-COPY_FILES += $(LIBDIR)/flavormap.properties
-
 CURSORS_DEST_DIR = $(LIBDIR)/images/cursors
 CURSORS_OPENJDK_TARGET_OS_LIB_SRC = $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/lib/images/cursors
 
--- a/jdk/make/CopyIntoClasses.gmk	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/make/CopyIntoClasses.gmk	Wed Jul 05 19:53:51 2017 +0200
@@ -163,6 +163,19 @@
 
 ################################################################################
 
+ifneq ($(OPENJDK_TARGET_OS), macosx)
+  OPENJDK_TARGET_OS_FLAVORMAP_PROPERTIES = $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/classes/sun/awt/datatransfer/flavormap.properties
+else
+  OPENJDK_TARGET_OS_FLAVORMAP_PROPERTIES = $(JDK_TOPDIR)/src/macosx/classes/sun/awt/datatransfer/flavormap.properties
+endif
+
+$(JDK_OUTPUTDIR)/classes/sun/awt/datatransfer/flavormap.properties: $(OPENJDK_TARGET_OS_FLAVORMAP_PROPERTIES)
+	$(install-file)
+
+COPY_EXTRA += $(JDK_OUTPUTDIR)/classes/sun/awt/datatransfer/flavormap.properties
+
+################################################################################
+
 CLEAN_FILES := $(wildcard \
     $(JDK_TOPDIR)/src/share/classes/com/sun/imageio/plugins/common/*.properties \
     $(JDK_TOPDIR)/src/share/classes/com/sun/java/util/jar/pack/*.properties \
--- a/jdk/make/Setup.gmk	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/make/Setup.gmk	Wed Jul 05 19:53:51 2017 +0200
@@ -27,7 +27,7 @@
 
 # To build with all warnings enabled, do the following:
 # make JAVAC_WARNINGS="-Xlint:all -Xmaxwarns 10000"
-JAVAC_WARNINGS := -Xlint:all,-deprecation,-rawtypes,-unchecked -Werror
+JAVAC_WARNINGS := -Xlint:all,-deprecation -Werror
 
 # Any java code executed during a JDK build to build other parts of the JDK must be 
 # executed by the bootstrap JDK (probably with -Xbootclasspath/p: ) and for this 
--- a/jdk/make/data/swingbeaninfo/SwingBeanInfo.template	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/make/data/swingbeaninfo/SwingBeanInfo.template	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014, 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
@@ -42,7 +42,7 @@
  */
 
 public class @(BeanClassName)BeanInfo extends javax.swing.SwingBeanInfoBase {
-    private static final Class class@(BeanClassName) = @(BeanClassObject);
+    private static final Class<?> class@(BeanClassName) = @(BeanClassObject);
 
     /**
      * @return a @(BeanClassName) BeanDescriptor
--- a/jdk/make/data/swingbeaninfo/javax/swing/SwingBeanInfoBase.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/make/data/swingbeaninfo/javax/swing/SwingBeanInfoBase.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -67,7 +67,7 @@
      * its PropertyDescriptors will be included.
      */
     public BeanInfo[] getAdditionalBeanInfo() {
-        Class superClass = getBeanDescriptor().getBeanClass().getSuperclass();
+        Class<?> superClass = getBeanDescriptor().getBeanClass().getSuperclass();
         BeanInfo superBeanInfo = null;
         try {
             superBeanInfo = Introspector.getBeanInfo(superClass);
--- a/jdk/make/data/swingbeaninfo/sun/swing/BeanInfoUtils.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/make/data/swingbeaninfo/sun/swing/BeanInfoUtils.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -122,7 +122,7 @@
      * @see java.beans#PropertyDescriptor
      * @see java.beans#FeatureDescriptor
      */
-    public static PropertyDescriptor createPropertyDescriptor(Class cls, String name, Object[] args)
+    public static PropertyDescriptor createPropertyDescriptor(Class<?> cls, String name, Object[] args)
     {
         PropertyDescriptor pd = null;
         try {
@@ -156,7 +156,7 @@
                 String methodName = (String)value;
                 Method method;
                 try {
-                    method = cls.getMethod(methodName, new Class[0]);
+                    method = cls.getMethod(methodName, new Class<?>[0]);
                     pd.setReadMethod(method);
                 }
                 catch(Exception e) {
@@ -168,8 +168,8 @@
                 String methodName = (String)value;
                 Method method;
                 try {
-                    Class type = pd.getPropertyType();
-                    method = cls.getMethod(methodName, new Class[]{type});
+                    Class<?> type = pd.getPropertyType();
+                    method = cls.getMethod(methodName, new Class<?>[]{type});
                     pd.setWriteMethod(method);
                 }
                 catch(Exception e) {
@@ -215,9 +215,9 @@
      * @see java.beans#BeanInfo
      * @see java.beans#PropertyDescriptor
      */
-    public static BeanDescriptor createBeanDescriptor(Class cls, Object[] args)
+    public static BeanDescriptor createBeanDescriptor(Class<?> cls, Object[] args)
     {
-        Class customizerClass = null;
+        Class<?> customizerClass = null;
 
         /* For reasons I don't understand, customizerClass is a
          * readOnly property.  So we have to find it and pass it
@@ -242,11 +242,11 @@
     }
 
     static private PropertyDescriptor createReadOnlyPropertyDescriptor(
-        String name, Class cls) throws IntrospectionException {
+        String name, Class<?> cls) throws IntrospectionException {
 
         Method readMethod = null;
         String base = capitalize(name);
-        Class[] parameters = new Class[0];
+        Class<?>[] parameters = new Class<?>[0];
 
         // Is it a boolean?
         try {
@@ -264,7 +264,7 @@
 
         try {
             // Try indexed accessor pattern.
-            parameters = new Class[1];
+            parameters = new Class<?>[1];
             parameters[0] = int.class;
             readMethod = cls.getMethod("get" + base, parameters);
         } catch (NoSuchMethodException nsme) {
--- a/jdk/make/lib/PlatformLibraries.gmk	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/make/lib/PlatformLibraries.gmk	Wed Jul 05 19:53:51 2017 +0200
@@ -90,8 +90,7 @@
   LIBOSX_DIRS := \
       $(JDK_TOPDIR)/src/macosx/native/com/apple/concurrent \
       $(JDK_TOPDIR)/src/macosx/native/com/apple/eio \
-      $(JDK_TOPDIR)/src/macosx/native/apple/security \
-      $(JDK_TOPDIR)/src/macosx/native/apple/launcher
+      $(JDK_TOPDIR)/src/macosx/native/apple/security
 
   $(eval $(call SetupNativeCompilation,BUILD_LIBOSX, \
       LIBRARY := osx, \
--- a/jdk/make/mapfiles/libawt/mapfile-mawt-vers	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/make/mapfiles/libawt/mapfile-mawt-vers	Wed Jul 05 19:53:51 2017 +0200
@@ -204,6 +204,7 @@
                 Java_sun_print_CUPSPrinter_canConnect;
                 Java_sun_print_CUPSPrinter_getMedia;
                 Java_sun_print_CUPSPrinter_getPageSizes;
+                Java_sun_print_CUPSPrinter_getResolutions;
 
                 Java_com_sun_java_swing_plaf_gtk_GTKEngine_native_1paint_1arrow;
                 Java_com_sun_java_swing_plaf_gtk_GTKEngine_native_1paint_1box;
--- a/jdk/make/mapfiles/libawt_headless/mapfile-vers	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/make/mapfiles/libawt_headless/mapfile-vers	Wed Jul 05 19:53:51 2017 +0200
@@ -76,6 +76,7 @@
 		Java_sun_print_CUPSPrinter_canConnect;
 		Java_sun_print_CUPSPrinter_getMedia;
 		Java_sun_print_CUPSPrinter_getPageSizes;
+		Java_sun_print_CUPSPrinter_getResolutions;
 
 		# libfontmanager entry points
 		AWTIsHeadless;
--- a/jdk/make/mapfiles/libawt_xawt/mapfile-vers	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/make/mapfiles/libawt_xawt/mapfile-vers	Wed Jul 05 19:53:51 2017 +0200
@@ -442,6 +442,7 @@
 	Java_sun_print_CUPSPrinter_canConnect;
 	Java_sun_print_CUPSPrinter_getMedia;
 	Java_sun_print_CUPSPrinter_getPageSizes;
+	Java_sun_print_CUPSPrinter_getResolutions;
 
         awt_GetDrawingSurface;
         awt_FreeDrawingSurface;
--- a/jdk/make/profile-includes.txt	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/make/profile-includes.txt	Wed Jul 05 19:53:51 2017 +0200
@@ -177,7 +177,6 @@
     ext/dnsns.jar \
     ext/nashorn.jar \
     ext/zipfs.jar \
-    flavormap.properties \
     fontconfig.RedHat.5.bfc \
     fontconfig.RedHat.5.properties.src \
     fontconfig.RedHat.6.bfc \
--- a/jdk/src/macosx/bundle/JavaAppLauncher/JavaAppLauncher.xcodeproj/project.pbxproj	Wed Jul 05 19:52:35 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,318 +0,0 @@
-// !$*UTF8*$!
-{
-        archiveVersion = 1;
-        classes = {
-        };
-        objectVersion = 45;
-        objects = {
-
-/* Begin PBXBuildFile section */
-                2C483E05143512EB00F2AEFD /* 1.7.0.jre in Copy PlugIns */ = {isa = PBXBuildFile; fileRef = 2C483E04143512EB00F2AEFD /* 1.7.0.jre */; };
-                89D3CD32142EEB2200A08AED /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 89D3CD29142EEB2200A08AED /* InfoPlist.strings */; };
-                89D3CD33142EEB2200A08AED /* GenericApp.icns in Resources */ = {isa = PBXBuildFile; fileRef = 89D3CD2B142EEB2200A08AED /* GenericApp.icns */; };
-                89D3CD35142EEB2200A08AED /* JVMArgs.m in Sources */ = {isa = PBXBuildFile; fileRef = 89D3CD30142EEB2200A08AED /* JVMArgs.m */; };
-                89D3CD36142EEB2200A08AED /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 89D3CD31142EEB2200A08AED /* main.m */; };
-                89D3D365143041F000A08AED /* JavaAppLauncher.m in Sources */ = {isa = PBXBuildFile; fileRef = 89D3D364143041F000A08AED /* JavaAppLauncher.m */; };
-                8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; };
-/* End PBXBuildFile section */
-
-/* Begin PBXCopyFilesBuildPhase section */
-                2C48F06614350F0F00F2AEFD /* Copy PlugIns */ = {
-                        isa = PBXCopyFilesBuildPhase;
-                        buildActionMask = 2147483647;
-                        dstPath = "";
-                        dstSubfolderSpec = 13;
-                        files = (
-                                2C483E05143512EB00F2AEFD /* 1.7.0.jre in Copy PlugIns */,
-                        );
-                        name = "Copy PlugIns";
-                        runOnlyForDeploymentPostprocessing = 0;
-                };
-/* End PBXCopyFilesBuildPhase section */
-
-/* Begin PBXFileReference section */
-                1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
-                2C483E04143512EB00F2AEFD /* 1.7.0.jre */ = {isa = PBXFileReference; lastKnownFileType = folder; name = 1.7.0.jre; path = "../../../../../build/macosx-universal/j2sdk-bundle/1.7.0.jdk/Contents/Home/1.7.0.jre"; sourceTree = SOURCE_ROOT; };
-                2C48F06714350F8300F2AEFD /* 1.7.0.jdk */ = {isa = PBXFileReference; lastKnownFileType = folder; name = 1.7.0.jdk; path = "../../../../../build/macosx-universal/j2sdk-bundle/1.7.0.jdk"; sourceTree = SOURCE_ROOT; };
-                2CB5DA5E14355FCA00D3A656 /* classfile_constants.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = classfile_constants.h; sourceTree = "<group>"; };
-                2CB5DA6014355FCA00D3A656 /* jawt_md.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jawt_md.h; sourceTree = "<group>"; };
-                2CB5DA6114355FCA00D3A656 /* jni_md.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jni_md.h; sourceTree = "<group>"; };
-                2CB5DA6214355FCA00D3A656 /* jawt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jawt.h; sourceTree = "<group>"; };
-                2CB5DA6314355FCA00D3A656 /* jdwpTransport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jdwpTransport.h; sourceTree = "<group>"; };
-                2CB5DA6414355FCA00D3A656 /* jni.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jni.h; sourceTree = "<group>"; };
-                2CB5DA6514355FCA00D3A656 /* jvmti.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jvmti.h; sourceTree = "<group>"; };
-                2CB5DA6614355FCA00D3A656 /* jvmticmlr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jvmticmlr.h; sourceTree = "<group>"; };
-                89D3CD2A142EEB2200A08AED /* English */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; };
-                89D3CD2B142EEB2200A08AED /* GenericApp.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = GenericApp.icns; path = /System/Library/Frameworks/JavaVM.framework/Versions/A/Resources/GenericApp.icns; sourceTree = "<absolute>"; };
-                89D3CD2C142EEB2200A08AED /* JavaAppLauncher-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "JavaAppLauncher-Info.plist"; sourceTree = "<group>"; };
-                89D3CD2E142EEB2200A08AED /* JavaAppLauncher_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JavaAppLauncher_Prefix.pch; sourceTree = "<group>"; };
-                89D3CD2F142EEB2200A08AED /* JVMArgs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JVMArgs.h; sourceTree = "<group>"; };
-                89D3CD30142EEB2200A08AED /* JVMArgs.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JVMArgs.m; sourceTree = "<group>"; };
-                89D3CD31142EEB2200A08AED /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
-                89D3D363143041F000A08AED /* JavaAppLauncher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JavaAppLauncher.h; sourceTree = "<group>"; };
-                89D3D364143041F000A08AED /* JavaAppLauncher.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JavaAppLauncher.m; sourceTree = "<group>"; };
-                8D1107320486CEB800E47090 /* JavaAppLauncher.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = JavaAppLauncher.app; sourceTree = BUILT_PRODUCTS_DIR; };
-/* End PBXFileReference section */
-
-/* Begin PBXFrameworksBuildPhase section */
-                8D11072E0486CEB800E47090 /* Frameworks */ = {
-                        isa = PBXFrameworksBuildPhase;
-                        buildActionMask = 2147483647;
-                        files = (
-                                8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */,
-                        );
-                        runOnlyForDeploymentPostprocessing = 0;
-                };
-/* End PBXFrameworksBuildPhase section */
-
-/* Begin PBXGroup section */
-                1058C7A0FEA54F0111CA2CBB /* frameworks */ = {
-                        isa = PBXGroup;
-                        children = (
-                                1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */,
-                        );
-                        name = frameworks;
-                        sourceTree = "<group>";
-                };
-                19C28FACFE9D520D11CA2CBB /* Products */ = {
-                        isa = PBXGroup;
-                        children = (
-                                8D1107320486CEB800E47090 /* JavaAppLauncher.app */,
-                        );
-                        name = Products;
-                        sourceTree = "<group>";
-                };
-                29B97314FDCFA39411CA2CEA /* JavaAppLauncher */ = {
-                        isa = PBXGroup;
-                        children = (
-                                89D3CD2D142EEB2200A08AED /* src */,
-                                89D3CD28142EEB2200A08AED /* resources */,
-                                29B97323FDCFA39411CA2CEA /* linking */,
-                                19C28FACFE9D520D11CA2CBB /* Products */,
-                        );
-                        name = JavaAppLauncher;
-                        sourceTree = "<group>";
-                };
-                29B97323FDCFA39411CA2CEA /* linking */ = {
-                        isa = PBXGroup;
-                        children = (
-                                2C48F06714350F8300F2AEFD /* 1.7.0.jdk */,
-                                2C483E04143512EB00F2AEFD /* 1.7.0.jre */,
-                                2CB5DA5D14355FCA00D3A656 /* include */,
-                                1058C7A0FEA54F0111CA2CBB /* frameworks */,
-                        );
-                        name = linking;
-                        sourceTree = "<group>";
-                };
-                2CB5DA5D14355FCA00D3A656 /* include */ = {
-                        isa = PBXGroup;
-                        children = (
-                                2CB5DA5E14355FCA00D3A656 /* classfile_constants.h */,
-                                2CB5DA5F14355FCA00D3A656 /* darwin */,
-                                2CB5DA6214355FCA00D3A656 /* jawt.h */,
-                                2CB5DA6314355FCA00D3A656 /* jdwpTransport.h */,
-                                2CB5DA6414355FCA00D3A656 /* jni.h */,
-                                2CB5DA6514355FCA00D3A656 /* jvmti.h */,
-                                2CB5DA6614355FCA00D3A656 /* jvmticmlr.h */,
-                        );
-                        name = include;
-                        path = "../../../../../build/macosx-universal/j2sdk-bundle/1.7.0.jdk/Contents/Home/include";
-                        sourceTree = "<group>";
-                };
-                2CB5DA5F14355FCA00D3A656 /* darwin */ = {
-                        isa = PBXGroup;
-                        children = (
-                                2CB5DA6014355FCA00D3A656 /* jawt_md.h */,
-                                2CB5DA6114355FCA00D3A656 /* jni_md.h */,
-                        );
-                        path = darwin;
-                        sourceTree = "<group>";
-                };
-                89D3CD28142EEB2200A08AED /* resources */ = {
-                        isa = PBXGroup;
-                        children = (
-                                89D3CD29142EEB2200A08AED /* InfoPlist.strings */,
-                                89D3CD2B142EEB2200A08AED /* GenericApp.icns */,
-                                89D3CD2C142EEB2200A08AED /* JavaAppLauncher-Info.plist */,
-                        );
-                        path = resources;
-                        sourceTree = "<group>";
-                };
-                89D3CD2D142EEB2200A08AED /* src */ = {
-                        isa = PBXGroup;
-                        children = (
-                                89D3CD31142EEB2200A08AED /* main.m */,
-                                89D3D363143041F000A08AED /* JavaAppLauncher.h */,
-                                89D3D364143041F000A08AED /* JavaAppLauncher.m */,
-                                89D3CD2F142EEB2200A08AED /* JVMArgs.h */,
-                                89D3CD30142EEB2200A08AED /* JVMArgs.m */,
-                                89D3CD2E142EEB2200A08AED /* JavaAppLauncher_Prefix.pch */,
-                        );
-                        path = src;
-                        sourceTree = "<group>";
-                };
-/* End PBXGroup section */
-
-/* Begin PBXNativeTarget section */
-                8D1107260486CEB800E47090 /* JavaAppLauncher */ = {
-                        isa = PBXNativeTarget;
-                        buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "JavaAppLauncher" */;
-                        buildPhases = (
-                                8D1107290486CEB800E47090 /* Resources */,
-                                2C48F06614350F0F00F2AEFD /* Copy PlugIns */,
-                                8D11072C0486CEB800E47090 /* Sources */,
-                                8D11072E0486CEB800E47090 /* Frameworks */,
-                        );
-                        buildRules = (
-                        );
-                        dependencies = (
-                        );
-                        name = JavaAppLauncher;
-                        productInstallPath = "$(HOME)/Applications";
-                        productName = JavaAppLauncher;
-                        productReference = 8D1107320486CEB800E47090 /* JavaAppLauncher.app */;
-                        productType = "com.apple.product-type.application";
-                };
-/* End PBXNativeTarget section */
-
-/* Begin PBXProject section */
-                29B97313FDCFA39411CA2CEA /* Project object */ = {
-                        isa = PBXProject;
-                        buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "JavaAppLauncher" */;
-                        compatibilityVersion = "Xcode 3.1";
-                        developmentRegion = English;
-                        hasScannedForEncodings = 1;
-                        knownRegions = (
-                                en,
-                                English,
-                        );
-                        mainGroup = 29B97314FDCFA39411CA2CEA /* JavaAppLauncher */;
-                        projectDirPath = "";
-                        projectRoot = "";
-                        targets = (
-                                8D1107260486CEB800E47090 /* JavaAppLauncher */,
-                        );
-                };
-/* End PBXProject section */
-
-/* Begin PBXResourcesBuildPhase section */
-                8D1107290486CEB800E47090 /* Resources */ = {
-                        isa = PBXResourcesBuildPhase;
-                        buildActionMask = 2147483647;
-                        files = (
-                                89D3CD32142EEB2200A08AED /* InfoPlist.strings in Resources */,
-                                89D3CD33142EEB2200A08AED /* GenericApp.icns in Resources */,
-                        );
-                        runOnlyForDeploymentPostprocessing = 0;
-                };
-/* End PBXResourcesBuildPhase section */
-
-/* Begin PBXSourcesBuildPhase section */
-                8D11072C0486CEB800E47090 /* Sources */ = {
-                        isa = PBXSourcesBuildPhase;
-                        buildActionMask = 2147483647;
-                        files = (
-                                89D3CD35142EEB2200A08AED /* JVMArgs.m in Sources */,
-                                89D3CD36142EEB2200A08AED /* main.m in Sources */,
-                                89D3D365143041F000A08AED /* JavaAppLauncher.m in Sources */,
-                        );
-                        runOnlyForDeploymentPostprocessing = 0;
-                };
-/* End PBXSourcesBuildPhase section */
-
-/* Begin PBXVariantGroup section */
-                89D3CD29142EEB2200A08AED /* InfoPlist.strings */ = {
-                        isa = PBXVariantGroup;
-                        children = (
-                                89D3CD2A142EEB2200A08AED /* English */,
-                        );
-                        name = InfoPlist.strings;
-                        sourceTree = "<group>";
-                };
-/* End PBXVariantGroup section */
-
-/* Begin XCBuildConfiguration section */
-                C01FCF4B08A954540054247B /* Debug */ = {
-                        isa = XCBuildConfiguration;
-                        buildSettings = {
-                                ALWAYS_SEARCH_USER_PATHS = NO;
-                                COPY_PHASE_STRIP = NO;
-                                GCC_DYNAMIC_NO_PIC = NO;
-                                GCC_ENABLE_FIX_AND_CONTINUE = YES;
-                                GCC_MODEL_TUNING = G5;
-                                GCC_OPTIMIZATION_LEVEL = 0;
-                                GCC_PRECOMPILE_PREFIX_HEADER = YES;
-                                GCC_PREFIX_HEADER = src/JavaAppLauncher_Prefix.pch;
-                                INFOPLIST_FILE = "resources/JavaAppLauncher-Info.plist";
-                                INSTALL_PATH = "$(HOME)/Applications";
-                                LIBRARY_SEARCH_PATHS = "$(inherited)";
-                                PRODUCT_NAME = JavaAppLauncher;
-                        };
-                        name = Debug;
-                };
-                C01FCF4C08A954540054247B /* Release */ = {
-                        isa = XCBuildConfiguration;
-                        buildSettings = {
-                                ALWAYS_SEARCH_USER_PATHS = NO;
-                                DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
-                                GCC_MODEL_TUNING = G5;
-                                GCC_PRECOMPILE_PREFIX_HEADER = YES;
-                                GCC_PREFIX_HEADER = src/JavaAppLauncher_Prefix.pch;
-                                INFOPLIST_FILE = "resources/JavaAppLauncher-Info.plist";
-                                INSTALL_PATH = "$(HOME)/Applications";
-                                LIBRARY_SEARCH_PATHS = "$(inherited)";
-                                PRODUCT_NAME = JavaAppLauncher;
-                        };
-                        name = Release;
-                };
-                C01FCF4F08A954540054247B /* Debug */ = {
-                        isa = XCBuildConfiguration;
-                        buildSettings = {
-                                ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
-                                GCC_C_LANGUAGE_STANDARD = gnu99;
-                                GCC_OPTIMIZATION_LEVEL = 0;
-                                GCC_WARN_ABOUT_RETURN_TYPE = YES;
-                                GCC_WARN_UNUSED_VARIABLE = YES;
-                                ONLY_ACTIVE_ARCH = YES;
-                                PREBINDING = NO;
-                                SDKROOT = "";
-                        };
-                        name = Debug;
-                };
-                C01FCF5008A954540054247B /* Release */ = {
-                        isa = XCBuildConfiguration;
-                        buildSettings = {
-                                ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
-                                GCC_C_LANGUAGE_STANDARD = gnu99;
-                                GCC_WARN_ABOUT_RETURN_TYPE = YES;
-                                GCC_WARN_UNUSED_VARIABLE = YES;
-                                PREBINDING = NO;
-                                SDKROOT = "";
-                        };
-                        name = Release;
-                };
-/* End XCBuildConfiguration section */
-
-/* Begin XCConfigurationList section */
-                C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "JavaAppLauncher" */ = {
-                        isa = XCConfigurationList;
-                        buildConfigurations = (
-                                C01FCF4B08A954540054247B /* Debug */,
-                                C01FCF4C08A954540054247B /* Release */,
-                        );
-                        defaultConfigurationIsVisible = 0;
-                        defaultConfigurationName = Release;
-                };
-                C01FCF4E08A954540054247B /* Build configuration list for PBXProject "JavaAppLauncher" */ = {
-                        isa = XCConfigurationList;
-                        buildConfigurations = (
-                                C01FCF4F08A954540054247B /* Debug */,
-                                C01FCF5008A954540054247B /* Release */,
-                        );
-                        defaultConfigurationIsVisible = 0;
-                        defaultConfigurationName = Release;
-                };
-/* End XCConfigurationList section */
-        };
-        rootObject = 29B97313FDCFA39411CA2CEA /* Project object */;
-}
--- a/jdk/src/macosx/bundle/JavaAppLauncher/resources/English.lproj/InfoPlist.strings	Wed Jul 05 19:52:35 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2 +0,0 @@
-/* Localized versions of Info.plist keys */
-
--- a/jdk/src/macosx/bundle/JavaAppLauncher/resources/JavaAppLauncher-Info.plist	Wed Jul 05 19:52:35 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-        <key>CFBundleDevelopmentRegion</key>
-        <string>English</string>
-        <key>CFBundleExecutable</key>
-        <string>${EXECUTABLE_NAME}</string>
-        <key>CFBundleIconFile</key>
-        <string>GenericApp.icns</string>
-        <key>CFBundleIdentifier</key>
-        <string>com.yourcompany.${PRODUCT_NAME:rfc1034identifier}</string>
-        <key>CFBundleDisplayName</key>
-        <string>Your Cool App</string>
-        <key>CFBundleInfoDictionaryVersion</key>
-        <string>6.0</string>
-        <key>CFBundleName</key>
-        <string>${PRODUCT_NAME}</string>
-        <key>CFBundlePackageType</key>
-        <string>APPL</string>
-        <key>CFBundleShortVersionString</key>
-        <string>1.0</string>
-        <key>CFBundleSignature</key>
-        <string>????</string>
-        <key>CFBundleVersion</key>
-        <string>1</string>
-        <key>LSMinimumSystemVersion</key>
-        <string>${MACOSX_DEPLOYMENT_TARGET}</string>
-        <key>NSHumanReadableCopyright</key>
-        <string>Copyright © 2011 Your Company Inc. All Rights Reserved.</string>
-        <key>JVMInfo</key>
-        <dict>
-                <key>JRE</key>
-                <string>1.7.0.jre</string>
-                <key>ClassPath</key>
-                <array/>
-                <key>Properties</key>
-                <dict>
-                        <key>apple.laf.useScreenMenuBar</key>
-                        <string>true</string>
-                </dict>
-                <key>MainClass</key>
-                <string>com.yourcompany.yourapp.mainclass</string>
-                <key>Arguments</key>
-                <array/>
-        </dict>
-</dict>
-</plist>
--- a/jdk/src/macosx/bundle/JavaAppLauncher/src/JVMArgs.h	Wed Jul 05 19:52:35 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,62 +0,0 @@
-/*
- * Copyright (c) 2011, 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * 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 <Cocoa/Cocoa.h>
-
-#import "jni.h"
-
-
-@interface JVMArgs : NSObject {
-@public
-    NSBundle *jreBundle;
-    char *preferredJVMLib;
-    JavaVMInitArgs vm_args;
-    BOOL startOnFirstThread;
-    BOOL debug;
-
-    NSDictionary *appInfo;
-    NSMutableDictionary *jvmInfo;
-
-    NSString *userHome;
-    NSString *appPackage;
-    NSString *javaRoot;
-}
-
-@property (retain, nonatomic) NSBundle *jreBundle;
-@property (nonatomic) char *preferredJVMLib;
-@property (nonatomic) JavaVMInitArgs vm_args;
-@property (nonatomic) BOOL startOnFirstThread;
-@property (nonatomic) BOOL debug;
-
-@property (retain, nonatomic) NSDictionary *appInfo;
-@property (retain, nonatomic) NSMutableDictionary *jvmInfo;
-
-@property (retain, nonatomic) NSString *userHome;
-@property (retain, nonatomic) NSString *appPackage;
-@property (retain, nonatomic) NSString *javaRoot;
-
-+ (JVMArgs *)jvmArgsForBundle:(NSBundle *)appBundle argc:(int)argc argv:(char *[])argv;
-
-@end
--- a/jdk/src/macosx/bundle/JavaAppLauncher/src/JVMArgs.m	Wed Jul 05 19:52:35 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,236 +0,0 @@
-/*
- * Copyright (c) 2011, 2013, 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * 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 "JVMArgs.h"
-
-
-#define kArgsFailure "JVMArgsFailure"
-
-NSString *kArgumentsKey = @"Arguments";
-
-NSString *kClassPathKey = @"ClassPath";
-#ifdef __i386__
-NSString *kArchClassPathKey = @"ClassPath.i386";
-#elif __x86_64__
-NSString *kArchClassPathKey = @"ClassPath.x86_64";
-#endif
-
-NSString *kVMOptionsKey = @"VMOptions";
-#ifdef __i386__
-NSString *kArchVMOptionsKey = @"VMOptions.i386";
-#elif __x86_64__
-NSString *kArchVMOptionsKey = @"VMOptions.x86_64";
-#endif
-
-
-@implementation JVMArgs
-
-@synthesize jreBundle;
-@synthesize preferredJVMLib;
-@synthesize vm_args;
-@synthesize startOnFirstThread;
-@synthesize debug;
-
-@synthesize appInfo;
-@synthesize jvmInfo;
-
-@synthesize userHome;
-@synthesize appPackage;
-@synthesize javaRoot;
-
-- (void) dealloc {
-    self.jreBundle = nil;
-    if (self.preferredJVMLib) free(self.preferredJVMLib);
-
-    self.appInfo = nil;
-    self.jvmInfo = nil;
-
-    self.userHome = nil;
-    self.appPackage = nil;
-    self.javaRoot = nil;
-
-    [super dealloc];
-}
-
-
-NSString *GetJavaRoot(NSDictionary *jvmInfoDict) {
-    NSObject *javaRoot = [jvmInfoDict objectForKey:@"$JAVAROOT"];
-    if (![javaRoot isKindOfClass:[NSString class]]) return @"$APP_PACKAGE/Contents/Java";
-    return (NSString *)javaRoot;
-}
-
-// Replaces occurances of $JAVAROOT, $APP_PACKAGE, and $USER_HOME
-- (NSString *) expandMacros:(NSString *)str {
-    if ([str rangeOfString:@"$JAVAROOT"].length == 0 && [str rangeOfString:@"$APP_PACKAGE"].length == 0 && [str rangeOfString:@"$USER_HOME"].length == 0) return str;
-
-    // expand $JAVAROOT first, because it can contain $APP_PACKAGE
-    NSMutableString *mutable = [str mutableCopy];
-    [mutable replaceOccurrencesOfString:@"$JAVAROOT" withString:javaRoot options:0 range:NSMakeRange(0, [str length])];
-    [mutable replaceOccurrencesOfString:@"$APP_PACKAGE" withString:appPackage options:0 range:NSMakeRange(0, [str length])];
-    [mutable replaceOccurrencesOfString:@"$USER_HOME" withString:userHome options:0 range:NSMakeRange(0, [str length])];
-    return mutable;
-}
-
-- (NSArray *) arrayFrom:(id) obj delimitedBy:(NSString *)delimiter withErrKey:(NSString *)key {
-    if (obj == nil) return nil;
-    if ([obj isKindOfClass:[NSArray class]]) return obj;
-    if (![obj isKindOfClass:[NSString class]]) {
-        [NSException raise:@kArgsFailure format:@"%@", [NSString stringWithFormat:@"Failed to find '%@' array in JVMInfo Info.plist"]];
-    }
-
-    // split
-    return [(NSString *)obj componentsSeparatedByString:delimiter];
-}
-
-- (void) buildArgsForBundle:(NSBundle *)appBundle argc:(int)argc argv:(char *[])argv {
-    // for verbose logging
-    self.debug = NULL != getenv("JAVA_LAUNCHER_VERBOSE");
-
-    self.appInfo = [appBundle infoDictionary];
-
-    // all apps must have a JVMInfo dictionary inside their Info.plist
-    self.jvmInfo = [[self.appInfo objectForKey:@"JVMInfo"] mutableCopy];
-    if (![jvmInfo isKindOfClass:[NSDictionary class]]) {
-        [NSException raise:@kArgsFailure format:@"Failed to find 'JVMInfo' dictionary in Info.plist"];
-    }
-
-    // initialize macro expansion values
-    self.userHome = NSHomeDirectory();
-    self.appPackage = [appBundle bundlePath];
-    self.javaRoot = GetJavaRoot(jvmInfo);
-    self.javaRoot = [self expandMacros:self.javaRoot]; // dereference $APP_PACKAGE
-
-    // if the 'Arguments' key is defined, those override the ones that came into main()
-    NSArray *jvmInfoArgs = [jvmInfo valueForKey:kArgumentsKey];
-    if (jvmInfoArgs != nil) {
-        // substitute all the variables in the 'Arguments' array/string
-        jvmInfoArgs = [self arrayFrom:jvmInfoArgs delimitedBy:@" " withErrKey:kArgumentsKey];
-        NSMutableArray *arguments = [NSMutableArray arrayWithCapacity:[jvmInfoArgs count]];
-        [jvmInfoArgs enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
-            [arguments replaceObjectAtIndex:idx withObject:[self expandMacros:[obj description]]];
-        }];
-        [jvmInfo setObject:arguments forKey:kArgumentsKey];
-    } else if (argc != 0) {
-        // put the (macro expanded) args to main() in an NSArray
-        NSMutableArray *arguments = [NSMutableArray arrayWithCapacity:argc];
-        for (int i = 0; i < argc; i++) {
-            [arguments addObject:[self expandMacros:[NSString stringWithUTF8String:(argv[i])]]];
-        }
-        [jvmInfo setObject:arguments forKey:kArgumentsKey];
-    }
-
-    // all JVMInfo's must have a JRE or JDK key
-    NSString *jreBundleName = [jvmInfo objectForKey:@"JRE"];
-    if (!jreBundleName) jreBundleName = [jvmInfo objectForKey:@"JDK"];
-    if (![jreBundleName isKindOfClass:[NSString class]]) {
-        [NSException raise:@kArgsFailure format:@"Failed to find 'JRE' or 'JDK' string in Info.plist JVMInfo"];
-    }
-
-    // the JRE/JDK must be loadable from the ($APP_PACKAGE)/Contents/PlugIns/ directory
-    NSURL *jreBundleURL = [[appBundle builtInPlugInsURL] URLByAppendingPathComponent:jreBundleName];
-    self.jreBundle = [NSBundle bundleWithURL:jreBundleURL];
-    if (!self.jreBundle) {
-        [NSException raise:@kArgsFailure format:@"Failed to find JRE/JDK at: %@", jreBundleURL];
-    }
-
-    // if the app prefers 'client' or 'server', use the JVM key
-    NSString *JVMLib = [jvmInfo objectForKey:@"JVM"];
-    if (JVMLib != nil) self.preferredJVMLib = strdup([JVMLib UTF8String]);
-
-    // sniff for StartOnFirstThread
-    if ([[jvmInfo objectForKey:@"StartOnFirstThread"] boolValue]) {
-        self.startOnFirstThread = YES;
-    } else if ([[jvmInfo objectForKey:@"StartOnMainThread"] boolValue]) {
-        // for key compatibility with the Apple JavaApplicationStub's 'Java' dictionary
-        self.startOnFirstThread = YES;
-    }
-
-    // add $JAVAROOT directory to the JNI library search path
-    setenv("JAVA_LIBRARY_PATH", [javaRoot UTF8String], 1);
-
-    // 'WorkingDirectory' key changes current working directory
-    NSString *javaWorkingDir = [jvmInfo objectForKey:@"WorkingDirectory"];
-    if (javaWorkingDir == nil) javaWorkingDir = @"$APP_PACKAGE/..";
-    javaWorkingDir = [self expandMacros:javaWorkingDir];
-    if (chdir([javaWorkingDir UTF8String]) == -1) {
-        NSLog(@kArgsFailure " chdir() failed, could not change the current working directory to %s\n", [javaWorkingDir UTF8String]);
-    }
-
-    NSMutableArray *classpath = [NSMutableArray array];
-
-    // 'Jar' key sets exactly one classpath entry
-    NSString *jarFile = [jvmInfo objectForKey:@"Jar"];
-    if (jarFile != nil) {
-        [jvmInfo setObject:[self expandMacros:jarFile] forKey:@"Jar"];
-        [classpath addObject:jarFile];
-    }
-
-    // 'ClassPath' key allows arbitrary classpath
-    [classpath addObjectsFromArray:[self arrayFrom:[jvmInfo objectForKey:kClassPathKey] delimitedBy:@":" withErrKey:kClassPathKey]];
-    [classpath addObjectsFromArray:[self arrayFrom:[jvmInfo objectForKey:kArchClassPathKey] delimitedBy:@":" withErrKey:kArchClassPathKey]];
-
-    // Sum up all the classpath entries into one big JVM arg
-    NSMutableString *classpathOption = [NSMutableString stringWithString:@"-Djava.class.path="];
-    [classpath enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
-        if (idx > 1) [classpathOption appendString:@":"];
-        [classpathOption appendString:obj];
-    }];
-
-    NSMutableArray *jvmOptions = [NSMutableArray arrayWithObject:classpathOption];
-
-    // 'VMOptions' key allows arbitary VM start up options
-    [jvmOptions addObjectsFromArray:[self arrayFrom:[jvmInfo objectForKey:kVMOptionsKey] delimitedBy:@" " withErrKey:kVMOptionsKey]];
-    [jvmOptions addObjectsFromArray:[self arrayFrom:[jvmInfo objectForKey:kArchVMOptionsKey] delimitedBy:@" " withErrKey:kArchVMOptionsKey]];
-
-    // 'Properties' key is a sub-dictionary transfered to initial System.properties
-    NSDictionary *properties = [jvmInfo objectForKey:@"Properties"];
-    if (properties != nil) {
-        if (![properties isKindOfClass:[NSDictionary class]]) {
-            [NSException raise:@kArgsFailure format:@"Failed to find 'Properties' dictionary in Info.plist JVMInfo"];
-        }
-
-        [properties enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) {
-            [jvmOptions addObject:[NSString stringWithFormat:@"-D%@=%@", key, obj]];
-        }];
-    }
-
-    // build the real JVM init args struct
-    vm_args.version = JNI_VERSION_1_6;
-    vm_args.ignoreUnrecognized = JNI_TRUE;
-    vm_args.nOptions = [jvmOptions count];
-    vm_args.options = calloc(vm_args.nOptions, sizeof(JavaVMOption));
-    [jvmOptions enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
-        NSString *expanded = [self expandMacros:[obj description]]; // turn everything into a string, and expand macros
-        vm_args.options[idx].optionString = strdup([expanded UTF8String]);
-    }];
-}
-
-+ (JVMArgs *)jvmArgsForBundle:(NSBundle *)appBundle argc:(int)argc argv:(char *[])argv {
-    JVMArgs *args = [JVMArgs new];
-    [args buildArgsForBundle:appBundle argc:argc argv:argv];
-    return [args autorelease];
-}
-
-@end
--- a/jdk/src/macosx/bundle/JavaAppLauncher/src/JavaAppLauncher.h	Wed Jul 05 19:52:35 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 2011, 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * 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 <Cocoa/Cocoa.h>
-
-#import "jni.h"
-
-#import "JVMArgs.h"
-
-
-@interface JavaAppLauncher : NSObject {
-    JVMArgs *args;
-    JavaVM *jvm;
-}
-
-@property (retain) JVMArgs *args;
-
-- (void) findAndLoadJVM;
-- (void) invokeBundledAppJavaLauncherWithEnv:(JNIEnv *)env;
-
-@end
--- a/jdk/src/macosx/bundle/JavaAppLauncher/src/JavaAppLauncher.m	Wed Jul 05 19:52:35 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,133 +0,0 @@
-/*
- * Copyright (c) 2011, 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * 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 "JavaAppLauncher.h"
-
-#import <dlfcn.h>
-
-#import "jni.h"
-
-#define kLaunchFailure "JavaAppLauncherFailure"
-
-
-typedef jint (JNICALL *CreateJavaVM_t)(JavaVM **pvm, void **env, void *args);
-typedef void (JNICALL *SetPreferredJVM_t)(const char *prefJVM);
-
-
-@implementation JavaAppLauncher
-
-@synthesize args;
-
-- (void) findAndLoadJVM {
-    NSAutoreleasePool *pool = [NSAutoreleasePool new];
-
-    @try {
-        // load the libjli.dylib of the embedded JRE (or JDK) bundle
-        NSURL *jreBundleURL = [args.jreBundle bundleURL];
-        CFBundleRef jreBundle = CFBundleCreate(NULL, (CFURLRef)jreBundleURL);
-
-        NSError *err = nil;
-        Boolean jreBundleLoaded = CFBundleLoadExecutableAndReturnError(jreBundle, (CFErrorRef *)&err);
-        if (err != nil || !jreBundleLoaded) {
-            [NSException raise:@kLaunchFailure format:@"could not load the JRE/JDK: %@", err];
-        }
-
-        // if there is a preferred libjvm to load, set it here
-        if (args.preferredJVMLib != NULL) {
-            SetPreferredJVM_t setPrefJVMFxnPtr = CFBundleGetFunctionPointerForName(jreBundle, CFSTR("JLI_SetPreferredJVM"));
-            if (setPrefJVMFxnPtr != NULL) {
-                setPrefJVMFxnPtr(args.preferredJVMLib);
-            } else {
-                NSLog(@"No JLI_SetPreferredJVM in JRE/JDK primary executable, failed to set preferred JVM library to: %s", args->preferredJVMLib);
-            }
-        }
-
-        // pull the JNI_CreateJavaVM function pointer out of the primary executable of the JRE/JDK bundle
-        CreateJavaVM_t createJVMFxnPtr = CFBundleGetFunctionPointerForName(jreBundle, CFSTR("JNI_CreateJavaVM"));
-        if (createJVMFxnPtr == NULL) {
-            [NSException raise:@kLaunchFailure format:@"null JNI_CreateJavaVM fxn ptr from: %@", jreBundle];
-        }
-
-        // instantiate the JVM
-        JNIEnv *env;
-        jint createJVMStatus = createJVMFxnPtr(&jvm, (void **)&env, &(args->vm_args));
-        if (createJVMStatus != JNI_OK) {
-            [NSException raise:@kLaunchFailure format:@"failed to JNI_CreateJavaVM (%d): %@", createJVMStatus, jreBundle];
-        }
-
-        // check the app needs to run the Java main() on the main thread
-        if (args.startOnFirstThread) {
-            dispatch_sync(dispatch_get_main_queue(), ^(void) {
-                JNIEnv *mainThreadEnv;
-                (*jvm)->AttachCurrentThread(jvm, (void **)&mainThreadEnv, NULL);
-                [self invokeBundledAppJavaLauncherWithEnv:mainThreadEnv];
-                (*jvm)->DetachCurrentThread(jvm);
-            });
-        } else {
-            [self invokeBundledAppJavaLauncherWithEnv:env];
-        }
-
-    } @catch (NSException *e) {
-        NSLog(@"%@: %@", e, [e callStackSymbols]);
-    }
-
-    if (jvm) {
-        (*jvm)->DetachCurrentThread(jvm);
-        (*jvm)->DestroyJavaVM(jvm);
-    }
-
-    [pool drain];
-}
-
-static const char kLauncherClassName[] = "apple/launcher/JavaAppLauncher";
-
-- (void) invokeBundledAppJavaLauncherWithEnv:(JNIEnv *)env {
-    // hand off control to the apple.launcher.JavaAppLauncher class
-
-    jclass mainClass = (*env)->FindClass(env, kLauncherClassName);
-    if (mainClass == NULL) {
-        fprintf(stderr, kLaunchFailure " FindClass() failed for class %s:\n", kLauncherClassName);
-        (*env)->ExceptionDescribe(env);
-        return;
-    }
-
-    jmethodID mainMethod = (*env)->GetStaticMethodID(env, mainClass, "launch", "(JZ)V");
-    if ((mainMethod == NULL) || (*env)->ExceptionOccurred(env)) {
-        fprintf(stderr, kLaunchFailure " GetStaticMethodID() failed for launch() method");
-        (*env)->ExceptionDescribe(env);
-        return;
-    }
-
-    CFDictionaryRef jvmInfo = CFRetain(args.jvmInfo);
-
-    (*env)->CallStaticVoidMethod(env, mainClass, mainMethod, (jlong)jvmInfo, (jboolean)args.debug);
-    if ((*env)->ExceptionOccurred(env)) {
-        fprintf(stderr, kLaunchFailure " CallStaticVoidMethod() threw an exception\n");
-        (*env)->ExceptionDescribe(env);
-        return;
-    }
-}
-
-@end
--- a/jdk/src/macosx/bundle/JavaAppLauncher/src/JavaAppLauncher_Prefix.pch	Wed Jul 05 19:52:35 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-/*
- * Copyright (c) 2011, 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * 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.
- */
-
-//
-// Prefix header for all source files of the 'JavaAppLauncher' target in the 'JavaAppLauncher' project
-//
-
-#ifdef __OBJC__
-    #import <Cocoa/Cocoa.h>
-#endif
--- a/jdk/src/macosx/bundle/JavaAppLauncher/src/main.m	Wed Jul 05 19:52:35 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,80 +0,0 @@
-/*
- * Copyright (c) 2011, 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * 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 <Cocoa/Cocoa.h>
-
-#import "JVMArgs.h"
-#import "JavaAppLauncher.h"
-
-
-static void dummyTimer(CFRunLoopTimerRef timer, void *info) {}
-static void ParkEventLoop() {
-    // RunLoop needs at least one source, and 1e20 is pretty far into the future
-    CFRunLoopTimerRef t = CFRunLoopTimerCreate(kCFAllocatorDefault, 1.0e20, 0.0, 0, 0, dummyTimer, NULL);
-    CFRunLoopAddTimer(CFRunLoopGetCurrent(), t, kCFRunLoopDefaultMode);
-    CFRelease(t);
-
-    // Park this thread in the main run loop.
-    int32_t result;
-    do {
-        result = CFRunLoopRunInMode(kCFRunLoopDefaultMode, 1.0e20, false);
-    } while (result != kCFRunLoopRunFinished);
-}
-
-int main(int argc, char *argv[]) {
-    NSAutoreleasePool *pool = [NSAutoreleasePool new];
-
-    @try {
-        NSBundle *mainBundle = [NSBundle mainBundle];
-
-        // pick apart the Info.plist, and release all the temporary objects
-        NSAutoreleasePool *argParsingPool = [NSAutoreleasePool new];
-        JVMArgs *args = [JVMArgs jvmArgsForBundle:mainBundle argc:argc argv:argv];
-        JavaAppLauncher *launcher = [JavaAppLauncher new];
-        launcher.args = args;
-        [argParsingPool drain];
-
-        // kick off a new thread to instantiate the JVM on
-        NSThread *thread = [[NSThread alloc] initWithTarget:launcher selector:@selector(findAndLoadJVM) object:nil];
-        struct rlimit limit;
-        int err = getrlimit(RLIMIT_STACK, &limit);
-        if (err == 0 && limit.rlim_cur != 0LL) {
-            [thread setStackSize:limit.rlim_cur];
-        }
-        [thread start];
-        [thread release];
-
-        [launcher release];
-
-        ParkEventLoop();
-
-    } @catch (NSException *e) {
-        NSLog(@"%@: %@", e, [e callStackSymbols]);
-    }
-
-    [pool drain];
-
-    return 0;
-}
--- a/jdk/src/macosx/classes/apple/launcher/JavaAppLauncher.java	Wed Jul 05 19:52:35 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,239 +0,0 @@
-/*
- * Copyright (c) 2011, 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * 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 apple.launcher;
-
-import java.io.*;
-import java.lang.reflect.*;
-import java.text.MessageFormat;
-import java.util.*;
-import java.util.jar.*;
-
-import javax.swing.*;
-
-class JavaAppLauncher implements Runnable {
-    static {
-        java.security.AccessController.doPrivileged(
-            new java.security.PrivilegedAction<Void>() {
-                public Void run() {
-                    System.loadLibrary("osx");
-                    return null;
-                }
-            });
-    }
-
-    private static native <T> T nativeConvertAndRelease(final long ptr);
-    private static native void nativeInvokeNonPublic(Class<? extends Method> cls, Method m, String[] args);
-
-    // entry point from native
-    static void launch(final long javaDictionaryPtr, final boolean verbose) {
-        final Map<String, ?> javaDictionary = nativeConvertAndRelease(javaDictionaryPtr);
-        (new JavaAppLauncher(javaDictionary, verbose)).run();
-    }
-
-        // these are the values for the enumeration JavaFailureMode
-        static final String kJavaFailureMainClassNotSpecified = "MainClassNotSpecified";
-        static final String kJavaFailureMainClassNotFound = "CannotLoadMainClass";
-        static final String kJavaFailureMainClassHasNoMain = "NoMainMethod";
-        static final String kJavaFailureMainClassMainNotStatic = "MainNotStatic";
-        static final String kJavaFailureMainThrewException = "MainThrewException";
-        static final String kJavaFailureMainInitializerException = "MainInitializerException";
-
-        final boolean verbose; // Normally set by environment variable JAVA_LAUNCHER_VERBOSE.
-        final Map<String, ?> javaDictionary;
-
-        JavaAppLauncher(final Map<String, ?> javaDictionary, final boolean verbose) {
-                this.verbose = verbose;
-                this.javaDictionary = javaDictionary;
-        }
-
-        @Override
-        public void run() {
-                final Method m = loadMainMethod(getMainMethod());
-                final String methodName = m.getDeclaringClass().getName() + ".main(String[])";
-                try {
-                        log("Calling " + methodName + " method");
-                        m.invoke(null, new Object[] { getArguments() });
-                        log(methodName + " has returned");
-                } catch (final IllegalAccessException x) {
-                        try {
-                                nativeInvokeNonPublic(m.getClass(), m, getArguments());
-                        } catch (final Throwable excpt) {
-                                logError(methodName + " threw an exception:");
-                                if ((excpt instanceof UnsatisfiedLinkError) && excpt.getMessage().equals("nativeInvokeNonPublic")) {
-                                        showFailureAlertAndKill(kJavaFailureMainThrewException, "nativeInvokeNonPublic not registered");
-                                } else {
-                                        excpt.printStackTrace();
-                                        showFailureAlertAndKill(kJavaFailureMainThrewException, excpt.toString());
-                                }
-                        }
-                } catch (final InvocationTargetException invokeExcpt) {
-                        logError(methodName + " threw an exception:");
-                        invokeExcpt.getTargetException().printStackTrace();
-                        showFailureAlertAndKill(kJavaFailureMainThrewException, invokeExcpt.getTargetException().toString());
-                }
-        }
-
-        Method loadMainMethod(final String mainClassName) {
-                try {
-                        final Class<?> mainClass = Class.forName(mainClassName, true, sun.misc.Launcher.getLauncher().getClassLoader());
-                        final Method mainMethod = mainClass.getDeclaredMethod("main", new Class[] { String[].class });
-                        if ((mainMethod.getModifiers() & Modifier.STATIC) == 0) {
-                                logError("The main(String[]) method of class " + mainClassName + " is not static!");
-                                showFailureAlertAndKill(kJavaFailureMainClassMainNotStatic, mainClassName);
-                        }
-                        return mainMethod;
-                } catch (final ExceptionInInitializerError x) {
-                        logError("The main class \"" + mainClassName + "\" had a static initializer throw an exception.");
-                        x.getException().printStackTrace();
-                        showFailureAlertAndKill(kJavaFailureMainInitializerException, x.getException().toString());
-                } catch (final ClassNotFoundException x) {
-                        logError("The main class \"" + mainClassName + "\" could not be found.");
-                        showFailureAlertAndKill(kJavaFailureMainClassNotFound, mainClassName);
-                } catch (final NoSuchMethodException x) {
-                        logError("The main class \"" + mainClassName + "\" has no static main(String[]) method.");
-                        showFailureAlertAndKill(kJavaFailureMainClassHasNoMain, mainClassName);
-                } catch (final NullPointerException x) {
-                        logError("No main class specified");
-                        showFailureAlertAndKill(kJavaFailureMainClassNotSpecified, null);
-                }
-
-                return null;
-        }
-
-        // get main class name from 'Jar' key, or 'MainClass' key
-        String getMainMethod() {
-                final Object javaJar = javaDictionary.get("Jar");
-                if (javaJar != null) {
-                        if (!(javaJar instanceof String)) {
-                                logError("'Jar' key in 'Java' sub-dictionary of Info.plist requires a string value");
-                                return null;
-                        }
-
-                        final String jarPath = (String)javaJar;
-                        if (jarPath.length() == 0) {
-                                log("'Jar' key of sub-dictionary 'Java' of Info.plist key is empty");
-                        } else {
-                                // extract main class from manifest of this jar
-                                final String main = getMainFromManifest(jarPath);
-                                if (main == null) {
-                                        logError("jar file '" + jarPath + "' does not have Main-Class: attribute in its manifest");
-                                        return null;
-                                }
-
-                                log("Main class " + main + " found in jar manifest");
-                                return main;
-                        }
-                }
-
-                final Object javaMain = javaDictionary.get("MainClass");
-                if (!(javaMain instanceof String)) {
-                        logError("'MainClass' key in 'Java' sub-dictionary of Info.plist requires a string value");
-                        return null;
-                }
-
-                final String main = (String)javaMain;
-                if (main.length() == 0) {
-                        log("'MainClass' key of sub-dictionary 'Java' of Info.plist key is empty");
-                        return null;
-                }
-
-                log("Main class " + (String)javaMain + " found via 'MainClass' key of sub-dictionary 'Java' of Info.plist key");
-                return (String)javaMain;
-        }
-
-        // get arguments for main(String[]) out of Info.plist and command line
-        String[] getArguments() {
-                // check for 'Arguments' key, which contains the main() args if not defined in Info.plist
-                final Object javaArguments = javaDictionary.get("Arguments");
-                if (javaArguments == null) {
-                        // no arguments
-                        log("No arguments for main(String[]) specified");
-                        return new String[0];
-                }
-
-                if (javaArguments instanceof List) {
-                        final List<?> args = (List<?>)javaArguments;
-                        final int count = args.size();
-                        log("Arguments to main(String[" + count + "]):");
-
-                        final String[] result = new String[count];
-                        for (int i = 0; i < count; ++i) {
-                                final Object element = args.get(i);
-                                if (element instanceof String) {
-                                        result[i] = (String)element;
-                                } else {
-                                        logError("Found non-string in array");
-                                }
-                                log("   arg[" + i + "]=" + result[i]);
-                        }
-                        return result;
-                }
-
-                logError("'Arguments' key in 'Java' sub-dictionary of Info.plist requires a string value or an array of strings");
-                return new String[0];
-        }
-
-        // returns name of main class, or null
-        String getMainFromManifest(final String jarpath) {
-                JarFile jar = null;
-                try {
-                        jar = new JarFile(jarpath);
-                        final Manifest man = jar.getManifest();
-                        final Attributes attr = man.getMainAttributes();
-                        return attr.getValue("Main-Class");
-                } catch (final IOException x) {
-                        // shrug
-                } finally {
-                        if (jar != null) {
-                                try {
-                                        jar.close();
-                                } catch (final IOException x) { }
-                        }
-                }
-                return null;
-        }
-
-        void log(final String s) {
-                if (!verbose) return;
-                System.out.println("[LaunchRunner] " + s);
-        }
-
-        static void logError(final String s) {
-                System.err.println("[LaunchRunner Error] " + s);
-        }
-
-        // This kills the app and does not return!
-        static void showFailureAlertAndKill(final String msg, String arg) {
-                if (arg == null) arg = "<<null>>";
-                JOptionPane.showMessageDialog(null, getMessage(msg, arg), "", JOptionPane.ERROR_MESSAGE);
-                System.exit(-1);
-        }
-
-        static String getMessage(final String msgKey, final Object ... args) {
-            final String msg = ResourceBundle.getBundle("appLauncherErrors").getString(msgKey);
-            return MessageFormat.format(msg, args);
-        }
-}
--- a/jdk/src/macosx/classes/apple/launcher/appLauncherErrors.properties	Wed Jul 05 19:52:35 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,6 +0,0 @@
-MainClassNotSpecified=No main class specified.
-CannotLoadMainClass=The main class \u201C{0}\u201D could not be loaded.
-NoMainMethod=The main class \u201C{0}\u201D has no \u201Cvoid main(String[])\u201D method.
-MainNotStatic=The \u201Cmain(String[])\u201D method of class \u201C{0}\u201D is not static.
-MainThrewException=Uncaught exception in main method: {0}
-MainInitializerException=A static initializer of the main class threw an exception: {0}
--- a/jdk/src/macosx/classes/apple/security/KeychainStore.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/macosx/classes/apple/security/KeychainStore.java	Wed Jul 05 19:53:51 2017 +0200
@@ -74,19 +74,19 @@
      * Entries that have been deleted.  When something calls engineStore we'll
      * remove them from the keychain.
      */
-    private Hashtable deletedEntries = new Hashtable();
+    private Hashtable<String, Object> deletedEntries = new Hashtable<>();
 
     /**
      * Entries that have been added.  When something calls engineStore we'll
      * add them to the keychain.
      */
-    private Hashtable addedEntries = new Hashtable();
+    private Hashtable<String, Object> addedEntries = new Hashtable<>();
 
     /**
      * Private keys and certificates are stored in a hashtable.
      * Hash entries are keyed by alias names.
      */
-    private Hashtable entries = new Hashtable();
+    private Hashtable<String, Object> entries = new Hashtable<>();
 
     /**
      * Algorithm identifiers and corresponding OIDs for the contents of the PKCS12 bag we get from the Keychain.
@@ -471,7 +471,7 @@
 
             // This will be slow, but necessary.  Enumerate the values and then see if the cert matches the one in the trusted cert entry.
             // Security framework doesn't support the same certificate twice in a keychain.
-            Collection allValues = entries.values();
+            Collection<Object> allValues = entries.values();
 
             for (Object value : allValues) {
                 if (value instanceof TrustedCertEntry) {
@@ -517,7 +517,7 @@
      *
      * @return enumeration of the alias names
      */
-    public Enumeration engineAliases() {
+    public Enumeration<String> engineAliases() {
         permissionCheck();
         return entries.keys();
     }
@@ -598,8 +598,8 @@
         permissionCheck();
         Certificate certElem;
 
-        for (Enumeration e = entries.keys(); e.hasMoreElements(); ) {
-            String alias = (String)e.nextElement();
+        for (Enumeration<String> e = entries.keys(); e.hasMoreElements(); ) {
+            String alias = e.nextElement();
             Object entry = entries.get(alias);
             if (entry instanceof TrustedCertEntry) {
                 certElem = ((TrustedCertEntry)entry).cert;
@@ -634,8 +634,8 @@
         permissionCheck();
 
         // Delete items that do have a keychain item ref.
-        for (Enumeration e = deletedEntries.keys(); e.hasMoreElements(); ) {
-            String alias = (String)e.nextElement();
+        for (Enumeration<String> e = deletedEntries.keys(); e.hasMoreElements(); ) {
+            String alias = e.nextElement();
             Object entry = deletedEntries.get(alias);
             if (entry instanceof TrustedCertEntry) {
                 if (((TrustedCertEntry)entry).certRef != 0) {
@@ -664,8 +664,8 @@
 
         // Add all of the certs or keys in the added entries.
         // No need to check for 0 refs, as they are in the added list.
-        for (Enumeration e = addedEntries.keys(); e.hasMoreElements(); ) {
-            String alias = (String)e.nextElement();
+        for (Enumeration<String> e = addedEntries.keys(); e.hasMoreElements(); ) {
+            String alias = e.nextElement();
             Object entry = addedEntries.get(alias);
             if (entry instanceof TrustedCertEntry) {
                 TrustedCertEntry tce = (TrustedCertEntry)entry;
@@ -730,8 +730,8 @@
 
         // Release any stray keychain references before clearing out the entries.
         synchronized(entries) {
-            for (Enumeration e = entries.keys(); e.hasMoreElements(); ) {
-                String alias = (String)e.nextElement();
+            for (Enumeration<String> e = entries.keys(); e.hasMoreElements(); ) {
+                String alias = e.nextElement();
                 Object entry = entries.get(alias);
                 if (entry instanceof TrustedCertEntry) {
                     if (((TrustedCertEntry)entry).certRef != 0) {
@@ -816,7 +816,7 @@
 
         // Next, create X.509 Certificate objects from the raw data.  This is complicated
         // because a certificate's public key may be too long for Java's default encryption strength.
-        List createdCerts = new ArrayList();
+        List<CertKeychainItemPair> createdCerts = new ArrayList<>();
 
         try {
             CertificateFactory cf = CertificateFactory.getInstance("X.509");
@@ -842,12 +842,12 @@
 
         // We have our certificates in the List, so now extract them into an array of
         // Certificates and SecCertificateRefs.
-        Object[] objArray = createdCerts.toArray();
+        CertKeychainItemPair[] objArray = createdCerts.toArray(new CertKeychainItemPair[0]);
         Certificate[] certArray = new Certificate[objArray.length];
         long[] certRefArray = new long[objArray.length];
 
         for (int i = 0; i < objArray.length; i++) {
-            CertKeychainItemPair addedItem = (CertKeychainItemPair)objArray[i];
+            CertKeychainItemPair addedItem = objArray[i];
             certArray[i] = addedItem.mCert;
             certRefArray[i] = addedItem.mCertificateRef;
         }
--- a/jdk/src/macosx/classes/com/apple/eawt/_AppDockIconHandler.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/macosx/classes/com/apple/eawt/_AppDockIconHandler.java	Wed Jul 05 19:53:51 2017 +0200
@@ -95,7 +95,7 @@
 
     static Creator getCImageCreator() {
         try {
-            final Method getCreatorMethod = CImage.class.getDeclaredMethod("getCreator", new Class[] {});
+            final Method getCreatorMethod = CImage.class.getDeclaredMethod("getCreator", new Class<?>[] {});
             getCreatorMethod.setAccessible(true);
             return (Creator)getCreatorMethod.invoke(null, new Object[] {});
         } catch (final Throwable e) {
--- a/jdk/src/macosx/classes/com/apple/laf/AquaBorder.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/macosx/classes/com/apple/laf/AquaBorder.java	Wed Jul 05 19:53:51 2017 +0200
@@ -75,7 +75,7 @@
     protected AquaBorder deriveBorderForSize(final Size size) {
         try {
             final Class<? extends AquaBorder> clazz = getClass();
-            final AquaBorder border = clazz.getConstructor(new Class[] { clazz }).newInstance(new Object[] { this });
+            final AquaBorder border = clazz.getConstructor(new Class<?>[] { clazz }).newInstance(new Object[] { this });
             border.setSize(size);
             return border;
         } catch (final Throwable e) {
--- a/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxButton.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxButton.java	Wed Jul 05 19:53:51 2017 +0200
@@ -35,8 +35,8 @@
 
 @SuppressWarnings("serial") // Superclass is not serializable across versions
 class AquaComboBoxButton extends JButton {
-    final protected JComboBox comboBox;
-    final protected JList list;
+    final protected JComboBox<Object> comboBox;
+    final protected JList<?> list;
     final protected CellRendererPane rendererPane;
     final protected AquaComboBoxUI ui;
 
@@ -45,7 +45,10 @@
     boolean isSquare;
 
     @SuppressWarnings("serial") // anonymous class
-    protected AquaComboBoxButton(final AquaComboBoxUI ui, final JComboBox comboBox, final CellRendererPane rendererPane, final JList list) {
+    protected AquaComboBoxButton(final AquaComboBoxUI ui,
+                                 final JComboBox<Object> comboBox,
+                                 final CellRendererPane rendererPane,
+                                 final JList<?> list) {
         super("");
         putClientProperty("JButton.buttonType", "comboboxInternal");
 
@@ -163,7 +166,7 @@
     }
 
     protected void doRendererPaint(final Graphics g, final ButtonModel buttonModel, final boolean editable, final Insets insets, int left, int top, int width, int height) {
-        final ListCellRenderer renderer = comboBox.getRenderer();
+        final ListCellRenderer<Object> renderer = comboBox.getRenderer();
 
         // fake it out! not renderPressed
         final Component c = renderer.getListCellRendererComponent(list, comboBox.getSelectedItem(), -1, false, false);
--- a/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxPopup.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxPopup.java	Wed Jul 05 19:53:51 2017 +0200
@@ -43,7 +43,7 @@
     protected Component bottomStrut;
     protected boolean isPopDown = false;
 
-    public AquaComboBoxPopup(final JComboBox cBox) {
+    public AquaComboBoxPopup(final JComboBox<Object> cBox) {
         super(cBox);
     }
 
@@ -93,7 +93,7 @@
         final int rowCount = Math.min(maxRowCount, currentElementCount);
 
         final Dimension popupSize = new Dimension();
-        final ListCellRenderer renderer = list.getCellRenderer();
+        final ListCellRenderer<Object> renderer = list.getCellRenderer();
 
         for (int i = 0; i < rowCount; i++) {
             final Object value = list.getModel().getElementAt(i);
@@ -149,8 +149,8 @@
 
     @Override
     @SuppressWarnings("serial") // anonymous class
-    protected JList createList() {
-        return new JList(comboBox.getModel()) {
+    protected JList<Object> createList() {
+        return new JList<Object>(comboBox.getModel()) {
             @Override
             public void processMouseEvent(MouseEvent e) {
                 if (e.isMetaDown()) {
--- a/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxRenderer.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxRenderer.java	Wed Jul 05 19:53:51 2017 +0200
@@ -29,8 +29,8 @@
 import javax.swing.plaf.UIResource;
 
 @SuppressWarnings("serial") // Superclass is not serializable across versions
-class AquaComboBoxRenderer extends AquaComboBoxRendererInternal implements UIResource {
-    public AquaComboBoxRenderer(final JComboBox comboBox) {
+class AquaComboBoxRenderer extends AquaComboBoxRendererInternal<Object> implements UIResource {
+    public AquaComboBoxRenderer(final JComboBox<?> comboBox) {
         super(comboBox);
     }
 }
--- a/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxRendererInternal.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxRendererInternal.java	Wed Jul 05 19:53:51 2017 +0200
@@ -31,8 +31,8 @@
 import java.awt.*;
 
 @SuppressWarnings("serial") // Superclass is not serializable across versions
-class AquaComboBoxRendererInternal extends JLabel implements ListCellRenderer {
-    final JComboBox fComboBox;
+class AquaComboBoxRendererInternal<E> extends JLabel implements ListCellRenderer<E> {
+    final JComboBox<?> fComboBox;
     boolean fSelected;
     boolean fChecked;
     boolean fInList;
@@ -40,7 +40,7 @@
     boolean fDrawCheckedItem = true;
 
     // Provides space for a checkbox, and is translucent
-    public AquaComboBoxRendererInternal(final JComboBox comboBox) {
+    public AquaComboBoxRendererInternal(final JComboBox<?> comboBox) {
         super();
         fComboBox = comboBox;
     }
@@ -72,7 +72,10 @@
     }
 
     // Really means is the one with the mouse over it
-    public Component getListCellRendererComponent(final JList list, final Object value, int index, final boolean isSelected, final boolean cellHasFocus) {
+    public Component getListCellRendererComponent(final JList<? extends E> list,
+                                                  final E value, int index,
+                                                  final boolean isSelected,
+                                                  final boolean cellHasFocus) {
         fInList = (index >= 0); // When the button wants the item painted, it passes in -1
         fSelected = isSelected;
         if (index < 0) {
--- a/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxUI.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxUI.java	Wed Jul 05 19:53:51 2017 +0200
@@ -102,13 +102,13 @@
                 if (now - 1000 < lastBlink) return;
                 lastBlink = now;
 
-                final JList itemList = popup.getList();
+                final JList<Object> itemList = popup.getList();
                 final ListUI listUI = itemList.getUI();
                 if (!(listUI instanceof AquaListUI)) return;
                 final AquaListUI aquaListUI = (AquaListUI)listUI;
 
                 final int selectedIndex = comboBox.getSelectedIndex();
-                final ListModel dataModel = itemList.getModel();
+                final ListModel<Object> dataModel = itemList.getModel();
                 if (dataModel == null) return;
 
                 final Object value = dataModel.getElementAt(selectedIndex);
@@ -125,7 +125,7 @@
         // this space intentionally left blank
     }
 
-    protected ListCellRenderer createRenderer() {
+    protected ListCellRenderer<Object> createRenderer() {
         return new AquaComboBoxRenderer(comboBox);
     }
 
@@ -185,7 +185,7 @@
 
             final Object text = editor.getText();
 
-            final ListModel model = listBox.getModel();
+            final ListModel<Object> model = listBox.getModel();
             final int items = model.getSize();
             for (int i = 0; i < items; i++) {
                 final Object element = model.getElementAt(i);
@@ -423,7 +423,7 @@
                 return;
             }
 
-            final JComboBox cb = (JComboBox)parent;
+            final JComboBox<?> cb = (JComboBox<?>) parent;
             final int width = cb.getWidth();
             final int height = cb.getHeight();
 
@@ -450,11 +450,11 @@
         return Boolean.TRUE.equals(c.getClientProperty(AquaComboBoxUI.IS_TABLE_CELL_EDITOR));
     }
 
-    protected static boolean isPopdown(final JComboBox c) {
+    protected static boolean isPopdown(final JComboBox<?> c) {
         return c.isEditable() || Boolean.TRUE.equals(c.getClientProperty(AquaComboBoxUI.POPDOWN_CLIENT_PROPERTY_KEY));
     }
 
-    protected static void triggerSelectionEvent(final JComboBox comboBox, final ActionEvent e) {
+    protected static void triggerSelectionEvent(final JComboBox<?> comboBox, final ActionEvent e) {
         if (!comboBox.isEnabled()) return;
 
         final AquaComboBoxUI aquaUi = (AquaComboBoxUI)comboBox.getUI();
@@ -505,7 +505,7 @@
     @SuppressWarnings("serial") // anonymous class
     private static final Action toggleSelectionAction = new AbstractAction() {
         public void actionPerformed(final ActionEvent e) {
-            final JComboBox comboBox = (JComboBox)e.getSource();
+            final JComboBox<?> comboBox = (JComboBox<?>) e.getSource();
             if (!comboBox.isEnabled()) return;
             if (comboBox.isEditable()) return;
 
@@ -525,7 +525,7 @@
     private final Action hideAction = new AbstractAction() {
         @Override
         public void actionPerformed(final ActionEvent e) {
-            final JComboBox comboBox = (JComboBox)e.getSource();
+            final JComboBox<?> comboBox = (JComboBox<?>) e.getSource();
             comboBox.firePopupMenuCanceled();
             comboBox.setPopupVisible(false);
         }
@@ -588,10 +588,11 @@
     }
 
     @SuppressWarnings("unchecked")
-    static final RecyclableSingleton<ClientPropertyApplicator<JComboBox, AquaComboBoxUI>> APPLICATOR = new RecyclableSingleton<ClientPropertyApplicator<JComboBox, AquaComboBoxUI>>() {
+    static final RecyclableSingleton<ClientPropertyApplicator<JComboBox<?>, AquaComboBoxUI>> APPLICATOR = new
+            RecyclableSingleton<ClientPropertyApplicator<JComboBox<?>, AquaComboBoxUI>>() {
         @Override
-        protected ClientPropertyApplicator<JComboBox, AquaComboBoxUI> getInstance() {
-            return new ClientPropertyApplicator<JComboBox, AquaComboBoxUI>(
+        protected ClientPropertyApplicator<JComboBox<?>, AquaComboBoxUI> getInstance() {
+            return new ClientPropertyApplicator<JComboBox<?>, AquaComboBoxUI>(
                 new Property<AquaComboBoxUI>(AquaFocusHandler.FRAME_ACTIVE_PROPERTY) {
                     public void applyProperty(final AquaComboBoxUI target, final Object value) {
                         if (Boolean.FALSE.equals(value)) {
@@ -633,7 +634,7 @@
                     }
                 }
             ) {
-                public AquaComboBoxUI convertJComponentToTarget(final JComboBox combo) {
+                public AquaComboBoxUI convertJComponentToTarget(final JComboBox<?> combo) {
                     final ComboBoxUI comboUI = combo.getUI();
                     if (comboUI instanceof AquaComboBoxUI) return (AquaComboBoxUI)comboUI;
                     return null;
@@ -641,7 +642,7 @@
             };
         }
     };
-    static ClientPropertyApplicator<JComboBox, AquaComboBoxUI> getApplicator() {
+    static ClientPropertyApplicator<JComboBox<?>, AquaComboBoxUI> getApplicator() {
         return APPLICATOR.get();
     }
 }
--- a/jdk/src/macosx/classes/com/apple/laf/AquaFileChooserUI.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/macosx/classes/com/apple/laf/AquaFileChooserUI.java	Wed Jul 05 19:53:51 2017 +0200
@@ -724,6 +724,7 @@
             final Transferable transferable = dtde.getTransferable();
 
             try {
+                @SuppressWarnings("unchecked")
                 final java.util.List<File> fileList = (java.util.List<File>)transferable.getTransferData(DataFlavor.javaFileListFlavor);
                 dropFiles(fileList.toArray(new File[fileList.size()]));
                 dtde.dropComplete(true);
@@ -1144,11 +1145,14 @@
     }
 
     @SuppressWarnings("serial") // anonymous class
-    protected ListCellRenderer createDirectoryComboBoxRenderer(final JFileChooser fc) {
-        return new AquaComboBoxRendererInternal(directoryComboBox) {
-            public Component getListCellRendererComponent(final JList list, final Object value, final int index, final boolean isSelected, final boolean cellHasFocus) {
-                super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
-                final File directory = (File)value;
+    protected ListCellRenderer<File> createDirectoryComboBoxRenderer(final JFileChooser fc) {
+        return new AquaComboBoxRendererInternal<File>(directoryComboBox) {
+            public Component getListCellRendererComponent(final JList<? extends File> list,
+                                                          final File directory,
+                                                          final int index,
+                                                          final boolean isSelected,
+                                                          final boolean cellHasFocus) {
+                super.getListCellRendererComponent(list, directory, index, isSelected, cellHasFocus);
                 if (directory == null) {
                     setText("");
                     return this;
@@ -1173,7 +1177,7 @@
      * Data model for a type-face selection combo-box.
      */
     @SuppressWarnings("serial") // Superclass is not serializable across versions
-    protected class DirectoryComboBoxModel extends AbstractListModel implements ComboBoxModel {
+    protected class DirectoryComboBoxModel extends AbstractListModel<File> implements ComboBoxModel<File> {
         Vector<File> fDirectories = new Vector<File>();
         int topIndex = -1;
         int fPathCount = 0;
@@ -1248,7 +1252,7 @@
             return fDirectories.size();
         }
 
-        public Object getElementAt(final int index) {
+        public File getElementAt(final int index) {
             return fDirectories.elementAt(index);
         }
     }
@@ -1257,11 +1261,14 @@
     // Renderer for Types ComboBox
     //
     @SuppressWarnings("serial") // anonymous class
-    protected ListCellRenderer createFilterComboBoxRenderer() {
-        return new AquaComboBoxRendererInternal(filterComboBox) {
-            public Component getListCellRendererComponent(final JList list, final Object value, final int index, final boolean isSelected, final boolean cellHasFocus) {
-                super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
-                final FileFilter filter = (FileFilter)value;
+    protected ListCellRenderer<FileFilter> createFilterComboBoxRenderer() {
+        return new AquaComboBoxRendererInternal<FileFilter>(filterComboBox) {
+            public Component getListCellRendererComponent(final JList<? extends FileFilter> list,
+                                                          final FileFilter filter,
+                                                          final int index,
+                                                          final boolean isSelected,
+                                                          final boolean cellHasFocus) {
+                super.getListCellRendererComponent(list, filter, index, isSelected, cellHasFocus);
                 if (filter != null) setText(filter.getDescription());
                 return this;
             }
@@ -1356,7 +1363,7 @@
         }
 
         public void actionPerformed(final ActionEvent e) {
-            getFileChooser().setFileFilter((FileFilter)filterComboBox.getSelectedItem());
+            getFileChooser().setFileFilter((FileFilter) filterComboBox.getSelectedItem());
         }
     }
 
@@ -1503,7 +1510,7 @@
         fTextfieldPanel.add(tPanel, BorderLayout.CENTER);
 
         // DirectoryComboBox, left-justified, 200x20 not including drop shadow
-        directoryComboBox = new JComboBox();
+        directoryComboBox = new JComboBox<>();
         directoryComboBox.putClientProperty("JComboBox.lightweightKeyboardNavigation", "Lightweight");
         fDirectoryComboBoxModel = createDirectoryComboBoxModel(fc);
         directoryComboBox.setModel(fDirectoryComboBoxModel);
@@ -1551,7 +1558,7 @@
         // Combobox
         filterComboBoxModel = createFilterComboBoxModel();
         fc.addPropertyChangeListener(filterComboBoxModel);
-        filterComboBox = new JComboBox(filterComboBoxModel);
+        filterComboBox = new JComboBox<>(filterComboBoxModel);
         formatLabel.setLabelFor(filterComboBox);
         filterComboBox.setRenderer(createFilterComboBoxRenderer());
         d = new Dimension(220, (int)filterComboBox.getMinimumSize().getHeight());
@@ -1788,7 +1795,7 @@
         }
     }
 
-    JComboBox directoryComboBox;
+    JComboBox<File> directoryComboBox;
     DirectoryComboBoxModel fDirectoryComboBoxModel;
     private final Action directoryComboBoxAction = new DirectoryComboBoxAction();
 
@@ -1797,7 +1804,7 @@
     JTableExtension fFileList;
 
     private FilterComboBoxModel filterComboBoxModel;
-    JComboBox filterComboBox;
+    JComboBox<FileFilter> filterComboBox;
     private final Action filterComboBoxAction = new FilterComboBoxAction();
 
     private static final Dimension hstrut10 = new Dimension(10, 1);
--- a/jdk/src/macosx/classes/com/apple/laf/AquaFocusHandler.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/macosx/classes/com/apple/laf/AquaFocusHandler.java	Wed Jul 05 19:53:51 2017 +0200
@@ -131,7 +131,7 @@
         c.setSelectionBackground(UIManager.getColor(bgName));
     }
 
-    static void swapSelectionColors(final String prefix, final JList c, final Object value) {
+    static void swapSelectionColors(final String prefix, final JList<?> c, final Object value) {
         if (!isComponentValid(c)) return;
 
         final Color bg = c.getSelectionBackground();
@@ -149,7 +149,7 @@
         }
     }
 
-    static void setSelectionColors(final JList c, final String fgName, final String bgName) {
+    static void setSelectionColors(final JList<?> c, final String fgName, final String bgName) {
         c.setSelectionForeground(UIManager.getColor(fgName));
         c.setSelectionBackground(UIManager.getColor(bgName));
     }
--- a/jdk/src/macosx/classes/com/apple/laf/AquaListUI.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/macosx/classes/com/apple/laf/AquaListUI.java	Wed Jul 05 19:53:51 2017 +0200
@@ -79,7 +79,7 @@
          * For a Home action, scrolls to the top. Otherwise, scroll to the end.
          */
         public void actionPerformed(final ActionEvent e) {
-            final JList list = (JList)e.getSource();
+            final JList<?> list = (JList<?>)e.getSource();
 
             if (fHomeAction) {
                 list.ensureIndexIsVisible(0);
@@ -135,7 +135,7 @@
         }*/
     }
 
-    JList getComponent() {
+    JList<Object> getComponent() {
         return list;
     }
 
@@ -144,7 +144,7 @@
         final Rectangle rowBounds = getCellBounds(list, selectedIndex, selectedIndex);
         if (rowBounds == null) return;
 
-        final ListCellRenderer renderer = list.getCellRenderer();
+        final ListCellRenderer<Object> renderer = list.getCellRenderer();
         if (renderer == null) return;
 
         final Component rendererComponent = renderer.getListCellRendererComponent(list, value, selectedIndex, selected, true);
--- a/jdk/src/macosx/classes/com/apple/laf/AquaTabbedPaneCopyFromBasicUI.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/macosx/classes/com/apple/laf/AquaTabbedPaneCopyFromBasicUI.java	Wed Jul 05 19:53:51 2017 +0200
@@ -3820,7 +3820,7 @@
                 _loader = null;
                 final Class<?> klass = (Class<?>)loader;
                 try {
-                    final java.lang.reflect.Method method = klass.getDeclaredMethod("loadActionMap", new Class[] { LazyActionMap.class });
+                    final java.lang.reflect.Method method = klass.getDeclaredMethod("loadActionMap", new Class<?>[] { LazyActionMap.class });
                     method.invoke(klass, new Object[] { this });
                 } catch (final NoSuchMethodException nsme) {
                     assert false : "LazyActionMap unable to load actions " + klass;
--- a/jdk/src/macosx/classes/com/apple/laf/AquaTableHeaderUI.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/macosx/classes/com/apple/laf/AquaTableHeaderUI.java	Wed Jul 05 19:53:51 2017 +0200
@@ -69,6 +69,7 @@
 
     final static RecyclableSingleton<ClientPropertyApplicator<JTableHeader, JTableHeader>> TABLE_HEADER_APPLICATORS = new RecyclableSingleton<ClientPropertyApplicator<JTableHeader, JTableHeader>>() {
         @Override
+        @SuppressWarnings("unchecked")
         protected ClientPropertyApplicator<JTableHeader, JTableHeader> getInstance() {
             return new ClientPropertyApplicator<JTableHeader, JTableHeader>(
                     new Property<JTableHeader>("JTableHeader.selectedColumn") {
--- a/jdk/src/macosx/classes/com/apple/laf/AquaUtilControlSize.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/macosx/classes/com/apple/laf/AquaUtilControlSize.java	Wed Jul 05 19:53:51 2017 +0200
@@ -121,7 +121,7 @@
         try {
             // see if this component has a "getUI" method
             final Class<? extends JComponent> clazz = c.getClass();
-            final Method getUIMethod = clazz.getMethod("getUI", new Class[0]);
+            final Method getUIMethod = clazz.getMethod("getUI", new Class<?>[0]);
 
             // see if that UI is one of ours that understands sizing
             final Object ui = getUIMethod.invoke(c, new Object[0]);
--- a/jdk/src/macosx/classes/com/apple/laf/AquaUtils.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/macosx/classes/com/apple/laf/AquaUtils.java	Wed Jul 05 19:53:51 2017 +0200
@@ -82,7 +82,8 @@
             @Override
             public Creator run() {
                 try {
-                    final Method getCreatorMethod = CImage.class.getDeclaredMethod("getCreator", new Class[] {});
+                    final Method getCreatorMethod = CImage.class.getDeclaredMethod(
+                                "getCreator", new Class<?>[] {});
                     getCreatorMethod.setAccessible(true);
                     return (Creator)getCreatorMethod.invoke(null, new Object[] {});
                 } catch (final Exception ignored) {
@@ -383,7 +384,8 @@
                     @Override
                     public Method run() {
                         try {
-                            final Method method = JComponent.class.getDeclaredMethod("getFlag", new Class[] { int.class });
+                            final Method method = JComponent.class.getDeclaredMethod(
+                                    "getFlag", new Class<?>[] { int.class });
                             method.setAccessible(true);
                             return method;
                         } catch (final Throwable ignored) {
--- a/jdk/src/macosx/classes/com/apple/laf/ClientPropertyApplicator.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/macosx/classes/com/apple/laf/ClientPropertyApplicator.java	Wed Jul 05 19:53:51 2017 +0200
@@ -33,6 +33,7 @@
 public class ClientPropertyApplicator<T extends JComponent, N> implements PropertyChangeListener {
     private final Map<String, Property<N>> properties = new HashMap<String, Property<N>>();
 
+    @SuppressWarnings("unchecked")
     public ClientPropertyApplicator(final Property<N>... propertyList) {
         for (final Property<N> p : propertyList) {
             properties.put(p.name, p);
--- a/jdk/src/macosx/classes/com/apple/laf/ScreenMenuBar.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/macosx/classes/com/apple/laf/ScreenMenuBar.java	Wed Jul 05 19:53:51 2017 +0200
@@ -25,6 +25,9 @@
 
 package com.apple.laf;
 
+import sun.awt.AWTAccessor;
+import sun.lwawt.macosx.CMenuBar;
+
 import java.awt.*;
 import java.awt.event.*;
 import java.lang.reflect.*;
@@ -243,54 +246,25 @@
             fSubmenus.remove(menu);
     }
 
-    private static Field[] stolenFields = null;
-
-    static {
-        stolenFields = AccessController.doPrivileged(new PrivilegedAction<Field[]>() {
-            public Field[] run() {
-                try {
-                    final Field[] localFields = new Field[2];
-                    localFields[0] = MenuBar.class.getDeclaredField("menus");
-                    localFields[1] = MenuComponent.class.getDeclaredField("parent");
-                    AccessibleObject.setAccessible(localFields, true);
-                    return localFields;
-                } catch (final NoSuchFieldException nsf) {
-                    // If this happens, Sun changed the definition of MenuBar and MenuComponent!
-                    nsf.printStackTrace(System.err);
-                    return null;
-                }
-            }
-        });
-    };
-
     public Menu add(final Menu m, final int index) {
         synchronized (getTreeLock()) {
             if (m.getParent() != null) {
                 m.getParent().remove(m);
             }
 
-            // Use nasty reflection to get at the menus array and parent fields.
-            try {
-                if (stolenFields == null) return m;
-
-                final Vector<Menu> menus = (Vector<Menu>)stolenFields[0].get(this);
-                    menus.insertElementAt(m, index);
-
-                    stolenFields[1].set(m, this);
+            final Vector<Menu> menus = AWTAccessor.getMenuBarAccessor().getMenus(this);
+            menus.insertElementAt(m, index);
+            AWTAccessor.getMenuComponentAccessor().setParent(m, this);
 
-                    final sun.lwawt.macosx.CMenuBar peer = (sun.lwawt.macosx.CMenuBar)getPeer();
-                if (peer == null) return m;
+            final CMenuBar peer = (CMenuBar)getPeer();
+            if (peer == null) return m;
 
-                        peer.setNextInsertionIndex(index);
-                        if (m.getPeer() == null) {
-                            m.addNotify();
-                        }
-
-                        peer.setNextInsertionIndex(-1);
-            } catch (final IllegalAccessException iae) {
-                iae.printStackTrace(System.err);
+            peer.setNextInsertionIndex(index);
+            if (m.getPeer() == null) {
+                m.addNotify();
             }
 
+            peer.setNextInsertionIndex(-1);
             return m;
         }
     }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/macosx/classes/sun/awt/datatransfer/flavormap.properties	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,76 @@
+#
+# This properties file is used to initialize the default
+# java.awt.datatransfer.SystemFlavorMap. It contains the Mac OS X platform-specific,
+# default mappings between common Mac OS X selection atoms and platform-independent
+# MIME type strings, which will be converted into 
+# java.awt.datatransfer.DataFlavors.
+#
+# The standard format is:
+#
+# <native>=<MIME type>,<MIME type>, ...
+#
+# <native> should be a string identifier that the native platform will
+# recognize as a valid data format. <MIME type> should specify both a MIME
+# primary type and a MIME subtype separated by a '/'. The MIME type may include
+# parameters, where each parameter is a key/value pair separated by '=', and
+# where each parameter to the MIME type is separated by a ';'.
+#
+# Because SystemFlavorMap implements FlavorTable, developers are free to
+# duplicate DataFlavor values and set multiple values for a single native by
+# separating them with ",". If a mapping contains a duplicate key or value,
+# earlier mappings which included this key or value will be preferred.
+#
+# Mappings whose values specify DataFlavors with primary MIME types of
+# "text", and which support the charset parameter, should specify the exact
+# format in which the native platform expects the data. The "charset"
+# parameter specifies the char to byte encoding, the "eoln" parameter
+# specifies the end-of-line marker, and the "terminators" parameter specifies
+# the number of terminating NUL bytes. Note that "eoln" and "terminators"
+# are not standardized MIME type parameters. They are specific to this file
+# format ONLY. They will not appear in any of the DataFlavors returned by the
+# SystemFlavorMap at the Java level.
+#
+# If the "charset" parameter is omitted, or has zero length, the platform
+# default encoding is assumed. If the "eoln" parameter is omitted, or has
+# zero length, "\n" is assumed. If the "terminators" parameter is omitted,
+# or has a value less than zero, zero is assumed.
+#
+# Upon initialization, the data transfer subsystem will record the specified
+# details of the native text format, but the default SystemFlavorMap will
+# present a large set of synthesized DataFlavors which map, in both
+# directions, to the native. After receiving data from the application in one
+# of the synthetic DataFlavors, the data transfer subsystem will transform
+# the data stream into the format specified in this file before passing the
+# transformed stream to the native system.
+#
+# Mappings whose values specify DataFlavors with primary MIME types of
+# "text", but which do not support the charset parameter, will be treated as
+# opaque, 8-bit data. They will not undergo any transformation process, and
+# any "charset", "eoln", or "terminators" parameters specified in this file
+# will be ignored.
+#
+# See java.awt.datatransfer.DataFlavor.selectBestTextFlavor for a list of
+# text flavors which support the charset parameter.
+
+UTF8_STRING=text/plain;charset=UTF-8;eoln="\n";terminators=0
+
+# The COMPOUND_TEXT support for inter-client text transfer is disabled by 
+# default. The reason is that many native applications prefer this format over 
+# other native text formats, but are unable to decode the textual data in this 
+# format properly. This results in java-to-native text transfer failures.
+# To enable the COMPOUND_TEXT support for this JRE installation uncomment 
+# the line below.
+
+# COMPOUND_TEXT=text/plain;charset=x-compound-text;eoln="\n";terminators=0
+
+TEXT=text/plain;eoln="\n";terminators=0
+STRING=text/plain;charset=UTF-8;eoln="\n";terminators=0
+FILE_NAME=application/x-java-file-list;class=java.util.List
+text/uri-list=application/x-java-file-list;class=java.util.List
+PNG=image/x-java-image;class=java.awt.Image
+JFIF=image/x-java-image;class=java.awt.Image
+TIFF=image/x-java-image;class=java.awt.Image
+RICH_TEXT=text/rtf
+HTML=text/html;charset=utf-8;eoln="\r\n";terminators=1
+URL=application/x-java-url;class=java.net.URL,\
+    text/uri-list;eoln="\r\n";terminators=1
--- a/jdk/src/macosx/classes/sun/lwawt/macosx/CDragSourceContextPeer.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CDragSourceContextPeer.java	Wed Jul 05 19:53:51 2017 +0200
@@ -88,7 +88,7 @@
         super.startDrag(dsc, cursor, dragImage, dragImageOffset);
     }
 
-    protected void startDrag(Transferable transferable, long[] formats, Map formatMap) {
+    protected void startDrag(Transferable transferable, long[] formats, Map<Long, DataFlavor> formatMap) {
         DragGestureEvent trigger = getTrigger();
         InputEvent         triggerEvent = trigger.getTriggerEvent();
 
@@ -311,7 +311,7 @@
         }
     }
 
-    private void setDefaultDragImage(JList component) {
+    private void setDefaultDragImage(JList<?> component) {
         Rectangle selectedOutline = null;
 
         // This code actually works, even under the (non-existant) multiple-selections, because we only draw a union outline
@@ -485,7 +485,7 @@
     private native long createNativeDragSource(Component component, long nativePeer, Transferable transferable,
         InputEvent triggerEvent, int dragPosX, int dragPosY, int extModifiers, int clickCount, long timestamp,
         long nsDragImagePtr, int dragImageOffsetX, int dragImageOffsetY,
-        int sourceActions, long[] formats, Map formatMap);
+        int sourceActions, long[] formats, Map<Long, DataFlavor> formatMap);
 
     private native void doDragging(long nativeDragSource);
 
--- a/jdk/src/macosx/classes/sun/lwawt/macosx/CInputMethod.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CInputMethod.java	Wed Jul 05 19:53:51 2017 +0200
@@ -44,13 +44,14 @@
 public class CInputMethod extends InputMethodAdapter {
     private InputMethodContext fIMContext;
     private Component fAwtFocussedComponent;
-    private LWComponentPeer fAwtFocussedComponentPeer;
+    private LWComponentPeer<?, ?> fAwtFocussedComponentPeer;
     private boolean isActive;
 
     private static Map<TextAttribute, Integer>[] sHighlightStyles;
 
     // Intitalize highlight mapping table and its mapper.
     static {
+        @SuppressWarnings({"rawtypes", "unchecked"})
         Map<TextAttribute, Integer> styles[] = new Map[4];
         HashMap<TextAttribute, Integer> map;
 
@@ -242,7 +243,7 @@
     public void hideWindows() {
     }
 
-    long getNativeViewPtr(LWComponentPeer peer) {
+    long getNativeViewPtr(LWComponentPeer<?, ?> peer) {
         if (peer.getPlatformWindow() instanceof CPlatformWindow) {
             CPlatformWindow platformWindow = (CPlatformWindow) peer.getPlatformWindow();
             CPlatformView platformView = platformWindow.getContentView();
@@ -272,7 +273,7 @@
      * to talk to when responding to key events.
      */
     protected void setAWTFocussedComponent(Component component) {
-        LWComponentPeer peer = null;
+        LWComponentPeer<?, ?> peer = null;
         long modelPtr = 0;
         CInputMethod imInstance = this;
 
@@ -305,7 +306,7 @@
     /**
         * @see java.awt.Toolkit#mapInputMethodHighlight
      */
-    public static Map mapInputMethodHighlight(InputMethodHighlight highlight) {
+    public static Map<TextAttribute, ?> mapInputMethodHighlight(InputMethodHighlight highlight) {
         int index;
         int state = highlight.getState();
         if (state == InputMethodHighlight.RAW_TEXT) {
@@ -384,7 +385,7 @@
 
     // java.awt.Toolkit#getNativeContainer() is not available
     //    from this package
-    private LWComponentPeer getNearestNativePeer(Component comp) {
+    private LWComponentPeer<?, ?> getNearestNativePeer(Component comp) {
         if (comp==null)
             return null;
 
@@ -796,7 +797,7 @@
     // these calls will be ignored.
     private native void nativeNotifyPeer(long nativePeer, CInputMethod imInstance);
     private native void nativeEndComposition(long nativePeer);
-    private native void nativeHandleEvent(LWComponentPeer peer, AWTEvent event);
+    private native void nativeHandleEvent(LWComponentPeer<?, ?> peer, AWTEvent event);
 
     // Returns the locale of the active input method.
     static native Locale getNativeLocale();
--- a/jdk/src/macosx/classes/sun/lwawt/macosx/CInputMethodDescriptor.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CInputMethodDescriptor.java	Wed Jul 05 19:53:51 2017 +0200
@@ -57,7 +57,7 @@
     }
 
     static Object[] getAvailableLocalesInternal() {
-        List workList = nativeGetAvailableLocales();
+        List<?> workList = nativeGetAvailableLocales();
 
         if (workList != null) {
             return workList.toArray();
@@ -119,5 +119,5 @@
     }
 
     private static native void nativeInit();
-    private static native List nativeGetAvailableLocales();
+    private static native List<?> nativeGetAvailableLocales();
 }
--- a/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java	Wed Jul 05 19:53:51 2017 +0200
@@ -151,7 +151,7 @@
         return (bits & mask) != 0;
     }
 
-    @SuppressWarnings("unchecked")
+    @SuppressWarnings({"unchecked", "rawtypes"})
     static ClientPropertyApplicator<JRootPane, CPlatformWindow> CLIENT_PROPERTY_APPLICATOR = new ClientPropertyApplicator<JRootPane, CPlatformWindow>(new Property[] {
         new Property<CPlatformWindow>(WINDOW_DOCUMENT_MODIFIED) { public void applyProperty(final CPlatformWindow c, final Object value) {
             c.setStyleBits(DOCUMENT_MODIFIED, value == null ? false : Boolean.parseBoolean(value.toString()));
--- a/jdk/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java	Wed Jul 05 19:53:51 2017 +0200
@@ -32,6 +32,7 @@
 import java.awt.event.InputEvent;
 import java.awt.event.InvocationEvent;
 import java.awt.event.KeyEvent;
+import java.awt.font.TextAttribute;
 import java.awt.im.InputMethodHighlight;
 import java.awt.im.spi.InputMethodDescriptor;
 import java.awt.peer.*;
@@ -543,9 +544,9 @@
             return super.getImage(filename);
         }
 
-        String fileneame2x = getScaledImageName(filename);
-        return (imageExists(fileneame2x))
-                ? getImageWithResolutionVariant(filename, fileneame2x)
+        String filename2x = getScaledImageName(filename);
+        return (imageExists(filename2x))
+                ? getImageWithResolutionVariant(filename, filename2x)
                 : super.getImage(filename);
     }
 
@@ -691,6 +692,7 @@
     }
 
     @Override
+    @SuppressWarnings("unchecked")
     public <T extends DragGestureRecognizer> T createDragGestureRecognizer(
             Class<T> abstractRecognizerClass, DragSource ds, Component c,
             int srcActions, DragGestureListener dgl) {
@@ -743,7 +745,7 @@
      * @since 1.3
      */
     @Override
-    public Map mapInputMethodHighlight(InputMethodHighlight highlight) {
+    public Map<TextAttribute, ?> mapInputMethodHighlight(InputMethodHighlight highlight) {
         return CInputMethod.mapInputMethodHighlight(highlight);
     }
 
@@ -906,6 +908,9 @@
     }
 
     private static boolean isValidPath(String path) {
-        return !path.isEmpty() && !path.endsWith("/") && !path.endsWith(".");
+        return path != null &&
+                !path.isEmpty() &&
+                !path.endsWith("/") &&
+                !path.endsWith(".");
     }
 }
--- a/jdk/src/macosx/lib/flavormap.properties	Wed Jul 05 19:52:35 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,83 +0,0 @@
-#
-# This properties file is used to initialize the default
-# java.awt.datatransfer.SystemFlavorMap. It contains the Mac OS X platform-specific,
-# default mappings between common Mac OS X selection atoms and platform-independent
-# MIME type strings, which will be converted into
-# java.awt.datatransfer.DataFlavors.
-#
-# These default mappings may be augmented by specifying the
-#
-#       AWT.DnD.flavorMapFileURL 
-#
-# property in the appropriate awt.properties file. The specified properties URL
-# will be loaded into the SystemFlavorMap.
-#
-# The standard format is:
-#
-# <native>=<MIME type>
-#
-# <native> should be a string identifier that the native platform will
-# recognize as a valid data format. <MIME type> should specify both a MIME
-# primary type and a MIME subtype separated by a '/'. The MIME type may include
-# parameters, where each parameter is a key/value pair separated by '=', and
-# where each parameter to the MIME type is separated by a ';'.
-#
-# Because SystemFlavorMap implements FlavorTable, developers are free to
-# duplicate both native keys and DataFlavor values. If a mapping contains a
-# duplicate key or value, earlier mappings which included this key or value
-# will be preferred.
-#
-# Mappings whose values specify DataFlavors with primary MIME types of
-# "text", and which support the charset parameter, should specify the exact
-# format in which the native platform expects the data. The "charset"
-# parameter specifies the char to byte encoding, the "eoln" parameter
-# specifies the end-of-line marker, and the "terminators" parameter specifies
-# the number of terminating NUL bytes. Note that "eoln" and "terminators"
-# are not standardized MIME type parameters. They are specific to this file
-# format ONLY. They will not appear in any of the DataFlavors returned by the
-# SystemFlavorMap at the Java level.
-#
-# If the "charset" parameter is omitted, or has zero length, the platform
-# default encoding is assumed. If the "eoln" parameter is omitted, or has
-# zero length, "\n" is assumed. If the "terminators" parameter is omitted,
-# or has a value less than zero, zero is assumed.
-#
-# Upon initialization, the data transfer subsystem will record the specified
-# details of the native text format, but the default SystemFlavorMap will
-# present a large set of synthesized DataFlavors which map, in both
-# directions, to the native. After receiving data from the application in one
-# of the synthetic DataFlavors, the data transfer subsystem will transform
-# the data stream into the format specified in this file before passing the
-# transformed stream to the native system.
-#
-# Mappings whose values specify DataFlavors with primary MIME types of
-# "text", but which do not support the charset parameter, will be treated as
-# opaque, 8-bit data. They will not undergo any transformation process, and
-# any "charset", "eoln", or "terminators" parameters specified in this file
-# will be ignored.
-#
-# See java.awt.datatransfer.DataFlavor.selectBestTextFlavor for a list of
-# text flavors which support the charset parameter.
-
-UTF8_STRING=text/plain;charset=UTF-8;eoln="\n";terminators=0
-
-# The COMPOUND_TEXT support for inter-client text transfer is disabled by 
-# default. The reason is that many native applications prefer this format over 
-# other native text formats, but are unable to decode the textual data in this 
-# format properly. This results in java-to-native text transfer failures.
-# To enable the COMPOUND_TEXT support for this JRE installation uncomment 
-# the line below.
-
-# COMPOUND_TEXT=text/plain;charset=x-compound-text;eoln="\n";terminators=0
-
-TEXT=text/plain;eoln="\n";terminators=0
-STRING=text/plain;charset=UTF-8;eoln="\n";terminators=0
-FILE_NAME=application/x-java-file-list;class=java.util.List
-text/uri-list=application/x-java-file-list;class=java.util.List
-PNG=image/x-java-image;class=java.awt.Image
-JFIF=image/x-java-image;class=java.awt.Image
-TIFF=image/x-java-image;class=java.awt.Image
-RICH_TEXT=text/rtf
-HTML=text/html;charset=utf-8;eoln="\r\n";terminators=1
-URL=application/x-java-url;class=java.net.URL
-URL=text/uri-list;eoln="\r\n";terminators=1
--- a/jdk/src/macosx/native/apple/launcher/JavaAppLauncher.m	Wed Jul 05 19:52:35 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-/*
- * Copyright (c) 2011, 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * 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 "apple_launcher_JavaAppLauncher.h"
-
-#import <Cocoa/Cocoa.h>
-#import <JavaNativeFoundation/JavaNativeFoundation.h>
-
-
-/*
- * Class:     apple_launcher_JavaAppLauncher
- * Method:    nativeConvertAndRelease
- * Signature: (J)Ljava/lang/Object;
- */
-JNIEXPORT jobject JNICALL Java_apple_launcher_JavaAppLauncher_nativeConvertAndRelease
-(JNIEnv *env, jclass clazz, jlong nsObjectPtr) {
-
-    jobject value = NULL;
-
-JNF_COCOA_ENTER(env);
-
-    id obj = jlong_to_ptr(nsObjectPtr);
-    value = [[JNFDefaultCoercions defaultCoercer] coerceNSObject:obj withEnv:env];
-    CFRelease(obj);
-
-JNF_COCOA_EXIT(env);
-
-    return value;
-}
-
-/*
- * Class:     apple_launcher_JavaAppLauncher
- * Method:    nativeInvokeNonPublic
- * Signature: (Ljava/lang/Class;Ljava/lang/reflect/Method;[Ljava/lang/String;)V
- */
-JNIEXPORT void JNICALL Java_apple_launcher_JavaAppLauncher_nativeInvokeNonPublic
-(JNIEnv *env, jclass clazz, jclass targetClass, jobject targetMethod, jobjectArray args) {
-    jmethodID mainMethodID = (*env)->FromReflectedMethod(env, targetMethod);
-    if ((*env)->ExceptionOccurred(env)) return;
-    (*env)->CallStaticVoidMethod(env, targetClass, mainMethodID, args);
-}
--- a/jdk/src/macosx/native/sun/awt/splashscreen/splashscreen_sys.m	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/macosx/native/sun/awt/splashscreen/splashscreen_sys.m	Wed Jul 05 19:53:51 2017 +0200
@@ -45,6 +45,7 @@
 #include <dlfcn.h>
 
 #include <sizecalc.h>
+#import "ThreadUtilities.h"
 
 static NSScreen* SplashNSScreen()
 {
@@ -130,8 +131,12 @@
     NSAutoreleasePool *pool = [NSAutoreleasePool new];
     *scaleFactor = 1;
     char* scaledFile = nil;
-    float screenScaleFactor = [SplashNSScreen() backingScaleFactor];
-    
+    __block float screenScaleFactor = 1;
+
+    [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
+        screenScaleFactor = [SplashNSScreen() backingScaleFactor];
+    }];
+
     if (screenScaleFactor > 1) {
         NSString *fileName = [NSString stringWithUTF8String: file];
         NSUInteger length = [fileName length];
--- a/jdk/src/share/bin/java.c	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/bin/java.c	Wed Jul 05 19:53:51 2017 +0200
@@ -98,6 +98,7 @@
  */
 static void SetClassPath(const char *s);
 static void SelectVersion(int argc, char **argv, char **main_class);
+static void SetJvmEnvironment(int argc, char **argv);
 static jboolean ParseArguments(int *pargc, char ***pargv,
                                int *pmode, char **pwhat,
                                int *pret, const char *jrepath);
@@ -238,6 +239,10 @@
                                jvmpath, sizeof(jvmpath),
                                jvmcfg,  sizeof(jvmcfg));
 
+    if (!IsJavaArgs()) {
+        SetJvmEnvironment(argc,argv);
+    }
+
     ifn.CreateJavaVM = 0;
     ifn.GetDefaultJavaVMInitArgs = 0;
 
@@ -640,6 +645,67 @@
     return jvmtype;
 }
 
+/*
+ * static void SetJvmEnvironment(int argc, char **argv);
+ *   Is called just before the JVM is loaded.  We can set env variables
+ *   that are consumed by the JVM.  This function is non-destructive,
+ *   leaving the arg list intact.  The first use is for the JVM flag
+ *   -XX:NativeMemoryTracking=value.
+ */
+static void
+SetJvmEnvironment(int argc, char **argv) {
+
+    static const char*  NMT_Env_Name    = "NMT_LEVEL_";
+
+    int i;
+    for (i = 0; i < argc; i++) {
+        /*
+         * The following case checks for "-XX:NativeMemoryTracking=value".
+         * If value is non null, an environmental variable set to this value
+         * will be created to be used by the JVM.
+         * The argument is passed to the JVM, which will check validity.
+         * The JVM is responsible for removing the env variable.
+         */
+        char *arg = argv[i];
+        if (JLI_StrCCmp(arg, "-XX:NativeMemoryTracking=") == 0) {
+            int retval;
+            // get what follows this parameter, include "="
+            size_t pnlen = JLI_StrLen("-XX:NativeMemoryTracking=");
+            if (JLI_StrLen(arg) > pnlen) {
+                char* value = arg + pnlen;
+                size_t pbuflen = pnlen + JLI_StrLen(value) + 10; // 10 max pid digits
+
+                /*
+                 * ensures that malloc successful
+                 * DONT JLI_MemFree() pbuf.  JLI_PutEnv() uses system call
+                 *   that could store the address.
+                 */
+                char * pbuf = (char*)JLI_MemAlloc(pbuflen);
+
+                JLI_Snprintf(pbuf, pbuflen, "%s%d=%s", NMT_Env_Name, JLI_GetPid(), value);
+                retval = JLI_PutEnv(pbuf);
+                if (JLI_IsTraceLauncher()) {
+                    char* envName;
+                    char* envBuf;
+
+                    // ensures that malloc successful
+                    envName = (char*)JLI_MemAlloc(pbuflen);
+                    JLI_Snprintf(envName, pbuflen, "%s%d", NMT_Env_Name, JLI_GetPid());
+
+                    printf("TRACER_MARKER: NativeMemoryTracking: env var is %s\n",envName);
+                    printf("TRACER_MARKER: NativeMemoryTracking: putenv arg %s\n",pbuf);
+                    envBuf = getenv(envName);
+                    printf("TRACER_MARKER: NativeMemoryTracking: got value %s\n",envBuf);
+                    free(envName);
+                }
+
+            }
+
+        }
+
+    }
+}
+
 /* copied from HotSpot function "atomll()" */
 static int
 parse_size(const char *s, jlong *result) {
--- a/jdk/src/share/bin/jli_util.h	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/bin/jli_util.h	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2014, 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
@@ -64,17 +64,22 @@
 #ifdef _WIN32
 #include <windows.h>
 #include <io.h>
+#include <process.h>
 #define JLI_StrCaseCmp(p1, p2)          stricmp((p1), (p2))
 #define JLI_StrNCaseCmp(p1, p2, p3)     strnicmp((p1), (p2), (p3))
 int  JLI_Snprintf(char *buffer, size_t size, const char *format, ...);
 void JLI_CmdToArgs(char *cmdline);
 #define JLI_Lseek                       _lseeki64
+#define JLI_PutEnv                      _putenv
+#define JLI_GetPid                      _getpid
 #else  /* NIXES */
 #include <unistd.h>
 #include <strings.h>
 #define JLI_StrCaseCmp(p1, p2)          strcasecmp((p1), (p2))
 #define JLI_StrNCaseCmp(p1, p2, p3)     strncasecmp((p1), (p2), (p3))
 #define JLI_Snprintf                    snprintf
+#define JLI_PutEnv                      putenv
+#define JLI_GetPid                      getpid
 #ifdef __solaris__
 #define JLI_Lseek                       llseek
 #endif
--- a/jdk/src/share/classes/com/sun/imageio/plugins/bmp/BMPMetadata.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/com/sun/imageio/plugins/bmp/BMPMetadata.java	Wed Jul 05 19:53:51 2017 +0200
@@ -126,18 +126,18 @@
             new IIOMetadataNode(nativeMetadataFormatName);
 
         addChildNode(root, "BMPVersion", bmpVersion);
-        addChildNode(root, "Width", new Integer(width));
-        addChildNode(root, "Height", new Integer(height));
+        addChildNode(root, "Width", width);
+        addChildNode(root, "Height", height);
         addChildNode(root, "BitsPerPixel", new Short(bitsPerPixel));
-        addChildNode(root, "Compression", new Integer(compression));
-        addChildNode(root, "ImageSize", new Integer(imageSize));
+        addChildNode(root, "Compression", compression);
+        addChildNode(root, "ImageSize", imageSize);
 
         IIOMetadataNode node = addChildNode(root, "PixelsPerMeter", null);
-        addChildNode(node, "X", new Integer(xPixelsPerMeter));
-        addChildNode(node, "Y", new Integer(yPixelsPerMeter));
+        addChildNode(node, "X", xPixelsPerMeter);
+        addChildNode(node, "Y", yPixelsPerMeter);
 
-        addChildNode(root, "ColorsUsed", new Integer(colorsUsed));
-        addChildNode(root, "ColorsImportant", new Integer(colorsImportant));
+        addChildNode(root, "ColorsUsed", colorsUsed);
+        addChildNode(root, "ColorsImportant", colorsImportant);
 
         int version = 0;
         for (int i = 0; i < bmpVersion.length(); i++)
@@ -146,19 +146,19 @@
 
         if (version >= 4) {
             node = addChildNode(root, "Mask", null);
-            addChildNode(node, "Red", new Integer(redMask));
-            addChildNode(node, "Green", new Integer(greenMask));
-            addChildNode(node, "Blue", new Integer(blueMask));
-            addChildNode(node, "Alpha", new Integer(alphaMask));
+            addChildNode(node, "Red", redMask);
+            addChildNode(node, "Green", greenMask);
+            addChildNode(node, "Blue", blueMask);
+            addChildNode(node, "Alpha", alphaMask);
 
-            addChildNode(root, "ColorSpaceType", new Integer(colorSpace));
+            addChildNode(root, "ColorSpaceType", colorSpace);
 
             node = addChildNode(root, "CIEXYZEndPoints", null);
             addXYZPoints(node, "Red", redX, redY, redZ);
             addXYZPoints(node, "Green", greenX, greenY, greenZ);
             addXYZPoints(node, "Blue", blueX, blueY, blueZ);
 
-            node = addChildNode(root, "Intent", new Integer(intent));
+            node = addChildNode(root, "Intent", intent);
         }
 
         // Palette
--- a/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGMetadata.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGMetadata.java	Wed Jul 05 19:53:51 2017 +0200
@@ -2323,7 +2323,7 @@
                 SOSMarkerSegment sos = (SOSMarkerSegment) seg;
                 SOSMarkerSegment.ScanComponentSpec [] specs = sos.componentSpecs;
                 for (int i = 0; i < specs.length; i++) {
-                    Integer id = new Integer(specs[i].componentSelector);
+                    Integer id = specs[i].componentSelector;
                     if (!ids.contains(id)) {
                         ids.add(id);
                     }
--- a/jdk/src/share/classes/com/sun/imageio/plugins/png/PNGImageReader.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/com/sun/imageio/plugins/png/PNGImageReader.java	Wed Jul 05 19:53:51 2017 +0200
@@ -639,7 +639,7 @@
         metadata.zTXt_keyword.add(keyword);
 
         int method = stream.readUnsignedByte();
-        metadata.zTXt_compressionMethod.add(new Integer(method));
+        metadata.zTXt_compressionMethod.add(method);
 
         byte[] b = new byte[chunkLength - keyword.length() - 2];
         stream.readFully(b);
--- a/jdk/src/share/classes/com/sun/imageio/plugins/png/PNGMetadata.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/com/sun/imageio/plugins/png/PNGMetadata.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1254,8 +1254,11 @@
             if (name.equals("IHDR")) {
                 IHDR_width = getIntAttribute(node, "width");
                 IHDR_height = getIntAttribute(node, "height");
-                IHDR_bitDepth = getEnumeratedAttribute(node, "bitDepth",
-                                                       IHDR_bitDepths);
+                IHDR_bitDepth =
+                        Integer.valueOf(IHDR_bitDepths[
+                                getEnumeratedAttribute(node,
+                                                    "bitDepth",
+                                                    IHDR_bitDepths)]);
                 IHDR_colorType = getEnumeratedAttribute(node, "colorType",
                                                         IHDR_colorTypeNames);
                 IHDR_compressionMethod =
@@ -1644,7 +1647,7 @@
                     int compressionMethod =
                         getEnumeratedAttribute(zTXt_node, "compressionMethod",
                                                zTXt_compressionMethodNames);
-                    zTXt_compressionMethod.add(new Integer(compressionMethod));
+                    zTXt_compressionMethod.add(compressionMethod);
 
                     String text = getAttribute(zTXt_node, "text");
                     zTXt_text.add(text);
--- a/jdk/src/share/classes/com/sun/imageio/plugins/wbmp/WBMPMetadata.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/com/sun/imageio/plugins/wbmp/WBMPMetadata.java	Wed Jul 05 19:53:51 2017 +0200
@@ -75,9 +75,9 @@
         IIOMetadataNode root =
             new IIOMetadataNode(nativeMetadataFormatName);
 
-        addChildNode(root, "WBMPType", new Integer(wbmpType));
-        addChildNode(root, "Width", new Integer(width));
-        addChildNode(root, "Height", new Integer(height));
+        addChildNode(root, "WBMPType", wbmpType);
+        addChildNode(root, "Width", width);
+        addChildNode(root, "Height", height);
 
         return root;
     }
--- a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKLookAndFeel.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKLookAndFeel.java	Wed Jul 05 19:53:51 2017 +0200
@@ -812,12 +812,12 @@
 
             "OptionPane.setButtonMargin", Boolean.FALSE,
             "OptionPane.sameSizeButtons", Boolean.TRUE,
-            "OptionPane.buttonOrientation", new Integer(SwingConstants.RIGHT),
+            "OptionPane.buttonOrientation", SwingConstants.RIGHT,
             "OptionPane.minimumSize", new DimensionUIResource(262, 90),
-            "OptionPane.buttonPadding", new Integer(10),
+            "OptionPane.buttonPadding", 10,
             "OptionPane.windowBindings", new Object[] {
                 "ESCAPE", "close" },
-            "OptionPane.buttonClickThreshhold", new Integer(500),
+            "OptionPane.buttonClickThreshhold", 500,
             "OptionPane.isYesLast", Boolean.TRUE,
             "OptionPane.font", new FontLazyValue(Region.OPTION_PANE),
 
--- a/jdk/src/share/classes/com/sun/java/swing/plaf/motif/MotifLookAndFeel.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/com/sun/java/swing/plaf/motif/MotifLookAndFeel.java	Wed Jul 05 19:53:51 2017 +0200
@@ -567,7 +567,7 @@
             "ProgressBar.selectionForeground", table.get("control"),
             "ProgressBar.selectionBackground", table.get("controlText"),
             "ProgressBar.border", loweredBevelBorder,
-            "ProgressBar.cellLength", new Integer(6),
+            "ProgressBar.cellLength", 6,
             "ProgressBar.cellSpacing", Integer.valueOf(0),
 
             // Buttons
@@ -582,7 +582,7 @@
                  "released SPACE", "released"
               }),
 
-            "CheckBox.textIconGap", new Integer(8),
+            "CheckBox.textIconGap", 8,
             "CheckBox.margin", new InsetsUIResource(4, 2, 4, 2),
             "CheckBox.icon", checkBoxIcon,
             "CheckBox.focus", table.get("activeCaptionBorder"),
@@ -593,7 +593,7 @@
                  }),
 
             "RadioButton.margin", new InsetsUIResource(4, 2, 4, 2),
-            "RadioButton.textIconGap", new Integer(8),
+            "RadioButton.textIconGap", 8,
             "RadioButton.background", table.get("control"),
             "RadioButton.foreground", table.get("controlText"),
             "RadioButton.icon", radioButtonIcon,
@@ -627,10 +627,10 @@
             "Menu.selectionBackground", menuItemPressedBackground,
             "Menu.checkIcon", menuItemCheckIcon,
             "Menu.arrowIcon", menuArrowIcon,
-            "Menu.menuPopupOffsetX", new Integer(0),
-            "Menu.menuPopupOffsetY", new Integer(0),
-            "Menu.submenuPopupOffsetX", new Integer(-2),
-            "Menu.submenuPopupOffsetY", new Integer(3),
+            "Menu.menuPopupOffsetX", 0,
+            "Menu.menuPopupOffsetY", 0,
+            "Menu.submenuPopupOffsetX", -2,
+            "Menu.submenuPopupOffsetY", 3,
             "Menu.shortcutKeys", new int[]{
                 SwingUtilities2.getSystemMnemonicKeyMask(),
                 KeyEvent.META_MASK
@@ -938,7 +938,7 @@
             "Tree.collapsedIcon", treeCollapsedIcon,
             "Tree.editorBorder", focusBorder,
             "Tree.editorBorderSelectionColor", table.get("activeCaptionBorder"),
-            "Tree.rowHeight", new Integer(18),
+            "Tree.rowHeight", 18,
             "Tree.drawsFocusBorderAroundIcon", Boolean.TRUE,
             "Tree.focusInputMap", new UIDefaults.LazyInputMap(new Object[] {
                                 "COPY", "copy",
--- a/jdk/src/share/classes/com/sun/jndi/cosnaming/CNCtx.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/com/sun/jndi/cosnaming/CNCtx.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1145,7 +1145,7 @@
 
         // Never destroy an orb in CNCtx.
         // The orb we have is either the shared/default orb, or one passed in to a constructor
-        // from elsewhere, so that orb is somebody else's reponsibility.
+        // from elsewhere, so that orb is somebody else's responsibility.
     }
 
     protected void finalize() {
--- a/jdk/src/share/classes/com/sun/jndi/dns/DnsClient.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/com/sun/jndi/dns/DnsClient.java	Wed Jul 05 19:53:51 2017 +0200
@@ -376,7 +376,7 @@
 
 
     /**
-     * Tries to retreive an UDP packet matching the given xid
+     * Tries to retrieve a UDP packet matching the given xid
      * received within the timeout.
      * If a packet with different xid is received, the received packet
      * is enqueued with the corresponding xid in 'resps'.
--- a/jdk/src/share/classes/com/sun/jndi/ldap/AbstractLdapNamingEnumeration.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/AbstractLdapNamingEnumeration.java	Wed Jul 05 19:53:51 2017 +0200
@@ -137,7 +137,7 @@
         limit = (entries == null) ? 0 : entries.size(); // handle empty set
         posn = 0; // reset
 
-        // mimimize the number of calls to processReturnCode()
+        // minimize the number of calls to processReturnCode()
         // (expensive when batchSize is small and there are many results)
         if ((res.status != LdapClient.LDAP_SUCCESS) ||
             ((res.status == LdapClient.LDAP_SUCCESS) &&
--- a/jdk/src/share/classes/com/sun/jndi/ldap/ClientId.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/ClientId.java	Wed Jul 05 19:53:51 2017 +0200
@@ -196,7 +196,7 @@
                 System.out.println("ClientId received an exception");
                 e.printStackTrace();
             }
-            // Failed to invoke the comparator; flag unequality
+            // Failed to invoke the comparator; flag inequality
             return false;
         }
         if (((Integer) ret) == 0) {
--- a/jdk/src/share/classes/com/sun/jndi/ldap/EventQueue.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/EventQueue.java	Wed Jul 05 19:53:51 2017 +0200
@@ -75,7 +75,7 @@
      * Enqueue an event.
      * @param event Either a <tt>NamingExceptionEvent</tt> or a subclass
      *              of <tt>NamingEvent</tt> or
-     * <tt>UnsolicitedNotificatoniEvent</tt>.
+     * <tt>UnsolicitedNotificationEvent</tt>.
      * If it is a subclass of <tt>NamingEvent</tt>, all listeners must implement
      * the corresponding subinterface of <tt>NamingListener</tt>.
      * For example, for a <tt>ObjectAddedEvent</tt>, all listeners <em>must</em>
@@ -141,7 +141,7 @@
                     // it is interested in. (No need to check mask or
                     // instanceof subinterfaces.)
                     // It is the responsibility of the enqueuer to
-                    // only enqueue events with listseners of the correct type.
+                    // only enqueue events with listeners of the correct type.
 
                     if (e instanceof NamingEvent) {
                         ((NamingEvent)e).dispatch(v.elementAt(i));
--- a/jdk/src/share/classes/com/sun/jndi/ldap/EventSupport.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/EventSupport.java	Wed Jul 05 19:53:51 2017 +0200
@@ -83,7 +83,7 @@
  *a new notifier is created for the listener.
  *
  *<h4>Deregistration</h4>
- *When a deregistration request is made, this class attemps to find its
+ *When a deregistration request is made, this class attempts to find its
  *corresponding notifier. If the notifier is found, the listener is removed
  *from the notifier's list. If the listener is the last listener on the list,
  *the notifier's thread is terminated and removed from this class's hashtable.
--- a/jdk/src/share/classes/com/sun/jndi/ldap/LdapAttribute.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/LdapAttribute.java	Wed Jul 05 19:53:51 2017 +0200
@@ -34,7 +34,7 @@
 /**
   * This subclass is used by LDAP to implement the schema calls.
   * Basically, it keeps track of which context it is an attribute of
-  * so it can get the schema for that cotnext.
+  * so it can get the schema for that context.
   *
   * @author Jon Ruiz
   */
@@ -134,7 +134,7 @@
         // setup internal state
         this.setBaseCtxInfo();
 
-        // let the ObjectOutpurStream do the real work of serialization
+        // let the ObjectOutputStream do the real work of serialization
         out.defaultWriteObject();
     }
 
--- a/jdk/src/share/classes/com/sun/jndi/ldap/LdapCtx.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/LdapCtx.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1651,7 +1651,7 @@
      *
      * This function is called regardless of the server's version, since
      * an administrator may have setup the server to support client schema
-     * queries. If this function trys a serarch on a v2 server that
+     * queries. If this function tries a search on a v2 server that
      * doesn't support schema, one of these two things will happen:
      * 1) It will get an exception when querying the root DSE
      * 2) It will not find a subschemasubentry on the root DSE
@@ -2016,7 +2016,7 @@
      *    - the returning attributes list is present but empty
      */
 
-    // returns true if a search can be caried out as a compare, and sets
+    // returns true if a search can be carried out as a compare, and sets
     // tokens[0] and tokens[1] to the type and value respectively.
     // e.g. filter "cn=Jon Ruiz" becomes, type "cn" and value "Jon Ruiz"
     // This function uses the documents JNDI Compare example as a model
@@ -2083,7 +2083,7 @@
             return false; // unbalanced
         }
 
-        // make sure the left and right half are not expresions themselves
+        // make sure the left and right half are not expressions themselves
         StringTokenizer illegalCharsTokenizer =
             new StringTokenizer(tokens[0], "()&|!=~><*", true);
 
@@ -2443,7 +2443,7 @@
     }
 
     /**
-     * Set whether aliases are derefereced during resolution and searches.
+     * Set whether aliases are dereferenced during resolution and searches.
      */
     private void setDerefAliases(String deref) {
         if (deref != null) {
--- a/jdk/src/share/classes/com/sun/jndi/ldap/LdapName.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/LdapName.java	Wed Jul 05 19:53:51 2017 +0200
@@ -346,8 +346,8 @@
     }
 
     /**
-     * Given an attribute value formated according to RFC 2253,
-     * returns the unformated value.  Returns a string value as
+     * Given an attribute value formatted according to RFC 2253,
+     * returns the unformatted value.  Returns a string value as
      * a string, and a binary value as a byte array.
      */
     public static Object unescapeAttributeValue(String val) {
@@ -687,7 +687,7 @@
         private final boolean binary;
         private final boolean valueCaseSensitive;
 
-        // If non-null, a canonical represention of the value suitable
+        // If non-null, a canonical representation of the value suitable
         // for comparison using String.compareTo().
         private String comparable = null;
 
@@ -842,8 +842,8 @@
         }
 
         /*
-         * Given an attribute value formated according to RFC 2253,
-         * returns the unformated value.  Escapes and quotes are
+         * Given an attribute value formatted according to RFC 2253,
+         * returns the unformatted value.  Escapes and quotes are
          * stripped away, and hex-encoded UTF-8 is converted to 16-bit
          * Unicode chars.  Returns a string value as a String, and a
          * binary value as a byte array.
--- a/jdk/src/share/classes/com/sun/jndi/ldap/LdapReferralContext.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/LdapReferralContext.java	Wed Jul 05 19:53:51 2017 +0200
@@ -679,7 +679,7 @@
 
         } catch (LdapReferralException e) {
 
-            // %%% VR - setNameResolved(true);
+            // %%% setNameResolved(true);
 
             // append (referrals from) the exception that generated this
             // context to the new exception, so that referral processing
@@ -897,7 +897,7 @@
 
     /*
      * Use the attributes and scope components from the LDAP URL (if present)
-     * to override the corrpesonding components supplied in SearchControls.
+     * to override the corresponding components supplied in SearchControls.
      */
     private SearchControls overrideAttributesAndScope(SearchControls cons) {
         SearchControls urlCons;
--- a/jdk/src/share/classes/com/sun/jndi/ldap/LdapRequest.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/LdapRequest.java	Wed Jul 05 19:53:51 2017 +0200
@@ -62,7 +62,7 @@
         cancelled = true;
 
         // Unblock reader of pending request
-        // Should only ever have atmost one waiter
+        // Should only ever have at most one waiter
         notify();
     }
 
--- a/jdk/src/share/classes/com/sun/jndi/ldap/LdapSchemaParser.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/LdapSchemaParser.java	Wed Jul 05 19:53:51 2017 +0200
@@ -84,7 +84,7 @@
     // Object Class specific IDs
     private static final String    ABSTRACT_ID = "ABSTRACT";
     private static final String  STRUCTURAL_ID = "STRUCTURAL";
-    private static final String    AUXILARY_ID = "AUXILIARY";
+    private static final String   AUXILIARY_ID = "AUXILIARY";
     private static final String        MUST_ID = "MUST";
     private static final String         MAY_ID = "MAY";
 
@@ -300,8 +300,8 @@
         return new Object[] {currentName, attrs};
     }
 
-    // returns the index of the first whitespace char of a linear whitspace
-    // sequince ending at the given position.
+    // returns the index of the first whitespace char of a linear whitespace
+    // sequence ending at the given position.
     final private static int findTrailingWhitespace(String string, int pos) {
         for(int i = pos; i > 0; i--) {
             if(string.charAt(i) != WHSP) {
@@ -423,7 +423,7 @@
         if (tag.equals(OBSOLETE_ID) ||
             tag.equals(ABSTRACT_ID) ||
             tag.equals(STRUCTURAL_ID) ||
-            tag.equals(AUXILARY_ID) ||
+            tag.equals(AUXILIARY_ID) ||
             tag.equals(SINGLE_VAL_ID) ||
             tag.equals(COLLECTIVE_ID) ||
             tag.equals(NO_USER_MOD_ID)) {
@@ -819,7 +819,7 @@
             count++;
         }
 
-        attr = attrs.get(AUXILARY_ID);
+        attr = attrs.get(AUXILIARY_ID);
         if (attr != null) {
             objectDesc.append(writeBoolean(attr));
             count++;
@@ -856,7 +856,7 @@
                     attrId.equals(MUST_ID) ||
                     attrId.equals(STRUCTURAL_ID) ||
                     attrId.equals(DESC_ID) ||
-                    attrId.equals(AUXILARY_ID) ||
+                    attrId.equals(AUXILIARY_ID) ||
                     attrId.equals(ABSTRACT_ID) ||
                     attrId.equals(OBSOLETE_ID)) {
                     continue;
--- a/jdk/src/share/classes/com/sun/jndi/ldap/LdapSearchEnumeration.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/LdapSearchEnumeration.java	Wed Jul 05 19:53:51 2017 +0200
@@ -156,7 +156,7 @@
             String[] reqAttrs;
             if ((reqAttrs = searchArgs.reqAttrs) != null) {
                 // create an attribute set for those requested
-                Attributes rattrs = new BasicAttributes(true); // caseignore
+                Attributes rattrs = new BasicAttributes(true); // ignore case
                 for (int i = 0; i < reqAttrs.length; i++) {
                     rattrs.put(reqAttrs[i], null);
                 }
@@ -213,8 +213,6 @@
         // Update search-specific variables
         LdapSearchEnumeration se = (LdapSearchEnumeration)ne;
         startName = se.startName;
-//VR - keep original args, don't overwite with current args
-//      searchArgs = se.searchArgs;
     }
 
     void setStartName(Name nm) {
--- a/jdk/src/share/classes/com/sun/jndi/ldap/LdapURL.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/LdapURL.java	Wed Jul 05 19:53:51 2017 +0200
@@ -162,7 +162,7 @@
     }
 
     /**
-     * Derermines whether an LDAP URL has query components.
+     * Determines whether an LDAP URL has query components.
      */
     public static boolean hasQueryComponents(String url) {
         return (url.lastIndexOf('?') != -1);
--- a/jdk/src/share/classes/com/sun/jndi/ldap/ServiceLocator.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/ServiceLocator.java	Wed Jul 05 19:53:51 2017 +0200
@@ -62,7 +62,7 @@
      *
      * @param dn A string distinguished name (RFC 2253).
      * @return A domain name or null if none can be derived.
-     * @throw InvalidNameException If the distinugished name is invalid.
+     * @throw InvalidNameException If the distinguished name is invalid.
      */
     static String mapDnToDomainName(String dn) throws InvalidNameException {
         if (dn == null) {
--- a/jdk/src/share/classes/com/sun/jndi/ldap/VersionHelper.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/VersionHelper.java	Wed Jul 05 19:53:51 2017 +0200
@@ -25,32 +25,77 @@
 
 package com.sun.jndi.ldap;
 
+import sun.misc.SharedSecrets;
+
 import java.net.MalformedURLException;
 import java.net.URL;
+import java.net.URLClassLoader;
+import java.security.AccessControlContext;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
 
-abstract class VersionHelper {
+public final class VersionHelper {
+
+    private static final VersionHelper helper = new VersionHelper();
 
-    private static final VersionHelper helper = new VersionHelper12();
+    /**
+     * Determines whether classes may be loaded from an arbitrary URL code base.
+     */
+    private static final boolean trustURLCodebase;
 
-    VersionHelper() {} // Disallow anyone from creating one of these.
+    static {
+        // System property to control whether classes may be loaded from an
+        // arbitrary URL code base
+        PrivilegedAction<String> act =
+                () -> System.getProperty("com.sun.jndi.ldap.object.trustURLCodebase", "false");
+        String trust = AccessController.doPrivileged(act);
+        trustURLCodebase = "true".equalsIgnoreCase(trust);
+    }
+
+    private VersionHelper() { }
 
     static VersionHelper getVersionHelper() {
         return helper;
     }
 
-    abstract ClassLoader getURLClassLoader(String[] url)
-        throws MalformedURLException;
+    ClassLoader getURLClassLoader(String[] url) throws MalformedURLException {
+        ClassLoader parent = getContextClassLoader();
+        /*
+         * Classes may only be loaded from an arbitrary URL code base when
+         * the system property com.sun.jndi.ldap.object.trustURLCodebase
+         * has been set to "true".
+         */
+        if (url != null && trustURLCodebase) {
+            return URLClassLoader.newInstance(getUrlArray(url), parent);
+        } else {
+            return parent;
+        }
+    }
 
+    Class<?> loadClass(String className) throws ClassNotFoundException {
+        return Class.forName(className, true, getContextClassLoader());
+    }
 
-    static protected URL[] getUrlArray(String[] url) throws MalformedURLException {
+    Thread createThread(Runnable r) {
+        AccessControlContext acc = AccessController.getContext();
+        // 4290486: doPrivileged is needed to create a thread in
+        // an environment that restricts "modifyThreadGroup".
+        PrivilegedAction<Thread> act =
+                () -> SharedSecrets.getJavaLangAccess().newThreadWithAcc(r, acc);
+        return AccessController.doPrivileged(act);
+    }
+
+    private ClassLoader getContextClassLoader() {
+        PrivilegedAction<ClassLoader> act =
+                Thread.currentThread()::getContextClassLoader;
+        return AccessController.doPrivileged(act);
+    }
+
+    private static URL[] getUrlArray(String[] url) throws MalformedURLException {
         URL[] urlArray = new URL[url.length];
         for (int i = 0; i < urlArray.length; i++) {
             urlArray[i] = new URL(url[i]);
         }
         return urlArray;
     }
-
-    abstract Class<?> loadClass(String className) throws ClassNotFoundException;
-
-    abstract Thread createThread(Runnable r);
 }
--- a/jdk/src/share/classes/com/sun/jndi/ldap/VersionHelper12.java	Wed Jul 05 19:52:35 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,98 +0,0 @@
-/*
- * Copyright (c) 1999, 2013, 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * 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 com.sun.jndi.ldap;
-
-import java.net.URLClassLoader;
-import java.net.MalformedURLException;
-import java.security.AccessControlContext;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import sun.misc.SharedSecrets;
-
-final class VersionHelper12 extends VersionHelper {
-
-    // System property to control whether classes may be loaded from an
-    // arbitrary URL code base.
-    private static final String TRUST_URL_CODEBASE_PROPERTY =
-        "com.sun.jndi.ldap.object.trustURLCodebase";
-
-    // Determine whether classes may be loaded from an arbitrary URL code base.
-    private static final String trustURLCodebase =
-        AccessController.doPrivileged(
-            new PrivilegedAction<String>() {
-                public String run() {
-                    return System.getProperty(TRUST_URL_CODEBASE_PROPERTY,
-                            "false");
-                }
-            }
-        );
-
-    VersionHelper12() {} // Disallow external from creating one of these.
-
-    ClassLoader getURLClassLoader(String[] url)
-        throws MalformedURLException {
-            ClassLoader parent = getContextClassLoader();
-            /*
-             * Classes may only be loaded from an arbitrary URL code base when
-             * the system property com.sun.jndi.ldap.object.trustURLCodebase
-             * has been set to "true".
-             */
-            if (url != null && "true".equalsIgnoreCase(trustURLCodebase)) {
-                return URLClassLoader.newInstance(getUrlArray(url), parent);
-            } else {
-                return parent;
-            }
-    }
-
-    Class<?> loadClass(String className) throws ClassNotFoundException {
-        ClassLoader cl = getContextClassLoader();
-        return Class.forName(className, true, cl);
-    }
-
-    private ClassLoader getContextClassLoader() {
-        return AccessController.doPrivileged(
-            new PrivilegedAction<ClassLoader>() {
-                public ClassLoader run() {
-                    return Thread.currentThread().getContextClassLoader();
-                }
-            }
-        );
-    }
-
-    Thread createThread(final Runnable r) {
-        final AccessControlContext acc = AccessController.getContext();
-        // 4290486: doPrivileged is needed to create a thread in
-        // an environment that restricts "modifyThreadGroup".
-        return AccessController.doPrivileged(
-                new PrivilegedAction<Thread>() {
-                    public Thread run() {
-                        return SharedSecrets.getJavaLangAccess()
-                                .newThreadWithAcc(r, acc);
-                    }
-                }
-        );
-    }
-}
--- a/jdk/src/share/classes/com/sun/jndi/ldap/pool/Connections.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/pool/Connections.java	Wed Jul 05 19:53:51 2017 +0200
@@ -254,7 +254,7 @@
     /**
      * Removes PooledConnection from list of connections.
      * The closing of the connection is separate from this method.
-     * This method is called usually when the caller encouters an error
+     * This method is called usually when the caller encounters an error
      * when using the connection and wants it removed from the pool.
      *
      * @return true if conn removed; false if it was not in pool
--- a/jdk/src/share/classes/com/sun/jndi/ldap/pool/Pool.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/pool/Pool.java	Wed Jul 05 19:53:51 2017 +0200
@@ -68,8 +68,8 @@
  * whenever a pooled connection is requested or a call to remove the expired
  * connections is made. The monitoring is done regularly when idle connection
  * timeout is set as the PoolCleaner removes expired connections periodically.
- * As determined by the experiements, cleanup of resources using the
- * ReferenceQueue mechanism is reliable and has immidiate effect than the
+ * As determined by experimentation, cleanup of resources using the
+ * ReferenceQueue mechanism is reliable and has more immediate effect than the
  * finalizer approach.
  *
  * @author Rosanna Lee
--- a/jdk/src/share/classes/com/sun/jndi/toolkit/corba/CorbaUtils.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/com/sun/jndi/toolkit/corba/CorbaUtils.java	Wed Jul 05 19:53:51 2017 +0200
@@ -165,6 +165,7 @@
 
         // Get Applet from environment
         if (env != null) {
+            @SuppressWarnings("deprecation")
             Applet applet = (Applet) env.get(Context.APPLET);
             if (applet != null) {
             // Create ORBs using applet and orbProp
--- a/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/AtomicContext.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/AtomicContext.java	Wed Jul 05 19:53:51 2017 +0200
@@ -96,7 +96,7 @@
       * Resolves the nns for 'name' when the named context is acting
       * as an intermediate context.
       *
-      * For a system that supports junctions, this would be equilvalent to
+      * For a system that supports junctions, this would be equivalent to
       *         a_lookup(name, cont);
       * because for junctions, an intermediate slash simply signifies
       * a syntactic separator.
@@ -487,7 +487,7 @@
                 resolve_to_nns_and_continue(name, cont);
                 return null;
             } else {
-                // use COmponentContext
+                // use ComponentContext
                 return super.c_getNameParser_nns(name, cont);
             }
         }
--- a/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/ComponentContext.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/ComponentContext.java	Wed Jul 05 19:53:51 2017 +0200
@@ -137,7 +137,7 @@
       * as an intermediate context.
       *
       * For a system that supports only junctions, this would be
-      * equilvalent to
+      * equivalent to
       *         c_lookup(name, cont);
       * because for junctions, an intermediate slash simply signifies
       * a syntactic separator.
--- a/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/Continuation.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/Continuation.java	Wed Jul 05 19:53:51 2017 +0200
@@ -172,7 +172,7 @@
      *
      * This method is typically called by _nns methods that have been
      * given a name to process. It might process part of that name but
-     * encountered some error. Consequenetly, it would call setErrorNNS()
+     * encountered some error. Consequently, it would call setErrorNNS()
      * with the remaining name. Since the _nns method was expected to
      * operate upon the "nns" of the original name, the remaining name
      * must include the "nns". That's why this method adds a trailing "/".
@@ -219,7 +219,7 @@
      *
      * This method is typically called by methods that have been
      * given a name to process. It might process part of that name but
-     * encountered some error. Consequenetly, it would call setError()
+     * encountered some error. Consequently, it would call setError()
      * with the resolved object and the remaining name.
      *<p>
      * After this method is called, isContinuing() returns false.
--- a/jdk/src/share/classes/com/sun/jndi/toolkit/dir/ContextEnumerator.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/com/sun/jndi/toolkit/dir/ContextEnumerator.java	Wed Jul 05 19:53:51 2017 +0200
@@ -182,14 +182,14 @@
 
         if (!currentReturned) {
             // returning parent
-            if(debug) {System.out.println("getNextDescedant: simple case");}
+            if(debug) {System.out.println("getNextDescendant: simple case");}
 
             currentReturned = true;
             return currentChild;
 
         } else if (currentChildExpanded && currentChildEnum.hasMore()) {
 
-            if(debug) {System.out.println("getNextDescedant: expanded case");}
+            if(debug) {System.out.println("getNextDescendant: expanded case");}
 
             // if the current child is expanded, use it's enumerator
             return currentChildEnum.next();
@@ -197,7 +197,7 @@
         } else {
 
             // Ready to go onto next child
-            if(debug) {System.out.println("getNextDescedant: next case");}
+            if(debug) {System.out.println("getNextDescendant: next case");}
 
             prepNextChild();
             return getNextDescendant();
--- a/jdk/src/share/classes/com/sun/jndi/toolkit/dir/HierMemDirCtx.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/com/sun/jndi/toolkit/dir/HierMemDirCtx.java	Wed Jul 05 19:53:51 2017 +0200
@@ -881,8 +881,8 @@
     }
 }
 
-    // CompundNames's HashCode() method isn't good enough for many string.
-    // The only prupose of this subclass is to have a more discerning
+    // CompoundNames's HashCode() method isn't good enough for many strings.
+    // The only purpose of this subclass is to have a more discerning
     // hash function. We'll make up for the performance hit by caching
     // the hash value.
 
--- a/jdk/src/share/classes/com/sun/jndi/toolkit/dir/LazySearchEnumerationImpl.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/com/sun/jndi/toolkit/dir/LazySearchEnumerationImpl.java	Wed Jul 05 19:53:51 2017 +0200
@@ -152,7 +152,7 @@
                         } else if (useFactory) {
                             try {
                                 // Give name only if context non-null,
-                                // otherewise, name will be interpreted relative
+                                // otherwise, name will be interpreted relative
                                 // to initial context (not what we want)
                                 Name nm = (context != null ?
                                     new CompositeName(next.getName()) : null);
--- a/jdk/src/share/classes/com/sun/jndi/toolkit/dir/SearchFilter.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/com/sun/jndi/toolkit/dir/SearchFilter.java	Wed Jul 05 19:53:51 2017 +0200
@@ -256,7 +256,7 @@
     static final int LESS_MATCH = 4;
 
     /**
-     * A class for dealing wtih atomic filters
+     * A class for dealing with atomic filters
      */
     final class AtomicFilter implements StringFilter {
         private String attrID;
@@ -369,7 +369,7 @@
                     }
                     break;
                 default:
-                    if (debug) {System.out.println("AtomicFilter: unkown " +
+                    if (debug) {System.out.println("AtomicFilter: unknown " +
                                                    "matchType");}
                 }
             }
@@ -434,7 +434,7 @@
 
 
     /**
-      * Creates an LDAP filter as a conjuction of the attributes supplied.
+      * Creates an LDAP filter as a conjunction of the attributes supplied.
       */
     public static String format(Attributes attrs) throws NamingException {
         if (attrs == null || attrs.size() == 0) {
--- a/jdk/src/share/classes/com/sun/jndi/toolkit/url/GenericURLContext.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/com/sun/jndi/toolkit/url/GenericURLContext.java	Wed Jul 05 19:53:51 2017 +0200
@@ -168,7 +168,7 @@
             }
         }
 
-        // else 0 or 1 iniitial slashes; start is unchanged
+        // else 0 or 1 initial slashes; start is unchanged
         return url.substring(0, start);
     }
 
--- a/jdk/src/share/classes/com/sun/jndi/url/ldap/ldapURLContext.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/com/sun/jndi/url/ldap/ldapURLContext.java	Wed Jul 05 19:53:51 2017 +0200
@@ -562,7 +562,7 @@
     }
 
     // Search using the LDAP URL in name.
-    // LDAP URL query components override the search argments.
+    // LDAP URL query components override the search arguments.
     private NamingEnumeration<SearchResult> searchUsingURL(String name)
         throws NamingException {
 
--- a/jdk/src/share/classes/com/sun/management/GcInfo.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/com/sun/management/GcInfo.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, 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
@@ -267,7 +267,7 @@
         return cdata.toString();
     }
 
-    public Collection values() {
+    public Collection<?> values() {
         return cdata.values();
     }
 
--- a/jdk/src/share/classes/com/sun/naming/internal/ResourceManager.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/com/sun/naming/internal/ResourceManager.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, 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,6 @@
 import java.io.InputStream;
 import java.io.IOException;
 import java.lang.ref.WeakReference;
-import java.lang.reflect.Method;
-import java.lang.reflect.InvocationTargetException;
 import java.util.HashMap;
 import java.util.Hashtable;
 import java.util.Map;
@@ -126,52 +124,6 @@
     private static final WeakReference<Object> NO_FACTORY =
             new WeakReference<>(null);
 
-    /**
-     * A class to allow JNDI properties be specified as applet parameters
-     * without creating a static dependency on java.applet.
-     */
-    private static class AppletParameter {
-        private static final Class<?> clazz = getClass("java.applet.Applet");
-        private static final Method getMethod =
-            getMethod(clazz, "getParameter", String.class);
-        private static Class<?> getClass(String name) {
-            try {
-                return Class.forName(name, true, null);
-            } catch (ClassNotFoundException e) {
-                return null;
-            }
-        }
-        private static Method getMethod(Class<?> clazz,
-                                        String name,
-                                        Class<?>... paramTypes)
-        {
-            if (clazz != null) {
-                try {
-                    return clazz.getMethod(name, paramTypes);
-                } catch (NoSuchMethodException e) {
-                    throw new AssertionError(e);
-                }
-            } else {
-                return null;
-            }
-        }
-
-        /**
-         * Returns the value of the applet's named parameter.
-         */
-        static Object get(Object applet, String name) {
-            // if clazz is null then applet cannot be an Applet.
-            if (clazz == null || !clazz.isInstance(applet))
-                throw new ClassCastException(applet.getClass().getName());
-            try {
-                return getMethod.invoke(applet, name);
-            } catch (InvocationTargetException |
-                     IllegalAccessException e) {
-                throw new AssertionError(e);
-            }
-        }
-    }
-
     // There should be no instances of this class.
     private ResourceManager() {
     }
@@ -179,12 +131,11 @@
 
     // ---------- Public methods ----------
 
-    /*
+    /**
      * Given the environment parameter passed to the initial context
      * constructor, returns the full environment for that initial
      * context (never null).  This is based on the environment
-     * parameter, the applet parameters (where appropriate), the
-     * system properties, and all application resource files.
+     * parameter, the system properties, and all application resource files.
      *
      * <p> This method will modify <tt>env</tt> and save
      * a reference to it.  The caller may no longer modify it.
@@ -196,18 +147,16 @@
      *          resource file
      */
     @SuppressWarnings("unchecked")
-    public static Hashtable<?, ?> getInitialEnvironment(
-            Hashtable<?, ?> env)
+    public static Hashtable<?, ?> getInitialEnvironment(Hashtable<?, ?> env)
             throws NamingException
     {
-        String[] props = VersionHelper.PROPS;   // system/applet properties
+        String[] props = VersionHelper.PROPS;   // system properties
         if (env == null) {
             env = new Hashtable<>(11);
         }
-        Object applet = env.get(Context.APPLET);
 
-        // Merge property values from env param, applet params, and system
-        // properties.  The first value wins:  there's no concatenation of
+        // Merge property values from env param, and system properties.
+        // The first value wins: there's no concatenation of
         // colon-separated lists.
         // Read system properties by first trying System.getProperties(),
         // and then trying System.getProperty() if that fails.  The former
@@ -217,18 +166,13 @@
         for (int i = 0; i < props.length; i++) {
             Object val = env.get(props[i]);
             if (val == null) {
-                if (applet != null) {
-                    val = AppletParameter.get(applet, props[i]);
-                }
-                if (val == null) {
-                    // Read system property.
-                    val = (jndiSysProps != null)
+                // Read system property.
+                val = (jndiSysProps != null)
                         ? jndiSysProps[i]
                         : helper.getJndiProperty(i);
-                }
-                if (val != null) {
-                    ((Hashtable<String, Object>)env).put(props[i], val);
-                }
+            }
+            if (val != null) {
+                ((Hashtable<String, Object>)env).put(props[i], val);
             }
         }
 
@@ -248,8 +192,8 @@
     /**
       * Retrieves the property from the environment, or from the provider
       * resource file associated with the given context.  The environment
-      * may in turn contain values that come from applet parameters,
-      * system properties, or application resource files.
+      * may in turn contain values that come from system properties,
+      * or application resource files.
       *
       * If <tt>concat</tt> is true and both the environment and the provider
       * resource file contain the property, the two values are concatenated
@@ -289,7 +233,7 @@
      * property.
      *
      * The property is gotten from the environment and the provider
-     * resource file associated with the given context and concantenated.
+     * resource file associated with the given context and concatenated.
      * See getProperty(). The resulting property value is a list of class names.
      *<p>
      * This method then loads each class using the current thread's context
--- a/jdk/src/share/classes/com/sun/naming/internal/VersionHelper.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/com/sun/naming/internal/VersionHelper.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, 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,14 +25,19 @@
 
 package com.sun.naming.internal;
 
+import javax.naming.NamingEnumeration;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
 import java.io.InputStream;
-import java.io.IOException;
 import java.net.MalformedURLException;
 import java.net.URL;
-import java.util.StringTokenizer;
-import java.util.Vector;
-
-import javax.naming.NamingEnumeration;
+import java.net.URLClassLoader;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.security.PrivilegedActionException;
+import java.security.PrivilegedExceptionAction;
+import java.util.*;
 
 /**
  * VersionHelper was used by JNDI to accommodate differences between
@@ -45,10 +50,10 @@
  * @author Scott Seligman
  */
 
-public abstract class VersionHelper {
-    private static VersionHelper helper = null;
+public final class VersionHelper {
+    private static final VersionHelper helper = new VersionHelper();
 
-    final static String[] PROPS = new String[] {
+    final static String[] PROPS = new String[]{
         javax.naming.Context.INITIAL_CONTEXT_FACTORY,
         javax.naming.Context.OBJECT_FACTORIES,
         javax.naming.Context.URL_PKG_PREFIXES,
@@ -67,31 +72,57 @@
     public final static int DNS_URL = 5;
     public final static int CONTROL_FACTORIES = 6;
 
-    VersionHelper() {} // Disallow anyone from creating one of these.
-
-    static {
-        helper = new VersionHelper12();
-    }
+    private VersionHelper() {} // Disallow anyone from creating one of these.
 
     public static VersionHelper getVersionHelper() {
         return helper;
     }
 
-    public abstract Class<?> loadClass(String className)
-        throws ClassNotFoundException;
+    public Class<?> loadClass(String className) throws ClassNotFoundException {
+        return loadClass(className, getContextClassLoader());
+    }
+
+    /**
+     * @param className A non-null fully qualified class name.
+     * @param codebase  A non-null, space-separated list of URL strings.
+     */
+    public Class<?> loadClass(String className, String codebase)
+            throws ClassNotFoundException, MalformedURLException {
+
+        ClassLoader parent = getContextClassLoader();
+        ClassLoader cl =
+                URLClassLoader.newInstance(getUrlArray(codebase), parent);
 
-    abstract Class<?> loadClass(String className, ClassLoader cl)
-        throws ClassNotFoundException;
+        return loadClass(className, cl);
+    }
 
-    public abstract Class<?> loadClass(String className, String codebase)
-        throws ClassNotFoundException, MalformedURLException;
+    /**
+     * Package private.
+     * <p>
+     * This internal method is used with Thread Context Class Loader (TCCL),
+     * please don't expose this method as public.
+     */
+    Class<?> loadClass(String className, ClassLoader cl)
+            throws ClassNotFoundException {
+        Class<?> cls = Class.forName(className, true, cl);
+        return cls;
+    }
 
     /*
-     * Returns a JNDI property from the system properties.  Returns
+     * Returns a JNDI property from the system properties. Returns
      * null if the property is not set, or if there is no permission
      * to read it.
      */
-    abstract String getJndiProperty(int i);
+    String getJndiProperty(int i) {
+        PrivilegedAction<String> act = () -> {
+            try {
+                return System.getProperty(PROPS[i]);
+            } catch (SecurityException e) {
+                return null;
+            }
+        };
+        return AccessController.doPrivileged(act);
+    }
 
     /*
      * Reads each property in PROPS from the system properties, and
@@ -99,13 +130,33 @@
      * unset property, the corresponding array element is set to null.
      * Returns null if there is no permission to call System.getProperties().
      */
-    abstract String[] getJndiProperties();
+    String[] getJndiProperties() {
+        PrivilegedAction<Properties> act = () -> {
+            try {
+                return System.getProperties();
+            } catch (SecurityException e) {
+                return null;
+            }
+        };
+        Properties sysProps = AccessController.doPrivileged(act);
+        if (sysProps == null) {
+            return null;
+        }
+        String[] jProps = new String[PROPS.length];
+        for (int i = 0; i < PROPS.length; i++) {
+            jProps[i] = sysProps.getProperty(PROPS[i]);
+        }
+        return jProps;
+    }
 
     /*
      * Returns the resource of a given name associated with a particular
      * class (never null), or null if none can be found.
      */
-    abstract InputStream getResourceAsStream(Class<?> c, String name);
+    InputStream getResourceAsStream(Class<?> c, String name) {
+        PrivilegedAction<InputStream> act = () -> c.getResourceAsStream(name);
+        return AccessController.doPrivileged(act);
+    }
 
     /*
      * Returns an input stream for a file in <java.home>/lib,
@@ -113,7 +164,22 @@
      *
      * @param filename  The file name, sans directory.
      */
-    abstract InputStream getJavaHomeLibStream(String filename);
+    InputStream getJavaHomeLibStream(String filename) {
+        PrivilegedAction<InputStream> act = () -> {
+            try {
+                String javahome = System.getProperty("java.home");
+                if (javahome == null) {
+                    return null;
+                }
+                String pathname = javahome + File.separator +
+                        "lib" + File.separator + filename;
+                return new FileInputStream(pathname);
+            } catch (Exception e) {
+                return null;
+            }
+        };
+        return AccessController.doPrivileged(act);
+    }
 
     /*
      * Returns an enumeration (never null) of InputStreams of the
@@ -121,29 +187,55 @@
      * loader.  Null represents the bootstrap class loader in some
      * Java implementations.
      */
-    abstract NamingEnumeration<InputStream> getResources(
-            ClassLoader cl, String name)
-        throws IOException;
+    NamingEnumeration<InputStream> getResources(ClassLoader cl,
+                                                String name) throws IOException {
+        Enumeration<URL> urls;
+        PrivilegedExceptionAction<Enumeration<URL>> act = () ->
+                (cl == null)
+                        ? ClassLoader.getSystemResources(name)
+                        : cl.getResources(name);
+        try {
+            urls = AccessController.doPrivileged(act);
+        } catch (PrivilegedActionException e) {
+            throw (IOException) e.getException();
+        }
+        return new InputStreamEnumeration(urls);
+    }
+
 
-    /*
-     * Returns the context class loader associated with the current thread.
-     * Null indicates the bootstrap class loader in some Java implementations.
-     *
-     * @throws SecurityException if the class loader is not accessible.
+    /**
+     * Package private.
+     * <p>
+     * This internal method returns Thread Context Class Loader (TCCL),
+     * if null, returns the system Class Loader.
+     * <p>
+     * Please don't expose this method as public.
+     * @throws SecurityException if the class loader is not accessible
      */
-    abstract ClassLoader getContextClassLoader();
+    ClassLoader getContextClassLoader() {
 
-    static protected URL[] getUrlArray(String codebase)
-        throws MalformedURLException {
+        PrivilegedAction<ClassLoader> act = () -> {
+            ClassLoader loader = Thread.currentThread().getContextClassLoader();
+            if (loader == null) {
+                // Don't use bootstrap class loader directly!
+                loader = ClassLoader.getSystemClassLoader();
+            }
+            return loader;
+        };
+        return AccessController.doPrivileged(act);
+    }
+
+    private static URL[] getUrlArray(String codebase)
+            throws MalformedURLException {
         // Parse codebase into separate URLs
         StringTokenizer parser = new StringTokenizer(codebase);
-        Vector<String> vec = new Vector<>(10);
+        List<String> list = new ArrayList<>();
         while (parser.hasMoreTokens()) {
-            vec.addElement(parser.nextToken());
+            list.add(parser.nextToken());
         }
-        String[] url = new String[vec.size()];
+        String[] url = new String[list.size()];
         for (int i = 0; i < url.length; i++) {
-            url[i] = vec.elementAt(i);
+            url[i] = list.get(i);
         }
 
         URL[] urlArray = new URL[url.length];
@@ -152,4 +244,70 @@
         }
         return urlArray;
     }
+
+    /**
+     * Given an enumeration of URLs, an instance of this class represents
+     * an enumeration of their InputStreams.  Each operation on the URL
+     * enumeration is performed within a doPrivileged block.
+     * This is used to enumerate the resources under a foreign codebase.
+     * This class is not MT-safe.
+     */
+    private class InputStreamEnumeration implements
+            NamingEnumeration<InputStream> {
+
+        private final Enumeration<URL> urls;
+
+        private InputStream nextElement;
+
+        InputStreamEnumeration(Enumeration<URL> urls) {
+            this.urls = urls;
+        }
+
+        /*
+         * Returns the next InputStream, or null if there are no more.
+         * An InputStream that cannot be opened is skipped.
+         */
+        private InputStream getNextElement() {
+            PrivilegedAction<InputStream> act = () -> {
+                while (urls.hasMoreElements()) {
+                    try {
+                        return urls.nextElement().openStream();
+                    } catch (IOException e) {
+                        // skip this URL
+                    }
+                }
+                return null;
+            };
+            return AccessController.doPrivileged(act);
+        }
+
+        public boolean hasMore() {
+            if (nextElement != null) {
+                return true;
+            }
+            nextElement = getNextElement();
+            return (nextElement != null);
+        }
+
+        public boolean hasMoreElements() {
+            return hasMore();
+        }
+
+        public InputStream next() {
+            if (hasMore()) {
+                InputStream res = nextElement;
+                nextElement = null;
+                return res;
+            } else {
+                throw new NoSuchElementException();
+            }
+        }
+
+        public InputStream nextElement() {
+            return next();
+        }
+
+        public void close() {
+        }
+    }
 }
--- a/jdk/src/share/classes/com/sun/naming/internal/VersionHelper12.java	Wed Jul 05 19:52:35 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,268 +0,0 @@
-/*
- * Copyright (c) 1999, 2011, 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * 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 com.sun.naming.internal;
-
-import java.io.InputStream;
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URLClassLoader;
-import java.net.URL;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.security.PrivilegedActionException;
-import java.security.PrivilegedExceptionAction;
-import java.util.Enumeration;
-import java.util.NoSuchElementException;
-import java.util.Properties;
-
-import javax.naming.*;
-
-/**
- * VersionHelper was used by JNDI to accommodate differences between
- * JDK 1.1.x and the Java 2 platform. As this is no longer necessary
- * since JNDI's inclusion in the platform, this class currently
- * serves as a set of utilities for performing system-level things,
- * such as class-loading and reading system properties.
- *
- * @author Rosanna Lee
- * @author Scott Seligman
- */
-
-final class VersionHelper12 extends VersionHelper {
-
-    // Disallow external from creating one of these.
-    VersionHelper12() {
-    }
-
-    public Class<?> loadClass(String className) throws ClassNotFoundException {
-        return loadClass(className, getContextClassLoader());
-    }
-
-    /**
-     * Package private.
-     *
-     * This internal method is used with Thread Context Class Loader (TCCL),
-     * please don't expose this method as public.
-     */
-    Class<?> loadClass(String className, ClassLoader cl)
-        throws ClassNotFoundException {
-        Class<?> cls = Class.forName(className, true, cl);
-        return cls;
-    }
-
-    /**
-     * @param className A non-null fully qualified class name.
-     * @param codebase A non-null, space-separated list of URL strings.
-     */
-    public Class<?> loadClass(String className, String codebase)
-            throws ClassNotFoundException, MalformedURLException {
-
-        ClassLoader parent = getContextClassLoader();
-        ClassLoader cl =
-                 URLClassLoader.newInstance(getUrlArray(codebase), parent);
-
-        return loadClass(className, cl);
-    }
-
-    String getJndiProperty(final int i) {
-        return AccessController.doPrivileged(
-            new PrivilegedAction<String>() {
-                public String run() {
-                    try {
-                        return System.getProperty(PROPS[i]);
-                    } catch (SecurityException e) {
-                        return null;
-                    }
-                }
-            }
-        );
-    }
-
-    String[] getJndiProperties() {
-        Properties sysProps = AccessController.doPrivileged(
-            new PrivilegedAction<Properties>() {
-                public Properties run() {
-                    try {
-                        return System.getProperties();
-                    } catch (SecurityException e) {
-                        return null;
-                    }
-                }
-            }
-        );
-        if (sysProps == null) {
-            return null;
-        }
-        String[] jProps = new String[PROPS.length];
-        for (int i = 0; i < PROPS.length; i++) {
-            jProps[i] = sysProps.getProperty(PROPS[i]);
-        }
-        return jProps;
-    }
-
-    InputStream getResourceAsStream(final Class<?> c, final String name) {
-        return AccessController.doPrivileged(
-            new PrivilegedAction<InputStream>() {
-                public InputStream run() {
-                    return c.getResourceAsStream(name);
-                }
-            }
-        );
-    }
-
-    InputStream getJavaHomeLibStream(final String filename) {
-        return AccessController.doPrivileged(
-            new PrivilegedAction<InputStream>() {
-                public InputStream run() {
-                    try {
-                        String javahome = System.getProperty("java.home");
-                        if (javahome == null) {
-                            return null;
-                        }
-                        String pathname = javahome + java.io.File.separator +
-                            "lib" + java.io.File.separator + filename;
-                        return new java.io.FileInputStream(pathname);
-                    } catch (Exception e) {
-                        return null;
-                    }
-                }
-            }
-        );
-    }
-
-    NamingEnumeration<InputStream> getResources(final ClassLoader cl,
-            final String name) throws IOException {
-        Enumeration<URL> urls;
-        try {
-            urls = AccessController.doPrivileged(
-                new PrivilegedExceptionAction<Enumeration<URL>>() {
-                    public Enumeration<URL> run() throws IOException {
-                        return (cl == null)
-                            ? ClassLoader.getSystemResources(name)
-                            : cl.getResources(name);
-                    }
-                }
-            );
-        } catch (PrivilegedActionException e) {
-            throw (IOException)e.getException();
-        }
-        return new InputStreamEnumeration(urls);
-    }
-
-    /**
-     * Package private.
-     *
-     * This internal method returns Thread Context Class Loader (TCCL),
-     * if null, returns the system Class Loader.
-     *
-     * Please don't expose this method as public.
-     */
-    ClassLoader getContextClassLoader() {
-
-        return AccessController.doPrivileged(
-            new PrivilegedAction<ClassLoader>() {
-                public ClassLoader run() {
-                    ClassLoader loader =
-                            Thread.currentThread().getContextClassLoader();
-                    if (loader == null) {
-                        // Don't use bootstrap class loader directly!
-                        loader = ClassLoader.getSystemClassLoader();
-                    }
-
-                    return loader;
-                }
-            }
-        );
-    }
-
-    /**
-     * Given an enumeration of URLs, an instance of this class represents
-     * an enumeration of their InputStreams.  Each operation on the URL
-     * enumeration is performed within a doPrivileged block.
-     * This is used to enumerate the resources under a foreign codebase.
-     * This class is not MT-safe.
-     */
-    class InputStreamEnumeration implements NamingEnumeration<InputStream> {
-
-        private final Enumeration<URL> urls;
-
-        private InputStream nextElement = null;
-
-        InputStreamEnumeration(Enumeration<URL> urls) {
-            this.urls = urls;
-        }
-
-        /*
-         * Returns the next InputStream, or null if there are no more.
-         * An InputStream that cannot be opened is skipped.
-         */
-        private InputStream getNextElement() {
-            return AccessController.doPrivileged(
-                new PrivilegedAction<InputStream>() {
-                    public InputStream run() {
-                        while (urls.hasMoreElements()) {
-                            try {
-                                return urls.nextElement().openStream();
-                            } catch (IOException e) {
-                                // skip this URL
-                            }
-                        }
-                        return null;
-                    }
-                }
-            );
-        }
-
-        public boolean hasMore() {
-            if (nextElement != null) {
-                return true;
-            }
-            nextElement = getNextElement();
-            return (nextElement != null);
-        }
-
-        public boolean hasMoreElements() {
-            return hasMore();
-        }
-
-        public InputStream next() {
-            if (hasMore()) {
-                InputStream res = nextElement;
-                nextElement = null;
-                return res;
-            } else {
-                throw new NoSuchElementException();
-            }
-        }
-
-        public InputStream nextElement() {
-            return next();
-        }
-
-        public void close() {
-        }
-    }
-}
--- a/jdk/src/share/classes/com/sun/tools/example/debug/expr/ExpressionParser.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/com/sun/tools/example/debug/expr/ExpressionParser.java	Wed Jul 05 19:53:51 2017 +0200
@@ -33,18 +33,18 @@
 
 public class ExpressionParser implements ExpressionParserConstants {
 
-  Stack stack = new Stack();
+  Stack<LValue> stack = new Stack<>();
   VirtualMachine vm = null;
   GetFrame frameGetter = null;
   private static GetFrame lastFrameGetter;
   private static LValue lastLValue;
 
   LValue peek() {
-    return (LValue)stack.peek();
+    return stack.peek();
   }
 
   LValue pop() {
-    return (LValue)stack.pop();
+    return stack.pop();
   }
 
   void push(LValue lval) {
@@ -915,7 +915,7 @@
   }
 
   final public void PrimarySuffix() throws ParseException {
- List argList;
+ List<Value> argList;
     switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
     case LBRACKET:
       jj_consume_token(LBRACKET);
@@ -993,8 +993,8 @@
     jj_consume_token(NULL);
   }
 
-  final public List Arguments() throws ParseException {
- List argList = new ArrayList();
+  final public List<Value> Arguments() throws ParseException {
+ List<Value> argList = new ArrayList<>();
     jj_consume_token(LPAREN);
     switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
     case FALSE:
@@ -1026,7 +1026,7 @@
     throw new Error("Missing return statement in function");
   }
 
-  final public void ArgumentList(List argList) throws ParseException {
+  final public void ArgumentList(List<Value> argList) throws ParseException {
     Expression();
                 argList.add(pop().interiorGetValue());
     label_17:
@@ -1046,7 +1046,7 @@
   }
 
   final public void AllocationExpression() throws ParseException {
- List argList; String className;
+ List<Value> argList; String className;
     if (jj_2_7(2)) {
       jj_consume_token(NEW);
       PrimitiveType();
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/model/JavaClass.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/model/JavaClass.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, 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
@@ -229,9 +229,9 @@
         return name.indexOf('[') != -1;
     }
 
-    public Enumeration getInstances(boolean includeSubclasses) {
+    public Enumeration<JavaHeapObject> getInstances(boolean includeSubclasses) {
         if (includeSubclasses) {
-            Enumeration res = instances.elements();
+            Enumeration<JavaHeapObject> res = instances.elements();
             for (int i = 0; i < subclasses.length; i++) {
                 res = new CompositeEnumeration(res,
                               subclasses[i].getInstances(true));
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/model/JavaHeapObject.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/model/JavaHeapObject.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, 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
@@ -166,11 +166,11 @@
      *
      * @return an Enumeration of JavaHeapObject instances
      */
-    public Enumeration getReferers() {
+    public Enumeration<JavaThing> getReferers() {
         if (referersLen != -1) {
             throw new RuntimeException("not resolved: " + getIdString());
         }
-        return new Enumeration() {
+        return new Enumeration<JavaThing>() {
 
             private int num = 0;
 
@@ -178,7 +178,7 @@
                 return referers != null && num < referers.length;
             }
 
-            public Object nextElement() {
+            public JavaThing nextElement() {
                 return referers[num++];
             }
         };
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/model/ReachableExcludesImpl.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/model/ReachableExcludesImpl.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -54,7 +54,7 @@
 
     private File excludesFile;
     private long lastModified;
-    private Hashtable methods;  // Hashtable<String, String>, used as a bag
+    private Hashtable<String, String> methods;  // Used as a bag
 
     /**
      * Create a new ReachableExcludesImpl over the given file.  The file will be
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/model/ReachableObjects.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/model/ReachableObjects.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -86,7 +86,7 @@
         // Now grab the elements into a vector, and sort it in decreasing size
         JavaThing[] things = new JavaThing[bag.size()];
         int i = 0;
-        for (Enumeration e = bag.elements(); e.hasMoreElements(); ) {
+        for (Enumeration<JavaHeapObject> e = bag.elements(); e.hasMoreElements(); ) {
             things[i++] = (JavaThing) e.nextElement();
         }
         ArraySorter.sort(things, new Comparer() {
@@ -131,7 +131,7 @@
         return usedFields;
     }
 
-    private String[] getElements(Hashtable ht) {
+    private String[] getElements(Hashtable<?, ?> ht) {
         Object[] keys = ht.keySet().toArray();
         int len = keys.length;
         String[] res = new String[len];
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/model/Snapshot.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/model/Snapshot.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, 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
@@ -81,7 +81,7 @@
                  new HashMap<JavaHeapObject, Root>();
 
     // soft cache of finalizeable objects - lazily initialized
-    private SoftReference<Vector> finalizablesCache;
+    private SoftReference<Vector<?>> finalizablesCache;
 
     // represents null reference
     private JavaThing nullThing;
@@ -383,7 +383,7 @@
     /**
      * Return an Iterator of all of the classes in this snapshot.
      **/
-    public Iterator getClasses() {
+    public Iterator<JavaClass> getClasses() {
         // note that because classes is a TreeMap
         // classes are already sorted by name
         return classes.values().iterator();
@@ -395,8 +395,8 @@
         return res;
     }
 
-    public synchronized Enumeration getFinalizerObjects() {
-        Vector obj;
+    public synchronized Enumeration<?> getFinalizerObjects() {
+        Vector<?> obj;
         if (finalizablesCache != null &&
             (obj = finalizablesCache.get()) != null) {
             return obj.elements();
@@ -418,7 +418,7 @@
                 finalizables.add(referent);
             }
         }
-        finalizablesCache = new SoftReference<Vector>(finalizables);
+        finalizablesCache = new SoftReference<Vector<?>>(finalizables);
         return finalizables.elements();
     }
 
@@ -455,7 +455,7 @@
                 // Even though curr is in the rootset, we want to explore its
                 // referers, because they might be more interesting.
             }
-            Enumeration referers = curr.getReferers();
+            Enumeration<JavaThing> referers = curr.getReferers();
             while (referers.hasMoreElements()) {
                 JavaHeapObject t = (JavaHeapObject) referers.nextElement();
                 if (t != null && !visited.containsKey(t)) {
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/oql/OQLEngine.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/oql/OQLEngine.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -51,7 +51,7 @@
 
             // create JavaScript engine
             Method getEngineMethod = managerClass.getMethod("getEngineByName",
-                                new Class[] { String.class });
+                                new Class<?>[] { String.class });
             Object jse = getEngineMethod.invoke(manager, new Object[] {"js"});
             oqlSupported = (jse != null);
         } catch (Exception exp) {
@@ -205,9 +205,9 @@
             }
 
             if (q.className != null) {
-                Enumeration objects = clazz.getInstances(q.isInstanceOf);
+                Enumeration<JavaHeapObject> objects = clazz.getInstances(q.isInstanceOf);
                 while (objects.hasMoreElements()) {
-                    JavaHeapObject obj = (JavaHeapObject) objects.nextElement();
+                    JavaHeapObject obj = objects.nextElement();
                     Object[] args = new Object[] { wrapJavaObject(obj) };
                     boolean b = (whereCode == null);
                     if (!b) {
@@ -265,14 +265,14 @@
 
             // create JavaScript engine
             Method getEngineMethod = managerClass.getMethod("getEngineByName",
-                                new Class[] { String.class });
+                                new Class<?>[] { String.class });
             engine = getEngineMethod.invoke(manager, new Object[] {"js"});
 
             // initialize engine with init file (hat.js)
             InputStream strm = getInitStream();
             Class<?> engineClass = Class.forName("javax.script.ScriptEngine");
             evalMethod = engineClass.getMethod("eval",
-                                new Class[] { Reader.class });
+                                new Class<?>[] { Reader.class });
             evalMethod.invoke(engine, new Object[] {new InputStreamReader(strm)});
 
             // initialize ScriptEngine.eval(String) and
@@ -280,13 +280,13 @@
             Class<?> invocableClass = Class.forName("javax.script.Invocable");
 
             evalMethod = engineClass.getMethod("eval",
-                                  new Class[] { String.class });
+                                  new Class<?>[] { String.class });
             invokeMethod = invocableClass.getMethod("invokeFunction",
-                                  new Class[] { String.class, Object[].class });
+                                  new Class<?>[] { String.class, Object[].class });
 
             // initialize ScriptEngine.put(String, Object) method
             Method putMethod = engineClass.getMethod("put",
-                                  new Class[] { String.class, Object.class });
+                                  new Class<?>[] { String.class, Object.class });
 
             // call ScriptEngine.put to initialize built-in heap object
             putMethod.invoke(engine, new Object[] {
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/server/AllClassesQuery.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/server/AllClassesQuery.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, 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
@@ -58,10 +58,10 @@
             startHtml("All Classes (including platform)");
         }
 
-        Iterator classes = snapshot.getClasses();
+        Iterator<JavaClass> classes = snapshot.getClasses();
         String lastPackage = null;
         while (classes.hasNext()) {
-            JavaClass clazz = (JavaClass) classes.next();
+            JavaClass clazz = classes.next();
             if (excludePlatform && PlatformClasses.isPlatformClass(clazz)) {
                 // skip this..
                 continue;
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/server/ClassQuery.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/server/ClassQuery.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, 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
@@ -151,7 +151,7 @@
         }
         out.println("<h2>References to this object:</h2>");
         out.flush();
-        Enumeration referers = obj.getReferers();
+        Enumeration<JavaThing> referers = obj.getReferers();
         while (referers.hasMoreElements()) {
             JavaHeapObject ref = (JavaHeapObject) referers.nextElement();
             printThing(ref);
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/server/FinalizerObjectsQuery.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/server/FinalizerObjectsQuery.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, 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,7 +37,7 @@
 
 public class FinalizerObjectsQuery extends QueryHandler {
     public void run() {
-        Enumeration objs = snapshot.getFinalizerObjects();
+        Enumeration<?> objs = snapshot.getFinalizerObjects();
         startHtml("Objects pending finalization");
 
         out.println("<a href='/finalizerSummary/'>Finalizer summary</a>");
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/server/FinalizerSummaryQuery.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/server/FinalizerSummaryQuery.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, 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,7 +37,7 @@
 
 public class FinalizerSummaryQuery extends QueryHandler {
     public void run() {
-        Enumeration objs = snapshot.getFinalizerObjects();
+        Enumeration<?> objs = snapshot.getFinalizerObjects();
         startHtml("Finalizer Summary");
 
         out.println("<p align='center'>");
@@ -74,7 +74,7 @@
         private long count;
     }
 
-    private void printFinalizerSummary(Enumeration objs) {
+    private void printFinalizerSummary(Enumeration<?> objs) {
         int count = 0;
         Map<JavaClass, HistogramElement> map = new HashMap<JavaClass, HistogramElement>();
 
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/server/InstancesCountQuery.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/server/InstancesCountQuery.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, 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
@@ -111,10 +111,10 @@
             }
             out.print("</a> ");
             if (snapshot.getHasNewSet()) {
-                Enumeration objects = clazz.getInstances(false);
+                Enumeration<JavaHeapObject> objects = clazz.getInstances(false);
                 int newInst = 0;
                 while (objects.hasMoreElements()) {
-                    JavaHeapObject obj = (JavaHeapObject)objects.nextElement();
+                    JavaHeapObject obj = objects.nextElement();
                     if (obj.isNew()) {
                         newInst++;
                     }
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/server/InstancesQuery.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/server/InstancesQuery.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -73,11 +73,11 @@
             out.print("<strong>");
             printClass(clazz);
             out.print("</strong><br><br>");
-            Enumeration objects = clazz.getInstances(includeSubclasses);
+            Enumeration<JavaHeapObject> objects = clazz.getInstances(includeSubclasses);
             long totalSize = 0;
             long instances = 0;
             while (objects.hasMoreElements()) {
-                JavaHeapObject obj = (JavaHeapObject) objects.nextElement();
+                JavaHeapObject obj = objects.nextElement();
                 if (newObjects && !obj.isNew())
                     continue;
                 printThing(obj);
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/server/RefsByTypeQuery.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/server/RefsByTypeQuery.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -47,15 +47,15 @@
         } else {
             Map<JavaClass, Long> referrersStat = new HashMap<JavaClass, Long>();
             final Map<JavaClass, Long> refereesStat = new HashMap<JavaClass, Long>();
-            Enumeration instances = clazz.getInstances(false);
+            Enumeration<JavaHeapObject> instances = clazz.getInstances(false);
             while (instances.hasMoreElements()) {
-                JavaHeapObject instance = (JavaHeapObject) instances.nextElement();
+                JavaHeapObject instance = instances.nextElement();
                 if (instance.getId() == -1) {
                     continue;
                 }
-                Enumeration e = instance.getReferers();
+                Enumeration<JavaThing> e = instance.getReferers();
                 while (e.hasMoreElements()) {
-                    JavaHeapObject ref = (JavaHeapObject) e.nextElement();
+                    JavaHeapObject ref = (JavaHeapObject)e.nextElement();
                     JavaClass cl = ref.getClazz();
                     if (cl == null) {
                          System.out.println("null class for " + ref);
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/util/CompositeEnumeration.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/util/CompositeEnumeration.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, 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
@@ -34,12 +34,13 @@
 
 import java.util.Enumeration;
 import java.util.NoSuchElementException;
+import com.sun.tools.hat.internal.model.JavaHeapObject;
 
-public class CompositeEnumeration implements Enumeration {
-    Enumeration e1;
-    Enumeration e2;
+public class CompositeEnumeration implements Enumeration<JavaHeapObject> {
+    Enumeration<JavaHeapObject> e1;
+    Enumeration<JavaHeapObject> e2;
 
-    public CompositeEnumeration(Enumeration e1, Enumeration e2) {
+    public CompositeEnumeration(Enumeration<JavaHeapObject> e1, Enumeration<JavaHeapObject> e2) {
         this.e1 = e1;
         this.e2 = e2;
     }
@@ -48,7 +49,7 @@
         return e1.hasMoreElements() || e2.hasMoreElements();
     }
 
-    public Object nextElement() {
+    public JavaHeapObject nextElement() {
         if (e1.hasMoreElements()) {
             return e1.nextElement();
         }
--- a/jdk/src/share/classes/com/sun/tools/jdi/EventRequestManagerImpl.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/com/sun/tools/jdi/EventRequestManagerImpl.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -39,7 +39,7 @@
 // Warnings from List filters and List[] requestLists is  hard to fix.
 // Remove SuppressWarning when we fix the warnings from List filters
 // and List[] requestLists. The generic array is not supported.
-@SuppressWarnings("unchecked")
+@SuppressWarnings({"unchecked", "rawtypes"})
 class EventRequestManagerImpl extends MirrorImpl
                                        implements EventRequestManager
 {
--- a/jdk/src/share/classes/java/awt/Color.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/java/awt/Color.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -50,7 +50,7 @@
  * see <A href="http://www.w3.org/pub/WWW/Graphics/Color/sRGB.html">
  * http://www.w3.org/pub/WWW/Graphics/Color/sRGB.html
  * </A>.
- * <p>
+ *
  * @version     10 Feb 1997
  * @author      Sami Shaio
  * @author      Arthur van Hoff
--- a/jdk/src/share/classes/java/awt/Font.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/java/awt/Font.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2014, 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
@@ -542,7 +542,6 @@
      * compatible alternative, then the font system will map the Font
      * instance to "Dialog", such that for example, the family as reported
      * by {@link #getFamily() getFamily} will be "Dialog".
-     * <p>
      *
      * @param name the font name.  This can be a font face name or a font
      * family name, and may represent either a logical font or a physical
--- a/jdk/src/share/classes/java/awt/Graphics.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/java/awt/Graphics.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2014, 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
@@ -151,7 +151,7 @@
      * is specified by the <code>width</code> and <code>height</code>
      * arguments.
      * </ul>
-     * <p>
+     *
      * @param      x   the <i>x</i> coordinate.
      * @param      y   the <i>y</i> coordinate.
      * @param      width   the width of the clipping rectangle.
--- a/jdk/src/share/classes/java/awt/MenuComponent.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/java/awt/MenuComponent.java	Wed Jul 05 19:53:51 2017 +0200
@@ -132,16 +132,24 @@
     static {
         AWTAccessor.setMenuComponentAccessor(
             new AWTAccessor.MenuComponentAccessor() {
+                @Override
                 public AppContext getAppContext(MenuComponent menuComp) {
                     return menuComp.appContext;
                 }
+                @Override
                 public void setAppContext(MenuComponent menuComp,
                                           AppContext appContext) {
                     menuComp.appContext = appContext;
                 }
+                @Override
                 public MenuContainer getParent(MenuComponent menuComp) {
                     return menuComp.parent;
                 }
+                @Override
+                public void setParent(MenuComponent menuComp, MenuContainer menuContainer) {
+                    menuComp.parent = menuContainer;
+                }
+                @Override
                 public Font getFont_NoClientCode(MenuComponent menuComp) {
                     return menuComp.getFont_NoClientCode();
                 }
--- a/jdk/src/share/classes/java/awt/Polygon.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/java/awt/Polygon.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2014, 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
@@ -351,7 +351,7 @@
     /**
      * Determines whether the specified coordinates are inside this
      * <code>Polygon</code>.
-     * <p>
+     *
      * @param x the specified X coordinate to be tested
      * @param y the specified Y coordinate to be tested
      * @return {@code true} if this {@code Polygon} contains
--- a/jdk/src/share/classes/java/awt/Rectangle.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/java/awt/Rectangle.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2014, 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
@@ -41,14 +41,13 @@
  * <p>
  * <a name="Empty">
  * A {@code Rectangle} whose width or height is exactly zero has location
- * along those axes with zero dimension, but is otherwise considered empty.
+ * along those axes with zero dimension, but is otherwise considered empty.</a>
  * The {@link #isEmpty} method will return true for such a {@code Rectangle}.
  * Methods which test if an empty {@code Rectangle} contains or intersects
  * a point or rectangle will always return false if either dimension is zero.
  * Methods which combine such a {@code Rectangle} with a point or rectangle
  * will include the location of the {@code Rectangle} on that axis in the
  * result as if the {@link #add(Point)} method were being called.
- * </a>
  * <p>
  * <a name="NonExistant">
  * A {@code Rectangle} whose width or height is negative has neither
@@ -422,7 +421,7 @@
      * <code>Rectangle</code> to the specified
      * <code>x</code>, <code>y</code>, <code>width</code>,
      * and <code>height</code>.
-     * <p>
+     *
      * @param x the new X coordinate for the upper-left
      *                    corner of this <code>Rectangle</code>
      * @param y the new Y coordinate for the upper-left
@@ -488,7 +487,7 @@
 
     /**
      * Moves this <code>Rectangle</code> to the specified location.
-     * <p>
+     *
      * @param x the X coordinate of the new location
      * @param y the Y coordinate of the new location
      * @deprecated As of JDK version 1.1,
@@ -629,7 +628,7 @@
     /**
      * Sets the size of this <code>Rectangle</code> to the specified
      * width and height.
-     * <p>
+     *
      * @param width the new width for this <code>Rectangle</code>
      * @param height the new height for this <code>Rectangle</code>
      * @deprecated As of JDK version 1.1,
--- a/jdk/src/share/classes/java/awt/Toolkit.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/java/awt/Toolkit.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1241,10 +1241,9 @@
      * clipboard enables data transfer between Java programs and native
      * applications which use native clipboard facilities.
      * <p>
-     * In addition to any and all formats specified in the flavormap.properties
-     * file, or other file specified by the <code>AWT.DnD.flavorMapFileURL
-     * </code> Toolkit property, text returned by the system Clipboard's <code>
-     * getTransferData()</code> method is available in the following flavors:
+     * In addition to any and all default formats text returned by the system
+     * Clipboard's <code>getTransferData()</code> method is available in the
+     * following flavors:
      * <ul>
      * <li>DataFlavor.stringFlavor</li>
      * <li>DataFlavor.plainTextFlavor (<b>deprecated</b>)</li>
--- a/jdk/src/share/classes/java/awt/color/ColorSpace.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/java/awt/color/ColorSpace.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, 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
@@ -388,7 +388,7 @@
      * convert from CS_CIEXYZ to the output color space.
      * See {@link #toCIEXYZ(float[]) toCIEXYZ} and
      * {@link #fromCIEXYZ(float[]) fromCIEXYZ} for further information.
-     * <p>
+     *
      * @param colorvalue a float array with length of at least the number
      *        of components in this ColorSpace
      * @return a float array of length 3
@@ -412,7 +412,7 @@
      * convert from CS_CIEXYZ to the output color space.
      * See {@link #toCIEXYZ(float[]) toCIEXYZ} and
      * {@link #fromCIEXYZ(float[]) fromCIEXYZ} for further information.
-     * <p>
+     *
      * @param rgbvalue a float array with length of at least 3
      * @return a float array with length equal to the number of
      *         components in this ColorSpace
@@ -439,7 +439,7 @@
      * that would be measured using current CIE recommended practices.
      * See the {@link ICC_ColorSpace#toCIEXYZ(float[]) toCIEXYZ} method of
      * <code>ICC_ColorSpace</code> for further information.
-     * <p>
+     *
      * @param colorvalue a float array with length of at least the number
      *        of components in this ColorSpace
      * @return a float array of length 3
@@ -467,7 +467,7 @@
      * relative values before being passed to this method.
      * See the {@link ICC_ColorSpace#fromCIEXYZ(float[]) fromCIEXYZ} method of
      * <code>ICC_ColorSpace</code> for further information.
-     * <p>
+     *
      * @param colorvalue a float array with length of at least 3
      * @return a float array with length equal to the number of
      *         components in this ColorSpace
--- a/jdk/src/share/classes/java/awt/color/ICC_ColorSpace.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/java/awt/color/ICC_ColorSpace.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, 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
@@ -149,7 +149,7 @@
      * convert from CS_CIEXYZ to the output color space.
      * See {@link #toCIEXYZ(float[]) toCIEXYZ} and
      * {@link #fromCIEXYZ(float[]) fromCIEXYZ} for further information.
-     * <p>
+     *
      * @param colorvalue a float array with length of at least the number
      *      of components in this ColorSpace.
      * @return a float array of length 3.
@@ -201,7 +201,7 @@
      * convert from CS_CIEXYZ to the output color space.
      * See {@link #toCIEXYZ(float[]) toCIEXYZ} and
      * {@link #fromCIEXYZ(float[]) fromCIEXYZ} for further information.
-     * <p>
+     *
      * @param rgbvalue a float array with length of at least 3.
      * @return a float array with length equal to the number of
      *       components in this ColorSpace.
@@ -336,7 +336,7 @@
      * will result in a measured device XYZ value of D65.  This will not
      * be the same as the media white point tag XYZ value in the ICC
      * profile for an sRGB device.
-     * <p>
+     *
      * @param colorvalue a float array with length of at least the number
      *        of components in this ColorSpace.
      * @return a float array of length 3.
@@ -480,7 +480,7 @@
      * will result in a measured device XYZ value of D65.  This will not
      * be the same as the media white point tag XYZ value in the ICC
      * profile for an sRGB device.
-     * <p>
+     *
      * @param colorvalue a float array with length of at least 3.
      * @return a float array with length equal to the number of
      *         components in this ColorSpace.
--- a/jdk/src/share/classes/java/awt/datatransfer/SystemFlavorMap.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/java/awt/datatransfer/SystemFlavorMap.java	Wed Jul 05 19:53:51 2017 +0200
@@ -27,6 +27,8 @@
 
 import java.awt.Toolkit;
 
+import java.io.BufferedInputStream;
+import java.io.InputStream;
 import java.lang.ref.SoftReference;
 
 import java.io.BufferedReader;
@@ -38,6 +40,7 @@
 import java.net.MalformedURLException;
 
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -45,6 +48,7 @@
 import java.util.List;
 import java.util.Map;
 import java.util.Objects;
+import java.util.Properties;
 import java.util.Set;
 
 import sun.awt.AppContext;
@@ -210,193 +214,48 @@
     }
 
     /**
-     * Initializes a SystemFlavorMap by reading flavormap.properties and
-     * AWT.DnD.flavorMapFileURL.
+     * Initializes a SystemFlavorMap by reading flavormap.properties
      * For thread-safety must be called under lock on this.
      */
     private void initSystemFlavorMap() {
         if (isMapInitialized) {
             return;
         }
-
         isMapInitialized = true;
-        BufferedReader flavormapDotProperties =
-            java.security.AccessController.doPrivileged(
-                new java.security.PrivilegedAction<BufferedReader>() {
-                    public BufferedReader run() {
-                        String fileName =
-                            System.getProperty("java.home") +
-                            File.separator +
-                            "lib" +
-                            File.separator +
-                            "flavormap.properties";
-                        try {
-                            return new BufferedReader
-                                (new InputStreamReader
-                                    (new File(fileName).toURI().toURL().openStream(), "ISO-8859-1"));
-                        } catch (MalformedURLException e) {
-                            System.err.println("MalformedURLException:" + e + " while loading default flavormap.properties file:" + fileName);
-                        } catch (IOException e) {
-                            System.err.println("IOException:" + e + " while loading default flavormap.properties file:" + fileName);
-                        }
-                        return null;
-                    }
-                });
 
-        String url =
-            java.security.AccessController.doPrivileged(
-                new java.security.PrivilegedAction<String>() {
-                    public String run() {
-                        return Toolkit.getProperty("AWT.DnD.flavorMapFileURL", null);
-                    }
-                });
-
-        if (flavormapDotProperties != null) {
-            try {
-                parseAndStoreReader(flavormapDotProperties);
-            } catch (IOException e) {
-                System.err.println("IOException:" + e + " while parsing default flavormap.properties file");
-            }
-        }
-
-        BufferedReader flavormapURL = null;
-        if (url != null) {
-            try {
-                flavormapURL = new BufferedReader(new InputStreamReader(new URL(url).openStream(), "ISO-8859-1"));
-            } catch (MalformedURLException e) {
-                System.err.println("MalformedURLException:" + e + " while reading AWT.DnD.flavorMapFileURL:" + url);
-            } catch (IOException e) {
-                System.err.println("IOException:" + e + " while reading AWT.DnD.flavorMapFileURL:" + url);
-            } catch (SecurityException e) {
-                // ignored
-            }
+        InputStream is = SystemFlavorMap.class.getResourceAsStream("/sun/awt/datatransfer/flavormap.properties");
+        if (is == null) {
+            throw new InternalError("Default flavor mapping not found");
         }
 
-        if (flavormapURL != null) {
-            try {
-                parseAndStoreReader(flavormapURL);
-            } catch (IOException e) {
-                System.err.println("IOException:" + e + " while parsing AWT.DnD.flavorMapFileURL");
-            }
-        }
-    }
-    /**
-     * Copied code from java.util.Properties. Parsing the data ourselves is the
-     * only way to handle duplicate keys and values.
-     */
-    private void parseAndStoreReader(BufferedReader in) throws IOException {
-        while (true) {
-            // Get next line
-            String line = in.readLine();
-            if (line == null) {
-                return;
-            }
-
-            if (line.length() > 0) {
-                // Continue lines that end in slashes if they are not comments
-                char firstChar = line.charAt(0);
-                if (firstChar != '#' && firstChar != '!') {
-                    while (continueLine(line)) {
-                        String nextLine = in.readLine();
-                        if (nextLine == null) {
-                            nextLine = "";
-                        }
-                        String loppedLine =
-                            line.substring(0, line.length() - 1);
-                        // Advance beyond whitespace on new line
-                        int startIndex = 0;
-                        for(; startIndex < nextLine.length(); startIndex++) {
-                            if (whiteSpaceChars.
-                                    indexOf(nextLine.charAt(startIndex)) == -1)
-                            {
-                                break;
-                            }
-                        }
-                        nextLine = nextLine.substring(startIndex,
-                                                      nextLine.length());
-                        line = loppedLine+nextLine;
-                    }
-
-                    // Find start of key
-                    int len = line.length();
-                    int keyStart = 0;
-                    for(; keyStart < len; keyStart++) {
-                        if(whiteSpaceChars.
-                               indexOf(line.charAt(keyStart)) == -1) {
-                            break;
-                        }
-                    }
-
-                    // Blank lines are ignored
-                    if (keyStart == len) {
-                        continue;
-                    }
-
-                    // Find separation between key and value
-                    int separatorIndex = keyStart;
-                    for(; separatorIndex < len; separatorIndex++) {
-                        char currentChar = line.charAt(separatorIndex);
-                        if (currentChar == '\\') {
-                            separatorIndex++;
-                        } else if (keyValueSeparators.
-                                       indexOf(currentChar) != -1) {
-                            break;
-                        }
-                    }
-
-                    // Skip over whitespace after key if any
-                    int valueIndex = separatorIndex;
-                    for (; valueIndex < len; valueIndex++) {
-                        if (whiteSpaceChars.
-                                indexOf(line.charAt(valueIndex)) == -1) {
-                            break;
-                        }
-                    }
-
-                    // Skip over one non whitespace key value separators if any
-                    if (valueIndex < len) {
-                        if (strictKeyValueSeparators.
-                                indexOf(line.charAt(valueIndex)) != -1) {
-                            valueIndex++;
-                        }
-                    }
-
-                    // Skip over white space after other separators if any
-                    while (valueIndex < len) {
-                        if (whiteSpaceChars.
-                                indexOf(line.charAt(valueIndex)) == -1) {
-                            break;
-                        }
-                        valueIndex++;
-                    }
-
-                    String key = line.substring(keyStart, separatorIndex);
-                    String value = (separatorIndex < len)
-                        ? line.substring(valueIndex, len)
-                        : "";
-
-                    // Convert then store key and value
-                    key = loadConvert(key);
-                    value = loadConvert(value);
-
+        try (InputStreamReader isr = new InputStreamReader(is);
+             BufferedReader reader = new BufferedReader(isr)) {
+            String line;
+            while ((line = reader.readLine()) != null) {
+                line = line.trim();
+                if (line.startsWith("#") || line.isEmpty()) continue;
+                while (line.endsWith("\\")) {
+                    line = line.substring(0, line.length() - 1) + reader.readLine().trim();
+                }
+                int delimiterPosition = line.indexOf('=');
+                String key = line.substring(0, delimiterPosition).replace("\\ ", " ");
+                String[] values = line.substring(delimiterPosition + 1, line.length()).split(",");
+                for (String value : values) {
                     try {
                         MimeType mime = new MimeType(value);
                         if ("text".equals(mime.getPrimaryType())) {
                             String charset = mime.getParameter("charset");
-                            if (DataTransferer.doesSubtypeSupportCharset
-                                    (mime.getSubType(), charset))
+                            if (DataTransferer.doesSubtypeSupportCharset(mime.getSubType(), charset))
                             {
                                 // We need to store the charset and eoln
                                 // parameters, if any, so that the
                                 // DataTransferer will have this information
                                 // for conversion into the native format.
-                                DataTransferer transferer =
-                                    DataTransferer.getInstance();
+                                DataTransferer transferer = DataTransferer.getInstance();
                                 if (transferer != null) {
-                                    transferer.registerTextFlavorProperties
-                                        (key, charset,
-                                         mime.getParameter("eoln"),
-                                         mime.getParameter("terminators"));
+                                    transferer.registerTextFlavorProperties(key, charset,
+                                            mime.getParameter("eoln"),
+                                            mime.getParameter("terminators"));
                                 }
                             }
 
@@ -441,78 +300,9 @@
                     }
                 }
             }
-        }
-    }
-
-    /**
-     * Copied from java.util.Properties.
-     */
-    private boolean continueLine (String line) {
-        int slashCount = 0;
-        int index = line.length() - 1;
-        while((index >= 0) && (line.charAt(index--) == '\\')) {
-            slashCount++;
+        } catch (IOException e) {
+            throw new InternalError("Error reading default flavor mapping", e);
         }
-        return (slashCount % 2 == 1);
-    }
-
-    /**
-     * Copied from java.util.Properties.
-     */
-    private String loadConvert(String theString) {
-        char aChar;
-        int len = theString.length();
-        StringBuilder outBuffer = new StringBuilder(len);
-
-        for (int x = 0; x < len; ) {
-            aChar = theString.charAt(x++);
-            if (aChar == '\\') {
-                aChar = theString.charAt(x++);
-                if (aChar == 'u') {
-                    // Read the xxxx
-                    int value = 0;
-                    for (int i = 0; i < 4; i++) {
-                        aChar = theString.charAt(x++);
-                        switch (aChar) {
-                          case '0': case '1': case '2': case '3': case '4':
-                          case '5': case '6': case '7': case '8': case '9': {
-                             value = (value << 4) + aChar - '0';
-                             break;
-                          }
-                          case 'a': case 'b': case 'c':
-                          case 'd': case 'e': case 'f': {
-                             value = (value << 4) + 10 + aChar - 'a';
-                             break;
-                          }
-                          case 'A': case 'B': case 'C':
-                          case 'D': case 'E': case 'F': {
-                             value = (value << 4) + 10 + aChar - 'A';
-                             break;
-                          }
-                          default: {
-                              throw new IllegalArgumentException(
-                                           "Malformed \\uxxxx encoding.");
-                          }
-                        }
-                    }
-                    outBuffer.append((char)value);
-                } else {
-                    if (aChar == 't') {
-                        aChar = '\t';
-                    } else if (aChar == 'r') {
-                        aChar = '\r';
-                    } else if (aChar == 'n') {
-                        aChar = '\n';
-                    } else if (aChar == 'f') {
-                        aChar = '\f';
-                    }
-                    outBuffer.append(aChar);
-                }
-            } else {
-                outBuffer.append(aChar);
-            }
-        }
-        return outBuffer.toString();
     }
 
     /**
--- a/jdk/src/share/classes/java/awt/font/TextAttribute.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/java/awt/font/TextAttribute.java	Wed Jul 05 19:53:51 2017 +0200
@@ -96,7 +96,7 @@
  * </UL>
  *
  * <h4>Summary of attributes</h4>
- * <table style="float:center" border="0" cellspacing="0" cellpadding="2" width="%95"
+ * <table style="float:center" border="0" cellspacing="0" cellpadding="2" width="95%"
  *     summary="Key, value type, principal constants, and default value
  *     behavior of all TextAttributes">
  * <tr style="background-color:#ccccff">
--- a/jdk/src/share/classes/java/awt/geom/Arc2D.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/java/awt/geom/Arc2D.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, 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
@@ -35,8 +35,8 @@
  * <p>
  * <a name="inscribes">
  * The arc is a partial section of a full ellipse which
- * inscribes the framing rectangle of its parent {@link RectangularShape}.
- * </a>
+ * inscribes the framing rectangle of its parent</a> {@link RectangularShape}.
+ *
  * <a name="angles">
  * The angles are specified relative to the non-square
  * framing rectangle such that 45 degrees always falls on the line from
--- a/jdk/src/share/classes/java/awt/image/AffineTransformOp.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/java/awt/image/AffineTransformOp.java	Wed Jul 05 19:53:51 2017 +0200
@@ -324,7 +324,7 @@
      * this part of the rectangle is not drawn.  If the coordinates
      * of the rectangle are positive then the filtered image is drawn at
      * that position in the destination <code>Raster</code>.
-     * <p>
+     *
      * @param src The <CODE>Raster</CODE> to transform.
      * @param dst The <CODE>Raster</CODE> in which to store the results of the
      * transformation.
--- a/jdk/src/share/classes/java/awt/image/BufferedImageFilter.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/java/awt/image/BufferedImageFilter.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2000, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, 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
@@ -85,7 +85,7 @@
      * an image should avoid calling this method directly since that
      * operation could result in problems with retrieving the requested
      * pixels.
-     * <p>
+     *
      * @param width the width to which to set the width of this
      *        <code>BufferedImageFilter</code>
      * @param height the height to which to set the height of this
--- a/jdk/src/share/classes/java/awt/image/ImageFilter.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/java/awt/image/ImageFilter.java	Wed Jul 05 19:53:51 2017 +0200
@@ -225,7 +225,7 @@
      *
      * <li>
      * Override the method to simply send the data.
-     * This is appropriate if the filter can handle the request itself &#151;
+     * This is appropriate if the filter can handle the request itself &#8212;
      * for example,
      * if the generated pixels have been saved in some sort of buffer.
      *
--- a/jdk/src/share/classes/java/awt/image/WritableRaster.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/java/awt/image/WritableRaster.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, 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
@@ -394,7 +394,7 @@
      * is first converted to a 32-bit int (if necessary), using the above
      * rules for integral types, and then the int is cast to float or
      * double.
-     * <p>
+     *
      * @param srcRaster  The  Raster from which to copy pixels.
      *
      * @throws NullPointerException if srcRaster is null.
--- a/jdk/src/share/classes/java/awt/image/renderable/ParameterBlock.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/java/awt/image/renderable/ParameterBlock.java	Wed Jul 05 19:53:51 2017 +0200
@@ -370,7 +370,7 @@
      *         the specified parameter.
      */
     public ParameterBlock add(int i) {
-        return add(new Integer(i));
+        return add(i);
     }
 
     /**
@@ -489,7 +489,7 @@
      *        the specified parameter.
      */
     public ParameterBlock set(int i, int index) {
-        return set(new Integer(i), index);
+        return set(i, index);
     }
 
     /**
--- a/jdk/src/share/classes/java/awt/print/PrinterJob.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/java/awt/print/PrinterJob.java	Wed Jul 05 19:53:51 2017 +0200
@@ -546,7 +546,6 @@
      * user settings returned from
      * <code>printDialog(PrintRequestAttributeSet attributes</code> to
      * this print() method.
-     * <p>
      *
      * @param attributes a set of attributes for the job
      * @exception PrinterException an error in the print system
--- a/jdk/src/share/classes/java/beans/EventHandler.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/java/beans/EventHandler.java	Wed Jul 05 19:53:51 2017 +0200
@@ -437,7 +437,7 @@
         if (method.getDeclaringClass() == Object.class)  {
             // Handle the Object public methods.
             if (methodName.equals("hashCode"))  {
-                return new Integer(System.identityHashCode(proxy));
+                return System.identityHashCode(proxy);
             } else if (methodName.equals("equals")) {
                 return (proxy == arguments[0] ? Boolean.TRUE : Boolean.FALSE);
             } else if (methodName.equals("toString")) {
--- a/jdk/src/share/classes/java/beans/MetaData.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/java/beans/MetaData.java	Wed Jul 05 19:53:51 2017 +0200
@@ -123,13 +123,13 @@
         Class<?> oldClass = oldInstance.getClass();
         return new Expression(oldInstance, Array.class, "newInstance",
                    new Object[]{oldClass.getComponentType(),
-                                new Integer(Array.getLength(oldInstance))});
+                                Array.getLength(oldInstance)});
         }
 
     protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder out) {
         int n = Array.getLength(oldInstance);
         for (int i = 0; i < n; i++) {
-            Object index = new Integer(i);
+            Object index = i;
             // Expression oldGetExp = new Expression(Array.class, "get", new Object[]{oldInstance, index});
             // Expression newGetExp = new Expression(Array.class, "get", new Object[]{newInstance, index});
             Expression oldGetExp = new Expression(oldInstance, "get", new Object[]{index});
@@ -635,7 +635,7 @@
             newSize = 0;
         }
         for (int i = 0; i < newSize; i++) {
-            Object index = new Integer(i);
+            Object index = i;
 
             Expression oldGetExp = new Expression(oldInstance, "get", new Object[]{index});
             Expression newGetExp = new Expression(newInstance, "get", new Object[]{index});
@@ -892,7 +892,7 @@
     protected Expression instantiate(Object oldInstance, Encoder out) {
         java.awt.MenuShortcut m = (java.awt.MenuShortcut)oldInstance;
         return new Expression(oldInstance, m.getClass(), "new",
-                   new Object[]{new Integer(m.getKey()), Boolean.valueOf(m.usesShiftModifier())});
+                   new Object[]{m.getKey(), Boolean.valueOf(m.usesShiftModifier())});
     }
 }
 
--- a/jdk/src/share/classes/java/beans/NameGenerator.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/java/beans/NameGenerator.java	Wed Jul 05 19:53:51 2017 +0200
@@ -107,7 +107,7 @@
 
             Integer size = nameToCount.get(className);
             int instanceNumber = (size == null) ? 0 : (size).intValue() + 1;
-            nameToCount.put(className, new Integer(instanceNumber));
+            nameToCount.put(className, instanceNumber);
 
             result = className + instanceNumber;
             valueToName.put(instance, result);
--- a/jdk/src/share/classes/java/lang/reflect/Modifier.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/java/lang/reflect/Modifier.java	Wed Jul 05 19:53:51 2017 +0200
@@ -26,6 +26,7 @@
 package java.lang.reflect;
 
 import java.security.AccessController;
+import java.util.StringJoiner;
 import sun.reflect.LangReflectAccess;
 import sun.reflect.ReflectionFactory;
 
@@ -232,27 +233,24 @@
      * represented by {@code mod}
      */
     public static String toString(int mod) {
-        StringBuilder sb = new StringBuilder();
-        int len;
+        StringJoiner sj = new StringJoiner(" ");
 
-        if ((mod & PUBLIC) != 0)        sb.append("public ");
-        if ((mod & PROTECTED) != 0)     sb.append("protected ");
-        if ((mod & PRIVATE) != 0)       sb.append("private ");
+        if ((mod & PUBLIC) != 0)        sj.add("public");
+        if ((mod & PROTECTED) != 0)     sj.add("protected");
+        if ((mod & PRIVATE) != 0)       sj.add("private");
 
         /* Canonical order */
-        if ((mod & ABSTRACT) != 0)      sb.append("abstract ");
-        if ((mod & STATIC) != 0)        sb.append("static ");
-        if ((mod & FINAL) != 0)         sb.append("final ");
-        if ((mod & TRANSIENT) != 0)     sb.append("transient ");
-        if ((mod & VOLATILE) != 0)      sb.append("volatile ");
-        if ((mod & SYNCHRONIZED) != 0)  sb.append("synchronized ");
-        if ((mod & NATIVE) != 0)        sb.append("native ");
-        if ((mod & STRICT) != 0)        sb.append("strictfp ");
-        if ((mod & INTERFACE) != 0)     sb.append("interface ");
+        if ((mod & ABSTRACT) != 0)      sj.add("abstract");
+        if ((mod & STATIC) != 0)        sj.add("static");
+        if ((mod & FINAL) != 0)         sj.add("final");
+        if ((mod & TRANSIENT) != 0)     sj.add("transient");
+        if ((mod & VOLATILE) != 0)      sj.add("volatile");
+        if ((mod & SYNCHRONIZED) != 0)  sj.add("synchronized");
+        if ((mod & NATIVE) != 0)        sj.add("native");
+        if ((mod & STRICT) != 0)        sj.add("strictfp");
+        if ((mod & INTERFACE) != 0)     sj.add("interface");
 
-        if ((len = sb.length()) > 0)    /* trim trailing space */
-            return sb.toString().substring(0, len-1);
-        return "";
+        return sj.toString();
     }
 
     /*
--- a/jdk/src/share/classes/java/time/chrono/JapaneseEra.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/java/time/chrono/JapaneseEra.java	Wed Jul 05 19:53:51 2017 +0200
@@ -127,7 +127,7 @@
 
     // the number of defined JapaneseEra constants.
     // There could be an extra era defined in its configuration.
-    private static final int N_ERA_CONSTANTS = HEISEI.getValue() + ERA_OFFSET + 1;
+    private static final int N_ERA_CONSTANTS = HEISEI.getValue() + ERA_OFFSET;
 
     /**
      * Serialization version.
@@ -148,7 +148,7 @@
         for (int i = N_ERA_CONSTANTS; i < ERA_CONFIG.length; i++) {
             CalendarDate date = ERA_CONFIG[i].getSinceDate();
             LocalDate isoDate = LocalDate.of(date.getYear(), date.getMonth(), date.getDayOfMonth());
-            KNOWN_ERAS[i] = new JapaneseEra(i - ERA_OFFSET, isoDate);
+            KNOWN_ERAS[i] = new JapaneseEra(i - ERA_OFFSET + 1, isoDate);
         }
     };
 
@@ -195,7 +195,7 @@
      * @throws DateTimeException if the value is invalid
      */
     public static JapaneseEra of(int japaneseEra) {
-        if (japaneseEra < MEIJI.eraValue || japaneseEra + ERA_OFFSET - 1 >= KNOWN_ERAS.length) {
+        if (japaneseEra < MEIJI.eraValue || japaneseEra + ERA_OFFSET > KNOWN_ERAS.length) {
             throw new DateTimeException("Invalid era: " + japaneseEra);
         }
         return KNOWN_ERAS[ordinal(japaneseEra)];
--- a/jdk/src/share/classes/java/util/Collections.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/java/util/Collections.java	Wed Jul 05 19:53:51 2017 +0200
@@ -2342,7 +2342,7 @@
 
         public NavigableSet<E> tailSet(E fromElement, boolean inclusive) {
             synchronized (mutex) {
-                return new SynchronizedNavigableSet<>(ns.tailSet(fromElement, inclusive));
+                return new SynchronizedNavigableSet<>(ns.tailSet(fromElement, inclusive), mutex);
             }
         }
     }
@@ -3486,6 +3486,7 @@
          */
         @Override
         public void replaceAll(UnaryOperator<E> operator) {
+            Objects.requireNonNull(operator);
             list.replaceAll(e -> typeCheck(operator.apply(e)));
         }
 
--- a/jdk/src/share/classes/java/util/DoubleSummaryStatistics.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/java/util/DoubleSummaryStatistics.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2014, 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
@@ -129,9 +129,6 @@
      * Returns the sum of values recorded, or zero if no values have been
      * recorded.
      *
-     * If any recorded value is a NaN or the sum is at any point a NaN
-     * then the sum will be NaN.
-     *
      * <p> The value of a floating-point sum is a function both of the
      * input values as well as the order of addition operations. The
      * order of addition operations of this method is intentionally
@@ -143,6 +140,44 @@
      * numerical sum compared to a simple summation of {@code double}
      * values.
      *
+     * Because of the unspecified order of operations and the
+     * possibility of using differing summation schemes, the output of
+     * this method may vary on the same input values.
+     *
+     * <p>Various conditions can result in a non-finite sum being
+     * computed. This can occur even if the all the recorded values
+     * being summed are finite. If any recorded value is non-finite,
+     * the sum will be non-finite:
+     *
+     * <ul>
+     *
+     * <li>If any recorded value is a NaN, then the final sum will be
+     * NaN.
+     *
+     * <li>If the recorded values contain one or more infinities, the
+     * sum will be infinite or NaN.
+     *
+     * <ul>
+     *
+     * <li>If the recorded values contain infinities of opposite sign,
+     * the sum will be NaN.
+     *
+     * <li>If the recorded values contain infinities of one sign and
+     * an intermediate sum overflows to an infinity of the opposite
+     * sign, the sum may be NaN.
+     *
+     * </ul>
+     *
+     * </ul>
+     *
+     * It is possible for intermediate sums of finite values to
+     * overflow into opposite-signed infinities; if that occurs, the
+     * final sum will be NaN even if the recorded values are all
+     * finite.
+     *
+     * If all the recorded values are zero, the sign of zero is
+     * <em>not</em> guaranteed to be preserved in the final sum.
+     *
      * @apiNote Values sorted by increasing absolute magnitude tend to yield
      * more accurate results.
      *
@@ -193,15 +228,9 @@
      * Returns the arithmetic mean of values recorded, or zero if no
      * values have been recorded.
      *
-     * If any recorded value is a NaN or the sum is at any point a NaN
-     * then the average will be code NaN.
-     *
-     * <p>The average returned can vary depending upon the order in
-     * which values are recorded.
-     *
-     * This method may be implemented using compensated summation or
-     * other technique to reduce the error bound in the {@link #getSum
-     * numerical sum} used to compute the average.
+     * <p> The computed average can vary numerically and have the
+     * special case behavior as computing the sum; see {@link #getSum}
+     * for details.
      *
      * @apiNote Values sorted by increasing absolute magnitude tend to yield
      * more accurate results.
--- a/jdk/src/share/classes/java/util/stream/DoubleStream.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/java/util/stream/DoubleStream.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2014, 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
@@ -470,10 +470,7 @@
      * code is not necessarily equivalent to the summation computation
      * done by this method.
      *
-     * <p>If any stream element is a NaN or the sum is at any point a NaN
-     * then the sum will be NaN.
-     *
-     * The value of a floating-point sum is a function both
+     * <p>The value of a floating-point sum is a function both
      * of the input values as well as the order of addition
      * operations. The order of addition operations of this method is
      * intentionally not defined to allow for implementation
@@ -485,6 +482,44 @@
      * numerical sum compared to a simple summation of {@code double}
      * values.
      *
+     * Because of the unspecified order of operations and the
+     * possibility of using differing summation schemes, the output of
+     * this method may vary on the same input elements.
+     *
+     * <p>Various conditions can result in a non-finite sum being
+     * computed. This can occur even if the all the elements
+     * being summed are finite. If any element is non-finite,
+     * the sum will be non-finite:
+     *
+     * <ul>
+     *
+     * <li>If any element is a NaN, then the final sum will be
+     * NaN.
+     *
+     * <li>If the elements contain one or more infinities, the
+     * sum will be infinite or NaN.
+     *
+     * <ul>
+     *
+     * <li>If the elements contain infinities of opposite sign,
+     * the sum will be NaN.
+     *
+     * <li>If the elements contain infinities of one sign and
+     * an intermediate sum overflows to an infinity of the opposite
+     * sign, the sum may be NaN.
+     *
+     * </ul>
+     *
+     * </ul>
+     *
+     * It is possible for intermediate sums of finite values to
+     * overflow into opposite-signed infinities; if that occurs, the
+     * final sum will be NaN even if the elements are all
+     * finite.
+     *
+     * If all the elements are zero, the sign of zero is
+     * <em>not</em> guaranteed to be preserved in the final sum.
+     *
      * <p>This is a <a href="package-summary.html#StreamOps">terminal
      * operation</a>.
      *
@@ -555,15 +590,9 @@
      * mean of elements of this stream, or an empty optional if this
      * stream is empty.
      *
-     * If any recorded value is a NaN or the sum is at any point a NaN
-     * then the average will be NaN.
-     *
-     * <p>The average returned can vary depending upon the order in
-     * which values are recorded.
-     *
-     * This method may be implemented using compensated summation or
-     * other technique to reduce the error bound in the {@link #sum
-     * numerical sum} used to compute the average.
+     * <p>The computed average can vary numerically and have the
+     * special case behavior as computing the sum; see {@link #sum}
+     * for details.
      *
      *  <p>The average is a special case of a <a
      *  href="package-summary.html#Reduction">reduction</a>.
--- a/jdk/src/share/classes/javax/imageio/package.html	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/imageio/package.html	Wed Jul 05 19:53:51 2017 +0200
@@ -131,8 +131,8 @@
 <li>the number of bands is 1;
 <li>the number of bits per sample is not greater than 8;
 <li>the size of a color component is not greater than 8;
-</ul> </p>
- 
+</ul>
+
 <p>
  By default the GIF writer plug-in creates version "89a" images. This can be
  changed to "87a" by explicitly setting the version in the
--- a/jdk/src/share/classes/javax/imageio/spi/PartiallyOrderedSet.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/imageio/spi/PartiallyOrderedSet.java	Wed Jul 05 19:53:51 2017 +0200
@@ -170,7 +170,7 @@
         while (iter.hasNext()) {
             DigraphNode<E> node = iter.next();
             int inDegree = node.getInDegree();
-            inDegrees.put(node, new Integer(inDegree));
+            inDegrees.put(node, inDegree);
 
             // Add nodes with zero in-degree to the zero list
             if (inDegree == 0) {
@@ -191,7 +191,7 @@
         while (outNodes.hasNext()) {
             DigraphNode<E> node = outNodes.next();
             int inDegree = inDegrees.get(node).intValue() - 1;
-            inDegrees.put(node, new Integer(inDegree));
+            inDegrees.put(node, inDegree);
 
             // If the in-degree has fallen to 0, place the node on the list
             if (inDegree == 0) {
--- a/jdk/src/share/classes/javax/naming/Context.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/naming/Context.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, 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
@@ -203,9 +203,7 @@
  * <h2>Application Resource Files</h2>
  *
  * When an application is deployed, it will generally have several
- * codebase directories and JARs in its classpath.  Similarly, when an
- * applet is deployed, it will have a codebase and archives specifying
- * where to find the applet's classes.  JNDI locates (using
+ * codebase directories and JARs in its classpath. JNDI locates (using
  * {@link ClassLoader#getResources <tt>ClassLoader.getResources()</tt>})
  * all <em>application resource files</em> named <tt>jndi.properties</tt>
  * in the classpath.
@@ -236,7 +234,7 @@
  *
  * When JNDI constructs an initial context, the context's environment
  * is initialized with properties defined in the environment parameter
- * passed to the constructor, the system properties, the applet parameters,
+ * passed to the constructor, the system properties,
  * and the application resource files.  See
  * <a href=InitialContext.html#ENVIRONMENT><tt>InitialContext</tt></a>
  * for details.
@@ -268,8 +266,8 @@
  * <p>
  * In this way, each service provider developer can specify a list of
  * factories to use with that service provider. These can be modified by
- * the application resources specified by the deployer of the application
- * or applet, which in turn can be modified by the user.
+ * the application resources specified by the deployer of the application,
+ * which in turn can be modified by the user.
  *
  * @author Rosanna Lee
  * @author Scott Seligman
@@ -822,7 +820,7 @@
      * of the property should be the fully qualified class name
      * of the factory class that will create an initial context.
      * This property may be specified in the environment parameter
-     * passed to the initial context constructor, an applet parameter,
+     * passed to the initial context constructor,
      * a system property, or an application resource file.
      * If it is not specified in any of these sources,
      * <tt>NoInitialContextException</tt> is thrown when an initial
@@ -837,7 +835,6 @@
      * @see NoInitialContextException
      * @see #addToEnvironment(String, Object)
      * @see #removeFromEnvironment(String)
-     * @see #APPLET
      */
     String INITIAL_CONTEXT_FACTORY = "java.naming.factory.initial";
 
@@ -847,8 +844,8 @@
      * of the property should be a colon-separated list of the fully
      * qualified class names of factory classes that will create an object
      * given information about the object.
-     * This property may be specified in the environment, an applet
-     * parameter, a system property, or one or more resource files.
+     * This property may be specified in the environment, a system property,
+     * or one or more resource files.
      *
      * <p> The value of this constant is "java.naming.factory.object".
      *
@@ -856,7 +853,6 @@
      * @see javax.naming.spi.ObjectFactory
      * @see #addToEnvironment(String, Object)
      * @see #removeFromEnvironment(String)
-     * @see #APPLET
      */
     String OBJECT_FACTORIES = "java.naming.factory.object";
 
@@ -866,8 +862,8 @@
      * of the property should be a colon-separated list of the fully
      * qualified class names of state factory classes that will be used
      * to get an object's state given the object itself.
-     * This property may be specified in the environment, an applet
-     * parameter, a system property, or one or more resource files.
+     * This property may be specified in the environment, a system property,
+     * or one or more resource files.
      *
      * <p> The value of this constant is "java.naming.factory.state".
      *
@@ -875,7 +871,6 @@
      * @see javax.naming.spi.StateFactory
      * @see #addToEnvironment(String, Object)
      * @see #removeFromEnvironment(String)
-     * @see #APPLET
      * @since 1.3
      */
     String STATE_FACTORIES = "java.naming.factory.state";
@@ -887,9 +882,8 @@
      * of the property should be a colon-separated list of package
      * prefixes for the class name of the factory class that will create
      * a URL context factory.
-     * This property may be specified in the environment,
-     * an applet parameter, a system property, or one or more
-     * resource files.
+     * This property may be specified in the environment, a system property,
+     * or one or more resource files.
      * The prefix <tt>com.sun.jndi.url</tt> is always appended to
      * the possibly empty list of package prefixes.
      *
@@ -900,8 +894,7 @@
      * @see javax.naming.spi.ObjectFactory
      * @see #addToEnvironment(String, Object)
      * @see #removeFromEnvironment(String)
-     * @see #APPLET
-      */
+     */
     String URL_PKG_PREFIXES = "java.naming.factory.url.pkgs";
 
     /**
@@ -909,8 +902,8 @@
      * for specifying configuration information for the service provider
      * to use. The value of the property should contain a URL string
      * (e.g. "ldap://somehost:389").
-     * This property may be specified in the environment,
-     * an applet parameter, a system property, or a resource file.
+     * This property may be specified in the environment, a system property,
+     * or a resource file.
      * If it is not specified in any of these sources,
      * the default configuration is determined by the service provider.
      *
@@ -918,7 +911,6 @@
      *
      * @see #addToEnvironment(String, Object)
      * @see #removeFromEnvironment(String)
-     * @see #APPLET
      */
     String PROVIDER_URL = "java.naming.provider.url";
 
@@ -926,8 +918,8 @@
      * Constant that holds the name of the environment property
      * for specifying the DNS host and domain names to use for the
      * JNDI URL context (for example, "dns://somehost/wiz.com").
-     * This property may be specified in the environment,
-     * an applet parameter, a system property, or a resource file.
+     * This property may be specified in the environment, a system property,
+     * or a resource file.
      * If it is not specified in any of these sources
      * and the program attempts to use a JNDI URL containing a DNS name,
      * a <tt>ConfigurationException</tt> will be thrown.
@@ -1073,27 +1065,25 @@
     String LANGUAGE = "java.naming.language";
 
     /**
-     * Constant that holds the name of the environment property for
-     * specifying an applet for the initial context constructor to use
-     * when searching for other properties.
-     * The value of this property is the
-     * <tt>java.applet.Applet</tt> instance that is being executed.
-     * This property may be specified in the environment parameter
-     * passed to the initial context constructor.
-     * When this property is set, each property that the initial context
-     * constructor looks for in the system properties is first looked for
-     * in the applet's parameter list.
-     * If this property is unspecified, the initial context constructor
-     * will search for properties only in the environment parameter
-     * passed to it, the system properties, and application resource files.
+     * @deprecated An environment property with this name is ignored
+     *             while constructing an initial context.
+     * This constant was originally used as a property name to specify an
+     * {@code Applet} to retrieve parameters from, when creating an initial
+     * context. Currently any applet properties that need to be passed to an
+     * initial context should be copied into the environment hashtable:
+     * <pre>{@code
+     *     Hashtable env = new Hashtable();
+     *     env.put(Context.INITIAL_CONTEXT_FACTORY,
+     *       ((Applet) this).getParameter(Context.INITIAL_CONTEXT_FACTORY));
+     *     env.put(Context.PROVIDER_URL,
+     *       ((Applet) this).getParameter(Context.PROVIDER_URL));
+     *     // ... other properties ...
      *
-     * <p> The value of this constant is "java.naming.applet".
-     *
-     * @see #addToEnvironment(String, Object)
-     * @see #removeFromEnvironment(String)
-     * @see InitialContext
+     *     Context ctx = new InitialContext(env);
+     * }</pre>
      *
      * @since 1.3
      */
+    @Deprecated
     String APPLET = "java.naming.applet";
 };
--- a/jdk/src/share/classes/javax/naming/InitialContext.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/naming/InitialContext.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, 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
@@ -41,21 +41,13 @@
  * is initialized with properties defined in the environment parameter
  * passed to the constructor, and in any
  * <a href=Context.html#RESOURCEFILES>application resource files</a>.
- * In addition, a small number of standard JNDI properties may
- * be specified as system properties or as applet parameters
- * (through the use of {@link Context#APPLET}).
- * These special properties are listed in the field detail sections of the
- * <a href=Context.html#field_detail><tt>Context</tt></a> and
- * <a href=ldap/LdapContext.html#field_detail><tt>LdapContext</tt></a>
- * interface documentation.
  *<p>
  * JNDI determines each property's value by merging
  * the values from the following two sources, in order:
  * <ol>
  * <li>
  * The first occurrence of the property from the constructor's
- * environment parameter and (for appropriate properties) the applet
- * parameters and system properties.
+ * environment parameter and system properties.
  * <li>
  * The application resource files (<tt>jndi.properties</tt>).
  * </ol>
--- a/jdk/src/share/classes/javax/naming/directory/DirContext.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/naming/directory/DirContext.java	Wed Jul 05 19:53:51 2017 +0200
@@ -723,7 +723,7 @@
      * specified set of attributes.
      * This method returns all the attributes of such objects.
      * It is equivalent to supplying null as
-     * the <tt>atributesToReturn</tt> parameter to the method
+     * the <tt>attributesToReturn</tt> parameter to the method
      * <code>search(Name, Attributes, String[])</code>.
      * <br>
      * See {@link #search(Name, Attributes, String[])} for a full description.
--- a/jdk/src/share/classes/javax/naming/ldap/LdapContext.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/naming/ldap/LdapContext.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, 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
@@ -334,8 +334,8 @@
      * qualified class names of factory classes that will create a control
      * given another control. See
      * <tt>ControlFactory.getControlInstance()</tt> for details.
-     * This property may be specified in the environment, an applet
-     * parameter, a system property, or one or more resource files.
+     * This property may be specified in the environment, a system property,
+     * or one or more resource files.
      *<p>
      * The value of this constant is "java.naming.factory.control".
      *
--- a/jdk/src/share/classes/javax/naming/ldap/Rdn.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/naming/ldap/Rdn.java	Wed Jul 05 19:53:51 2017 +0200
@@ -421,7 +421,7 @@
         private String type;
         private Object value;
 
-        // If non-null, a cannonical representation of the value suitable
+        // If non-null, a canonical representation of the value suitable
         // for comparison using String.compareTo()
         private String comparable = null;
 
@@ -571,10 +571,10 @@
     }
 
     /**
-     * Given an attribute value string formated according to the rules
+     * Given an attribute value string formatted according to the rules
      * specified in
      * <a href="http://www.ietf.org/rfc/rfc2253.txt">RFC 2253</a>,
-     * returns the unformated value.  Escapes and quotes are
+     * returns the unformatted value.  Escapes and quotes are
      * stripped away, and hex-encoded UTF-8 is converted to equivalent
      * UTF-16 characters. Returns a string value as a String, and a
      * binary value as a byte array.
--- a/jdk/src/share/classes/javax/naming/ldap/SortControl.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/naming/ldap/SortControl.java	Wed Jul 05 19:53:51 2017 +0200
@@ -188,7 +188,7 @@
     /*
      * Encodes the sort control's value using ASN.1 BER.
      * The result includes the BER tag and length for the control's value but
-     * does not include the control's object identifer and criticality setting.
+     * does not include the control's object identifier and criticality setting.
      *
      * @param   sortKeys    A non-null list of keys to sort by.
      * @return A possibly null byte array representing the ASN.1 BER encoded
--- a/jdk/src/share/classes/javax/naming/spi/NamingManager.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/naming/spi/NamingManager.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, 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
@@ -491,7 +491,7 @@
      * (e.g. "ftpURLContextFactory" for the "ftp" scheme-id),
      * in the package specified as follows.
      * The <tt>Context.URL_PKG_PREFIXES</tt> environment property (which
-     * may contain values taken from applet parameters, system properties,
+     * may contain values taken from system properties,
      * or application resource files)
      * contains a colon-separated list of package prefixes.
      * Each package prefix in
@@ -661,8 +661,7 @@
             if (className == null) {
                 NoInitialContextException ne = new NoInitialContextException(
                     "Need to specify class name in environment or system " +
-                    "property, or as an applet parameter, or in an " +
-                    "application resource file:  " +
+                    "property, or in an application resource file: " +
                     Context.INITIAL_CONTEXT_FACTORY);
                 throw ne;
             }
--- a/jdk/src/share/classes/javax/print/Doc.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/Doc.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, 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
@@ -168,7 +168,7 @@
      * from the print data representation object.
      * However, if the print data representation object is itself a Reader,
      * then the print data representation object is simply returned.
-     * <P>
+     *
      * @return  Reader for reading the print data characters from this doc.
      *          If a reader cannot be provided because this doc does not meet
      *          the criteria stated above, null is returned.
@@ -192,7 +192,7 @@
      * object as a stream of bytes is created and returned. However, if the
      * print data representation object is itself an input stream, then the
      * print data representation object is simply returned.
-     * <P>
+     *
      * @return  Input stream for reading the print data bytes from this doc. If
      *          an input stream cannot be provided because this doc does not
      *          meet the criteria stated above, null is returned.
--- a/jdk/src/share/classes/javax/print/DocFlavor.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/DocFlavor.java	Wed Jul 05 19:53:51 2017 +0200
@@ -381,7 +381,6 @@
  * <LI>
  * A line feed (LF) character standing by itself means
  * "go to column 1 of the next line."
- * <LI>
  * </UL>
  * <P>
  * The client must itself perform all plain text print data formatting not
@@ -436,7 +435,6 @@
  * Java Print Service instance supports without having
  * to load the representation classes, which may be problematic for
  * limited-resource clients.
- * <P>
  *
  * @author  Alan Kaminsky
  */
@@ -536,7 +534,7 @@
      * The charset for text types is a commonly useful example.
      * This convenience method will return the value of the specified
      * parameter if one was specified in the mime type for this flavor.
-     * <p>
+     *
      * @param paramName the name of the paramater. This name is internally
      * converted to the canonical lower case format before performing
      * the match.
@@ -638,7 +636,6 @@
      * Class DocFlavor.BYTE_ARRAY provides predefined static constant
      * DocFlavor objects for example doc flavors using a byte array
      * (<CODE>byte[]</CODE>) as the print data representation class.
-     * <P>
      *
      * @author  Alan Kaminsky
      */
@@ -836,7 +833,6 @@
      * DocFlavor objects for example doc flavors using a byte stream ({@link
      * java.io.InputStream java.io.InputStream}) as the print
      * data representation class.
-     * <P>
      *
      * @author  Alan Kaminsky
      */
@@ -1038,8 +1034,7 @@
      * objects.
      * For example doc flavors using a Uniform Resource Locator ({@link
      * java.net.URL java.net.URL}) as the print data
-     * representation  class.
-     * <P>
+     * representation class.
      *
      * @author  Alan Kaminsky
      */
@@ -1229,7 +1224,6 @@
      * DocFlavor objects for example doc flavors using a character array
      * (<CODE>char[]</CODE>) as the print data representation class. As such,
      * the character set is Unicode.
-     * <P>
      *
      * @author  Alan Kaminsky
      */
@@ -1279,7 +1273,6 @@
      * objects for example doc flavors using a string ({@link java.lang.String
      * java.lang.String}) as the print data representation class.
      * As such, the character set is Unicode.
-     * <P>
      *
      * @author  Alan Kaminsky
      */
@@ -1327,7 +1320,6 @@
      * objects for example doc flavors using a character stream ({@link
      * java.io.Reader java.io.Reader}) as the print data
      * representation class. As such, the character set is Unicode.
-     * <P>
      *
      * @author  Alan Kaminsky
      */
@@ -1376,7 +1368,6 @@
      * Class DocFlavor.SERVICE_FORMATTED provides predefined static constant
      * DocFlavor objects for example doc flavors for service formatted print
      * data.
-     * <P>
      *
      * @author  Alan Kaminsky
      */
--- a/jdk/src/share/classes/javax/print/PrintService.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/PrintService.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, 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
@@ -327,7 +327,6 @@
      * that indicates bounds on the legal values -- used, for example, by an
      * integer-valued attribute that must lie within a certain range.
      * </UL>
-     * <P>
      *
      * @param  category    Printing attribute category to test. It must be a
      *                        {@link java.lang.Class Class} that implements
--- a/jdk/src/share/classes/javax/print/PrintServiceLookup.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/PrintServiceLookup.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2002, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, 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
@@ -199,7 +199,6 @@
      * available that is not part of the installation.
      * If the lookup service is already registered, or cannot be registered,
      * the method returns false.
-     * <p>
      *
      * @param sp an implementation of a lookup service.
      * @return <code>true</code> if the new lookup service is newly
@@ -305,7 +304,6 @@
     * <p>
     * Locates MultiDoc print services which can be positively confirmed
     * to support the combination of attributes and DocFlavors specified.
-    * <p>
     *
     * @param flavors of documents required. If null or empty it is ignored.
     * @param attributes required to be supported. If null this
--- a/jdk/src/share/classes/javax/print/ServiceUI.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/ServiceUI.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, 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
@@ -131,8 +131,7 @@
      *    }
      * }
      * }</pre>
-     * <p>
-
+     *
      * @param gc used to select screen. null means primary or default screen.
      * @param x location of dialog including border in screen coordinates
      * @param y location of dialog including border in screen coordinates
--- a/jdk/src/share/classes/javax/print/ServiceUIFactory.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/ServiceUIFactory.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, 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
@@ -111,7 +111,7 @@
     /**
      * Get a UI object which may be cast to the requested UI type
      * by the application and used in its user interface.
-     * <P>
+     *
      * @param role requested. Must be one of the standard roles or
      * a private role supported by this factory.
      * @param ui type in which the role is requested.
--- a/jdk/src/share/classes/javax/print/SimpleDoc.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/SimpleDoc.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2014, 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
@@ -176,7 +176,7 @@
      * However, if the print data representation object is itself a
      * <code>Reader</code> then the print data representation object is
      * simply returned.
-     * <P>
+     *
      * @return  a <code>Reader</code> for reading the print data
      *          characters from this doc.
      *          If a reader cannot be provided because this doc does not meet
@@ -224,7 +224,7 @@
      * However, if the print data representation object is itself an
      * input stream then the print data representation object is simply
      * returned.
-     * <P>
+     *
      * @return  an <code>InputStream</code> for reading the print data
      *          bytes from this doc.  If an input stream cannot be
      *          provided because this doc does not meet
--- a/jdk/src/share/classes/javax/print/StreamPrintServiceFactory.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/StreamPrintServiceFactory.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, 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
@@ -95,7 +95,7 @@
      * Although null is an acceptable value to use in the lookup of stream
      * printing services, it's typical to search for a particular
      * desired format, such as Postscript(TM).
-     * <p>
+     *
      * @param flavor of the input document type - null means match all
      * types.
      * @param outputMimeType representing the required output format, used to
@@ -153,7 +153,7 @@
      * Implementations which allocate resources on construction should examine
      * the stream and may wish to only allocate resources if the stream is
      * non-null.
-     * <p>
+     *
      * @param out destination stream for generated output.
      * @return a PrintService which will generate the format specified by the
      * DocFlavor supported by this Factory.
--- a/jdk/src/share/classes/javax/print/attribute/Attribute.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/attribute/Attribute.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, 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,7 +31,6 @@
  * Interface Attribute is the base interface implemented by any and every
  * printing attribute class to indicate that the class represents a
  * printing attribute. All printing attributes are serializable.
- * <P>
  *
  * @author  David Mendenhall
  * @author  Alan Kaminsky
--- a/jdk/src/share/classes/javax/print/attribute/DateTimeSyntax.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/attribute/DateTimeSyntax.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -54,7 +54,6 @@
  * rather than a <code>java.util.Calendar</code> because it typically takes
  * less memory to store and less time to compare a <code>java.util.Date</code>
  * than a <code>java.util.Calendar</code>.
- * <P>
  *
  * @author  Alan Kaminsky
  */
--- a/jdk/src/share/classes/javax/print/attribute/DocAttribute.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/attribute/DocAttribute.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, 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
@@ -36,7 +36,6 @@
  * PrintRequestAttribute} as well as DocAttribute, the client may include the
  * attribute in a attribute set which specifies a print job
  * to specify a characteristic for all the docs in that job.
- * <P>
  *
  * @see DocAttributeSet
  * @see PrintRequestAttributeSet
--- a/jdk/src/share/classes/javax/print/attribute/DocAttributeSet.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/attribute/DocAttributeSet.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, 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
@@ -40,7 +40,6 @@
  * The {@link #add(Attribute) add(Attribute)}, and
  * {@link #addAll(AttributeSet) addAll(AttributeSet)} operations
  * are respecified below to guarantee this additional invariant.
- * <P>
  *
  * @author  Alan Kaminsky
  */
--- a/jdk/src/share/classes/javax/print/attribute/EnumSyntax.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/attribute/EnumSyntax.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, 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
@@ -102,7 +102,6 @@
  * uses some of the same integer values as the superclass. However, the
  * application in which the enumeration class and subclass are used may need to
  * have distinct integer values in the superclass and subclass.
- * <P>
  *
  * @author  David Mendenhall
  * @author  Alan Kaminsky
--- a/jdk/src/share/classes/javax/print/attribute/HashAttributeSet.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/attribute/HashAttributeSet.java	Wed Jul 05 19:53:51 2017 +0200
@@ -34,7 +34,6 @@
 /**
  * Class HashAttributeSet provides an <code>AttributeSet</code>
  * implementation with characteristics of a hash map.
- * <P>
  *
  * @author  Alan Kaminsky
  */
--- a/jdk/src/share/classes/javax/print/attribute/HashDocAttributeSet.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/attribute/HashDocAttributeSet.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -33,7 +33,6 @@
  * inherits its implementation from class {@link HashAttributeSet
  * HashAttributeSet} and enforces the semantic restrictions of interface {@link
  * DocAttributeSet DocAttributeSet}.
- * <P>
  *
  * @author  Alan Kaminsky
  */
--- a/jdk/src/share/classes/javax/print/attribute/HashPrintJobAttributeSet.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/attribute/HashPrintJobAttributeSet.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -33,7 +33,6 @@
  * which inherits its implementation from class {@link HashAttributeSet
  * HashAttributeSet} and enforces the semantic restrictions of interface
  * {@link PrintJobAttributeSet PrintJobAttributeSet}.
- * <P>
  *
  * @author  Alan Kaminsky
  */
--- a/jdk/src/share/classes/javax/print/attribute/HashPrintRequestAttributeSet.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/attribute/HashPrintRequestAttributeSet.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -33,7 +33,6 @@
  * class {@link HashAttributeSet HashAttributeSet} and enforces the
  * semantic restrictions of interface
  * {@link PrintRequestAttributeSet PrintRequestAttributeSet}.
- * <P>
  *
  * @author  Alan Kaminsky
  */
--- a/jdk/src/share/classes/javax/print/attribute/HashPrintServiceAttributeSet.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/attribute/HashPrintServiceAttributeSet.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, 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,7 +32,6 @@
  * which inherits its implementation from class {@link HashAttributeSet
  * HashAttributeSet} and enforces the semantic restrictions of interface
  * {@link PrintServiceAttributeSet PrintServiceAttributeSet}.
- * <P>
  *
  * @author  Alan Kaminsky
  */
--- a/jdk/src/share/classes/javax/print/attribute/IntegerSyntax.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/attribute/IntegerSyntax.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, 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,7 +37,6 @@
  * established when it is constructed (see {@link #IntegerSyntax(int)
  * IntegerSyntax(int)}). Once constructed, an integer attribute's
  * value is immutable.
- * <P>
  *
  * @author  David Mendenhall
  * @author  Alan Kaminsky
--- a/jdk/src/share/classes/javax/print/attribute/PrintJobAttribute.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/attribute/PrintJobAttribute.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, 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
@@ -34,7 +34,6 @@
  * PrintRequestAttribute PrintRequestAttribute} as well as PrintJobAttribute,
  * the client may include the attribute in a attribute set to
  * specify the attribute's value for the Print Job.
- * <P>
  *
  * @see PrintRequestAttributeSet
  * @see PrintJobAttributeSet
--- a/jdk/src/share/classes/javax/print/attribute/PrintJobAttributeSet.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/attribute/PrintJobAttributeSet.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -39,7 +39,6 @@
  * The {@link #add(Attribute) add(Attribute)}, and
  * {@link #addAll(AttributeSet) >addAll(AttributeSet)} operations
  * are respecified below to guarantee this additional invariant.
- * <P>
  *
  * @author  Alan Kaminsky
  */
--- a/jdk/src/share/classes/javax/print/attribute/PrintRequestAttribute.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/attribute/PrintRequestAttribute.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -39,7 +39,6 @@
  * as well as PrintRequestAttribute, the client may include the
  * attribute in a <code>Doc</code>}'s attribute set to specify
  * a job setting which pertains just to that doc.
- * <P>
  *
  * @see DocAttributeSet
  * @see PrintRequestAttributeSet
--- a/jdk/src/share/classes/javax/print/attribute/PrintRequestAttributeSet.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/attribute/PrintRequestAttributeSet.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, 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
@@ -40,7 +40,6 @@
  * The {@link #add(Attribute) add(Attribute)}, and
  * {@link #addAll(AttributeSet) addAll(AttributeSet)} operations
  * are respecified below to guarantee this additional invariant.
- * <P>
  *
  * @author  Alan Kaminsky
  */
--- a/jdk/src/share/classes/javax/print/attribute/PrintServiceAttribute.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/attribute/PrintServiceAttribute.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, 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,7 +31,6 @@
  * of a Print Service or some other characteristic of a Print Service. A Print
  * Service instance adds a number of PrintServiceAttributes to a Print
  * service's attribute set to report the Print Service's status.
- * <P>
  *
  * @see PrintServiceAttributeSet
  *
--- a/jdk/src/share/classes/javax/print/attribute/PrintServiceAttributeSet.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/attribute/PrintServiceAttributeSet.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, 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
@@ -42,7 +42,6 @@
  * The {@link #add(Attribute) add(Attribute)}, and
  * {@link #addAll(AttributeSet) addAll(AttributeSet)} operations
  * are respecified below to guarantee this additional invariant.
- * <P>
  *
  * @author  Alan Kaminsky
  */
--- a/jdk/src/share/classes/javax/print/attribute/ResolutionSyntax.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/attribute/ResolutionSyntax.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -78,7 +78,6 @@
  * mind, there is no guarantee that the conversion factor for the client's units
  * will be an exact integer. If the conversion factor isn't an exact integer,
  * resolution values in the client's units won't be stored precisely.
- * <P>
  *
  * @author  David Mendenhall
  * @author  Alan Kaminsky
--- a/jdk/src/share/classes/javax/print/attribute/SetOfIntegerSyntax.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/attribute/SetOfIntegerSyntax.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, 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
@@ -75,7 +75,6 @@
  * Class SetOfIntegerSyntax has operations to return the set's members in
  * canonical array form, to test whether a given integer is a member of the
  * set, and to iterate through the members of the set.
- * <P>
  *
  * @author  David Mendenhall
  * @author  Alan Kaminsky
--- a/jdk/src/share/classes/javax/print/attribute/Size2DSyntax.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/attribute/Size2DSyntax.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, 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
@@ -77,7 +77,6 @@
  * client's units will be an exact integer. If the conversion factor isn't an
  * exact integer, resolution values in the client's units won't be stored
  * precisely.
- * <P>
  *
  * @author  Alan Kaminsky
  */
--- a/jdk/src/share/classes/javax/print/attribute/SupportedValuesAttribute.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/attribute/SupportedValuesAttribute.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, 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
@@ -36,7 +36,6 @@
  * which is a SupportedValuesAttribute giving the legal values a client may
  * specify for the {@link javax.print.attribute.standard.Copies Copies}
  * attribute.
- * <P>
  *
  * @author  Alan Kaminsky
  */
--- a/jdk/src/share/classes/javax/print/attribute/TextSyntax.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/attribute/TextSyntax.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, 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
@@ -35,7 +35,6 @@
  * includes a locale to indicate the natural language. Thus, a text attribute
  * always represents a localized string. Once constructed, a text attribute's
  * value is immutable.
- * <P>
  *
  * @author  David Mendenhall
  * @author  Alan Kaminsky
--- a/jdk/src/share/classes/javax/print/attribute/URISyntax.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/attribute/URISyntax.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -33,7 +33,6 @@
  * Class URISyntax is an abstract base class providing the common
  * implementation of all attributes whose value is a Uniform Resource
  * Identifier (URI). Once constructed, a URI attribute's value is immutable.
- * <P>
  *
  * @author  Alan Kaminsky
  */
--- a/jdk/src/share/classes/javax/print/attribute/package.html	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/attribute/package.html	Wed Jul 05 19:53:51 2017 +0200
@@ -3,7 +3,7 @@
 <head>
 <title>javax.print.attribute package</title>
 <!--
-Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+Copyright (c) 2000, 2014, 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
@@ -398,7 +398,7 @@
 in a run time exception either immediately or at some later time.
 IllegalArgumentException and NullPointerException are examples of
 typical and acceptable run time exceptions for such cases.
-<P>
+
 @since 1.4
 </body>
 </html>
--- a/jdk/src/share/classes/javax/print/attribute/standard/ColorSupported.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/attribute/standard/ColorSupported.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -52,7 +52,6 @@
  * <CODE>getName()</CODE> is the IPP attribute name.  The enumeration's
  * integer value is the IPP enum value.  The <code>toString()</code> method
  * returns the IPP string representation of the attribute value.
- * <P>
  *
  * @author  Alan Kaminsky
  */
--- a/jdk/src/share/classes/javax/print/attribute/standard/Compression.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/attribute/standard/Compression.java	Wed Jul 05 19:53:51 2017 +0200
@@ -40,7 +40,6 @@
  * <CODE>getName()</CODE> is the IPP attribute name.  The enumeration's
  * integer value is the IPP enum value.  The <code>toString()</code> method
  * returns the IPP string representation of the attribute value.
- * <P>
  *
  * @author  Alan Kaminsky
  */
--- a/jdk/src/share/classes/javax/print/attribute/standard/CopiesSupported.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/attribute/standard/CopiesSupported.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, 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
@@ -40,7 +40,6 @@
  * javax.print.attribute.SetOfIntegerSyntax SetOfIntegerSyntax} for an
  * explanation of canonical array form. The category name returned by
  * <CODE>getName()</CODE> gives the IPP attribute name.
- * <P>
  *
  * @author  Alan Kaminsky
  */
--- a/jdk/src/share/classes/javax/print/attribute/standard/DateTimeAtCompleted.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/attribute/standard/DateTimeAtCompleted.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -47,7 +47,6 @@
  * "date-time-at-completed" attribute can be obtained as described above. The
  * category name returned by <CODE>getName()</CODE> gives the IPP attribute
  * name.
- * <P>
  *
  * @author  Alan Kaminsky
  */
--- a/jdk/src/share/classes/javax/print/attribute/standard/DateTimeAtCreation.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/attribute/standard/DateTimeAtCreation.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -47,7 +47,6 @@
  * "date-time-at-creation" attribute can be obtained as described above. The
  * category name returned by <CODE>getName()</CODE> gives the IPP attribute
  * name.
- * <P>
  *
  * @author  Alan Kaminsky
  */
--- a/jdk/src/share/classes/javax/print/attribute/standard/DateTimeAtProcessing.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/attribute/standard/DateTimeAtProcessing.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -47,7 +47,6 @@
  * "date-time-at-processing" attribute can be obtained as described above. The
  * category name returned by <CODE>getName()</CODE> gives the IPP attribute
  * name.
- * <P>
  *
  * @author  Alan Kaminsky
  */
--- a/jdk/src/share/classes/javax/print/attribute/standard/Destination.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/attribute/standard/Destination.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -50,7 +50,6 @@
  * cause.
  * <P>
  * <B>IPP Compatibility:</B> Destination is not an IPP attribute.
- * <P>
  *
  * @author  Phil Race.
  */
--- a/jdk/src/share/classes/javax/print/attribute/standard/DialogTypeSelection.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/attribute/standard/DialogTypeSelection.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -46,9 +46,8 @@
  * or even printer specific options.
  * <P>
  * <B>IPP Compatibility:</B> This is not an IPP attribute.
- * <P>
+ *
  * @since 1.7
- *
  */
 public final class DialogTypeSelection extends EnumSyntax
         implements PrintRequestAttribute {
--- a/jdk/src/share/classes/javax/print/attribute/standard/DocumentName.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/attribute/standard/DocumentName.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, 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
@@ -43,7 +43,6 @@
  * <B>IPP Compatibility:</B> The string value gives the IPP name value. The
  * locale gives the IPP natural language. The category name returned by
  * <CODE>getName()</CODE> gives the IPP attribute name.
- * <P>
  *
  * @author  Alan Kaminsky
  */
--- a/jdk/src/share/classes/javax/print/attribute/standard/JobHoldUntil.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/attribute/standard/JobHoldUntil.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -78,7 +78,6 @@
  * for example, a JobHoldUntil value with today's date and 9:00pm local time
  * might be converted to the standard IPP keyword "night". The category name
  * returned by <CODE>getName()</CODE> gives the IPP attribute name.
- * <P>
  *
  * @author  Alan Kaminsky
  */
--- a/jdk/src/share/classes/javax/print/attribute/standard/JobImpressions.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/attribute/standard/JobImpressions.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, 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
@@ -65,7 +65,6 @@
  * <B>IPP Compatibility:</B> The integer value gives the IPP integer value. The
  * category name returned by <CODE>getName()</CODE> gives the IPP attribute
  * name.
- * <P>
  *
  * @see JobImpressionsSupported
  * @see JobImpressionsCompleted
--- a/jdk/src/share/classes/javax/print/attribute/standard/JobImpressionsCompleted.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/attribute/standard/JobImpressionsCompleted.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -47,7 +47,6 @@
  * <B>IPP Compatibility:</B> The integer value gives the IPP integer value. The
  * category name returned by <CODE>getName()</CODE> gives the IPP attribute
  * name.
- * <P>
  *
  * @see JobImpressions
  * @see JobImpressionsSupported
--- a/jdk/src/share/classes/javax/print/attribute/standard/JobImpressionsSupported.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/attribute/standard/JobImpressionsSupported.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, 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
@@ -42,7 +42,6 @@
  * javax.print.attribute.SetOfIntegerSyntax SetOfIntegerSyntax} for an
  * explanation of canonical array form. The category name returned by
  * <CODE>getName()</CODE> gives the IPP attribute name.
- * <P>
  *
  * @author  Alan Kaminsky
  */
--- a/jdk/src/share/classes/javax/print/attribute/standard/JobKOctets.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/attribute/standard/JobKOctets.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, 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
@@ -117,7 +117,6 @@
  * <B>IPP Compatibility:</B> The integer value gives the IPP integer value. The
  * category name returned by <CODE>getName()</CODE> gives the IPP attribute
  * name.
- * <P>
  *
  * @see JobKOctetsSupported
  * @see JobKOctetsProcessed
--- a/jdk/src/share/classes/javax/print/attribute/standard/JobKOctetsProcessed.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/attribute/standard/JobKOctetsProcessed.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -59,7 +59,6 @@
  * <B>IPP Compatibility:</B> The integer value gives the IPP integer value. The
  * category name returned by <CODE>getName()</CODE> gives the IPP attribute
  * name.
- * <P>
  *
  * @see JobKOctets
  * @see JobKOctetsSupported
--- a/jdk/src/share/classes/javax/print/attribute/standard/JobKOctetsSupported.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/attribute/standard/JobKOctetsSupported.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, 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
@@ -42,7 +42,6 @@
  * javax.print.attribute.SetOfIntegerSyntax SetOfIntegerSyntax} for an
  * explanation of canonical array form. The category name returned by
  * <CODE>getName()</CODE> gives the IPP attribute name.
- * <P>
  *
  * @author  Alan Kaminsky
  */
--- a/jdk/src/share/classes/javax/print/attribute/standard/JobMediaSheets.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/attribute/standard/JobMediaSheets.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -57,7 +57,6 @@
  * <B>IPP Compatibility:</B> The integer value gives the IPP integer value. The
  * category name returned by <CODE>getName()</CODE> gives the IPP attribute
  * name.
- * <P>
  *
  * @see JobMediaSheetsSupported
  * @see JobMediaSheetsCompleted
--- a/jdk/src/share/classes/javax/print/attribute/standard/JobMediaSheetsCompleted.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/attribute/standard/JobMediaSheetsCompleted.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -47,7 +47,6 @@
  * <B>IPP Compatibility:</B> The integer value gives the IPP integer value. The
  * category name returned by <CODE>getName()</CODE> gives the IPP attribute
  * name.
- * <P>
  *
  * @see JobMediaSheets
  * @see JobMediaSheetsSupported
--- a/jdk/src/share/classes/javax/print/attribute/standard/JobMediaSheetsSupported.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/attribute/standard/JobMediaSheetsSupported.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, 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
@@ -42,7 +42,6 @@
  * javax.print.attribute.SetOfIntegerSyntax SetOfIntegerSyntax} for an
  * explanation of canonical array form. The category name returned by
  * <CODE>getName()</CODE> gives the IPP attribute name.
- * <P>
  *
  * @author  Alan Kaminsky
  */
--- a/jdk/src/share/classes/javax/print/attribute/standard/JobMessageFromOperator.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/attribute/standard/JobMessageFromOperator.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -47,7 +47,6 @@
  * <B>IPP Compatibility:</B> The string value gives the IPP name value. The
  * locale gives the IPP natural language. The category name returned by
  * <CODE>getName()</CODE> gives the IPP attribute name.
- * <P>
  *
  * @author  Alan Kaminsky
  */
--- a/jdk/src/share/classes/javax/print/attribute/standard/JobName.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/attribute/standard/JobName.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -48,7 +48,6 @@
  * <B>IPP Compatibility:</B> The string value gives the IPP name value. The
  * locale gives the IPP natural language. The category name returned by
  * <CODE>getName()</CODE> gives the IPP attribute name.
- * <P>
  *
  * @author  Alan Kaminsky
  */
--- a/jdk/src/share/classes/javax/print/attribute/standard/JobOriginatingUserName.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/attribute/standard/JobOriginatingUserName.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -47,7 +47,6 @@
  * <B>IPP Compatibility:</B> The string value gives the IPP name value. The
  * locale gives the IPP natural language. The category name returned by
  * <CODE>getName()</CODE> gives the IPP attribute name.
- * <P>
  *
  * @author  Alan Kaminsky
  */
--- a/jdk/src/share/classes/javax/print/attribute/standard/JobPriority.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/attribute/standard/JobPriority.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -54,7 +54,6 @@
  * <B>IPP Compatibility:</B> The integer value gives the IPP integer value. The
  * category name returned by <CODE>getName()</CODE> gives the IPP attribute
  * name.
- * <P>
  *
  * @author  Alan Kaminsky
  */
--- a/jdk/src/share/classes/javax/print/attribute/standard/JobPrioritySupported.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/attribute/standard/JobPrioritySupported.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, 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
@@ -44,7 +44,6 @@
  * <B>IPP Compatibility:</B> The integer value gives the IPP integer value.
  * The category name returned by <CODE>getName()</CODE> gives the IPP
  * attribute name.
- * <P>
  *
  * @author  Alan Kaminsky
  */
--- a/jdk/src/share/classes/javax/print/attribute/standard/JobSheets.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/attribute/standard/JobSheets.java	Wed Jul 05 19:53:51 2017 +0200
@@ -49,7 +49,6 @@
  * <code>toString()</code> method returns the IPP string representation of
  * the attribute value. For a subclass, the attribute value must be
  * localized to give the IPP name and natural language values.
- * <P>
  *
  * @author  Alan Kaminsky
  */
--- a/jdk/src/share/classes/javax/print/attribute/standard/JobState.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/attribute/standard/JobState.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, 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
@@ -42,7 +42,6 @@
  * <CODE>getName()</CODE> is the IPP attribute name.  The enumeration's
  * integer value is the IPP enum value.  The <code>toString()</code> method
  * returns the IPP string representation of the attribute value.
- * <P>
  *
  * @author  Alan Kaminsky
  */
--- a/jdk/src/share/classes/javax/print/attribute/standard/JobStateReason.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/attribute/standard/JobStateReason.java	Wed Jul 05 19:53:51 2017 +0200
@@ -51,7 +51,6 @@
  * <CODE>getName()</CODE> is the IPP attribute name.  The enumeration's
  * integer value is the IPP enum value.  The <code>toString()</code> method
  * returns the IPP string representation of the attribute value.
- * <P>
  *
  * @author  Alan Kaminsky
  */
--- a/jdk/src/share/classes/javax/print/attribute/standard/JobStateReasons.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/attribute/standard/JobStateReasons.java	Wed Jul 05 19:53:51 2017 +0200
@@ -62,7 +62,6 @@
  * JobStateReason JobStateReason} object's <CODE>toString()</CODE> method gives
  * the IPP keyword value. The category name returned by <CODE>getName()</CODE>
  * gives the IPP attribute name.
- * <P>
  *
  * @author  Alan Kaminsky
  */
--- a/jdk/src/share/classes/javax/print/attribute/standard/Media.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/attribute/standard/Media.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -52,7 +52,6 @@
  * <CODE>getName()</CODE> is the IPP attribute name.  The enumeration's
  * integer value is the IPP enum value.  The <code>toString()</code> method
  * returns the IPP string representation of the attribute value.
- * <P>
  *
  * @author Phil Race
  */
--- a/jdk/src/share/classes/javax/print/attribute/standard/MediaSize.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/attribute/standard/MediaSize.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -46,7 +46,6 @@
  * to find the physical dimensions of the MediaSizeName instances
  * enumerated in this API. This is useful for clients which need this
  * information to format {@literal &} paginate printing.
- * <P>
  *
  * @author  Phil Race, Alan Kaminsky
  */
--- a/jdk/src/share/classes/javax/print/attribute/standard/NumberOfDocuments.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/attribute/standard/NumberOfDocuments.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, 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,7 +37,6 @@
  * <B>IPP Compatibility:</B> The integer value gives the IPP integer value. The
  * category name returned by <CODE>getName()</CODE> gives the IPP attribute
  * name.
- * <P>
  *
  * @author  Alan Kaminsky
  */
--- a/jdk/src/share/classes/javax/print/attribute/standard/NumberOfInterveningJobs.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/attribute/standard/NumberOfInterveningJobs.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, 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,7 +37,6 @@
  * <B>IPP Compatibility:</B> The integer value gives the IPP integer value.
  * The category name returned by <CODE>getName()</CODE> gives the IPP
  * attribute name.
- * <P>
  *
  * @author  Alan Kaminsky
  */
--- a/jdk/src/share/classes/javax/print/attribute/standard/NumberUpSupported.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/attribute/standard/NumberUpSupported.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, 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
@@ -38,7 +38,6 @@
  * javax.print.attribute.SetOfIntegerSyntax SetOfIntegerSyntax} for an
  * explanation of canonical array form. The category name returned by
  * <CODE>getName()</CODE> gives the IPP attribute name.
- * <P>
  *
  * @author  Alan Kaminsky
  */
--- a/jdk/src/share/classes/javax/print/attribute/standard/OrientationRequested.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/attribute/standard/OrientationRequested.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, 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
@@ -58,7 +58,6 @@
  * <CODE>getName()</CODE> is the IPP attribute name.  The enumeration's
  * integer value is the IPP enum value.  The <code>toString()</code> method
  * returns the IPP string representation of the attribute value.
- * <P>
  *
  * @author  Alan Kaminsky
  */
--- a/jdk/src/share/classes/javax/print/attribute/standard/OutputDeviceAssigned.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/attribute/standard/OutputDeviceAssigned.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, 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
@@ -43,7 +43,6 @@
  * <B>IPP Compatibility:</B> The string value gives the IPP name value. The
  * locale gives the IPP natural language. The category name returned by
  * <CODE>getName()</CODE> gives the IPP attribute name.
- * <P>
  *
  * @author  Alan Kaminsky
  */
--- a/jdk/src/share/classes/javax/print/attribute/standard/PDLOverrideSupported.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/attribute/standard/PDLOverrideSupported.java	Wed Jul 05 19:53:51 2017 +0200
@@ -38,7 +38,6 @@
  * <CODE>getName()</CODE> is the IPP attribute name.  The enumeration's
  * integer value is the IPP enum value.  The <code>toString()</code> method
  * returns the IPP string representation of the attribute value.
- * <P>
  *
  * @author  Alan Kaminsky
  */
--- a/jdk/src/share/classes/javax/print/attribute/standard/PagesPerMinute.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/attribute/standard/PagesPerMinute.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -39,7 +39,6 @@
  * <B>IPP Compatibility:</B> The integer value gives the IPP integer value. The
  * category name returned by <CODE>getName()</CODE> gives the IPP attribute
  * name.
- * <P>
  *
  * @author  Alan Kaminsky
  */
--- a/jdk/src/share/classes/javax/print/attribute/standard/PagesPerMinuteColor.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/attribute/standard/PagesPerMinuteColor.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -50,7 +50,6 @@
  * <B>IPP Compatibility:</B> The integer value gives the IPP integer value. The
  * category name returned by <CODE>getName()</CODE> gives the IPP attribute
  * name.
- * <P>
  *
  * @author  Alan Kaminsky
  */
--- a/jdk/src/share/classes/javax/print/attribute/standard/PresentationDirection.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/attribute/standard/PresentationDirection.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2014, 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,6 @@
  * <CODE>getName()</CODE> is the IPP attribute name.  The enumeration's
  * integer value is the IPP enum value.  The <code>toString()</code> method
  * returns the IPP string representation of the attribute value.
- * <P>
  *
  * @author  Phil Race.
  */
--- a/jdk/src/share/classes/javax/print/attribute/standard/PrintQuality.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/attribute/standard/PrintQuality.java	Wed Jul 05 19:53:51 2017 +0200
@@ -38,7 +38,6 @@
  * <CODE>getName()</CODE> is the IPP attribute name.  The enumeration's
  * integer value is the IPP enum value.  The <code>toString()</code> method
  * returns the IPP string representation of the attribute value.
- * <P>
  *
  * @author  David Mendenhall
  * @author  Alan Kaminsky
--- a/jdk/src/share/classes/javax/print/attribute/standard/PrinterInfo.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/attribute/standard/PrinterInfo.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, 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
@@ -42,7 +42,6 @@
  * <B>IPP Compatibility:</B> The string value gives the IPP name value. The
  * locale gives the IPP natural language. The category name returned by
  * <CODE>getName()</CODE> gives the IPP attribute name.
- * <P>
  *
  * @author  Alan Kaminsky
  */
--- a/jdk/src/share/classes/javax/print/attribute/standard/PrinterIsAcceptingJobs.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/attribute/standard/PrinterIsAcceptingJobs.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, 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
@@ -43,7 +43,6 @@
  * <CODE>getName()</CODE> is the IPP attribute name.  The enumeration's
  * integer value is the IPP enum value.  The <code>toString()</code> method
  * returns the IPP string representation of the attribute value.
- * <P>
  *
  * @author  Alan Kaminsky
  */
--- a/jdk/src/share/classes/javax/print/attribute/standard/PrinterLocation.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/attribute/standard/PrinterLocation.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, 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
@@ -38,7 +38,6 @@
  * <B>IPP Compatibility:</B> The string value gives the IPP name value. The
  * locale gives the IPP natural language. The category name returned by
  * <CODE>getName()</CODE> gives the IPP attribute name.
- * <P>
  *
  * @author  Alan Kaminsky
  */
--- a/jdk/src/share/classes/javax/print/attribute/standard/PrinterMakeAndModel.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/attribute/standard/PrinterMakeAndModel.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, 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
@@ -36,7 +36,6 @@
  * <B>IPP Compatibility:</B> The string value gives the IPP name value. The
  * locale gives the IPP natural language. The category name returned by
  * <CODE>getName()</CODE> gives the IPP attribute name.
- * <P>
  *
  * @author  Alan Kaminsky
  */
--- a/jdk/src/share/classes/javax/print/attribute/standard/PrinterMessageFromOperator.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/attribute/standard/PrinterMessageFromOperator.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -51,7 +51,6 @@
  * <B>IPP Compatibility:</B> The string value gives the IPP name value. The
  * locale gives the IPP natural language. The category name returned by
  * <CODE>getName()</CODE> gives the IPP attribute name.
- * <P>
  *
  * @author  Alan Kaminsky
  */
--- a/jdk/src/share/classes/javax/print/attribute/standard/PrinterMoreInfo.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/attribute/standard/PrinterMoreInfo.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, 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 @@
  * <CODE>toString()</CODE>  gives the IPP uri value.
  * The category name returned by <CODE>getName()</CODE>
  * gives the IPP attribute name.
- * <P>
  *
  * @author  Alan Kaminsky
  */
--- a/jdk/src/share/classes/javax/print/attribute/standard/PrinterMoreInfoManufacturer.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/attribute/standard/PrinterMoreInfoManufacturer.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, 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 @@
  * <CODE>toString()</CODE> gives the IPP uri value.
  * The category name returned by <CODE>getName()</CODE>
  * gives the IPP attribute name.
- * <P>
  *
  * @author  Alan Kaminsky
  */
--- a/jdk/src/share/classes/javax/print/attribute/standard/PrinterName.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/attribute/standard/PrinterName.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, 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
@@ -41,7 +41,6 @@
  * <B>IPP Compatibility:</B> The string value gives the IPP name value. The
  * locale gives the IPP natural language. The category name returned by
  * <CODE>getName()</CODE> gives the IPP attribute name.
- * <P>
  *
  * @author  Alan Kaminsky
  */
--- a/jdk/src/share/classes/javax/print/attribute/standard/PrinterResolution.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/attribute/standard/PrinterResolution.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, 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
@@ -64,7 +64,6 @@
  * <CODE>"printer-resolution"</CODE> attribute can be obtained by calling
  * methods on the PrinterResolution object. The category name returned by
  * <CODE>getName()</CODE> gives the IPP attribute name.
- * <P>
  *
  * @author  David Mendenhall
  * @author  Alan Kaminsky
--- a/jdk/src/share/classes/javax/print/attribute/standard/PrinterState.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/attribute/standard/PrinterState.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, 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
@@ -42,7 +42,6 @@
  * <CODE>getName()</CODE> is the IPP attribute name.  The enumeration's
  * integer value is the IPP enum value.  The <code>toString()</code> method
  * returns the IPP string representation of the attribute value.
- * <P>
  *
  * @author  Alan Kaminsky
  */
--- a/jdk/src/share/classes/javax/print/attribute/standard/PrinterStateReason.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/attribute/standard/PrinterStateReason.java	Wed Jul 05 19:53:51 2017 +0200
@@ -61,7 +61,6 @@
  * between, gives the IPP keyword value for a {@link PrinterStateReasons}.
  * The category name returned by <CODE>getName()</CODE> gives the IPP
  * attribute name.
- * <P>
  *
  * @author  Alan Kaminsky
  */
--- a/jdk/src/share/classes/javax/print/attribute/standard/PrinterStateReasons.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/attribute/standard/PrinterStateReasons.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, 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
@@ -77,7 +77,6 @@
  * together with a hyphen (<CODE>"-"</CODE>) in between, gives the IPP keyword
  * value. The category name returned by <CODE>getName()</CODE> gives the IPP
  * attribute name.
- * <P>
  *
  * @author  Alan Kaminsky
  */
--- a/jdk/src/share/classes/javax/print/attribute/standard/PrinterURI.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/attribute/standard/PrinterURI.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2014, 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
@@ -41,7 +41,6 @@
  * <CODE>toString()</CODE>  gives the IPP printer-uri value.
  * The category name returned by <CODE>getName()</CODE>
  * gives the IPP attribute name.
- * <P>
  *
  * @author  Robert Herriot
  */
--- a/jdk/src/share/classes/javax/print/attribute/standard/QueuedJobCount.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/attribute/standard/QueuedJobCount.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, 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
@@ -36,7 +36,6 @@
  * <B>IPP Compatibility:</B> The integer value gives the IPP integer value.
  * The category name returned by <CODE>getName()</CODE> gives the IPP
  * attribute name.
- * <P>
  *
  * @author  Alan Kaminsky
  */
--- a/jdk/src/share/classes/javax/print/attribute/standard/ReferenceUriSchemesSupported.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/attribute/standard/ReferenceUriSchemesSupported.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -55,7 +55,6 @@
  * <CODE>getName()</CODE> is the IPP attribute name.  The enumeration's
  * integer value is the IPP enum value.  The <code>toString()</code> method
  * returns the IPP string representation of the attribute value.
- * <P>
  *
  * @author  Alan Kaminsky
  */
--- a/jdk/src/share/classes/javax/print/attribute/standard/RequestingUserName.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/attribute/standard/RequestingUserName.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -48,7 +48,6 @@
  * <B>IPP Compatibility:</B> The string value gives the IPP name value. The
  * locale gives the IPP natural language. The category name returned by
  * <CODE>getName()</CODE> gives the IPP attribute name.
- * <P>
  *
  * @author  Alan Kaminsky
  */
--- a/jdk/src/share/classes/javax/print/attribute/standard/Severity.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/attribute/standard/Severity.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, 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
@@ -58,7 +58,6 @@
  * between, gives the IPP keyword value for a {@link PrinterStateReasons}.
  * The category name returned by <CODE>getName()</CODE> gives the IPP
  * attribute name.
- * <P>
  *
  * @author  Alan Kaminsky
  */
--- a/jdk/src/share/classes/javax/print/attribute/standard/SheetCollate.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/attribute/standard/SheetCollate.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, 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
@@ -149,7 +149,6 @@
  * </UL>
  * <P>
  * <B>IPP Compatibility:</B> SheetCollate is not an IPP attribute at present.
- * <P>
  *
  * @see  MultipleDocumentHandling
  *
--- a/jdk/src/share/classes/javax/print/attribute/standard/package.html	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/attribute/standard/package.html	Wed Jul 05 19:53:51 2017 +0200
@@ -3,7 +3,7 @@
 <head>
 <title>javax.print.attribute.standard package</title>
 <!--
-Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+Copyright (c) 2000, 2014, 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
@@ -286,7 +286,7 @@
 in a run time exception either immediately or at some later time.
 IllegalArgumentException and NullPointerException are examples of
 typical and acceptable run time exceptions for such cases.
-<P>
+
 @since 1.4
 </body>
 </html>
--- a/jdk/src/share/classes/javax/print/event/package.html	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/event/package.html	Wed Jul 05 19:53:51 2017 +0200
@@ -3,7 +3,7 @@
 <head>
 <title>javax.print.event package</title>
 <!--
-Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
 DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 
 This code is free software; you can redistribute it and/or modify it
@@ -39,7 +39,7 @@
 in a run time exception either immediately or at some later time.
 IllegalArgumentException and NullPointerException are examples of
 typical and acceptable run time exceptions for such cases.
-<P>
+
 @since 1.4
 </body>
 </html>
--- a/jdk/src/share/classes/javax/print/package.html	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/print/package.html	Wed Jul 05 19:53:51 2017 +0200
@@ -3,7 +3,7 @@
 <head>
 <title>javax.print package</title>
 <!--
-Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+Copyright (c) 2000, 2014, 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
@@ -141,7 +141,7 @@
 in a run time exception either immediately or at some later time.
 IllegalArgumentException and NullPointerException are examples of
 typical and acceptable run time exceptions for such cases.
-<P>
+
 @since 1.4
 </body>
 </html>
--- a/jdk/src/share/classes/javax/sound/midi/MidiSystem.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/sound/midi/MidiSystem.java	Wed Jul 05 19:53:51 2017 +0200
@@ -914,7 +914,7 @@
             MidiFileWriter writer = providers.get(i);
             int[] types = writer.getMidiFileTypes();
             for (int j = 0; j < types.length; j++ ) {
-                allTypes.add(new Integer(types[j]));
+                allTypes.add(types[j]);
             }
         }
         int resultTypes[] = new int[allTypes.size()];
@@ -968,7 +968,7 @@
             MidiFileWriter writer = providers.get(i);
             int[] types = writer.getMidiFileTypes(sequence);
             for (int j = 0; j < types.length; j++ ) {
-                allTypes.add(new Integer(types[j]));
+                allTypes.add(types[j]);
             }
         }
         int resultTypes[] = new int[allTypes.size()];
--- a/jdk/src/share/classes/javax/swing/AbstractAction.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/swing/AbstractAction.java	Wed Jul 05 19:53:51 2017 +0200
@@ -269,6 +269,10 @@
      * when a bound property has changed and it will send the appropriate
      * <code>PropertyChangeEvent</code> to any registered
      * <code>PropertyChangeListeners</code>.
+     *
+     * @param propertyName  the name of the property that has changed
+     * @param oldValue  the old value of the property
+     * @param newValue  the new value of the property
      */
     protected void firePropertyChange(String propertyName, Object oldValue, Object newValue) {
         if (changeSupport == null ||
--- a/jdk/src/share/classes/javax/swing/CellRendererPane.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/swing/CellRendererPane.java	Wed Jul 05 19:53:51 2017 +0200
@@ -120,6 +120,18 @@
      * The Container p is the component we're actually drawing on, typically it's
      * equal to this.getParent(). If shouldValidate is true the component c will be
      * validated before painted.
+     *
+     * @param g  the {@code Graphics} object to draw on
+     * @param c  the {@code Component} to draw
+     * @param p  the {@code Container} component actually drawn on
+     * @param x  an int specifying the left side of the area draw in, in pixels,
+     *           measured from the left edge of the graphics context
+     * @param y  an int specifying the top of the area to draw in, in pixels
+     *           measured down from the top edge of the graphics context
+     * @param w  an int specifying the width of the area draw in, in pixels
+     * @param h  an int specifying the height of the area draw in, in pixels
+     * @param shouldValidate  if true, component {@code c} will be validated
+     *                        before being painted
      */
     public void paintComponent(Graphics g, Component c, Container p, int x, int y, int w, int h, boolean shouldValidate) {
         if (c == null) {
@@ -166,6 +178,16 @@
 
     /**
      * Calls this.paintComponent(g, c, p, x, y, w, h, false).
+     *
+     * @param g  the {@code Graphics} object to draw on
+     * @param c  the {@code Component} to draw
+     * @param p  the {@code Container} component actually drawn on
+     * @param x  an int specifying the left side of the area draw in, in pixels,
+     *           measured from the left edge of the graphics context
+     * @param y  an int specifying the top of the area to draw in, in pixels
+     *           measured down from the top edge of the graphics context
+     * @param w  an int specifying the width of the area draw in, in pixels
+     * @param h  an int specifying the height of the area draw in, in pixels
      */
     public void paintComponent(Graphics g, Component c, Container p, int x, int y, int w, int h) {
         paintComponent(g, c, p, x, y, w, h, false);
@@ -174,6 +196,11 @@
 
     /**
      * Calls this.paintComponent() with the rectangles x,y,width,height fields.
+     *
+     * @param g  the {@code Graphics} object to draw on
+     * @param c  the {@code Component} to draw
+     * @param p  the {@code Container} component actually drawn on
+     * @param r  the {@code Rectangle} to draw in
      */
     public void paintComponent(Graphics g, Component c, Container p, Rectangle r) {
         paintComponent(g, c, p, r.x, r.y, r.width, r.height);
--- a/jdk/src/share/classes/javax/swing/DebugGraphics.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/swing/DebugGraphics.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, 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
@@ -139,6 +139,8 @@
 
     /**
      * Sets the Color used to flash drawing operations.
+     *
+     * @param flashColor the Color used to flash drawing operations
      */
     public static void setFlashColor(Color flashColor) {
         info().flashColor = flashColor;
@@ -146,6 +148,8 @@
 
     /**
      * Returns the Color used to flash drawing operations.
+     *
+     * @return the Color used to flash drawing operations
      * @see #setFlashColor
      */
     public static Color flashColor() {
@@ -154,6 +158,8 @@
 
     /**
      * Sets the time delay of drawing operation flashing.
+     *
+     * @param flashTime the time delay of drawing operation flashing
      */
     public static void setFlashTime(int flashTime) {
         info().flashTime = flashTime;
@@ -161,6 +167,8 @@
 
     /**
      * Returns the time delay of drawing operation flashing.
+     *
+     * @return the time delay of drawing operation flashing
      * @see #setFlashTime
      */
     public static int flashTime() {
@@ -169,27 +177,38 @@
 
     /**
      * Sets the number of times that drawing operations will flash.
+     *
+     * @param flashCount number of times that drawing operations will flash
      */
     public static void setFlashCount(int flashCount) {
         info().flashCount = flashCount;
     }
 
-    /** Returns the number of times that drawing operations will flash.
-      * @see #setFlashCount
-      */
+    /**
+     * Returns the number of times that drawing operations will flash.
+     *
+     * @return the number of times that drawing operations will flash
+     * @see #setFlashCount
+     */
     public static int flashCount() {
         return info().flashCount;
     }
 
-    /** Sets the stream to which the DebugGraphics logs drawing operations.
-      */
+    /**
+     * Sets the stream to which the DebugGraphics logs drawing operations.
+     *
+     * @param stream the stream to which the DebugGraphics logs drawing operations
+     */
     public static void setLogStream(java.io.PrintStream stream) {
         info().stream = stream;
     }
 
-    /** Returns the stream to which the DebugGraphics logs drawing operations.
-      * @see #setLogStream
-      */
+    /**
+     * Returns the stream to which the DebugGraphics logs drawing operations.
+     *
+     * @return the stream to which the DebugGraphics logs drawing operations
+     * @see #setLogStream
+     */
     public static java.io.PrintStream logStream() {
         return info().stream;
     }
@@ -1337,6 +1356,8 @@
       * creates a new Frame that shows each operation on an
       * offscreen buffer. The value of <b>options</b> is bitwise OR'd into
       * the current value. To disable debugging use NONE_OPTION.
+      *
+      * @param options indicates how diagnostic information should be displayed
       */
     public void setDebugOptions(int options) {
         if (options != 0) {
@@ -1356,9 +1377,12 @@
         }
     }
 
-    /** Returns the current debugging options for this DebugGraphics.
-      * @see #setDebugOptions
-      */
+    /**
+     * Returns the current debugging options for this DebugGraphics.
+     *
+     * @return the current debugging options for this DebugGraphics
+     * @see #setDebugOptions
+     */
     public int getDebugOptions() {
         return debugOptions;
     }
--- a/jdk/src/share/classes/javax/swing/DefaultBoundedRangeModel.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/swing/DefaultBoundedRangeModel.java	Wed Jul 05 19:53:51 2017 +0200
@@ -88,6 +88,11 @@
      * <pre>
      * min &lt;= value &lt;= value+extent &lt;= max
      * </pre>
+     *
+     * @param value  an int giving the current value
+     * @param extent the length of the inner range that begins at the model's value
+     * @param min    an int giving the minimum value
+     * @param max    an int giving the maximum value
      */
     public DefaultBoundedRangeModel(int value, int extent, int min, int max)
     {
@@ -403,6 +408,7 @@
      * If no such listeners exist,
      * this method returns an empty array.
      *
+     * @param <T> the type of {@code EventListener} class being requested
      * @param listenerType  the type of listeners requested;
      *          this parameter should specify an interface
      *          that descends from <code>java.util.EventListener</code>
--- a/jdk/src/share/classes/javax/swing/DefaultDesktopManager.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/swing/DefaultDesktopManager.java	Wed Jul 05 19:53:51 2017 +0200
@@ -71,7 +71,7 @@
     private transient boolean didDrag;
 
     /** Normally this method will not be called. If it is, it
-      * try to determine the appropriate parent from the desktopIcon of the frame.
+      * tries to determine the appropriate parent from the desktopIcon of the frame.
       * Will remove the desktopIcon from its parent if it successfully adds the frame.
       */
     public void openFrame(JInternalFrame f) {
--- a/jdk/src/share/classes/javax/swing/DefaultSingleSelectionModel.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/swing/DefaultSingleSelectionModel.java	Wed Jul 05 19:53:51 2017 +0200
@@ -155,6 +155,7 @@
      * If no such listeners exist,
      * this method returns an empty array.
      *
+     * @param <T>  the type of {@code EventListener} class being requested
      * @param listenerType  the type of listeners requested;
      *          this parameter should specify an interface
      *          that descends from <code>java.util.EventListener</code>
--- a/jdk/src/share/classes/javax/swing/DesktopManager.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/swing/DesktopManager.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -47,73 +47,136 @@
   */
 public interface DesktopManager
 {
-    /** If possible, display this frame in an appropriate location.
-      * Normally, this is not called, as the creator of the JInternalFrame
-      * will add the frame to the appropriate parent.
-      */
+    /**
+     * If possible, display this frame in an appropriate location.
+     * Normally, this is not called, as the creator of the JInternalFrame
+     * will add the frame to the appropriate parent.
+     *
+     * @param f  the {@code JInternalFrame} to be displayed
+     */
     void openFrame(JInternalFrame f);
 
-    /** Generally, this call should remove the frame from it's parent. */
+    /**
+     * Generally, this call should remove the frame from its parent.
+     *
+     * @param f  the {@code JInternalFrame} to be removed
+     */
     void closeFrame(JInternalFrame f);
 
-    /** Generally, the frame should be resized to match it's parents bounds. */
+    /**
+     * Generally, the frame should be resized to match its parents bounds.
+     *
+     * @param f  the {@code JInternalFrame} to be resized
+     */
     void maximizeFrame(JInternalFrame f);
-    /** Generally, this indicates that the frame should be restored to it's
-      * size and position prior to a maximizeFrame() call.
-      */
+
+    /**
+     * Generally, this indicates that the frame should be restored to its
+     * size and position prior to a maximizeFrame() call.
+     *
+     * @param f  the {@code JInternalFrame} to be restored
+     */
     void minimizeFrame(JInternalFrame f);
-    /** Generally, remove this frame from it's parent and add an iconic representation. */
+
+    /**
+     * Generally, remove this frame from its parent and add an iconic representation.
+     *
+     * @param f  the {@code JInternalFrame} to be iconified
+     */
     void iconifyFrame(JInternalFrame f);
-    /** Generally, remove any iconic representation that is present and restore the
-      * frame to it's original size and location.
-      */
+
+    /**
+     * Generally, remove any iconic representation that is present and restore the
+     * frame to it's original size and location.
+     *
+     * @param f  the {@code JInternalFrame} to be de-iconified
+     */
     void deiconifyFrame(JInternalFrame f);
 
     /**
      * Generally, indicate that this frame has focus. This is usually called after
      * the JInternalFrame's IS_SELECTED_PROPERTY has been set to true.
+     *
+     * @param f  the {@code JInternalFrame} to be activated
      */
     void activateFrame(JInternalFrame f);
 
     /**
      * Generally, indicate that this frame has lost focus. This is usually called
      * after the JInternalFrame's IS_SELECTED_PROPERTY has been set to false.
+     *
+     * @param f  the {@code JInternalFrame} to be deactivated
      */
     void deactivateFrame(JInternalFrame f);
 
-    /** This method is normally called when the user has indicated that
-      * they will begin dragging a component around. This method should be called
-      * prior to any dragFrame() calls to allow the DesktopManager to prepare any
-      * necessary state. Normally <b>f</b> will be a JInternalFrame.
-      */
+    /**
+     * This method is normally called when the user has indicated that
+     * they will begin dragging a component around. This method should be called
+     * prior to any dragFrame() calls to allow the DesktopManager to prepare any
+     * necessary state. Normally <b>f</b> will be a JInternalFrame.
+     *
+     * @param f  the {@code JComponent} being dragged
+     */
     void beginDraggingFrame(JComponent f);
 
-    /** The user has moved the frame. Calls to this method will be preceded by calls
-      * to beginDraggingFrame().
-      *  Normally <b>f</b> will be a JInternalFrame.
-      */
+    /**
+     * The user has moved the frame. Calls to this method will be preceded by calls
+     * to beginDraggingFrame().
+     * Normally <b>f</b> will be a JInternalFrame.
+     *
+     * @param f  the {@code JComponent} being dragged
+     * @param newX  the new x-coordinate
+     * @param newY  the new y-coordinate
+     */
     void dragFrame(JComponent f, int newX, int newY);
-    /** This method signals the end of the dragging session. Any state maintained by
-      * the DesktopManager can be removed here.  Normally <b>f</b> will be a JInternalFrame.
-      */
+
+    /**
+     * This method signals the end of the dragging session. Any state maintained by
+     * the DesktopManager can be removed here.  Normally <b>f</b> will be a JInternalFrame.
+     *
+     * @param f  the {@code JComponent} being dragged
+     */
     void endDraggingFrame(JComponent f);
 
-    /** This methods is normally called when the user has indicated that
-      * they will begin resizing the frame. This method should be called
-      * prior to any resizeFrame() calls to allow the DesktopManager to prepare any
-      * necessary state.  Normally <b>f</b> will be a JInternalFrame.
-      */
+    /**
+     * This method is normally called when the user has indicated that
+     * they will begin resizing the frame. This method should be called
+     * prior to any resizeFrame() calls to allow the DesktopManager to prepare any
+     * necessary state.  Normally <b>f</b> will be a JInternalFrame.
+     *
+     * @param f  the {@code JComponent} being resized
+     */
     void beginResizingFrame(JComponent f, int direction);
-    /** The user has resized the component. Calls to this method will be preceded by calls
-      * to beginResizingFrame().
-      *  Normally <b>f</b> will be a JInternalFrame.
-      */
+
+    /**
+     * The user has resized the component. Calls to this method will be preceded by calls
+     * to beginResizingFrame().
+     * Normally <b>f</b> will be a JInternalFrame.
+     *
+     * @param f  the {@code JComponent} being resized
+     * @param newX  the new x-coordinate
+     * @param newY  the new y-coordinate
+     * @param newWidth  the new width
+     * @param newHeight  the new height
+     */
     void resizeFrame(JComponent f, int newX, int newY, int newWidth, int newHeight);
-    /** This method signals the end of the resize session. Any state maintained by
-      * the DesktopManager can be removed here.  Normally <b>f</b> will be a JInternalFrame.
-      */
+
+    /**
+     * This method signals the end of the resize session. Any state maintained by
+     * the DesktopManager can be removed here.  Normally <b>f</b> will be a JInternalFrame.
+     *
+     * @param f  the {@code JComponent} being resized
+     */
     void endResizingFrame(JComponent f);
 
-    /** This is a primitive reshape method.*/
+    /**
+     * This is a primitive reshape method.
+     *
+     * @param f  the {@code JComponent} being moved or resized
+     * @param newX  the new x-coordinate
+     * @param newY  the new y-coordinate
+     * @param newWidth  the new width
+     * @param newHeight  the new height
+     */
     void setBoundsForFrame(JComponent f, int newX, int newY, int newWidth, int newHeight);
 }
--- a/jdk/src/share/classes/javax/swing/GrayFilter.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/swing/GrayFilter.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 1998, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, 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
@@ -44,6 +44,9 @@
 
     /**
      * Creates a disabled image
+     *
+     * @param i  an {@code Image} to be created as disabled
+     * @return  the new grayscale image created from {@code i}
      */
     public static Image createDisabledImage (Image i) {
         GrayFilter filter = new GrayFilter(true, 50);
--- a/jdk/src/share/classes/javax/swing/Icon.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/swing/Icon.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 1998, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, 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
@@ -41,6 +41,11 @@
      * Draw the icon at the specified location.  Icon implementations
      * may use the Component argument to get properties useful for
      * painting, e.g. the foreground or background color.
+     *
+     * @param c  a {@code Component} to get properties useful for painting
+     * @param g  the graphics context
+     * @param x  the X coordinate of the icon's top-left corner
+     * @param y  the Y coordinate of the icon's top-left corner
      */
     void paintIcon(Component c, Graphics g, int x, int y);
 
--- a/jdk/src/share/classes/javax/swing/JApplet.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/swing/JApplet.java	Wed Jul 05 19:53:51 2017 +0200
@@ -157,8 +157,11 @@
         enableEvents(AWTEvent.KEY_EVENT_MASK);
     }
 
-
-    /** Called by the constructor methods to create the default rootPane. */
+    /**
+     * Called by the constructor methods to create the default rootPane.
+     *
+     * @return  a new {@code JRootPane}
+     */
     protected JRootPane createRootPane() {
         JRootPane rp = new JRootPane();
         // NOTE: this uses setOpaque vs LookAndFeel.installProperty as there
@@ -247,6 +250,7 @@
    /**
     * Returns the menubar set on this applet.
     *
+    * @return the menubar set on this applet
     * @see #setJMenuBar
     */
     public JMenuBar getJMenuBar() {
@@ -542,6 +546,9 @@
 // Accessibility support
 ////////////////
 
+    /**
+     * {@code AccessibleContext} associated with this {@code JApplet}
+     */
     protected AccessibleContext accessibleContext = null;
 
     /**
--- a/jdk/src/share/classes/javax/swing/JComponent.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/swing/JComponent.java	Wed Jul 05 19:53:51 2017 +0200
@@ -496,6 +496,7 @@
     /**
      * Returns true if the JPopupMenu should be inherited from the parent.
      *
+     * @return true if the JPopupMenu should be inherited from the parent
      * @see #setComponentPopupMenu
      * @since 1.5
      */
@@ -1302,6 +1303,7 @@
      * <code>SortingFocusTraversalPolicy</code> from considering descendants
      * of this JComponent when computing a focus traversal cycle.
      *
+     * @return false
      * @see java.awt.Component#setFocusTraversalKeys
      * @see SortingFocusTraversalPolicy
      * @deprecated As of 1.4, replaced by
@@ -2213,6 +2215,13 @@
      * This method is now obsolete, please use a combination of
      * <code>getActionMap()</code> and <code>getInputMap()</code> for
      * similar behavior.
+     *
+     * @param anAction  action to be registered to given keystroke and condition
+     * @param aKeyStroke  a {@code KeyStroke}
+     * @param aCondition  the condition to be associated with given keystroke
+     *                    and action
+     * @see #getActionMap
+     * @see #getInputMap(int)
      */
     public void registerKeyboardAction(ActionListener anAction,KeyStroke aKeyStroke,int aCondition) {
         registerKeyboardAction(anAction,null,aKeyStroke,aCondition);
@@ -2231,6 +2240,9 @@
      * Unregisters a keyboard action.
      * This will remove the binding from the <code>ActionMap</code>
      * (if it exists) as well as the <code>InputMap</code>s.
+     *
+     * @param aKeyStroke  the keystroke for which to unregister its
+     *                    keyboard action
      */
     public void unregisterKeyboardAction(KeyStroke aKeyStroke) {
         ActionMap am = getActionMap(false);
@@ -2286,6 +2298,8 @@
      * conditions <code>WHEN_FOCUSED</code> and
      * <code>WHEN_IN_FOCUSED_WINDOW</code> condition.
      *
+     * @param aKeyStroke  the keystroke for which to request an
+     *                    action-keystroke condition
      * @return the action-keystroke condition
      */
     public int getConditionForKeyStroke(KeyStroke aKeyStroke) {
@@ -2302,6 +2316,7 @@
      * Returns the object that will perform the action registered for a
      * given keystroke.
      *
+     * @param aKeyStroke  the keystroke for which to return a listener
      * @return the <code>ActionListener</code>
      *          object invoked when the keystroke occurs
      */
@@ -2610,6 +2625,8 @@
      * <code>FocusTraversalPolicy</code> of this <code>JComponent</code>'s
      * focus-cycle-root ancestor is used.
      *
+     * @return true if this component can request to get the input focus,
+     *              false if it can not
      * @see java.awt.FocusTraversalPolicy#getDefaultComponent
      * @deprecated As of 1.4, replaced by
      * <code>FocusTraversalPolicy.getDefaultComponent(Container).requestFocus()</code>
@@ -2821,6 +2838,8 @@
      * normally override this method if they process some
      * key events themselves.  If the event is processed,
      * it should be consumed.
+     *
+     * @param e the event to be processed
      */
     protected void processComponentKeyEvent(KeyEvent e) {
     }
@@ -3032,6 +3051,10 @@
      * <code>setToolTipText</code>.  If a component provides
      * more extensive API to support differing tooltips at different locations,
      * this method should be overridden.
+     *
+     * @param event the {@code MouseEvent} that initiated the
+     *              {@code ToolTip} display
+     * @return a string containing the  tooltip
      */
     public String getToolTipText(MouseEvent event) {
         return getToolTipText();
@@ -3774,6 +3797,10 @@
          * but not very pretty outside borders in compound border situations.
          * It's rather arbitrary, but hopefully decent UI programmers will
          * not create multiple titled borders for the same component.
+         *
+         * @param b  the {@code Border} for which to retrieve its title
+         * @return the border's title as a {@code String}, null if it has
+         *         no title
          */
         protected String getBorderTitle(Border b) {
             String s;
@@ -4198,6 +4225,7 @@
      * Returns true if this component is lightweight, that is, if it doesn't
      * have a native window system peer.
      *
+     * @param c  the {@code Component} to be checked
      * @return true if this component is lightweight
      */
     @SuppressWarnings("deprecation")
--- a/jdk/src/share/classes/javax/swing/JDesktopPane.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/swing/JDesktopPane.java	Wed Jul 05 19:53:51 2017 +0200
@@ -208,8 +208,11 @@
      }
 
     /**
-     * Returns the <code>DesktopManger</code> that handles
+     * Returns the {@code DesktopManger} that handles
      * desktop-specific UI actions.
+     *
+     * @return the {@code DesktopManger} that handles desktop-specific
+     *         UI actions
      */
     public DesktopManager getDesktopManager() {
         return desktopManager;
--- a/jdk/src/share/classes/javax/swing/JDialog.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/swing/JDialog.java	Wed Jul 05 19:53:51 2017 +0200
@@ -664,6 +664,8 @@
     /**
      * Called by the constructor methods to create the default
      * {@code rootPane}.
+     *
+     * @return  a new {@code JRootPane}
      */
     protected JRootPane createRootPane() {
         JRootPane rp = new JRootPane();
@@ -854,6 +856,7 @@
    /**
     * Returns the menubar set on this dialog.
     *
+    * @return the menubar set on this dialog
     * @see #setJMenuBar
     */
     public JMenuBar getJMenuBar() {
@@ -1225,6 +1228,9 @@
 // Accessibility support
 ////////////////
 
+    /**
+     * {@code AccessibleContext} associated with this {@code JDialog}
+     */
     protected AccessibleContext accessibleContext = null;
 
     /**
--- a/jdk/src/share/classes/javax/swing/JEditorPane.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/swing/JEditorPane.java	Wed Jul 05 19:53:51 2017 +0200
@@ -39,6 +39,7 @@
 import javax.swing.event.*;
 import javax.swing.text.html.*;
 import javax.accessibility.*;
+import sun.reflect.misc.ReflectUtil;
 
 /**
  * A text component to edit various kinds of content.
@@ -1193,12 +1194,12 @@
             try {
                 Class<?> c;
                 if (loader != null) {
+                    ReflectUtil.checkPackageAccess(classname);
                     c = loader.loadClass(classname);
                 } else {
                     // Will only happen if developer has invoked
                     // registerEditorKitForContentType(type, class, null).
-                    c = Class.forName(classname, true, Thread.currentThread().
-                                      getContextClassLoader());
+                    c = SwingUtilities.loadSystemClass(classname);
                 }
                 k = (EditorKit) c.newInstance();
                 kitRegistry.put(type, k);
--- a/jdk/src/share/classes/javax/swing/JInternalFrame.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/swing/JInternalFrame.java	Wed Jul 05 19:53:51 2017 +0200
@@ -2107,7 +2107,7 @@
             if (n == null) {
                 return false;
             }
-            setLayer(new Integer(n.intValue()));
+            setLayer(Integer.valueOf(n.intValue()));
             return true;
         }
 
--- a/jdk/src/share/classes/javax/swing/JLabel.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/swing/JLabel.java	Wed Jul 05 19:53:51 2017 +0200
@@ -128,6 +128,10 @@
     private int horizontalTextPosition = TRAILING;
     private int iconTextGap = 4;
 
+    /**
+     * The Component this label is for; null if the label
+     * is not the label for a component
+     */
     protected Component labelFor = null;
 
     /**
@@ -310,6 +314,7 @@
      * <p>
      * This is a JavaBeans bound property.
      *
+     * @param text  the single line of text this component will display
      * @see #setVerticalTextPosition
      * @see #setHorizontalTextPosition
      * @see #setIcon
@@ -366,6 +371,7 @@
      * <p>
      * This is a JavaBeans bound property.
      *
+     * @param icon  the default icon this component will display
      * @see #setVerticalTextPosition
      * @see #setHorizontalTextPosition
      * @see #getIcon
@@ -476,6 +482,7 @@
      * call the requestFocus method of the component specified by the
      * labelFor property when the mnemonic is activated.
      *
+     * @param key  a keycode that indicates a mnemonic key
      * @see #getLabelFor
      * @see #setLabelFor
      * @beaninfo
@@ -592,6 +599,8 @@
      *
      * @param key the property value to check
      * @param message the IllegalArgumentException detail message
+     * @return the key value if {@code key} is a a legal value for the
+     *         horizontalAlignment properties
      * @exception IllegalArgumentException if key isn't LEFT, CENTER, RIGHT,
      * LEADING or TRAILING.
      * @see #setHorizontalTextPosition
@@ -617,6 +626,8 @@
      *
      * @param key the property value to check
      * @param message the IllegalArgumentException detail message
+     * @return the key value if {@code key} is a legal value for the
+     *         verticalAlignment or verticalTextPosition properties
      * @exception IllegalArgumentException if key isn't TOP, CENTER, or BOTTOM.
      * @see #setVerticalAlignment
      * @see #setVerticalTextPosition
@@ -652,6 +663,7 @@
      * <p>
      * This is a JavaBeans bound property.
      *
+     * @param iconTextGap  the space between the icon and text properties
      * @see #getIconTextGap
      * @beaninfo
      *        bound: true
--- a/jdk/src/share/classes/javax/swing/JLayeredPane.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/swing/JLayeredPane.java	Wed Jul 05 19:53:51 2017 +0200
@@ -159,15 +159,15 @@
 public class JLayeredPane extends JComponent implements Accessible {
     /// Watch the values in getObjectForLayer()
     /** Convenience object defining the Default layer. Equivalent to new Integer(0).*/
-    public final static Integer DEFAULT_LAYER = new Integer(0);
+    public final static Integer DEFAULT_LAYER = 0;
     /** Convenience object defining the Palette layer. Equivalent to new Integer(100).*/
-    public final static Integer PALETTE_LAYER = new Integer(100);
+    public final static Integer PALETTE_LAYER = 100;
     /** Convenience object defining the Modal layer. Equivalent to new Integer(200).*/
-    public final static Integer MODAL_LAYER = new Integer(200);
+    public final static Integer MODAL_LAYER = 200;
     /** Convenience object defining the Popup layer. Equivalent to new Integer(300).*/
-    public final static Integer POPUP_LAYER = new Integer(300);
+    public final static Integer POPUP_LAYER = 300;
     /** Convenience object defining the Drag layer. Equivalent to new Integer(400).*/
-    public final static Integer DRAG_LAYER = new Integer(400);
+    public final static Integer DRAG_LAYER = 400;
     /** Convenience object defining the Frame Content layer.
       * This layer is normally only use to position the contentPane and menuBar
       * components of JFrame.
@@ -294,10 +294,7 @@
       */
     public static void putLayer(JComponent c, int layer) {
         /// MAKE SURE THIS AND setLayer(Component c, int layer, int position)  are SYNCED
-        Integer layerObj;
-
-        layerObj = new Integer(layer);
-        c.putClientProperty(LAYER_PROPERTY, layerObj);
+        c.putClientProperty(LAYER_PROPERTY, layer);
     }
 
     /** Gets the layer property for a JComponent, it
@@ -609,27 +606,20 @@
      * @return an Integer object for that layer
      */
     protected Integer getObjectForLayer(int layer) {
-        Integer layerObj;
         switch(layer) {
         case 0:
-            layerObj = DEFAULT_LAYER;
-            break;
+            return DEFAULT_LAYER;
         case 100:
-            layerObj = PALETTE_LAYER;
-            break;
+            return PALETTE_LAYER;
         case 200:
-            layerObj = MODAL_LAYER;
-            break;
+            return MODAL_LAYER;
         case 300:
-            layerObj = POPUP_LAYER;
-            break;
+            return POPUP_LAYER;
         case 400:
-            layerObj = DRAG_LAYER;
-            break;
+            return DRAG_LAYER;
         default:
-            layerObj = new Integer(layer);
+            return layer;
         }
-        return layerObj;
     }
 
     /**
--- a/jdk/src/share/classes/javax/swing/JPopupMenu.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/swing/JPopupMenu.java	Wed Jul 05 19:53:51 2017 +0200
@@ -298,6 +298,7 @@
      * it to the end of this menu.
      *
      * @param s the string for the menu item to be added
+     * @return a new {@code JMenuItem} created using {@code s}
      */
     public JMenuItem add(String s) {
         return add(new JMenuItem(s));
@@ -452,6 +453,9 @@
     /**
      * Returns a properly configured <code>PropertyChangeListener</code>
      * which updates the control as changes to the <code>Action</code> occur.
+     *
+     * @param b the menu item for which to create a listener
+     * @return a properly configured {@code PropertyChangeListener}
      */
     protected PropertyChangeListener createActionChangeListener(JMenuItem b) {
         return b.createActionPropertyChangeListener0(b.getAction());
@@ -1530,6 +1534,9 @@
     @SuppressWarnings("serial")
     static public class Separator extends JSeparator
     {
+        /**
+         * Constructs a popup menu-specific Separator.
+         */
         public Separator( )
         {
             super( JSeparator.HORIZONTAL );
@@ -1553,6 +1560,7 @@
      * Returns true if the <code>MouseEvent</code> is considered a popup trigger
      * by the <code>JPopupMenu</code>'s currently installed UI.
      *
+     * @param e a {@code MouseEvent}
      * @return true if the mouse event is a popup trigger
      * @since 1.3
      */
--- a/jdk/src/share/classes/javax/swing/JScrollBar.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/swing/JScrollBar.java	Wed Jul 05 19:53:51 2017 +0200
@@ -341,7 +341,7 @@
         if (accessibleContext != null) {
             accessibleContext.firePropertyChange(
                     AccessibleContext.ACCESSIBLE_VALUE_PROPERTY,
-                    oldValue, new Integer(model.getValue()));
+                    oldValue, model.getValue());
         }
     }
 
@@ -952,7 +952,7 @@
          */
         public Number getMaximumAccessibleValue() {
             // TIGER - 4422362
-            return new Integer(model.getMaximum() - model.getExtent());
+            return model.getMaximum() - model.getExtent();
         }
 
     } // AccessibleJScrollBar
--- a/jdk/src/share/classes/javax/swing/JScrollPane.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/swing/JScrollPane.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1102,6 +1102,7 @@
      * <code>setColumnHeaderView</code>
      * to add a column header component and its viewport to the scroll pane.
      *
+     * @param columnHeader  a {@code JViewport} which is the new column header
      * @see #getColumnHeader
      * @see #setColumnHeaderView
      *
@@ -1299,6 +1300,7 @@
      * Indicates whether or not scrolling will take place in response to the
      * mouse wheel.  Wheel scrolling is enabled by default.
      *
+     * @return true if mouse wheel scrolling is enabled, false otherwise
      * @see #setWheelScrollingEnabled
      * @since 1.4
      * @beaninfo
@@ -1448,9 +1450,12 @@
     protected class AccessibleJScrollPane extends AccessibleJComponent
         implements ChangeListener, PropertyChangeListener {
 
+        /**
+         * this {@code JScrollPane}'s current {@code JViewport}
+         */
         protected JViewport viewPort = null;
 
-        /*
+        /**
          * Resets the viewport ChangeListener and PropertyChangeListener
          */
         public void resetViewPort() {
--- a/jdk/src/share/classes/javax/swing/JSpinner.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/swing/JSpinner.java	Wed Jul 05 19:53:51 2017 +0200
@@ -149,6 +149,7 @@
      * a set of previous/next buttons, and an editor appropriate
      * for the model.
      *
+     * @param model  a model for the new spinner
      * @throws NullPointerException if the model is {@code null}
      */
     public JSpinner(SpinnerModel model) {
@@ -328,6 +329,7 @@
      * getModel().getValue()
      * </pre>
      *
+     * @return the current value of the model
      * @see #setValue
      * @see SpinnerModel#getValue
      */
@@ -349,6 +351,7 @@
      * getModel().setValue(value)
      * </pre>
      *
+     * @param value  new value for the spinner
      * @throws IllegalArgumentException if <code>value</code> isn't allowed
      * @see #getValue
      * @see SpinnerModel#setValue
--- a/jdk/src/share/classes/javax/swing/JTextField.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/swing/JTextField.java	Wed Jul 05 19:53:51 2017 +0200
@@ -675,6 +675,9 @@
      * that of the <code>Action</code>.
      *
      * @param a the textfield's action
+     * @return a {@code PropertyChangeListener} that is responsible for
+     *         listening for changes from the specified {@code Action} and
+     *         updating the appropriate properties
      * @since 1.3
      * @see Action
      * @see #setAction
--- a/jdk/src/share/classes/javax/swing/JWindow.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/swing/JWindow.java	Wed Jul 05 19:53:51 2017 +0200
@@ -272,6 +272,8 @@
     /**
      * Called by the constructor methods to create the default
      * <code>rootPane</code>.
+     *
+     * @return a new {@code JRootPane}
      */
     protected JRootPane createRootPane() {
         JRootPane rp = new JRootPane();
--- a/jdk/src/share/classes/javax/swing/LookAndFeel.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/swing/LookAndFeel.java	Wed Jul 05 19:53:51 2017 +0200
@@ -465,7 +465,7 @@
      * @see Class#getResourceAsStream(String)
      */
     public static Object makeIcon(final Class<?> baseClass, final String gifFile) {
-        return SwingUtilities2.makeIcon(baseClass, baseClass, gifFile);
+        return SwingUtilities2.makeIcon_Unprivileged(baseClass, baseClass, gifFile);
     }
 
     /**
--- a/jdk/src/share/classes/javax/swing/ProgressMonitor.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/swing/ProgressMonitor.java	Wed Jul 05 19:53:51 2017 +0200
@@ -369,6 +369,8 @@
 
     /**
      * Returns true if the user hits the Cancel button in the progress dialog.
+     *
+     * @return true if the user hits the Cancel button in the progress dialog
      */
     public boolean isCanceled() {
         if (pane == null) return false;
@@ -396,6 +398,8 @@
      * Returns the amount of time this object waits before deciding whether
      * or not to popup a progress monitor.
      *
+     * @return the amount of time in milliseconds this object waits before
+     *         deciding whether or not to popup a progress monitor
      * @see #setMillisToDecideToPopup
      */
     public int getMillisToDecideToPopup() {
@@ -419,6 +423,8 @@
     /**
      * Returns the amount of time it will take for the popup to appear.
      *
+     * @return the amont of time in milliseconds it will take for the
+     *         popup to appear
      * @see #setMillisToPopup
      */
     public int getMillisToPopup() {
--- a/jdk/src/share/classes/javax/swing/SortingFocusTraversalPolicy.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/swing/SortingFocusTraversalPolicy.java	Wed Jul 05 19:53:51 2017 +0200
@@ -109,11 +109,12 @@
             AccessController.doPrivileged(new PrivilegedAction<Method>() {
                 public Method run() {
                     try {
-                        Class c = Class.forName("java.util.Arrays");
-                        Method m = c.getDeclaredMethod("legacyMergeSort", new Class[]{Object[].class, Comparator.class});
+                        Method m = java.util.Arrays.class.getDeclaredMethod("legacyMergeSort",
+                                                                            new Class<?>[]{Object[].class,
+                                                                                    Comparator.class});
                         m.setAccessible(true);
                         return m;
-                    } catch (ClassNotFoundException | NoSuchMethodException e) {
+                    } catch (NoSuchMethodException e) {
                         // using default sorting algo
                         return null;
                     }
--- a/jdk/src/share/classes/javax/swing/SpinnerModel.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/swing/SpinnerModel.java	Wed Jul 05 19:53:51 2017 +0200
@@ -88,6 +88,7 @@
      * that case, <code>model.setValue(new Number(11))</code>
      * would throw an exception.
      *
+     * @param value  new value for the spinner
      * @throws IllegalArgumentException if <code>value</code> isn't allowed
      * @see #getValue
      */
--- a/jdk/src/share/classes/javax/swing/Timer.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/swing/Timer.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, 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
@@ -154,6 +154,9 @@
      * NOTE: all fields need to be handled in readResolve
      */
 
+    /**
+     * The collection of registered listeners
+     */
     protected EventListenerList listenerList = new EventListenerList();
 
     // The following field strives to maintain the following:
@@ -335,6 +338,7 @@
      * If no such listeners exist,
      * this method returns an empty array.
      *
+     * @param <T> the type of {@code EventListener} class being requested
      * @param listenerType  the type of listeners requested;
      *          this parameter should specify an interface
      *          that descends from <code>java.util.EventListener</code>
@@ -410,6 +414,7 @@
      * Returns the delay, in milliseconds,
      * between firings of action events.
      *
+     * @return the delay, in milliseconds, between firings of action events
      * @see #setDelay
      * @see #getInitialDelay
      */
@@ -441,8 +446,9 @@
 
 
     /**
-     * Returns the <code>Timer</code>'s initial delay.
+     * Returns the {@code Timer}'s initial delay.
      *
+     * @return the {@code Timer}'s intial delay, in milliseconds
      * @see #setInitialDelay
      * @see #setDelay
      */
@@ -470,6 +476,8 @@
      * an action event
      * to its listeners multiple times.
      *
+     * @return true if the {@code Timer} will send an action event to its
+     *              listeners multiple times
      * @see #setRepeats
      */
     public boolean isRepeats() {
@@ -506,9 +514,11 @@
 
 
     /**
-     * Returns <code>true</code> if the <code>Timer</code> coalesces
+     * Returns {@code true} if the {@code Timer} coalesces
      * multiple pending action events.
      *
+     * @return true if the {@code Timer} coalesces multiple pending
+     *              action events
      * @see #setCoalesce
      */
     public boolean isCoalesce() {
@@ -555,8 +565,9 @@
 
 
     /**
-     * Returns <code>true</code> if the <code>Timer</code> is running.
+     * Returns {@code true} if the {@code Timer} is running.
      *
+     * @return true if the {@code Timer} is running, false otherwise
      * @see #start
      */
     public boolean isRunning() {
--- a/jdk/src/share/classes/javax/swing/filechooser/FileSystemView.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/swing/filechooser/FileSystemView.java	Wed Jul 05 19:53:51 2017 +0200
@@ -645,7 +645,7 @@
         int i = 1;
         while (newFolder.exists() && i < 100) {
             newFolder = createFileObject(containingDir, MessageFormat.format(
-                    newFolderNextString, new Integer(i)));
+                    newFolderNextString, i));
             i++;
         }
 
@@ -755,7 +755,7 @@
         int i = 2;
         while (newFolder.exists() && i < 100) {
             newFolder = createFileObject(containingDir, MessageFormat.format(
-                newFolderNextString, new Integer(i)));
+                newFolderNextString, i));
             i++;
         }
 
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicArrowButton.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicArrowButton.java	Wed Jul 05 19:53:51 2017 +0200
@@ -99,6 +99,8 @@
 
         /**
          * Returns the direction of the arrow.
+         *
+         * @return the direction of the arrow
          */
         public int getDirection() {
             return direction;
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicBorders.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicBorders.java	Wed Jul 05 19:53:51 2017 +0200
@@ -45,6 +45,11 @@
 
 public class BasicBorders {
 
+    /**
+     * Returns a border instance for a {@code JButton}.
+     *
+     * @return a border instance for a {@code JButton}
+     */
     public static Border getButtonBorder() {
         UIDefaults table = UIManager.getLookAndFeelDefaults();
         Border buttonBorder = new BorderUIResource.CompoundBorderUIResource(
@@ -57,6 +62,11 @@
         return buttonBorder;
     }
 
+    /**
+     * Returns a border instance for a {@code JRadioButton}.
+     *
+     * @return a border instance for a {@code JRadioButton}
+     */
     public static Border getRadioButtonBorder() {
         UIDefaults table = UIManager.getLookAndFeelDefaults();
         Border radioButtonBorder = new BorderUIResource.CompoundBorderUIResource(
@@ -69,6 +79,11 @@
         return radioButtonBorder;
     }
 
+    /**
+     * Returns a border instance for a {@code JToggleButton}.
+     *
+     * @return a border instance for a {@code JToggleButton}
+     */
     public static Border getToggleButtonBorder() {
         UIDefaults table = UIManager.getLookAndFeelDefaults();
         Border toggleButtonBorder = new BorderUIResource.CompoundBorderUIResource(
@@ -81,6 +96,11 @@
         return toggleButtonBorder;
     }
 
+    /**
+     * Returns a border instance for a {@code JMenuBar}.
+     *
+     * @return a border instance for a {@code JMenuBar}
+     */
     public static Border getMenuBarBorder() {
         UIDefaults table = UIManager.getLookAndFeelDefaults();
         Border menuBarBorder = new BasicBorders.MenuBarBorder(
@@ -90,6 +110,11 @@
         return menuBarBorder;
     }
 
+    /**
+     * Returns a border instance for a {@code JSplitPane}.
+     *
+     * @return a border instance for a {@code JSplitPane}
+     */
     public static Border getSplitPaneBorder() {
         UIDefaults table = UIManager.getLookAndFeelDefaults();
         Border splitPaneBorder = new BasicBorders.SplitPaneBorder(
@@ -99,7 +124,9 @@
     }
 
     /**
-     * Returns a border instance for a JSplitPane divider
+     * Returns a border instance for a {@code JSplitPane} divider.
+     *
+     * @return a border instance for a {@code JSplitPane} divider
      * @since 1.3
      */
     public static Border getSplitPaneDividerBorder() {
@@ -110,6 +137,11 @@
         return splitPaneBorder;
     }
 
+    /**
+     * Returns a border instance for a {@code JTextField}.
+     *
+     * @return a border instance for a {@code JTextField}
+     */
     public static Border getTextFieldBorder() {
         UIDefaults table = UIManager.getLookAndFeelDefaults();
         Border textFieldBorder = new BasicBorders.FieldBorder(
@@ -120,12 +152,22 @@
         return textFieldBorder;
     }
 
+    /**
+     * Returns a border instance for a {@code JProgressBar}.
+     *
+     * @return a border instance for a {@code JProgressBar}
+     */
     public static Border getProgressBarBorder() {
         UIDefaults table = UIManager.getLookAndFeelDefaults();
         Border progressBarBorder = new BorderUIResource.LineBorderUIResource(Color.green, 2);
         return progressBarBorder;
     }
 
+    /**
+     * Returns a border instance for a {@code JInternalFrame}.
+     *
+     * @return a border instance for a {@code JInternalFrame}
+     */
     public static Border getInternalFrameBorder() {
         UIDefaults table = UIManager.getLookAndFeelDefaults();
         Border internalFrameBorder = new BorderUIResource.CompoundBorderUIResource(
@@ -147,6 +189,14 @@
     @SuppressWarnings("serial") // Superclass is not serializable across versions
     public static class RolloverButtonBorder extends ButtonBorder {
 
+        /**
+         * Constructs a new instance of a {@code RolloverButtonBorder}.
+         *
+         * @param shadow a color of shadow
+         * @param darkShadow a color of dark shadow
+         * @param highlight a color of highlight
+         * @param lightHighlight a color of light highlight
+         */
         public RolloverButtonBorder(Color shadow, Color darkShadow,
                                   Color highlight, Color lightHighlight) {
             super(shadow, darkShadow, highlight, lightHighlight);
@@ -227,13 +277,36 @@
         }
     }
 
+    /**
+     * Draws a border around a button.
+     */
     @SuppressWarnings("serial") // Superclass is not serializable across versions
    public static class ButtonBorder extends AbstractBorder implements UIResource {
+        /**
+         * The color of shadow.
+         */
         protected Color shadow;
+        /**
+         * The color of dark shadow.
+         */
         protected Color darkShadow;
+        /**
+         * The color of highlight.
+         */
         protected Color highlight;
+        /**
+         * The color of light highlight.
+         */
         protected Color lightHighlight;
 
+        /**
+         * Constructs a new instance of a {@code ButtonBorder}.
+         *
+         * @param shadow a color of shadow
+         * @param darkShadow a color of dark shadow
+         * @param highlight a color of highlight
+         * @param lightHighlight a color of light highlight
+         */
         public ButtonBorder(Color shadow, Color darkShadow,
                             Color highlight, Color lightHighlight) {
             this.shadow = shadow;
@@ -270,9 +343,20 @@
 
     }
 
+    /**
+     * Draws the border around a toggle button.
+     */
     @SuppressWarnings("serial") // Superclass is not serializable across versions
     public static class ToggleButtonBorder extends ButtonBorder {
 
+        /**
+         * Constructs a new instance of a {@code ToggleButtonBorder}.
+         *
+         * @param shadow a color of shadow
+         * @param darkShadow a color of dark shadow
+         * @param highlight a color of highlight
+         * @param lightHighlight a color of light highlight
+         */
         public ToggleButtonBorder(Color shadow, Color darkShadow,
                                   Color highlight, Color lightHighlight) {
             super(shadow, darkShadow, highlight, lightHighlight);
@@ -292,9 +376,20 @@
         }
     }
 
+    /**
+     * Draws the border around a radio button.
+     */
     @SuppressWarnings("serial") // Superclass is not serializable across versions
     public static class RadioButtonBorder extends ButtonBorder {
 
+        /**
+         * Constructs a new instance of a {@code RadioButtonBorder}.
+         *
+         * @param shadow a color of shadow
+         * @param darkShadow a color of dark shadow
+         * @param highlight a color of highlight
+         * @param lightHighlight a color of light highlight
+         */
         public RadioButtonBorder(Color shadow, Color darkShadow,
                                  Color highlight, Color lightHighlight) {
             super(shadow, darkShadow, highlight, lightHighlight);
@@ -329,11 +424,26 @@
         }
     }
 
+    /**
+     * Draws the border around a menu bar.
+     */
     @SuppressWarnings("serial") // Superclass is not serializable across versions
     public static class MenuBarBorder extends AbstractBorder implements UIResource {
+        /**
+         * The color of shadow.
+         */
         private Color shadow;
+        /**
+         * The color of highlight.
+         */
         private Color highlight;
 
+        /**
+         * Constructs a new instance of a {@code MenuBarBorder}.
+         *
+         * @param shadow a color of shadow
+         * @param highlight a color of highlight
+         */
         public MenuBarBorder(Color shadow, Color highlight) {
             this.shadow = shadow;
             this.highlight = highlight;
@@ -356,6 +466,9 @@
         }
     }
 
+    /**
+     * Draws the border around components which support margins.
+     */
     @SuppressWarnings("serial") // Superclass is not serializable across versions
     public static class MarginBorder extends AbstractBorder implements UIResource {
         public Insets getBorderInsets(Component c, Insets insets)       {
@@ -384,13 +497,36 @@
         }
     }
 
+    /**
+     * Draws the border around a field.
+     */
     @SuppressWarnings("serial") // Superclass is not serializable across versions
     public static class FieldBorder extends AbstractBorder implements UIResource {
+        /**
+         * The color of shadow.
+         */
         protected Color shadow;
+        /**
+         * The color of dark shadow.
+         */
         protected Color darkShadow;
+        /**
+         * The color of highlight.
+         */
         protected Color highlight;
+        /**
+         * The color of light highlight.
+         */
         protected Color lightHighlight;
 
+        /**
+         * Constructs a new instance of a {@code FieldBorder}.
+         *
+         * @param shadow a color of shadow
+         * @param darkShadow a color of dark shadow
+         * @param highlight a color of highlight
+         * @param lightHighlight a color of light highlight
+         */
         public FieldBorder(Color shadow, Color darkShadow,
                            Color highlight, Color lightHighlight) {
             this.shadow = shadow;
@@ -509,9 +645,21 @@
      * also install a border on the divider (property SplitPaneDivider.border).
      */
     public static class SplitPaneBorder implements Border, UIResource {
+        /**
+         * The color of highlight
+         */
         protected Color highlight;
+        /**
+         * The color of shadow
+         */
         protected Color shadow;
 
+        /**
+         * Constructs a new instance of a {@code SplitPaneBorder}.
+         *
+         * @param highlight a color of highlight
+         * @param shadow a color of shadow
+         */
         public SplitPaneBorder(Color highlight, Color shadow) {
             this.highlight = highlight;
             this.shadow = shadow;
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicButtonListener.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicButtonListener.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, 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
@@ -58,6 +58,11 @@
     }
 
 
+    /**
+     * Constructs a new instance of {@code BasicButtonListener}.
+     *
+     * @param b an abstract button
+     */
     public BasicButtonListener(AbstractButton b) {
     }
 
@@ -76,13 +81,20 @@
         }
     }
 
+    /**
+     * Checks the opacity of the {@code AbstractButton}.
+     *
+     * @param b an abstract button
+     */
     protected void checkOpacity(AbstractButton b) {
         b.setOpaque( b.isContentAreaFilled() );
     }
 
     /**
      * Register default key actions: pressing space to "click" a
-     * button and registring the keyboard mnemonic (if any).
+     * button and registering the keyboard mnemonic (if any).
+     *
+     * @param c a component
      */
     public void installKeyboardActions(JComponent c) {
         AbstractButton b = (AbstractButton)c;
@@ -98,7 +110,9 @@
     }
 
     /**
-     * Unregister's default key actions
+     * Unregister default key actions.
+     *
+     * @param c a component
      */
     public void uninstallKeyboardActions(JComponent c) {
         SwingUtilities.replaceUIInputMap(c, JComponent.
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicButtonUI.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicButtonUI.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, 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,6 +49,9 @@
     // Visual constants
     // NOTE: This is not used or set any where. Were we allowed to remove
     // fields, this would be removed.
+    /**
+     * The default gap between a text and an icon.
+     */
     protected int defaultTextIconGap;
 
     // Amount to offset text, the value of this comes from
@@ -56,6 +59,9 @@
     private int shiftOffset = 0;
     // Value that is set in shiftOffset once setTextShiftOffset has been
     // invoked. The value of this comes from the defaults table.
+    /**
+     * The default offset of a text.
+     */
     protected int defaultTextShiftOffset;
 
     private final static String propertyPrefix = "Button" + ".";
@@ -65,6 +71,12 @@
     // ********************************
     //          Create PLAF
     // ********************************
+    /**
+     * Returns an instance of {@code BasicButtonUI}.
+     *
+     * @param c a component
+     * @return an instance of {@code BasicButtonUI}
+     */
     public static ComponentUI createUI(JComponent c) {
         AppContext appContext = AppContext.getAppContext();
         BasicButtonUI buttonUI =
@@ -76,6 +88,11 @@
         return buttonUI;
     }
 
+    /**
+     * Returns the property prefix.
+     *
+     * @return the property prefix
+     */
     protected String getPropertyPrefix() {
         return propertyPrefix;
     }
@@ -91,6 +108,11 @@
         BasicHTML.updateRenderer(c, ((AbstractButton) c).getText());
     }
 
+    /**
+     * Installs default properties.
+     *
+     * @param b an abstract button
+     */
     protected void installDefaults(AbstractButton b) {
         // load shared instance defaults
         String pp = getPropertyPrefix();
@@ -120,6 +142,11 @@
         LookAndFeel.installProperty(b, "iconTextGap", Integer.valueOf(4));
     }
 
+    /**
+     * Registers listeners.
+     *
+     * @param b an abstract button
+     */
     protected void installListeners(AbstractButton b) {
         BasicButtonListener listener = createButtonListener(b);
         if(listener != null) {
@@ -131,6 +158,11 @@
         }
     }
 
+    /**
+     * Registers keyboard actions.
+     *
+     * @param b an abstract button
+     */
     protected void installKeyboardActions(AbstractButton b){
         BasicButtonListener listener = getButtonListener(b);
 
@@ -150,6 +182,11 @@
         BasicHTML.updateRenderer(c, "");
     }
 
+    /**
+     * Unregisters keyboard actions.
+     *
+     * @param b an abstract button
+     */
     protected void uninstallKeyboardActions(AbstractButton b) {
         BasicButtonListener listener = getButtonListener(b);
         if(listener != null) {
@@ -157,6 +194,11 @@
         }
     }
 
+    /**
+     * Unregisters listeners.
+     *
+     * @param b an abstract button
+     */
     protected void uninstallListeners(AbstractButton b) {
         BasicButtonListener listener = getButtonListener(b);
         if(listener != null) {
@@ -168,6 +210,11 @@
         }
     }
 
+    /**
+     * Uninstalls default properties.
+     *
+     * @param b an abstract button
+     */
     protected void uninstallDefaults(AbstractButton b) {
         LookAndFeel.uninstallBorder(b);
     }
@@ -175,10 +222,22 @@
     // ********************************
     //        Create Listeners
     // ********************************
+    /**
+     * Returns a new instance of {@code BasicButtonListener}.
+     *
+     * @param b an abstract button
+     * @return a new instance of {@code BasicButtonListener}
+     */
     protected BasicButtonListener createButtonListener(AbstractButton b) {
         return new BasicButtonListener(b);
     }
 
+    /**
+     * Returns the default gap between a text and an icon.
+     *
+     * @param b an abstract button
+     * @return the default gap between text and an icon
+     */
     public int getDefaultTextIconGap(AbstractButton b) {
         return defaultTextIconGap;
     }
@@ -231,6 +290,13 @@
         }
     }
 
+    /**
+     * Paints an icon of the current button.
+     *
+     * @param g an instance of {@code Graphics}
+     * @param c a component
+     * @param iconRect a bounding rectangle to render the icon
+     */
     protected void paintIcon(Graphics g, JComponent c, Rectangle iconRect){
             AbstractButton b = (AbstractButton) c;
             ButtonModel model = b.getModel();
@@ -295,8 +361,15 @@
     }
 
     /**
+     * Method which renders the text of the current button.
+     *
      * As of Java 2 platform v 1.4 this method should not be used or overriden.
      * Use the paintText method which takes the AbstractButton argument.
+     *
+     * @param g an instance of {@code Graphics}
+     * @param c a component
+     * @param textRect a bounding rectangle to render the text
+     * @param text a string to render
      */
     protected void paintText(Graphics g, JComponent c, Rectangle textRect, String text) {
         AbstractButton b = (AbstractButton) c;
@@ -328,7 +401,7 @@
      *
      * @param g Graphics context
      * @param b Current button to render
-     * @param textRect Bounding rectangle to render the text.
+     * @param textRect Bounding rectangle to render the text
      * @param text String to render
      * @since 1.4
      */
@@ -338,23 +411,48 @@
 
     // Method signature defined here overriden in subclasses.
     // Perhaps this class should be abstract?
+    /**
+     * Paints a focused button.
+     *
+     * @param g an instance of {@code Graphics}
+     * @param b an abstract button
+     * @param viewRect a bounding rectangle to render the button
+     * @param textRect a bounding rectangle to render the text
+     * @param iconRect a bounding rectangle to render the icon
+     */
     protected void paintFocus(Graphics g, AbstractButton b,
                               Rectangle viewRect, Rectangle textRect, Rectangle iconRect){
     }
 
 
-
+    /**
+     * Paints a pressed button.
+     *
+     * @param g an instance of {@code Graphics}
+     * @param b an abstract button
+     */
     protected void paintButtonPressed(Graphics g, AbstractButton b){
     }
 
+    /**
+     * Clears the offset of the text.
+     */
     protected void clearTextShiftOffset(){
         this.shiftOffset = 0;
     }
 
+    /**
+     * Sets the offset of the text.
+     */
     protected void setTextShiftOffset(){
         this.shiftOffset = defaultTextShiftOffset;
     }
 
+    /**
+     * Returns the offset of the text.
+     *
+     * @return the offset of the text
+     */
     protected int getTextShiftOffset() {
         return shiftOffset;
     }
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicCheckBoxMenuItemUI.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicCheckBoxMenuItemUI.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, 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,9 +29,6 @@
 import java.awt.event.*;
 import javax.swing.*;
 import javax.swing.plaf.*;
-import javax.swing.border.*;
-import java.io.Serializable;
-
 
 /**
  * BasicCheckboxMenuItem implementation
@@ -42,6 +39,12 @@
  */
 public class BasicCheckBoxMenuItemUI extends BasicMenuItemUI {
 
+    /**
+     * Constructs a new instance of {@code BasicCheckBoxMenuItemUI}.
+     *
+     * @param c a component
+     * @return a new instance of {@code BasicCheckBoxMenuItemUI}
+     */
     public static ComponentUI createUI(JComponent c) {
         return new BasicCheckBoxMenuItemUI();
     }
@@ -50,6 +53,14 @@
         return "CheckBoxMenuItem";
     }
 
+    /**
+     * Invoked when mouse event occurs.
+     *
+     * @param item a menu item
+     * @param e a mouse event
+     * @param path an array of {@code MenuElement}
+     * @param manager an instance of {@code MenuSelectionManager}
+     */
     public void processMouseEvent(JMenuItem item,MouseEvent e,MenuElement path[],MenuSelectionManager manager) {
         Point p = e.getPoint();
         if(p.x >= 0 && p.x < item.getWidth() &&
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicCheckBoxUI.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicCheckBoxUI.java	Wed Jul 05 19:53:51 2017 +0200
@@ -59,6 +59,13 @@
     // ********************************
     //            Create PLAF
     // ********************************
+
+    /**
+     * Returns an instance of {@code BasicCheckBoxUI}.
+     *
+     * @param b a component
+     * @return an instance of {@code BasicCheckBoxUI}
+     */
     public static ComponentUI createUI(JComponent b) {
         AppContext appContext = AppContext.getAppContext();
         BasicCheckBoxUI checkboxUI =
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicColorChooserUI.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicColorChooserUI.java	Wed Jul 05 19:53:51 2017 +0200
@@ -61,21 +61,45 @@
     boolean isMultiPanel = false;
     private static TransferHandler defaultTransferHandler = new ColorTransferHandler();
 
+    /**
+     * The array of default color choosers.
+     */
     protected AbstractColorChooserPanel[] defaultChoosers;
 
+    /**
+     * The instance of {@code ChangeListener}.
+     */
     protected ChangeListener previewListener;
+
+    /**
+     * The instance of {@code PropertyChangeListener}.
+     */
     protected PropertyChangeListener propertyChangeListener;
     private Handler handler;
 
+    /**
+     * Returns a new instance of {@code BasicColorChooserUI}.
+     *
+     * @param c a component
+     * @return a new instance of {@code BasicColorChooserUI}
+     */
     public static ComponentUI createUI(JComponent c) {
         return new BasicColorChooserUI();
     }
 
+    /**
+     * Returns an array of default color choosers.
+     *
+     * @return an array of default color choosers
+     */
     protected AbstractColorChooserPanel[] createDefaultChoosers() {
         AbstractColorChooserPanel[] panels = ColorChooserComponentFactory.getDefaultChooserPanels();
         return panels;
     }
 
+    /**
+     * Uninstalls default color choosers.
+     */
     protected void uninstallDefaultChoosers() {
         AbstractColorChooserPanel[] choosers = chooser.getChooserPanels();
         for( int i = 0 ; i < choosers.length; i++) {
@@ -138,6 +162,9 @@
         handler = null;
     }
 
+    /**
+     * Installs preview panel.
+     */
     protected void installPreviewPanel() {
         JComponent previewPanel = this.chooser.getPreviewPanel();
         if (previewPanel == null) {
@@ -169,6 +196,9 @@
         this.chooser.remove(this.previewPanelHolder);
     }
 
+    /**
+     * Installs default properties.
+     */
     protected void installDefaults() {
         LookAndFeel.installColorsAndFont(chooser, "ColorChooser.background",
                                               "ColorChooser.foreground",
@@ -180,16 +210,21 @@
         }
     }
 
+    /**
+     * Uninstalls default properties.
+     */
     protected void uninstallDefaults() {
         if (chooser.getTransferHandler() instanceof UIResource) {
             chooser.setTransferHandler(null);
         }
     }
 
-
+    /**
+     * Registers listeners.
+     */
     protected void installListeners() {
         propertyChangeListener = createPropertyChangeListener();
-        chooser.addPropertyChangeListener( propertyChangeListener );
+        chooser.addPropertyChangeListener(propertyChangeListener);
 
         previewListener = getHandler();
         chooser.getSelectionModel().addChangeListener(previewListener);
@@ -202,10 +237,18 @@
         return handler;
     }
 
+    /**
+     * Returns an instance of {@code PropertyChangeListener}.
+     *
+     * @return an instance of {@code PropertyChangeListener}
+     */
     protected PropertyChangeListener createPropertyChangeListener() {
         return getHandler();
     }
 
+    /**
+     * Unregisters listeners.
+     */
     protected void uninstallListeners() {
         chooser.removePropertyChangeListener( propertyChangeListener );
         chooser.getSelectionModel().removeChangeListener(previewListener);
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboBoxEditor.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboBoxEditor.java	Wed Jul 05 19:53:51 2017 +0200
@@ -41,9 +41,15 @@
  * @author Mark Davidson
  */
 public class BasicComboBoxEditor implements ComboBoxEditor,FocusListener {
+    /**
+     * An instance of {@code JTextField}.
+     */
     protected JTextField editor;
     private Object oldValue;
 
+    /**
+     * Constructs a new instance of {@code BasicComboBoxEditor}.
+     */
     public BasicComboBoxEditor() {
         editor = createEditorComponent();
     }
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboBoxRenderer.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboBoxRenderer.java	Wed Jul 05 19:53:51 2017 +0200
@@ -59,6 +59,9 @@
     protected static Border noFocusBorder = new EmptyBorder(1, 1, 1, 1);
     private final static Border SAFE_NO_FOCUS_BORDER = new EmptyBorder(1, 1, 1, 1);
 
+    /**
+     * Constructs a new instance of {@code BasicComboBoxRenderer}.
+     */
     public BasicComboBoxRenderer() {
         super();
         setOpaque(true);
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboBoxUI.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboBoxUI.java	Wed Jul 05 19:53:51 2017 +0200
@@ -61,6 +61,10 @@
  * @author Mark Davidson
  */
 public class BasicComboBoxUI extends ComboBoxUI {
+
+    /**
+     * The instance of {@code JComboBox}.
+     */
     protected JComboBox<Object> comboBox;
     /**
      * This protected field is implementation specific. Do not access directly
@@ -73,20 +77,30 @@
     private boolean isTableCellEditor = false;
     private static final String IS_TABLE_CELL_EDITOR = "JComboBox.isTableCellEditor";
 
-    // This list is for drawing the current item in the combo box.
+    /**
+     * This list is for drawing the current item in the combo box.
+     */
     protected JList<Object>   listBox;
 
-    // Used to render the currently selected item in the combo box.
-    // It doesn't have anything to do with the popup's rendering.
+    /**
+     * Used to render the currently selected item in the combo box.
+     * It doesn't have anything to do with the popup's rendering.
+     */
     protected CellRendererPane currentValuePane = new CellRendererPane();
 
-    // The implementation of ComboPopup that is used to show the popup.
+    /**
+     * The implementation of {@code ComboPopup} that is used to show the popup.
+     */
     protected ComboPopup popup;
 
-    // The Component that the ComboBoxEditor uses for editing
+    /**
+     * The Component that the @{code ComboBoxEditor} uses for editing.
+     */
     protected Component editor;
 
-    // The arrow button that invokes the popup.
+    /**
+     * The arrow button that invokes the popup.
+     */
     protected JButton   arrowButton;
 
     // Listeners that are attached to the JComboBox
@@ -121,8 +135,19 @@
     protected ItemListener itemListener;
 
     // Listeners that the ComboPopup produces.
+    /**
+     * The {@code MouseListener} listens to events.
+     */
     protected MouseListener popupMouseListener;
+
+    /**
+     * The {@code MouseMotionListener} listens to events.
+     */
     protected MouseMotionListener popupMouseMotionListener;
+
+    /**
+     * The {@code KeyListener} listens to events.
+     */
     protected KeyListener popupKeyListener;
 
     // This is used for knowing when to cache the minimum preferred size.
@@ -160,10 +185,14 @@
      */
     JComboBox.KeySelectionManager keySelectionManager;
 
-    // Flag for recalculating the minimum preferred size.
+    /**
+     * The flag for recalculating the minimum preferred size.
+     */
     protected boolean isMinimumSizeDirty = true;
 
-    // Cached minimum preferred size.
+    /**
+     * The cached minimum preferred size.
+     */
     protected Dimension cachedMinimumSize = new Dimension( 0, 0 );
 
     // Flag for calculating the display size
@@ -238,6 +267,12 @@
     // begin UI Initialization
     //
 
+    /**
+     * Constructs a new instance of {@code BasicComboBoxUI}.
+     *
+     * @param c a component
+     * @return a new instance of {@code BasicComboBoxUI}
+     */
     public static ComponentUI createUI(JComponent c) {
         return new BasicComboBoxUI();
     }
@@ -1090,6 +1125,9 @@
      * navigation.  This is used for optimizing key input by only passing non-
      * navigation keys to the type-ahead mechanism.  Subclasses should override this
      * if they change the navigation keys.
+     *
+     * @param keyCode a key code
+     * @return {@code true} if the supplied {@code keyCode} maps to a navigation key
      */
     protected boolean isNavigationKey( int keyCode ) {
         return keyCode == KeyEvent.VK_UP || keyCode == KeyEvent.VK_DOWN ||
@@ -1167,6 +1205,8 @@
 
     /**
      * Returns the area that is reserved for drawing the currently selected item.
+     *
+     * @return the area that is reserved for drawing the currently selected item
      */
     protected Rectangle rectangleForCurrentValue() {
         int width = comboBox.getWidth();
@@ -1190,6 +1230,8 @@
 
     /**
      * Gets the insets from the JComboBox.
+     *
+     * @return the insets
      */
     protected Insets getInsets() {
         return comboBox.getInsets();
@@ -1206,6 +1248,10 @@
 
     /**
      * Paints the currently selected item.
+     *
+     * @param g an instance of {@code Graphics}
+     * @param bounds a bounding rectangle to render to
+     * @param hasFocus is focused
      */
     public void paintCurrentValue(Graphics g,Rectangle bounds,boolean hasFocus) {
         ListCellRenderer<Object> renderer = comboBox.getRenderer();
@@ -1263,6 +1309,10 @@
 
     /**
      * Paints the background of the currently selected item.
+     *
+     * @param g an instance of {@code Graphics}
+     * @param bounds a bounding rectangle to render to
+     * @param hasFocus is focused
      */
     public void paintCurrentValueBackground(Graphics g,Rectangle bounds,boolean hasFocus) {
         Color t = g.getColor();
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboPopup.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboPopup.java	Wed Jul 05 19:53:51 2017 +0200
@@ -75,6 +75,9 @@
 
     private static Border LIST_BORDER = new LineBorder(Color.BLACK, 1);
 
+    /**
+     * The instance of {@code JComboBox}.
+     */
     protected JComboBox<Object>             comboBox;
     /**
      * This protected field is implementation specific. Do not access directly
@@ -186,11 +189,30 @@
      * or override.
      */
     protected Timer                    autoscrollTimer;
+
+    /**
+     * {@code true} if the mouse cursor is in the popup.
+     */
     protected boolean                  hasEntered = false;
+
+    /**
+     * If {@code true} the auto-scrolling is enabled.
+     */
     protected boolean                  isAutoScrolling = false;
+
+    /**
+     * The direction of scrolling.
+     */
     protected int                      scrollDirection = SCROLL_UP;
 
+    /**
+     * The direction of scrolling up.
+     */
     protected static final int         SCROLL_UP = 0;
+
+    /**
+     * The direction of scrolling down.
+     */
     protected static final int         SCROLL_DOWN = 1;
 
 
@@ -309,6 +331,9 @@
         }
     }
 
+    /**
+     * Unregisters keyboard actions.
+     */
     protected void uninstallKeyboardActions() {
         // XXX - shouldn't call this method
 //        comboBox.unregisterKeyboardAction( KeyStroke.getKeyStroke( KeyEvent.VK_ENTER, 0 ) );
@@ -319,6 +344,12 @@
     //===================================================================
     // begin Initialization routines
     //
+
+    /**
+     * Constructs a new instance of {@code BasicComboPopup}.
+     *
+     * @param combo an instance of {@code JComboBox}
+     */
     public BasicComboPopup( JComboBox<Object> combo ) {
         super();
         setName("ComboPopup.popup");
@@ -555,6 +586,8 @@
 
     /**
      * Creates the scroll pane which houses the scrollable list.
+     *
+     * @return the scroll pane which houses the scrollable list
      */
     protected JScrollPane createScroller() {
         JScrollPane sp = new JScrollPane( list,
@@ -616,6 +649,9 @@
         }
     }
 
+    /**
+     * Registers keyboard actions.
+     */
     protected void installKeyboardActions() {
 
         /* XXX - shouldn't call this method. take it out for testing.
@@ -1007,6 +1043,8 @@
     /**
      * This protected method is implementation specific and should be private.
      * do not call or override.
+     *
+     * @param direction the direction of scrolling
      */
     protected void startAutoScrolling( int direction ) {
         // XXX - should be a private method within InvocationMouseMotionHandler
@@ -1107,6 +1145,8 @@
      * send the focus when the popup is brought up.  The standard implementation
      * delegates the focus to the editor (if the combo box is editable) or to
      * the JComboBox if it is not editable.
+     *
+     * @param e a mouse event
      */
     protected void delegateFocus( MouseEvent e ) {
         if ( comboBox.isEditable() ) {
@@ -1150,6 +1190,12 @@
         }
     }
 
+    /**
+     * Converts mouse event.
+     *
+     * @param e a mouse event
+     * @return converted mouse event
+     */
     protected MouseEvent convertMouseEvent( MouseEvent e ) {
         Point convertedPoint = SwingUtilities.convertPoint( (Component)e.getSource(),
                                                             e.getPoint(), list );
@@ -1171,6 +1217,9 @@
     /**
      * Retrieves the height of the popup based on the current
      * ListCellRenderer and the maximum row count.
+     *
+     * @param maxRowCount the row count
+     * @return the height of the popup
      */
     protected int getPopupHeightForRowCount(int maxRowCount) {
         // Set the cached value of the minimum row count
@@ -1272,6 +1321,9 @@
     /**
      * A utility method used by the event listeners.  Given a mouse event, it changes
      * the list selection to the list item below the mouse.
+     *
+     * @param anEvent a mouse event
+     * @param shouldScroll if {@code true} list should be scrolled.
      */
     protected void updateListBoxSelectionForEvent(MouseEvent anEvent,boolean shouldScroll) {
         // XXX - only seems to be called from this class. shouldScroll flag is
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicDesktopIconUI.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicDesktopIconUI.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, 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
@@ -42,7 +42,14 @@
  */
 public class BasicDesktopIconUI extends DesktopIconUI {
 
+    /**
+     * The instance of {@code JInternalFrame.JDesktopIcon}.
+     */
     protected JInternalFrame.JDesktopIcon desktopIcon;
+
+    /**
+     * The instance of {@code JInternalFrame}.
+     */
     protected JInternalFrame frame;
 
     /**
@@ -53,12 +60,19 @@
     protected JComponent iconPane;
     MouseInputListener mouseInputListener;
 
-
-
+    /**
+     * Constructs a new instance of {@code BasicDesktopIconUI}.
+     *
+     * @param c a component
+     * @return a new instance of {@code BasicDesktopIconUI}
+     */
     public static ComponentUI createUI(JComponent c)    {
         return new BasicDesktopIconUI();
     }
 
+    /**
+     * Constructs a new instance of {@code BasicDesktopIconUI}.
+     */
     public BasicDesktopIconUI() {
     }
 
@@ -108,39 +122,62 @@
         desktopIcon = null;
     }
 
+    /**
+     * Registers components.
+     */
     protected void installComponents() {
         iconPane = new BasicInternalFrameTitlePane(frame);
         desktopIcon.setLayout(new BorderLayout());
         desktopIcon.add(iconPane, BorderLayout.CENTER);
     }
 
+    /**
+     * Unregisters components.
+     */
     protected void uninstallComponents() {
         desktopIcon.remove(iconPane);
         desktopIcon.setLayout(null);
         iconPane = null;
     }
 
+    /**
+     * Registers listeners.
+     */
     protected void installListeners() {
         mouseInputListener = createMouseInputListener();
         desktopIcon.addMouseMotionListener(mouseInputListener);
         desktopIcon.addMouseListener(mouseInputListener);
     }
 
+    /**
+     * Unregisters listeners.
+     */
     protected void uninstallListeners() {
         desktopIcon.removeMouseMotionListener(mouseInputListener);
         desktopIcon.removeMouseListener(mouseInputListener);
         mouseInputListener = null;
     }
 
+    /**
+     * Installs default properties.
+     */
     protected void installDefaults() {
         LookAndFeel.installBorder(desktopIcon, "DesktopIcon.border");
         LookAndFeel.installProperty(desktopIcon, "opaque", Boolean.TRUE);
     }
 
+    /**
+     * Uninstalls default properties.
+     */
     protected void uninstallDefaults() {
         LookAndFeel.uninstallBorder(desktopIcon);
     }
 
+    /**
+     * Returns a new instance of {@code MouseInputListener}.
+     *
+     * @return a new instance of {@code MouseInputListener}
+     */
     protected MouseInputListener createMouseInputListener() {
         return new MouseInputHandler();
     }
@@ -170,6 +207,12 @@
         return iconPane.getMaximumSize();
     }
 
+    /**
+     * Returns the insets.
+     *
+     * @param c a component
+     * @return the insets
+     */
     public Insets getInsets(JComponent c) {
         JInternalFrame iframe = desktopIcon.getInternalFrame();
         Border border = iframe.getBorder();
@@ -179,6 +222,9 @@
         return new Insets(0,0,0,0);
     }
 
+    /**
+     * De-iconifies the internal frame.
+     */
     public void deiconize() {
         try { frame.setIcon(false); } catch (PropertyVetoException e2) { }
     }
@@ -284,6 +330,15 @@
                 return;
         }
 
+        /**
+         * Moves and repaints a component {@code f}.
+         *
+         * @param f a component
+         * @param newX a new X coordinate
+         * @param newY a new Y coordinate
+         * @param newWidth a new width
+         * @param newHeight a new height
+         */
         public void moveAndRepaint(JComponent f, int newX, int newY,
                                         int newWidth, int newHeight) {
             Rectangle r = f.getBounds();
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicDesktopPaneUI.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicDesktopPaneUI.java	Wed Jul 05 19:53:51 2017 +0200
@@ -55,7 +55,14 @@
     private Handler handler;
     private PropertyChangeListener pcl;
 
+    /**
+     * The instance of {@code JDesktopPane}.
+     */
     protected JDesktopPane desktop;
+
+    /**
+     * The instance of {@code DesktopManager}.
+     */
     protected DesktopManager desktopManager;
 
     /**
@@ -109,10 +116,19 @@
     @Deprecated
     protected KeyStroke navigateKey2;
 
+    /**
+     * Constructs a new instance of {@code BasicDesktopPaneUI}.
+     *
+     * @param c a component
+     * @return a new instance of {@code BasicDesktopPaneUI}
+     */
     public static ComponentUI createUI(JComponent c) {
         return new BasicDesktopPaneUI();
     }
 
+    /**
+     * Constructs a new instance of {@code BasicDesktopPaneUI}.
+     */
     public BasicDesktopPaneUI() {
     }
 
@@ -133,6 +149,9 @@
         handler = null;
     }
 
+    /**
+     * Installs default properties.
+     */
     protected void installDefaults() {
         if (desktop.getBackground() == null ||
             desktop.getBackground() instanceof UIResource) {
@@ -141,6 +160,9 @@
         LookAndFeel.installProperty(desktop, "opaque", Boolean.TRUE);
     }
 
+    /**
+     * Uninstalls default properties.
+     */
     protected void uninstallDefaults() { }
 
     /**
@@ -169,6 +191,9 @@
         pcl = null;
     }
 
+    /**
+     * Installs desktop manager.
+     */
     protected void installDesktopManager() {
         desktopManager = desktop.getDesktopManager();
         if(desktopManager == null) {
@@ -177,6 +202,9 @@
         }
     }
 
+    /**
+     * Uninstalls desktop manager.
+     */
     protected void uninstallDesktopManager() {
         if(desktop.getDesktopManager() instanceof UIResource) {
             desktop.setDesktopManager(null);
@@ -184,6 +212,9 @@
         desktopManager = null;
     }
 
+    /**
+     * Installs keyboard actions.
+     */
     protected void installKeyboardActions(){
         InputMap inputMap = getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
         if (inputMap != null) {
@@ -202,9 +233,15 @@
         registerKeyboardActions();
     }
 
+    /**
+     * Registers keyboard actions.
+     */
     protected void registerKeyboardActions(){
     }
 
+    /**
+     * Unregisters keyboard actions.
+     */
     protected void unregisterKeyboardActions(){
     }
 
@@ -253,6 +290,9 @@
         map.put(new Actions(Actions.NAVIGATE_PREVIOUS));
     }
 
+    /**
+     * Unregisters keyboard actions.
+     */
     protected void uninstallKeyboardActions(){
       unregisterKeyboardActions();
       SwingUtilities.replaceUIInputMap(desktop, JComponent.
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicDirectoryModel.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicDirectoryModel.java	Wed Jul 05 19:53:51 2017 +0200
@@ -55,6 +55,11 @@
 
     private boolean busy = false;
 
+    /**
+     * Constructs a new instance of {@code BasicDirectoryModel}.
+     *
+     * @param filechooser an instance of {JFileChooser}
+     */
     public BasicDirectoryModel(JFileChooser filechooser) {
         this.filechooser = filechooser;
         validateFileCache();
@@ -93,6 +98,11 @@
         }
     }
 
+    /**
+     * Returns a list of directories.
+     *
+     * @return a list of directories
+     */
     public Vector<File> getDirectories() {
         synchronized(fileCache) {
             if (directories != null) {
@@ -103,6 +113,11 @@
         }
     }
 
+    /**
+     * Returns a list of files.
+     *
+     * @return a list of files
+     */
     public Vector<File> getFiles() {
         synchronized(fileCache) {
             if (files != null) {
@@ -126,6 +141,9 @@
         }
     }
 
+    /**
+     * Validates content of file cache.
+     */
     public void validateFileCache() {
         File currentDirectory = filechooser.getCurrentDirectory();
         if (currentDirectory == null) {
@@ -163,20 +181,34 @@
         }
     }
 
-
+    /**
+     * Invoked when a content is changed.
+     */
     public void fireContentsChanged() {
-        // System.out.println("BasicDirectoryModel: firecontentschanged");
-        fireContentsChanged(this, 0, getSize()-1);
+        fireContentsChanged(this, 0, getSize() - 1);
     }
 
     public int getSize() {
         return fileCache.size();
     }
 
+    /**
+     * Returns {@code true} if an element {@code o} is in file cache,
+     * otherwise, returns {@code false}.
+     *
+     * @param o an element
+     * @return {@code true} if an element {@code o} is in file cache
+     */
     public boolean contains(Object o) {
         return fileCache.contains(o);
     }
 
+    /**
+     * Returns an index of element {@code o} in file cache.
+     *
+     * @param o an element
+     * @return an index of element {@code o} in file cache
+     */
     public int indexOf(Object o) {
         return fileCache.indexOf(o);
     }
@@ -197,6 +229,11 @@
     public void intervalRemoved(ListDataEvent e) {
     }
 
+    /**
+     * Sorts a list of files.
+     *
+     * @param v a list of files
+     */
     protected void sort(Vector<? extends File> v){
         ShellFolder.sort(v);
     }
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicGraphicsUtils.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicGraphicsUtils.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, 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
@@ -40,16 +40,30 @@
 import sun.swing.SwingUtilities2;
 
 
-/*
+/**
+ * Convenient util class.
+ *
  * @author Hans Muller
  */
-
 public class BasicGraphicsUtils
 {
 
     private static final Insets GROOVE_INSETS = new Insets(2, 2, 2, 2);
     private static final Insets ETCHED_INSETS = new Insets(2, 2, 2, 2);
 
+    /**
+     * Draws an etched rectangle.
+     *
+     * @param g an instance of {@code Graphics}
+     * @param x an X coordinate
+     * @param y an Y coordinate
+     * @param w a width
+     * @param h a height
+     * @param shadow a color of shadow
+     * @param darkShadow a color of dark shadow
+     * @param highlight a color highlighting
+     * @param lightHighlight a color of light highlighting
+     */
     public static void drawEtchedRect(Graphics g, int x, int y, int w, int h,
                                       Color shadow, Color darkShadow,
                                       Color highlight, Color lightHighlight)
@@ -89,6 +103,17 @@
     }
 
 
+    /**
+     * Draws a groove.
+     *
+     * @param g an instance of {@code Graphics}
+     * @param x an X coordinate
+     * @param y an Y coordinate
+     * @param w a width
+     * @param h a height
+     * @param shadow a color of shadow
+     * @param highlight a color highlighting
+     */
     public static void drawGroove(Graphics g, int x, int y, int w, int h,
                                   Color shadow, Color highlight)
     {
@@ -120,6 +145,21 @@
     }
 
 
+    /**
+     * Draws a bezel.
+     *
+     * @param g an instance of {@code Graphics}
+     * @param x an X coordinate
+     * @param y an Y coordinate
+     * @param w a width
+     * @param h a height
+     * @param isPressed is component pressed
+     * @param isDefault is default drawing
+     * @param shadow a color of shadow
+     * @param darkShadow a color of dark shadow
+     * @param highlight a color highlighting
+     * @param lightHighlight a color of light highlighting
+     */
     public static void drawBezel(Graphics g, int x, int y, int w, int h,
                                  boolean isPressed, boolean isDefault,
                                  Color shadow, Color darkShadow,
@@ -176,6 +216,19 @@
         g.setColor(oldColor);
     }
 
+    /**
+     * Draws a lowered bezel.
+     *
+     * @param g an instance of {@code Graphics}
+     * @param x an X coordinate
+     * @param y an Y coordinate
+     * @param w a width
+     * @param h a height
+     * @param shadow a color of shadow
+     * @param darkShadow a color of dark shadow
+     * @param highlight a color highlighting
+     * @param lightHighlight a color of light highlighting
+     */
     public static void drawLoweredBezel(Graphics g, int x, int y, int w, int h,
                                         Color shadow, Color darkShadow,
                                         Color highlight, Color lightHighlight)  {
@@ -197,11 +250,17 @@
      }
 
 
-    /** Draw a string with the graphics <code>g</code> at location (x,y)
-     *  just like <code>g.drawString</code> would.
-     *  The first occurrence of <code>underlineChar</code>
-     *  in text will be underlined. The matching algorithm is
-     *  not case sensitive.
+    /**
+     * Draw a string with the graphics {@code g} at location (x,y)
+     * just like {@code g.drawString} would. The first occurrence
+     * of {@code underlineChar} in text will be underlined.
+     * The matching algorithm is not case sensitive.
+     *
+     * @param g an instance of {@code Graphics}
+     * @param text a text
+     * @param underlinedChar an underlined char
+     * @param x an X coordinate
+     * @param y an Y coordinate
      */
     public static void drawString(Graphics g,String text,int underlinedChar,int x,int y) {
         int index=-1;
@@ -244,9 +303,18 @@
     public static void drawStringUnderlineCharAt(Graphics g, String text,
                            int underlinedIndex, int x,int y) {
         SwingUtilities2.drawStringUnderlineCharAt(null, g, text,
-                                                  underlinedIndex, x, y);
+                underlinedIndex, x, y);
     }
 
+    /**
+     * Draws dashed rectangle.
+     *
+     * @param g an instance of {@code Graphics}
+     * @param x an X coordinate
+     * @param y an Y coordinate
+     * @param width a width of rectangle
+     * @param height a height of rectangle
+     */
     public static void drawDashedRect(Graphics g,int x,int y,int width,int height) {
         int vx,vy;
 
@@ -263,6 +331,13 @@
         }
     }
 
+    /**
+     * Returns the preferred size of the button.
+     *
+     * @param b an instance of {@code AbstractButton}
+     * @param textIconGap a gap between text and icon
+     * @return the preferred size of the button
+     */
     public static Dimension getPreferredButtonSize(AbstractButton b, int textIconGap)
     {
         if(b.getComponentCount() > 0) {
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicHTML.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicHTML.java	Wed Jul 05 19:53:51 2017 +0200
@@ -48,6 +48,10 @@
     /**
      * Create an html renderer for the given component and
      * string of html.
+     *
+     * @param c a component
+     * @param html an HTML string
+     * @return an HTML renderer
      */
     public static View createHTMLView(JComponent c, String html) {
         BasicEditorKit kit = getFactory();
@@ -178,6 +182,10 @@
      * Check the given string to see if it should trigger the
      * html rendering logic in a non-text component that supports
      * html rendering.
+     *
+     * @param s a text
+     * @return {@code true} if the given string should trigger the
+     *         html rendering logic in a non-text component
      */
     public static boolean isHTMLString(String s) {
         if (s != null) {
@@ -198,6 +206,9 @@
      * This method is useful for ComponentUI implementations
      * that are static (i.e. shared) and get their state
      * entirely from the JComponent.
+     *
+     * @param c a component
+     * @param text a text
      */
     public static void updateRenderer(JComponent c, String text) {
         View value = null;
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicIconFactory.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicIconFactory.java	Wed Jul 05 19:53:51 2017 +0200
@@ -61,6 +61,11 @@
     private static Icon menuItemArrowIcon;
     private static Icon menuArrowIcon;
 
+    /**
+     * Returns a menu item check icon.
+     *
+     * @return a menu item check icon
+     */
     public static Icon getMenuItemCheckIcon() {
         if (menuItemCheckIcon == null) {
             menuItemCheckIcon = new MenuItemCheckIcon();
@@ -68,6 +73,11 @@
         return menuItemCheckIcon;
     }
 
+    /**
+     * Returns a menu item arrow icon.
+     *
+     * @return a menu item arrow icon
+     */
     public static Icon getMenuItemArrowIcon() {
         if (menuItemArrowIcon == null) {
             menuItemArrowIcon = new MenuItemArrowIcon();
@@ -75,6 +85,11 @@
         return menuItemArrowIcon;
     }
 
+    /**
+     * Returns a menu arrow icon.
+     *
+     * @return a menu arrow icon
+     */
     public static Icon getMenuArrowIcon() {
         if (menuArrowIcon == null) {
             menuArrowIcon = new MenuArrowIcon();
@@ -82,6 +97,11 @@
         return menuArrowIcon;
     }
 
+    /**
+     * Returns a check box icon.
+     *
+     * @return a check box icon
+     */
     public static Icon getCheckBoxIcon() {
         if (checkBoxIcon == null) {
             checkBoxIcon = new CheckBoxIcon();
@@ -89,6 +109,11 @@
         return checkBoxIcon;
     }
 
+    /**
+     * Returns a radio button icon.
+     *
+     * @return a radio button icon
+     */
     public static Icon getRadioButtonIcon() {
         if (radioButtonIcon == null) {
             radioButtonIcon = new RadioButtonIcon();
@@ -96,6 +121,11 @@
         return radioButtonIcon;
     }
 
+    /**
+     * Returns a check box menu item icon.
+     *
+     * @return a check box menu item icon
+     */
     public static Icon getCheckBoxMenuItemIcon() {
         if (checkBoxMenuItemIcon == null) {
             checkBoxMenuItemIcon = new CheckBoxMenuItemIcon();
@@ -103,6 +133,11 @@
         return checkBoxMenuItemIcon;
     }
 
+    /**
+     * Returns a radio button menu item icon.
+     *
+     * @return a radio button menu item icon
+     */
     public static Icon getRadioButtonMenuItemIcon() {
         if (radioButtonMenuItemIcon == null) {
             radioButtonMenuItemIcon = new RadioButtonMenuItemIcon();
@@ -110,6 +145,11 @@
         return radioButtonMenuItemIcon;
     }
 
+    /**
+     * Returns an empty frame icon.
+     *
+     * @return an empty frame icon
+     */
     public static Icon createEmptyFrameIcon() {
         if(frame_icon == null)
             frame_icon = new EmptyFrameIcon();
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicInternalFrameTitlePane.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicInternalFrameTitlePane.java	Wed Jul 05 19:53:51 2017 +0200
@@ -60,44 +60,125 @@
 @SuppressWarnings("serial") // Same-version serialization only
 public class BasicInternalFrameTitlePane extends JComponent
 {
+    /**
+     * The instance of {@code JMenuBar}.
+     */
     protected JMenuBar menuBar;
+    /**
+     * The iconify button.
+     */
     protected JButton iconButton;
+    /**
+     * The maximize button.
+     */
     protected JButton maxButton;
+    /**
+     * The close button.
+     */
     protected JButton closeButton;
 
+    /**
+     * The instance of {@code JMenu}.
+     */
     protected JMenu windowMenu;
+    /**
+     * The instance of {@code JInternalFrame}.
+     */
     protected JInternalFrame frame;
 
+    /**
+     * The color of a selected title.
+     */
     protected Color selectedTitleColor;
+    /**
+     * The color of a selected text.
+     */
     protected Color selectedTextColor;
+    /**
+     * The color of a not selected title.
+     */
     protected Color notSelectedTitleColor;
+    /**
+     * The color of a not selected text.
+     */
     protected Color notSelectedTextColor;
 
+    /**
+     * The maximize icon.
+     */
     protected Icon maxIcon;
+    /**
+     * The minimize icon.
+     */
     protected Icon minIcon;
+    /**
+     * The iconify icon.
+     */
     protected Icon iconIcon;
+    /**
+     * The close icon.
+     */
     protected Icon closeIcon;
 
+    /**
+     * The instance of a {@code PropertyChangeListener}.
+     */
     protected PropertyChangeListener propertyChangeListener;
 
+    /**
+     * The instance of a {@code CloseAction}.
+     */
     protected Action closeAction;
+    /**
+     * The instance of a {@code MaximizeAction}.
+     */
     protected Action maximizeAction;
+    /**
+     * The instance of an {@code IconifyAction}.
+     */
     protected Action iconifyAction;
+    /**
+     * The instance of a {@code RestoreAction}.
+     */
     protected Action restoreAction;
+    /**
+     * The instance of a {@code MoveAction}.
+     */
     protected Action moveAction;
+    /**
+     * The instance of a {@code SizeAction}.
+     */
     protected Action sizeAction;
 
     // These constants are not used in JDK code
+    /**
+     * The close button text property.
+     */
     protected static final String CLOSE_CMD =
         UIManager.getString("InternalFrameTitlePane.closeButtonText");
+    /**
+     * The minimize button text property.
+     */
     protected static final String ICONIFY_CMD =
         UIManager.getString("InternalFrameTitlePane.minimizeButtonText");
+    /**
+     * The restore button text property.
+     */
     protected static final String RESTORE_CMD =
         UIManager.getString("InternalFrameTitlePane.restoreButtonText");
+    /**
+     * The maximize button text property.
+     */
     protected static final String MAXIMIZE_CMD =
         UIManager.getString("InternalFrameTitlePane.maximizeButtonText");
+    /**
+     * The move button text property.
+     */
     protected static final String MOVE_CMD =
         UIManager.getString("InternalFrameTitlePane.moveButtonText");
+    /**
+     * The size button text property.
+     */
     protected static final String SIZE_CMD =
         UIManager.getString("InternalFrameTitlePane.sizeButtonText");
 
@@ -107,11 +188,19 @@
     private String maxButtonToolTip;
     private Handler handler;
 
+    /**
+     * Constructs a new instance of {@code BasicInternalFrameTitlePane}.
+     *
+     * @param f an instance of {@code JInternalFrame}
+     */
     public BasicInternalFrameTitlePane(JInternalFrame f) {
         frame = f;
         installTitlePane();
     }
 
+    /**
+     * Installs the title pane.
+     */
     protected void installTitlePane() {
         installDefaults();
         installListeners();
@@ -128,6 +217,9 @@
 
     }
 
+    /**
+     * Adds subcomponents.
+     */
     protected void addSubComponents() {
         add(menuBar);
         add(iconButton);
@@ -135,6 +227,9 @@
         add(closeButton);
     }
 
+    /**
+     * Creates actions.
+     */
     protected void createActions() {
         maximizeAction = new MaximizeAction();
         iconifyAction = new IconifyAction();
@@ -151,6 +246,9 @@
         return map;
     }
 
+    /**
+     * Registers listeners.
+     */
     protected void installListeners() {
         if( propertyChangeListener == null ) {
             propertyChangeListener = createPropertyChangeListener();
@@ -158,11 +256,17 @@
         frame.addPropertyChangeListener(propertyChangeListener);
     }
 
+    /**
+     * Unregisters listeners.
+     */
     protected void uninstallListeners() {
         frame.removePropertyChangeListener(propertyChangeListener);
         handler = null;
     }
 
+    /**
+     * Installs default properties.
+     */
     protected void installDefaults() {
         maxIcon = UIManager.getIcon("InternalFrame.maximizeIcon");
         minIcon = UIManager.getIcon("InternalFrame.minimizeIcon");
@@ -184,10 +288,15 @@
                 UIManager.getString("InternalFrame.maxButtonToolTip");
     }
 
-
+    /**
+     * Uninstalls default properties.
+     */
     protected void uninstallDefaults() {
     }
 
+    /**
+     * Creates buttons.
+     */
     protected void createButtons() {
         iconButton = new NoFocusButton(
                      "InternalFrameTitlePane.iconifyButtonAccessibleName",
@@ -213,6 +322,9 @@
         setButtonIcons();
     }
 
+    /**
+     * Sets the button icons.
+     */
     protected void setButtonIcons() {
         if(frame.isIcon()) {
             if (minIcon != null) {
@@ -261,6 +373,9 @@
         }
     }
 
+    /**
+     * Assembles system menu.
+     */
     protected void assembleSystemMenu() {
         menuBar = createSystemMenuBar();
         windowMenu = createSystemMenu();
@@ -269,6 +384,11 @@
         enableActions();
     }
 
+    /**
+     * Adds system menu items to {@code systemMenu}.
+     *
+     * @param systemMenu an instance of {@code JMenu}
+     */
     protected void addSystemMenuItems(JMenu systemMenu) {
         JMenuItem mi = systemMenu.add(restoreAction);
         mi.setMnemonic(getButtonMnemonic("restore"));
@@ -294,16 +414,29 @@
         }
     }
 
+    /**
+     * Returns a new instance of {@code JMenu}.
+     *
+     * @return a new instance of {@code JMenu}
+     */
     protected JMenu createSystemMenu() {
         return new JMenu("    ");
     }
 
+    /**
+     * Returns a new instance of {@code JMenuBar}.
+     *
+     * @return a new instance of {@code JMenuBar}
+     */
     protected JMenuBar createSystemMenuBar() {
         menuBar = new SystemMenuBar();
         menuBar.setBorderPainted(false);
         return menuBar;
     }
 
+    /**
+     * Shows system menu.
+     */
     protected void showSystemMenu(){
         //      windowMenu.setPopupMenuVisible(true);
       //      windowMenu.setVisible(true);
@@ -367,14 +500,24 @@
         g.fillRect(0, 0, getWidth(), getHeight());
     }
 
+    /**
+     * Returns the title.
+     *
+     * @param text a text
+     * @param fm an instance of {@code FontMetrics}
+     * @param availTextWidth an available text width
+     * @return the title.
+     */
     protected String getTitle(String text, FontMetrics fm, int availTextWidth) {
         return SwingUtilities2.clipStringIfNecessary(
                            frame, fm, text, availTextWidth);
-      }
+    }
 
     /**
      * Post a WINDOW_CLOSING-like event to the frame, so that it can
-     * be treated like a regular Frame.
+     * be treated like a regular {@code Frame}.
+     *
+     * @param frame an instance of {@code JInternalFrame}
      */
     protected void postClosingEvent(JInternalFrame frame) {
         InternalFrameEvent e = new InternalFrameEvent(
@@ -387,7 +530,9 @@
         }
     }
 
-
+    /**
+     * Enables actions.
+     */
     protected void enableActions() {
         restoreAction.setEnabled(frame.isMaximum() || frame.isIcon());
         maximizeAction.setEnabled(
@@ -406,10 +551,20 @@
         return handler;
     }
 
+    /**
+     * Returns an instance of {@code PropertyChangeListener}.
+     *
+     * @return an instance of {@code PropertyChangeListener}
+     */
     protected PropertyChangeListener createPropertyChangeListener() {
         return getHandler();
     }
 
+    /**
+     * Returns a layout manager.
+     *
+     * @return a layout manager
+     */
     protected LayoutManager createLayout() {
         return getHandler();
     }
@@ -606,6 +761,9 @@
      * Instantiate it only within subclasses of <code>Foo</code>.
      */
     public class CloseAction extends AbstractAction {
+        /**
+         * Constructs a new instance of a {@code CloseAction}.
+         */
         public CloseAction() {
             super(UIManager.getString(
                     "InternalFrameTitlePane.closeButtonText"));
@@ -623,6 +781,9 @@
      * Instantiate it only within subclasses of <code>Foo</code>.
      */
     public class MaximizeAction extends AbstractAction {
+        /**
+         * Constructs a new instance of a {@code MaximizeAction}.
+         */
         public MaximizeAction() {
             super(UIManager.getString(
                     "InternalFrameTitlePane.maximizeButtonText"));
@@ -652,6 +813,9 @@
      * Instantiate it only within subclasses of <code>Foo</code>.
      */
     public class IconifyAction extends AbstractAction {
+        /**
+         * Constructs a new instance of an {@code IconifyAction}.
+         */
         public IconifyAction() {
             super(UIManager.getString(
                     "InternalFrameTitlePane.minimizeButtonText"));
@@ -673,6 +837,9 @@
      * Instantiate it only within subclasses of <code>Foo</code>.
      */
     public class RestoreAction extends AbstractAction {
+        /**
+         * Constructs a new instance of a {@code RestoreAction}.
+         */
         public RestoreAction() {
             super(UIManager.getString(
                     "InternalFrameTitlePane.restoreButtonText"));
@@ -700,6 +867,9 @@
      * Instantiate it only within subclasses of <code>Foo</code>.
      */
     public class MoveAction extends AbstractAction {
+        /**
+         * Constructs a new instance of a {@code MoveAction}.
+         */
         public MoveAction() {
             super(UIManager.getString(
                     "InternalFrameTitlePane.moveButtonText"));
@@ -734,6 +904,9 @@
      * Instantiate it only within subclasses of <code>Foo</code>.
      */
     public class SizeAction extends AbstractAction {
+        /**
+         * Constructs a new instance of a {@code SizeAction}.
+         */
         public SizeAction() {
             super(UIManager.getString(
                     "InternalFrameTitlePane.sizeButtonText"));
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicLabelUI.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicLabelUI.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, 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
@@ -80,6 +80,14 @@
      * This method is here so that a subclass could do Label specific
      * layout and to shorten the method name a little.
      *
+     * @param label an instance of {@code JLabel}
+     * @param fontMetrics a font metrics
+     * @param text a text
+     * @param icon an icon
+     * @param viewR a bounding rectangle to lay out label
+     * @param iconR a bounding rectangle to lay out icon
+     * @param textR a bounding rectangle to lay out text
+     * @return a possibly clipped version of the compound labels string
      * @see SwingUtilities#layoutCompoundLabel
      */
     protected String layoutCL(
@@ -109,6 +117,11 @@
     /**
      * Paint clippedText at textX, textY with the labels foreground color.
      *
+     * @param l an instance of {@code JLabel}
+     * @param g an instance of {@code Graphics}
+     * @param s a text
+     * @param textX an X coordinate
+     * @param textY an Y coordinate
      * @see #paint
      * @see #paintDisabledText
      */
@@ -125,6 +138,11 @@
      * Paint clippedText at textX, textY with background.lighter() and then
      * shifted down and to the right by one pixel with background.darker().
      *
+     * @param l an instance of {@code JLabel}
+     * @param g an instance of {@code Graphics}
+     * @param s a text
+     * @param textX an X coordinate
+     * @param textY an Y coordinate
      * @see #paint
      * @see #paintEnabledText
      */
@@ -329,26 +347,46 @@
 
 
     public void uninstallUI(JComponent c) {
-        uninstallDefaults((JLabel)c);
-        uninstallComponents((JLabel)c);
-        uninstallListeners((JLabel)c);
-        uninstallKeyboardActions((JLabel)c);
+        uninstallDefaults((JLabel) c);
+        uninstallComponents((JLabel) c);
+        uninstallListeners((JLabel) c);
+        uninstallKeyboardActions((JLabel) c);
     }
 
-     protected void installDefaults(JLabel c){
-         LookAndFeel.installColorsAndFont(c, "Label.background", "Label.foreground", "Label.font");
-         LookAndFeel.installProperty(c, "opaque", Boolean.FALSE);
-      }
+    /**
+     * Installs default properties.
+     *
+     * @param c an instance of {@code JLabel}
+     */
+    protected void installDefaults(JLabel c){
+        LookAndFeel.installColorsAndFont(c, "Label.background", "Label.foreground", "Label.font");
+        LookAndFeel.installProperty(c, "opaque", Boolean.FALSE);
+    }
 
+    /**
+     * Registers listeners.
+     *
+     * @param c an instance of {@code JLabel}
+     */
     protected void installListeners(JLabel c){
         c.addPropertyChangeListener(this);
     }
 
+    /**
+     * Registers components.
+     *
+     * @param c an instance of {@code JLabel}
+     */
     protected void installComponents(JLabel c){
         BasicHTML.updateRenderer(c, c.getText());
         c.setInheritsPopupMenu(true);
     }
 
+    /**
+     * Registers keyboard actions.
+     *
+     * @param l an instance of {@code JLabel}
+     */
     protected void installKeyboardActions(JLabel l) {
         int dka = l.getDisplayedMnemonic();
         Component lf = l.getLabelFor();
@@ -374,17 +412,37 @@
         }
     }
 
+    /**
+     * Uninstalls default properties.
+     *
+     * @param c an instance of {@code JLabel}
+     */
     protected void uninstallDefaults(JLabel c){
     }
 
+    /**
+     * Unregisters listeners.
+     *
+     * @param c an instance of {@code JLabel}
+     */
     protected void uninstallListeners(JLabel c){
         c.removePropertyChangeListener(this);
     }
 
+    /**
+     * Unregisters components.
+     *
+     * @param c an instance of {@code JLabel}
+     */
     protected void uninstallComponents(JLabel c){
         BasicHTML.updateRenderer(c, "");
     }
 
+    /**
+     * Unregisters keyboard actions.
+     *
+     * @param c an instance of {@code JLabel}
+     */
     protected void uninstallKeyboardActions(JLabel c) {
         SwingUtilities.replaceUIInputMap(c, JComponent.WHEN_FOCUSED, null);
         SwingUtilities.replaceUIInputMap(c, JComponent.WHEN_IN_FOCUSED_WINDOW,
@@ -392,6 +450,12 @@
         SwingUtilities.replaceUIActionMap(c, null);
     }
 
+    /**
+     * Returns an instance of {@code BasicLabelUI}.
+     *
+     * @param c a component
+     * @return an instance of {@code BasicLabelUI}
+     */
     public static ComponentUI createUI(JComponent c) {
         if (System.getSecurityManager() != null) {
             AppContext appContext = AppContext.getAppContext();
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicListUI.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicListUI.java	Wed Jul 05 19:53:51 2017 +0200
@@ -59,20 +59,53 @@
     private static final StringBuilder BASELINE_COMPONENT_KEY =
         new StringBuilder("List.baselineComponent");
 
+    /**
+     * The instance of {@code JList}.
+     */
     protected JList<Object> list = null;
+    /**
+     * The instance of {@code CellRendererPane}.
+     */
     protected CellRendererPane rendererPane;
 
     // Listeners that this UI attaches to the JList
+    /**
+     * {@code FocusListener} that attached to {@code JList}.
+     */
     protected FocusListener focusListener;
+    /**
+     * {@code MouseInputListener} that attached to {@code JList}.
+     */
     protected MouseInputListener mouseInputListener;
+    /**
+     * {@code ListSelectionListener} that attached to {@code JList}.
+     */
     protected ListSelectionListener listSelectionListener;
+    /**
+     * {@code ListDataListener} that attached to {@code JList}.
+     */
     protected ListDataListener listDataListener;
+    /**
+     * {@code PropertyChangeListener} that attached to {@code JList}.
+     */
     protected PropertyChangeListener propertyChangeListener;
     private Handler handler;
 
+    /**
+     * The array of cells' height
+     */
     protected int[] cellHeights = null;
+    /**
+     * The height of cell.
+     */
     protected int cellHeight = -1;
+    /**
+     * The width of cell.
+     */
     protected int cellWidth = -1;
+    /**
+     * The value represents changes to {@code JList} model.
+     */
     protected int updateLayoutStateNeeded = modelChanged;
     /**
      * Height of the list. When asked to paint, if the current size of
@@ -131,12 +164,33 @@
      * models length changed, are handled similarly, see DataListener.
      */
 
+    /**
+     * The bit relates to model changed property.
+     */
     protected final static int modelChanged = 1 << 0;
+    /**
+     * The bit relates to selection model changed property.
+     */
     protected final static int selectionModelChanged = 1 << 1;
+    /**
+     * The bit relates to font changed property.
+     */
     protected final static int fontChanged = 1 << 2;
+    /**
+     * The bit relates to fixed cell width changed property.
+     */
     protected final static int fixedCellWidthChanged = 1 << 3;
+    /**
+     * The bit relates to fixed cell height changed property.
+     */
     protected final static int fixedCellHeightChanged = 1 << 4;
+    /**
+     * The bit relates to prototype cell value changed property.
+     */
     protected final static int prototypeCellValueChanged = 1 << 5;
+    /**
+     * The bit relates to cell renderer changed property.
+     */
     protected final static int cellRendererChanged = 1 << 6;
     private final static int layoutOrientationChanged = 1 << 7;
     private final static int heightChanged = 1 << 8;
@@ -187,9 +241,16 @@
 
     /**
      * Paint one List cell: compute the relevant state, get the "rubber stamp"
-     * cell renderer component, and then use the CellRendererPane to paint it.
-     * Subclasses may want to override this method rather than paint().
+     * cell renderer component, and then use the {@code CellRendererPane} to paint it.
+     * Subclasses may want to override this method rather than {@code paint()}.
      *
+     * @param g an instance of {@code Graphics}
+     * @param row a row
+     * @param rowBounds a bounding rectangle to render to
+     * @param cellRenderer a list of {@code ListCellRenderer}
+     * @param dataModel a list model
+     * @param selModel a selection model
+     * @param leadIndex a lead index
      * @see #paint
      */
     protected void paintCell(
@@ -916,10 +977,11 @@
 
 
     /**
-     * Returns a new instance of BasicListUI.  BasicListUI delegates are
-     * allocated one per JList.
+     * Returns a new instance of {@code BasicListUI}.
+     * {@code BasicListUI} delegates are allocated one per {@code JList}.
      *
-     * @return A new ListUI implementation for the Windows look and feel.
+     * @param list a component
+     * @return a new {@code ListUI} implementation for the Windows look and feel.
      */
     public static ComponentUI createUI(JComponent list) {
         return new BasicListUI();
@@ -1046,7 +1108,8 @@
     /**
      * Returns the height of the specified row based on the current layout.
      *
-     * @return The specified row height or -1 if row isn't valid.
+     * @param row a row
+     * @return the specified row height or -1 if row isn't valid
      * @see #convertYToRow
      * @see #convertRowToY
      * @see #updateLayoutState
@@ -1058,11 +1121,12 @@
 
 
     /**
-     * Convert the JList relative coordinate to the row that contains it,
-     * based on the current layout.  If y0 doesn't fall within any row,
+     * Convert the {@code JList} relative coordinate to the row that contains it,
+     * based on the current layout. If {@code y0} doesn't fall within any row,
      * return -1.
      *
-     * @return The row that contains y0, or -1.
+     * @param y0 a relative Y coordinate
+     * @return the row that contains y0, or -1
      * @see #getRowHeight
      * @see #updateLayoutState
      */
@@ -1073,10 +1137,11 @@
 
 
     /**
-     * Return the JList relative Y coordinate of the origin of the specified
+     * Return the {@code JList} relative Y coordinate of the origin of the specified
      * row or -1 if row isn't valid.
      *
-     * @return The Y coordinate of the origin of row, or -1.
+     * @param row a row
+     * @return the Y coordinate of the origin of row, or -1
      * @see #getRowHeight
      * @see #updateLayoutState
      */
@@ -1535,10 +1600,10 @@
 
 
     /**
-     * Creates a delegate that implements MouseInputListener.
-     * The delegate is added to the corresponding java.awt.Component listener
-     * lists at installUI() time. Subclasses can override this method to return
-     * a custom MouseInputListener, e.g.
+     * Creates a delegate that implements {@code MouseInputListener}.
+     * The delegate is added to the corresponding {@code java.awt.Component} listener
+     * lists at {@code installUI()} time. Subclasses can override this method to return
+     * a custom {@code MouseInputListener}, e.g.
      * <pre>
      * class MyListUI extends BasicListUI {
      *    protected MouseInputListener <b>createMouseInputListener</b>() {
@@ -1553,6 +1618,7 @@
      * }
      * </pre>
      *
+     * @return an instance of {@code MouseInputListener}
      * @see MouseInputHandler
      * @see #installUI
      */
@@ -1566,6 +1632,9 @@
      */
     public class FocusHandler implements FocusListener
     {
+        /**
+         * Repaints focused cells.
+         */
         protected void repaintCellFocus()
         {
             getHandler().repaintCellFocus();
@@ -1584,6 +1653,11 @@
         }
     }
 
+    /**
+     * Returns an instance of {@code FocusListener}.
+     *
+     * @return an instance of {@code FocusListener}
+     */
     protected FocusListener createFocusListener() {
         return getHandler();
     }
@@ -1617,9 +1691,9 @@
 
 
     /**
-     * Creates an instance of ListSelectionHandler that's added to
-     * the JLists by selectionModel as needed.  Subclasses can override
-     * this method to return a custom ListSelectionListener, e.g.
+     * Creates an instance of {@code ListSelectionHandler} that's added to
+     * the {@code JLists} by selectionModel as needed.  Subclasses can override
+     * this method to return a custom {@code ListSelectionListener}, e.g.
      * <pre>
      * class MyListUI extends BasicListUI {
      *    protected ListSelectionListener <b>createListSelectionListener</b>() {
@@ -1634,6 +1708,7 @@
      * }
      * </pre>
      *
+     * @return an instance of {@code ListSelectionHandler}
      * @see ListSelectionHandler
      * @see #installUI
      */
@@ -1649,8 +1724,8 @@
 
 
     /**
-     * The ListDataListener that's added to the JLists model at
-     * installUI time, and whenever the JList.model property changes.
+     * The {@code ListDataListener} that's added to the {@code JLists} model at
+     * {@code installUI time}, and whenever the JList.model property changes.
      * <p>
      * <strong>Warning:</strong>
      * Serialized objects of this class will not be compatible with
@@ -1687,9 +1762,9 @@
 
 
     /**
-     * Creates an instance of ListDataListener that's added to
-     * the JLists by model as needed.  Subclasses can override
-     * this method to return a custom ListDataListener, e.g.
+     * Creates an instance of {@code ListDataListener} that's added to
+     * the {@code JLists} by model as needed. Subclasses can override
+     * this method to return a custom {@code ListDataListener}, e.g.
      * <pre>
      * class MyListUI extends BasicListUI {
      *    protected ListDataListener <b>createListDataListener</b>() {
@@ -1704,6 +1779,7 @@
      * }
      * </pre>
      *
+     * @return an instance of {@code ListDataListener}
      * @see ListDataListener
      * @see JList#getModel
      * @see #installUI
@@ -1744,9 +1820,9 @@
 
 
     /**
-     * Creates an instance of PropertyChangeHandler that's added to
-     * the JList by installUI().  Subclasses can override this method
-     * to return a custom PropertyChangeListener, e.g.
+     * Creates an instance of {@code PropertyChangeHandler} that's added to
+     * the {@code JList} by {@code installUI()}. Subclasses can override this method
+     * to return a custom {@code PropertyChangeListener}, e.g.
      * <pre>
      * class MyListUI extends BasicListUI {
      *    protected PropertyChangeListener <b>createPropertyChangeListener</b>() {
@@ -1763,6 +1839,7 @@
      * }
      * </pre>
      *
+     * @return an instance of {@code PropertyChangeHandler}
      * @see PropertyChangeListener
      * @see #installUI
      */
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicLookAndFeel.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicLookAndFeel.java	Wed Jul 05 19:53:51 2017 +0200
@@ -455,7 +455,7 @@
         initResourceBundle(table);
 
         // *** Shared Integers
-        Integer fiveHundred = new Integer(500);
+        Integer fiveHundred = 500;
 
         // *** Shared Longs
         Long oneThousand = 1000L;
@@ -673,7 +673,6 @@
         Object editorMargin = threeInsets;
 
         Object caretBlinkRate = fiveHundred;
-        Integer four = new Integer(4);
 
         Object[] allAuditoryCues = new Object[] {
                 "CheckBoxMenuItem.commandSound",
@@ -714,7 +713,7 @@
             "Button.highlight", controlLtHighlight,
             "Button.border", buttonBorder,
             "Button.margin", new InsetsUIResource(2, 14, 2, 14),
-            "Button.textIconGap", four,
+            "Button.textIconGap", 4,
             "Button.textShiftOffset", zero,
             "Button.focusInputMap", new UIDefaults.LazyInputMap(new Object[] {
                          "SPACE", "pressed",
@@ -732,7 +731,7 @@
             "ToggleButton.highlight", controlLtHighlight,
             "ToggleButton.border", buttonToggleBorder,
             "ToggleButton.margin", new InsetsUIResource(2, 14, 2, 14),
-            "ToggleButton.textIconGap", four,
+            "ToggleButton.textIconGap", 4,
             "ToggleButton.textShiftOffset", zero,
             "ToggleButton.focusInputMap",
               new UIDefaults.LazyInputMap(new Object[] {
@@ -749,7 +748,7 @@
             "RadioButton.highlight", controlLtHighlight,
             "RadioButton.border", radioButtonBorder,
             "RadioButton.margin", twoInsets,
-            "RadioButton.textIconGap", four,
+            "RadioButton.textIconGap", 4,
             "RadioButton.textShiftOffset", zero,
             "RadioButton.icon", radioButtonIcon,
             "RadioButton.focusInputMap",
@@ -764,7 +763,7 @@
             "CheckBox.foreground", controlText,
             "CheckBox.border", radioButtonBorder,
             "CheckBox.margin", twoInsets,
-            "CheckBox.textIconGap", four,
+            "CheckBox.textIconGap", 4,
             "CheckBox.textShiftOffset", zero,
             "CheckBox.icon", checkBoxIcon,
             "CheckBox.focusInputMap",
@@ -1087,10 +1086,10 @@
             "Menu.margin", twoInsets,
             "Menu.checkIcon", menuItemCheckIcon,
             "Menu.arrowIcon", menuArrowIcon,
-            "Menu.menuPopupOffsetX", new Integer(0),
-            "Menu.menuPopupOffsetY", new Integer(0),
-            "Menu.submenuPopupOffsetX", new Integer(0),
-            "Menu.submenuPopupOffsetY", new Integer(0),
+            "Menu.menuPopupOffsetX", 0,
+            "Menu.menuPopupOffsetY", 0,
+            "Menu.submenuPopupOffsetX", 0,
+            "Menu.submenuPopupOffsetY", 0,
             "Menu.shortcutKeys", new int[]{
                 SwingUtilities2.getSystemMnemonicKeyMask()
             },
@@ -1188,10 +1187,10 @@
             "ProgressBar.selectionForeground", control,
             "ProgressBar.selectionBackground", textHighlight,
             "ProgressBar.border", progressBarBorder,
-            "ProgressBar.cellLength", new Integer(1),
+            "ProgressBar.cellLength", 1,
             "ProgressBar.cellSpacing", zero,
-            "ProgressBar.repaintInterval", new Integer(50),
-            "ProgressBar.cycleTime", new Integer(3000),
+            "ProgressBar.repaintInterval", 50,
+            "ProgressBar.cycleTime", 3000,
             "ProgressBar.horizontalSize", new DimensionUIResource(146, 12),
             "ProgressBar.verticalSize", new DimensionUIResource(12, 146),
 
@@ -1236,7 +1235,7 @@
                         "LEFT", "positiveUnitIncrement",
                      "KP_LEFT", "positiveUnitIncrement",
                  }),
-            "ScrollBar.width", new Integer(16),
+            "ScrollBar.width", 16,
 
             "ScrollPane.font", dialogPlain12,
             "ScrollPane.background", control,
@@ -1332,7 +1331,7 @@
             "SplitPane.shadow", controlShadow,
             "SplitPane.darkShadow", controlDkShadow,
             "SplitPane.border", splitPaneBorder,
-            "SplitPane.dividerSize", new Integer(7),
+            "SplitPane.dividerSize", 7,
             "SplitPaneDivider.border", splitPaneDividerBorder,
             "SplitPaneDivider.draggingColor", darkGray,
             "SplitPane.ancestorInputMap",
@@ -1363,7 +1362,7 @@
             "TabbedPane.darkShadow", controlDkShadow,
             "TabbedPane.selected", null,
             "TabbedPane.focus", controlText,
-            "TabbedPane.textIconGap", four,
+            "TabbedPane.textIconGap", 4,
 
             // Causes tabs to be painted on top of the content area border.
             // The amount of overlap is then controlled by tabAreaInsets.bottom,
@@ -1377,7 +1376,7 @@
             "TabbedPane.selectedTabPadInsets", tabbedPaneTabPadInsets,
             "TabbedPane.tabAreaInsets", tabbedPaneTabAreaInsets,
             "TabbedPane.contentBorderInsets", tabbedPaneContentBorderInsets,
-            "TabbedPane.tabRunOverlay", new Integer(2),
+            "TabbedPane.tabRunOverlay", 2,
             "TabbedPane.tabsOpaque", Boolean.TRUE,
             "TabbedPane.contentOpaque", Boolean.TRUE,
             "TabbedPane.focusInputMap",
@@ -1737,9 +1736,9 @@
             "Tree.selectionBorderColor", black,
             "Tree.dropLineColor", controlShadow,
             "Tree.editorBorder", blackLineBorder,
-            "Tree.leftChildIndent", new Integer(7),
-            "Tree.rightChildIndent", new Integer(13),
-            "Tree.rowHeight", new Integer(16),
+            "Tree.leftChildIndent", 7,
+            "Tree.rightChildIndent", 13,
+            "Tree.rowHeight", 16,
             "Tree.scrollsOnExpand", Boolean.TRUE,
             "Tree.openIcon", SwingUtilities2.makeIcon(getClass(),
                                                       BasicLookAndFeel.class,
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicMenuBarUI.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicMenuBarUI.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -54,11 +54,29 @@
  * @author Arnaud Weber
  */
 public class BasicMenuBarUI extends MenuBarUI  {
+
+    /**
+     * The instance of {@code JMenuBar}.
+     */
     protected JMenuBar              menuBar = null;
+
+    /**
+     * The instance of {@code ContainerListener}.
+     */
     protected ContainerListener     containerListener;
+
+    /**
+     * The instance of {@code ChangeListener}.
+     */
     protected ChangeListener        changeListener;
     private Handler handler;
 
+    /**
+     * Returns a new instance of {@code BasicMenuBarUI}.
+     *
+     * @param x a component
+     * @return a new instance of {@code BasicMenuBarUI}
+     */
     public static ComponentUI createUI(JComponent x) {
         return new BasicMenuBarUI();
     }
@@ -76,6 +94,9 @@
 
     }
 
+    /**
+     * Installs default properties.
+     */
     protected void installDefaults() {
         if (menuBar.getLayout() == null ||
             menuBar.getLayout() instanceof UIResource) {
@@ -90,6 +111,9 @@
                                               "MenuBar.font");
     }
 
+    /**
+     * Registers listeners.
+     */
     protected void installListeners() {
         containerListener = createContainerListener();
         changeListener = createChangeListener();
@@ -102,6 +126,9 @@
         menuBar.addContainerListener(containerListener);
     }
 
+    /**
+     * Registers keyboard actions.
+     */
     protected void installKeyboardActions() {
         InputMap inputMap = getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
 
@@ -131,12 +158,18 @@
         menuBar = null;
     }
 
+    /**
+     * Uninstalls default properties.
+     */
     protected void uninstallDefaults() {
         if (menuBar!=null) {
             LookAndFeel.uninstallBorder(menuBar);
         }
     }
 
+    /**
+     * Unregisters listeners.
+     */
     protected void uninstallListeners() {
         menuBar.removeContainerListener(containerListener);
 
@@ -151,16 +184,29 @@
         handler = null;
     }
 
+    /**
+     * Unregisters keyboard actions.
+     */
     protected void uninstallKeyboardActions() {
         SwingUtilities.replaceUIInputMap(menuBar, JComponent.
                                        WHEN_IN_FOCUSED_WINDOW, null);
         SwingUtilities.replaceUIActionMap(menuBar, null);
     }
 
+    /**
+     * Returns an instance of {@code ContainerListener}.
+     *
+     * @return an instance of {@code ContainerListener}
+     */
     protected ContainerListener createContainerListener() {
         return getHandler();
     }
 
+    /**
+     * Returns an instance of {@code ChangeListener}.
+     *
+     * @return an instance of {@code ChangeListener}
+     */
     protected ChangeListener createChangeListener() {
         return getHandler();
     }
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicMenuItemUI.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicMenuItemUI.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -47,11 +47,29 @@
  */
 public class BasicMenuItemUI extends MenuItemUI
 {
+    /**
+     * The instance of {@code JMenuItem}.
+     */
     protected JMenuItem menuItem = null;
+    /**
+     * The color of the selection background.
+     */
     protected Color selectionBackground;
+    /**
+     * The color of the selection foreground.
+     */
     protected Color selectionForeground;
+    /**
+     * The color of the disabled foreground.
+     */
     protected Color disabledForeground;
+    /**
+     * The color of the accelerator foreground.
+     */
     protected Color acceleratorForeground;
+    /**
+     * The color of the accelerator selection.
+     */
     protected Color acceleratorSelectionForeground;
 
     /**
@@ -60,18 +78,33 @@
      */
     protected String acceleratorDelimiter;
 
+    /**
+     * The gap between the text and the icon.
+     */
     protected int defaultTextIconGap;
+    /**
+     * The accelerator font.
+     */
     protected Font acceleratorFont;
 
+    /**
+     * The instance of {@code MouseInputListener}.
+     */
     protected MouseInputListener mouseInputListener;
+    /**
+     * The instance of {@code MenuDragMouseListener}.
+     */
     protected MenuDragMouseListener menuDragMouseListener;
+    /**
+     * The instance of {@code MenuKeyListener}.
+     */
     protected MenuKeyListener menuKeyListener;
     /**
-     * <code>PropertyChangeListener</code> returned from
-     * <code>createPropertyChangeListener</code>. You should not
+     * {@code PropertyChangeListener} returned from
+     * {@code createPropertyChangeListener}. You should not
      * need to access this field, rather if you want to customize the
-     * <code>PropertyChangeListener</code> override
-     * <code>createPropertyChangeListener</code>.
+     * {@code PropertyChangeListener} override
+     * {@code createPropertyChangeListener}.
      *
      * @since 1.6
      * @see #createPropertyChangeListener
@@ -79,10 +112,17 @@
     protected PropertyChangeListener propertyChangeListener;
     // BasicMenuUI also uses this.
     Handler handler;
-
+    /**
+     * The arrow icon.
+     */
     protected Icon arrowIcon = null;
+    /**
+     * The check icon.
+     */
     protected Icon checkIcon = null;
-
+    /**
+     * The value represents if the old border is painted.
+     */
     protected boolean oldBorderPainted;
 
     /* diagnostic aids -- should be false for production builds. */
@@ -97,6 +137,12 @@
         BasicLookAndFeel.installAudioActionMap(map);
     }
 
+    /**
+     * Returns a new instance of {@code BasicMenuItemUI}.
+     *
+     * @param c a component
+     * @return a new instance of {@code BasicMenuItemUI}
+     */
     public static ComponentUI createUI(JComponent c) {
         return new BasicMenuItemUI();
     }
@@ -110,7 +156,9 @@
         installKeyboardActions();
     }
 
-
+    /**
+     * Installs default properties.
+     */
     protected void installDefaults() {
         String prefix = getPropertyPrefix();
 
@@ -202,16 +250,26 @@
     }
 
     /**
+     *
+     * @param menuItem a menu item
      * @since 1.3
      */
     protected void installComponents(JMenuItem menuItem){
         BasicHTML.updateRenderer(menuItem, menuItem.getText());
     }
 
+    /**
+     * Returns a property prefix.
+     *
+     * @return a property prefix
+     */
     protected String getPropertyPrefix() {
         return "MenuItem";
     }
 
+    /**
+     * Registers listeners.
+     */
     protected void installListeners() {
         if ((mouseInputListener = createMouseInputListener(menuItem)) != null) {
             menuItem.addMouseListener(mouseInputListener);
@@ -228,6 +286,9 @@
         }
     }
 
+    /**
+     * Registers keyboard action.
+     */
     protected void installKeyboardActions() {
         installLazyActionMap();
         updateAcceleratorBinding();
@@ -248,7 +309,9 @@
         menuItem = null;
     }
 
-
+    /**
+     * Uninstalls default properties.
+     */
     protected void uninstallDefaults() {
         LookAndFeel.uninstallBorder(menuItem);
         LookAndFeel.installProperty(menuItem, "borderPainted", oldBorderPainted);
@@ -261,12 +324,18 @@
     }
 
     /**
+     * Unregisters components.
+     *
+     * @param menuItem a menu item
      * @since 1.3
      */
     protected void uninstallComponents(JMenuItem menuItem){
         BasicHTML.updateRenderer(menuItem, "");
     }
 
+    /**
+     * Unregisters listeners.
+     */
     protected void uninstallListeners() {
         if (mouseInputListener != null) {
             menuItem.removeMouseListener(mouseInputListener);
@@ -289,30 +358,52 @@
         handler = null;
     }
 
+    /**
+     * Unregisters keyboard actions.
+     */
     protected void uninstallKeyboardActions() {
         SwingUtilities.replaceUIActionMap(menuItem, null);
         SwingUtilities.replaceUIInputMap(menuItem, JComponent.
                                          WHEN_IN_FOCUSED_WINDOW, null);
     }
 
+    /**
+     * Returns an instance of {@code MouseInputListener}.
+     *
+     * @param c a component
+     * @return an instance of {@code MouseInputListener}
+     */
     protected MouseInputListener createMouseInputListener(JComponent c) {
         return getHandler();
     }
 
+    /**
+     * Returns an instance of {@code MenuDragMouseListener}.
+     *
+     * @param c a component
+     * @return an instance of {@code MenuDragMouseListener}
+     */
     protected MenuDragMouseListener createMenuDragMouseListener(JComponent c) {
         return getHandler();
     }
 
+    /**
+     * Returns an instance of {@code MenuKeyListener}.
+     *
+     * @param c a component
+     * @return an instance of {@code MenuKeyListener}
+     */
     protected MenuKeyListener createMenuKeyListener(JComponent c) {
         return null;
     }
 
     /**
-     * Creates a <code>PropertyChangeListener</code> which will be added to
+     * Creates a {@code PropertyChangeListener} which will be added to
      * the menu item.
      * If this method returns null then it will not be added to the menu item.
      *
-     * @return an instance of a <code>PropertyChangeListener</code> or null
+     * @param c a component
+     * @return an instance of a {@code PropertyChangeListener} or null
      * @since 1.6
      */
     protected PropertyChangeListener
@@ -380,6 +471,15 @@
         return d;
     }
 
+    /**
+     * Returns the preferred size of a menu item.
+     *
+     * @param c a component
+     * @param checkIcon a check icon
+     * @param arrowIcon an arrow icon
+     * @param defaultTextIconGap a gap between a text and an icon
+     * @return the preferred size of a menu item
+     */
     protected Dimension getPreferredMenuItemSize(JComponent c,
                                                  Icon checkIcon,
                                                  Icon arrowIcon,
@@ -477,6 +577,17 @@
                       defaultTextIconGap);
     }
 
+    /**
+     * Paints a menu item.
+     *
+     * @param g an instance of {@code Graphics}
+     * @param c a component
+     * @param checkIcon a check icon
+     * @param arrowIcon an arrow icon
+     * @param background a background color
+     * @param foreground a foreground color
+     * @param defaultTextIconGap a gap between a text and an icon
+     */
     protected void paintMenuItem(Graphics g, JComponent c,
                                      Icon checkIcon, Icon arrowIcon,
                                      Color background, Color foreground,
@@ -701,6 +812,11 @@
         }
     }
 
+    /**
+     * Returns a menu element path.
+     *
+     * @return a menu element path
+     */
     public MenuElement[] getPath() {
         MenuSelectionManager m = MenuSelectionManager.defaultManager();
         MenuElement oldPath[] = m.getSelectedPath();
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicMenuUI.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicMenuUI.java	Wed Jul 05 19:53:51 2017 +0200
@@ -48,7 +48,14 @@
  */
 public class BasicMenuUI extends BasicMenuItemUI
 {
+    /**
+     * The instance of {@code ChangeListener}.
+     */
     protected ChangeListener         changeListener;
+
+    /**
+     * The instance of {@code MenuListener}.
+     */
     protected MenuListener           menuListener;
 
     private int lastMnemonic = 0;
@@ -63,6 +70,12 @@
 
     private static boolean crossMenuMnemonic = true;
 
+    /**
+     * Constructs a new instance of {@code BasicMenuUI}.
+     *
+     * @param x a component
+     * @return a new instance of {@code BasicMenuUI}
+     */
     public static ComponentUI createUI(JComponent x) {
         return new BasicMenuUI();
     }
@@ -152,10 +165,22 @@
         return getHandler();
     }
 
+    /**
+     * Returns an instance of {@code MenuListener}.
+     *
+     * @param c a component
+     * @return an instance of {@code MenuListener}
+     */
     protected MenuListener createMenuListener(JComponent c) {
         return null;
     }
 
+    /**
+     * Returns an instance of {@code ChangeListener}.
+     *
+     * @param c a component
+     * @return an instance of {@code ChangeListener}
+     */
     protected ChangeListener createChangeListener(JComponent c) {
         return null;
     }
@@ -208,6 +233,11 @@
         return null;
     }
 
+    /**
+     * Sets timer to the {@code menu}.
+     *
+     * @param menu an instance of {@code JMenu}.
+     */
     protected void setupPostTimer(JMenu menu) {
         Timer timer = new Timer(menu.getDelay(), new Actions(
                                     Actions.SELECT, menu,false));
@@ -388,11 +418,32 @@
      * is now obsolete. KeyBindings are now managed by the popup menu.
      */
     public class ChangeHandler implements ChangeListener {
+        /**
+         * The instance of {@code JMenu}.
+         */
         public JMenu    menu;
+
+        /**
+         * The instance of {@code BasicMenuUI}.
+         */
         public BasicMenuUI ui;
+
+        /**
+         * {@code true} if an item of popup menu is selected.
+         */
         public boolean  isSelected = false;
+
+        /**
+         * The component that was focused.
+         */
         public Component wasFocused;
 
+        /**
+         * Constructs a new instance of {@code ChangeHandler}.
+         *
+         * @param m an instance of {@code JMenu}
+         * @param ui an instance of {@code BasicMenuUI}
+         */
         public ChangeHandler(JMenu m, BasicMenuUI ui) {
             menu = m;
             this.ui = ui;
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicOptionPaneUI.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicOptionPaneUI.java	Wed Jul 05 19:53:51 2017 +0200
@@ -79,17 +79,26 @@
  */
 public class BasicOptionPaneUI extends OptionPaneUI {
 
+    /**
+     * The mininum width of {@code JOptionPane}.
+     */
     public static final int MinimumWidth = 262;
+    /**
+     * The mininum height of {@code JOptionPane}.
+     */
     public static final int MinimumHeight = 90;
 
     private static String newline;
 
     /**
-     * <code>JOptionPane</code> that the receiver is providing the
+     * {@code JOptionPane} that the receiver is providing the
      * look and feel for.
      */
     protected JOptionPane         optionPane;
 
+    /**
+     * The size of {@code JOptionPane}.
+     */
     protected Dimension minimumSize;
 
     /** JComponent provide for input if optionPane.getWantsInput() returns
@@ -103,6 +112,9 @@
      * in either the message or the buttons. */
     protected boolean             hasCustomComponents;
 
+    /**
+     * The instance of {@code PropertyChangeListener}.
+     */
     protected PropertyChangeListener propertyChangeListener;
 
     private Handler handler;
@@ -123,8 +135,10 @@
 
 
     /**
-      * Creates a new BasicOptionPaneUI instance.
-      */
+     * Creates a new {@code BasicOptionPaneUI} instance.
+     *
+     * @return a new {@code BasicOptionPaneUI} instance
+     */
     public static ComponentUI createUI(JComponent x) {
         return new BasicOptionPaneUI();
     }
@@ -155,6 +169,9 @@
         optionPane = null;
     }
 
+    /**
+     * Installs default properties.
+     */
     protected void installDefaults() {
         LookAndFeel.installColorsAndFont(optionPane, "OptionPane.background",
                                          "OptionPane.foreground", "OptionPane.font");
@@ -163,10 +180,16 @@
         LookAndFeel.installProperty(optionPane, "opaque", Boolean.TRUE);
     }
 
+    /**
+     * Uninstalls default properties.
+     */
     protected void uninstallDefaults() {
         LookAndFeel.uninstallBorder(optionPane);
     }
 
+    /**
+     * Registers components.
+     */
     protected void installComponents() {
         optionPane.add(createMessageArea());
 
@@ -178,6 +201,9 @@
         optionPane.applyComponentOrientation(optionPane.getComponentOrientation());
     }
 
+    /**
+     * Unregisters components.
+     */
     protected void uninstallComponents() {
         hasCustomComponents = false;
         inputComponent = null;
@@ -185,16 +211,27 @@
         optionPane.removeAll();
     }
 
+    /**
+     * Returns a layout manager.
+     *
+     * @return a layout manager
+     */
     protected LayoutManager createLayoutManager() {
         return new BoxLayout(optionPane, BoxLayout.Y_AXIS);
     }
 
+    /**
+     * Registers listeners.
+     */
     protected void installListeners() {
         if ((propertyChangeListener = createPropertyChangeListener()) != null) {
             optionPane.addPropertyChangeListener(propertyChangeListener);
         }
     }
 
+    /**
+     * Unregisters listeners.
+     */
     protected void uninstallListeners() {
         if (propertyChangeListener != null) {
             optionPane.removePropertyChangeListener(propertyChangeListener);
@@ -203,6 +240,11 @@
         handler = null;
     }
 
+    /**
+     * Returns an instance of {@code PropertyChangeListener}.
+     *
+     * @return an instance of {@code PropertyChangeListener}
+     */
     protected PropertyChangeListener createPropertyChangeListener() {
         return getHandler();
     }
@@ -214,6 +256,9 @@
         return handler;
     }
 
+    /**
+     * Registers keyboard actions.
+     */
     protected void installKeyboardActions() {
         InputMap map = getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
 
@@ -224,6 +269,9 @@
                                            "OptionPane.actionMap");
     }
 
+    /**
+     * Unregisters keyboard actions.
+     */
     protected void uninstallKeyboardActions() {
         SwingUtilities.replaceUIInputMap(optionPane, JComponent.
                                        WHEN_IN_FOCUSED_WINDOW, null);
@@ -244,6 +292,8 @@
     /**
      * Returns the minimum size the option pane should be. Primarily
      * provided for subclassers wishing to offer a different minimum size.
+     *
+     * @return the minimum size of the option pane
      */
     public Dimension getMinimumOptionPaneSize() {
         if (minimumSize == null) {
@@ -280,9 +330,11 @@
     }
 
     /**
-     * Messaged from installComponents to create a Container containing the
-     * body of the message. The icon is the created by calling
-     * <code>addIcon</code>.
+     * Messaged from {@code installComponents} to create a {@code Container}
+     * containing the body of the message. The icon is the created
+     * by calling {@code addIcon}.
+     *
+     * @return a instance of {@code Container}
      */
     protected Container createMessageArea() {
         JPanel top = new JPanel();
@@ -325,15 +377,21 @@
     }
 
     /**
-     * Creates the appropriate object to represent <code>msg</code> and
-     * places it into <code>container</code>. If <code>msg</code> is an
-     * instance of Component, it is added directly, if it is an Icon,
-     * a JLabel is created to represent it, otherwise a JLabel is
-     * created for the string, if <code>d</code> is an Object[], this
-     * method will be recursively invoked for the children.
-     * <code>internallyCreated</code> is true if Objc is an instance
-     * of Component and was created internally by this method (this is
-     * used to correctly set hasCustomComponents only if !internallyCreated).
+     * Creates the appropriate object to represent {@code msg} and
+     * places it into {@code container}. If {@code msg} is an instance of
+     * {@code Component}, it is added directly, if it is an {@code Icon},
+     * a {@code JLabel} is created to represent it, otherwise a {@code JLabel} is
+     * created for the string, if {@code d} is an Object[], this method
+     * will be recursively invoked for the children. {@code internallyCreated} is
+     * {@code true} if Objc is an instance of {@code Component} and was created
+     * internally by this method (this is used to correctly set
+     * {@code hasCustomComponents} only if {@code internallyCreated} is {@code false}).
+     *
+     * @param container a container
+     * @param cons an instance of {@code GridBagConstraints}
+     * @param msg a message
+     * @param maxll a maximum length
+     * @param internallyCreated {@code true} if the component was internally created
      */
     protected void addMessageComponents(Container container,
                                      GridBagConstraints cons,
@@ -431,8 +489,10 @@
     }
 
     /**
-     * Returns the message to display from the JOptionPane the receiver is
+     * Returns the message to display from the {@code JOptionPane} the receiver is
      * providing the look and feel for.
+     *
+     * @return the message to display
      */
     protected Object getMessage() {
         inputComponent = null;
@@ -514,8 +574,10 @@
 
     /**
      * Creates and adds a JLabel representing the icon returned from
-     * <code>getIcon</code> to <code>top</code>. This is messaged from
-     * <code>createMessageArea</code>
+     * {@code getIcon} to {@code top}. This is messaged from
+     * {@code createMessageArea}.
+     *
+     * @param top a container
      */
     protected void addIcon(Container top) {
         /* Create the icon. */
@@ -531,9 +593,11 @@
     }
 
     /**
-     * Returns the icon from the JOptionPane the receiver is providing
+     * Returns the icon from the {@code JOptionPane} the receiver is providing
      * the look and feel for, or the default icon as returned from
-     * <code>getDefaultIcon</code>.
+     * {@code getDefaultIcon}.
+     *
+     * @return the icon
      */
     protected Icon getIcon() {
         Icon      mIcon = (optionPane == null ? null : optionPane.getIcon());
@@ -545,6 +609,9 @@
 
     /**
      * Returns the icon to use for the passed in type.
+     *
+     * @param messageType a type of message
+     * @return the icon to use for the passed in type
      */
     protected Icon getIconForType(int messageType) {
         if(messageType < 0 || messageType > 3)
@@ -572,14 +639,20 @@
 
     /**
      * Returns the maximum number of characters to place on a line.
+     *
+     * @return the maximum number of characters to place on a line
      */
     protected int getMaxCharactersPerLineCount() {
         return optionPane.getMaxCharactersPerLineCount();
     }
 
-   /**
-     * Recursively creates new JLabel instances to represent <code>d</code>.
-     * Each JLabel instance is added to <code>c</code>.
+    /**
+     * Recursively creates new {@code JLabel} instances to represent {@code d}.
+     * Each {@code JLabel} instance is added to {@code c}.
+     *
+     * @param c a container
+     * @param d a text
+     * @param maxll a maximum length of a text
      */
     protected void burstStringInto(Container c, String d, int maxll) {
         // Primitive line wrapping
@@ -602,13 +675,20 @@
         c.add(label);
     }
 
+    /**
+     * Returns a separator.
+     *
+     * @return a separator
+     */
     protected Container createSeparator() {
         return null;
     }
 
     /**
-     * Creates and returns a Container containing the buttons. The buttons
-     * are created by calling <code>getButtons</code>.
+     * Creates and returns a {@code Container} containing the buttons.
+     * The buttons are created by calling {@code getButtons}.
+     *
+     * @return a {@code Container} containing the buttons
      */
     protected Container createButtonArea() {
         JPanel bottom = new JPanel();
@@ -633,10 +713,14 @@
 
     /**
      * Creates the appropriate object to represent each of the objects in
-     * <code>buttons</code> and adds it to <code>container</code>. This
+     * {@code buttons} and adds it to {@code container}. This
      * differs from addMessageComponents in that it will recurse on
-     * <code>buttons</code> and that if button is not a Component
+     * {@code buttons} and that if button is not a Component
      * it will create an instance of JButton.
+     *
+     * @param container a container
+     * @param buttons an array of buttons
+     * @param initialIndex an initial index
      */
     protected void addButtonComponents(Container container, Object[] buttons,
                                  int initialIndex) {
@@ -733,17 +817,25 @@
         }
     }
 
+    /**
+     * Constructs a new instance of a {@code ButtonActionListener}.
+     *
+     * @param buttonIndex an index of the button
+     * @return a new instance of a {@code ButtonActionListener}
+     */
     protected ActionListener createButtonActionListener(int buttonIndex) {
         return new ButtonActionListener(buttonIndex);
     }
 
     /**
-     * Returns the buttons to display from the JOptionPane the receiver is
-     * providing the look and feel for. If the JOptionPane has options
+     * Returns the buttons to display from the {@code JOptionPane} the receiver is
+     * providing the look and feel for. If the {@code JOptionPane} has options
      * set, they will be provided, otherwise if the optionType is
-     * YES_NO_OPTION, yesNoOptions is returned, if the type is
-     * YES_NO_CANCEL_OPTION yesNoCancelOptions is returned, otherwise
-     * defaultButtons are returned.
+     * {@code YES_NO_OPTION}, {@code yesNoOptions} is returned, if the type is
+     * {@code YES_NO_CANCEL_OPTION} {@code yesNoCancelOptions} is returned, otherwise
+     * {@code defaultButtons} are returned.
+     *
+     * @return the buttons to display from the JOptionPane
      */
     protected Object[] getButtons() {
         if (optionPane != null) {
@@ -827,8 +919,10 @@
     }
 
     /**
-     * Returns true, basic L&amp;F wants all the buttons to have the same
+     * Returns {@code true}, basic L&amp;F wants all the buttons to have the same
      * width.
+     *
+     * @return {@code true} if all the buttons should have the same width
      */
     protected boolean getSizeButtonsToSameWidth() {
         return true;
@@ -838,6 +932,8 @@
      * Returns the initial index into the buttons to select. The index
      * is calculated from the initial value from the JOptionPane and
      * options of the JOptionPane or 0.
+     *
+     * @return the initial index into the buttons to select
      */
     protected int getInitialValueIndex() {
         if (optionPane != null) {
@@ -915,7 +1011,13 @@
      * Instantiate it only within subclasses of {@code BasicOptionPaneUI}.
      */
     public static class ButtonAreaLayout implements LayoutManager {
+        /**
+         * The value represents if the width of children should be synchronized.
+         */
         protected boolean           syncAllWidths;
+        /**
+         * The padding value.
+         */
         protected int               padding;
         /** If true, children are lumped together in parent. */
         protected boolean           centersChildren;
@@ -928,6 +1030,12 @@
          */
         private boolean useOrientation;
 
+        /**
+         * Constructs a new instance of {@code ButtonAreaLayout}.
+         *
+         * @param syncAllWidths if the width of children should be synchronized
+         * @param padding the padding value
+         */
         public ButtonAreaLayout(boolean syncAllWidths, int padding) {
             this.syncAllWidths = syncAllWidths;
             this.padding = padding;
@@ -943,27 +1051,57 @@
             this.reverseButtons = reverseButtons;
         }
 
+        /**
+         * Sets if the width of children should be synchronized.
+         *
+         * @param newValue if the width of children should be synchronized
+         */
         public void setSyncAllWidths(boolean newValue) {
             syncAllWidths = newValue;
         }
 
+        /**
+         * Returns if the width of children should be synchronized.
+         *
+         * @return if the width of children should be synchronized
+         */
         public boolean getSyncAllWidths() {
             return syncAllWidths;
         }
 
+        /**
+         * Sets the padding value.
+         *
+         * @param newPadding the new padding
+         */
         public void setPadding(int newPadding) {
             this.padding = newPadding;
         }
 
+        /**
+         * Returns the padding.
+         *
+         * @return the padding
+         */
         public int getPadding() {
             return padding;
         }
 
+        /**
+         * Sets whether or not center children should be used.
+         *
+         * @param newValue a new value
+         */
         public void setCentersChildren(boolean newValue) {
             centersChildren = newValue;
             useOrientation = false;
         }
 
+        /**
+         * Returns whether or not center children should be used.
+         *
+         * @return whether or not center children should be used
+         */
         public boolean getCentersChildren() {
             return centersChildren;
         }
@@ -1163,8 +1301,16 @@
      * Instantiate it only within subclasses of {@code BasicOptionPaneUI}.
      */
     public class ButtonActionListener implements ActionListener {
+        /**
+         * The index of the button.
+         */
         protected int buttonIndex;
 
+        /**
+         * Constructs a new instance of {@code ButtonActionListener}.
+         *
+         * @param buttonIndex an index of the button
+         */
         public ButtonActionListener(int buttonIndex) {
             this.buttonIndex = buttonIndex;
         }
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicPanelUI.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicPanelUI.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014, 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
@@ -43,6 +43,12 @@
     // Shared UI object
     private static PanelUI panelUI;
 
+    /**
+     * Returns an instance of {@code BasicPanelUI}.
+     *
+     * @param c a component
+     * @return an instance of {@code BasicPanelUI}
+     */
     public static ComponentUI createUI(JComponent c) {
         if(panelUI == null) {
             panelUI = new BasicPanelUI();
@@ -62,6 +68,11 @@
         super.uninstallUI(c);
     }
 
+    /**
+     * Method for installing panel properties.
+     *
+     * @param p an instance of {@code JPanel}
+     */
     protected void installDefaults(JPanel p) {
         LookAndFeel.installColorsAndFont(p,
                                          "Panel.background",
@@ -71,6 +82,11 @@
         LookAndFeel.installProperty(p, "opaque", Boolean.TRUE);
     }
 
+    /**
+     * Method for uninstalling panel properties.
+     *
+     * @param p an instance of {@code JPanel}
+     */
     protected void uninstallDefaults(JPanel p) {
         LookAndFeel.uninstallBorder(p);
     }
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicPopupMenuSeparatorUI.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicPopupMenuSeparatorUI.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014, 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
@@ -42,6 +42,12 @@
 
 public class BasicPopupMenuSeparatorUI extends BasicSeparatorUI
 {
+    /**
+     * Returns a new instance of {@code BasicPopupMenuSeparatorUI}.
+     *
+     * @param c a component
+     * @return a new instance of {@code BasicPopupMenuSeparatorUI}
+     */
     public static ComponentUI createUI( JComponent c )
     {
         return new BasicPopupMenuSeparatorUI();
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicPopupMenuUI.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicPopupMenuUI.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, 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
@@ -66,6 +66,9 @@
     static final StringBuilder MENU_KEYBOARD_HELPER_KEY = new StringBuilder(
                    "javax.swing.plaf.basic.BasicPopupMenuUI.MenuKeyboardHelper");
 
+    /**
+     * The instance of {@code JPopupMenu}.
+     */
     protected JPopupMenu popupMenu = null;
     private transient PopupMenuListener popupMenuListener = null;
     private MenuKeyListener menuKeyListener = null;
@@ -73,10 +76,19 @@
     private static boolean checkedUnpostPopup;
     private static boolean unpostPopup;
 
+    /**
+     * Constructs a new instance of {@code BasicPopupMenuUI}.
+     *
+     * @param x a component
+     * @return a new instance of {@code BasicPopupMenuUI}
+     */
     public static ComponentUI createUI(JComponent x) {
         return new BasicPopupMenuUI();
     }
 
+    /**
+     * Constructs a new instance of {@code BasicPopupMenuUI}.
+     */
     public BasicPopupMenuUI() {
         BasicLookAndFeel.needsEventHelper = true;
         LookAndFeel laf = UIManager.getLookAndFeel();
@@ -93,6 +105,9 @@
         installKeyboardActions();
     }
 
+    /**
+     * Installs default properties.
+     */
     public void installDefaults() {
         if (popupMenu.getLayout() == null ||
             popupMenu.getLayout() instanceof UIResource)
@@ -101,11 +116,14 @@
         LookAndFeel.installProperty(popupMenu, "opaque", Boolean.TRUE);
         LookAndFeel.installBorder(popupMenu, "PopupMenu.border");
         LookAndFeel.installColorsAndFont(popupMenu,
-                                         "PopupMenu.background",
-                                         "PopupMenu.foreground",
-                                         "PopupMenu.font");
+                "PopupMenu.background",
+                "PopupMenu.foreground",
+                "PopupMenu.font");
     }
 
+    /**
+     * Registers listeners.
+     */
     protected void installListeners() {
         if (popupMenuListener == null) {
             popupMenuListener = new BasicPopupMenuListener();
@@ -138,6 +156,9 @@
         }
     }
 
+    /**
+     * Registers keyboard actions.
+     */
     protected void installKeyboardActions() {
     }
 
@@ -181,10 +202,16 @@
         popupMenu = null;
     }
 
+    /**
+     * Uninstalls default properties.
+     */
     protected void uninstallDefaults() {
         LookAndFeel.uninstallBorder(popupMenu);
     }
 
+    /**
+     * Unregisters listeners.
+     */
     protected void uninstallListeners() {
         if (popupMenuListener != null) {
             popupMenu.removePopupMenuListener(popupMenuListener);
@@ -194,6 +221,9 @@
         }
     }
 
+    /**
+     * Unregisters keyboard actions.
+     */
     protected void uninstallKeyboardActions() {
         SwingUtilities.replaceUIActionMap(popupMenu, null);
         SwingUtilities.replaceUIInputMap(popupMenu,
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicProgressBarUI.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicProgressBarUI.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -53,7 +53,13 @@
 
     private Animator animator;
 
+    /**
+     * The instance of {@code JProgressBar}.
+     */
     protected JProgressBar progressBar;
+    /**
+     * The instance of {@code ChangeListener}.
+     */
     protected ChangeListener changeListener;
     private Handler handler;
 
@@ -127,7 +133,12 @@
 
     private int maxPosition = 0; //maximum X (horiz) or Y box location
 
-
+    /**
+     * Returns a new instance of {@code BasicProgressBarUI}.
+     *
+     * @param x a component
+     * @return a new instance of {@code BasicProgressBarUI}
+     */
     public static ComponentUI createUI(JComponent x) {
         return new BasicProgressBarUI();
     }
@@ -150,6 +161,9 @@
         progressBar = null;
     }
 
+    /**
+     * Installs default properties.
+     */
     protected void installDefaults() {
         LookAndFeel.installProperty(progressBar, "opaque", Boolean.TRUE);
         LookAndFeel.installBorder(progressBar,"ProgressBar.border");
@@ -164,10 +178,16 @@
         selectionBackground = UIManager.getColor("ProgressBar.selectionBackground");
     }
 
+    /**
+     * Unintalls default properties.
+     */
     protected void uninstallDefaults() {
         LookAndFeel.uninstallBorder(progressBar);
     }
 
+    /**
+     * Registers listeners.
+     */
     protected void installListeners() {
         //Listen for changes in the progress bar's data.
         changeListener = getHandler();
@@ -291,6 +311,11 @@
     // protected void installKeyboardActions()
     // protected void uninstallKeyboardActions()
 
+    /**
+     * Returns preferred size of the horizontal {@code JProgressBar}.
+     *
+     * @return preferred size of the horizontal {@code JProgressBar}
+     */
     protected Dimension getPreferredInnerHorizontal() {
         Dimension horizDim = (Dimension)DefaultLookup.get(progressBar, this,
             "ProgressBar.horizontalSize");
@@ -300,6 +325,11 @@
         return horizDim;
     }
 
+    /**
+     * Returns preferred size of the vertical {@code JProgressBar}.
+     *
+     * @return preferred size of the vertical {@code JProgressBar}
+     */
     protected Dimension getPreferredInnerVertical() {
         Dimension vertDim = (Dimension)DefaultLookup.get(progressBar, this,
             "ProgressBar.verticalSize");
@@ -312,6 +342,8 @@
     /**
      * The "selectionForeground" is the color of the text when it is painted
      * over a filled area of the progress bar.
+     *
+     * @return the color of the selected foreground
      */
     protected Color getSelectionForeground() {
         return selectionForeground;
@@ -320,6 +352,8 @@
     /**
      * The "selectionBackground" is the color of the text when it is painted
      * over an unfilled area of the progress bar.
+     *
+     * @return the color of the selected background
      */
     protected Color getSelectionBackground() {
         return selectionBackground;
@@ -352,6 +386,11 @@
         }
     }
 
+    /**
+     * Sets the cell length.
+     *
+     * @param cellLen a new cell length
+     */
     protected void setCellLength(int cellLen) {
         this.cellLength = cellLen;
     }
@@ -374,6 +413,11 @@
         }
     }
 
+    /**
+     * Sets the cell spacing.
+     *
+     * @param cellSpace a new cell spacing
+     */
     protected void setCellSpacing(int cellSpace) {
         this.cellSpacing = cellSpace;
     }
@@ -384,6 +428,11 @@
      * operation so it was abstracted out. It assumes that your progress bar
      * is linear. That is, if you are making a circular progress indicator,
      * you will want to override this method.
+     *
+     * @param b insets
+     * @param width a width
+     * @param height a height
+     * @return the amount of the progress bar that should be filled
      */
     protected int getAmountFull(Insets b, int width, int height) {
         int amountFull = 0;
@@ -577,6 +626,8 @@
      * Override this if you are making another kind of
      * progress bar.
      *
+     * @param g an instance of {@code Graphics}
+     * @param c a component
      * @see #paintDeterminate
      *
      * @since 1.4
@@ -628,6 +679,8 @@
      * Naturally, override this if you are making a circular or
      * semi-circular progress bar.
      *
+     * @param g an instance of {@code Graphics}
+     * @param c a component
      * @see #paintIndeterminate
      *
      * @since 1.4
@@ -703,7 +756,18 @@
         }
     }
 
-
+    /**
+     * Paints the progress string.
+     *
+     * @param g an instance of {@code Graphics}
+     * @param x X location of bounding box
+     * @param y Y location of bounding box
+     * @param width width of bounding box
+     * @param height height of bounding box
+     * @param amountFull size of the fill region, either width or height
+     *        depending upon orientation.
+     * @param b Insets of the progress bar.
+     */
     protected void paintString(Graphics g, int x, int y,
                                int width, int height,
                                int amountFull, Insets b) {
@@ -793,6 +857,14 @@
      * bar (in both x and y). Override this if you want to right,
      * left, top, or bottom align the progress string or if you need
      * to nudge it around for any reason.
+     *
+     * @param g an instance of {@code Graphics}
+     * @param progressString a text
+     * @param x an X coordinate
+     * @param y an Y coordinate
+     * @param width a width
+     * @param height a height
+     * @return the place where the progress string will be painted
      */
     protected Point getStringPlacement(Graphics g, String progressString,
                                        int x,int y,int width,int height) {
@@ -894,6 +966,7 @@
     /**
      * Gets the index of the current animation frame.
      *
+     * @return the index of the current animation frame
      * @since 1.4
      */
     protected int getAnimationIndex() {
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicRadioButtonMenuItemUI.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicRadioButtonMenuItemUI.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -39,6 +39,12 @@
  */
 public class BasicRadioButtonMenuItemUI extends BasicMenuItemUI
 {
+    /**
+     * Returns a new instance of {@code BasicRadioButtonMenuItemUI}.
+     *
+     * @param b a component
+     * @return a new instance of {@code BasicRadioButtonMenuItemUI}
+     */
     public static ComponentUI createUI(JComponent b) {
         return new BasicRadioButtonMenuItemUI();
     }
@@ -47,6 +53,14 @@
         return "RadioButtonMenuItem";
     }
 
+    /**
+     * Invoked when mouse event occurs.
+     *
+     * @param item a menu item
+     * @param e a mouse event
+     * @param path an array of {@code MenuElement}
+     * @param manager an instance of {@code MenuSelectionManager}
+     */
     public void processMouseEvent(JMenuItem item,MouseEvent e,MenuElement path[],MenuSelectionManager manager) {
         Point p = e.getPoint();
         if(p.x >= 0 && p.x < item.getWidth() &&
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicRadioButtonUI.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicRadioButtonUI.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, 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
@@ -44,6 +44,9 @@
 {
     private static final Object BASIC_RADIO_BUTTON_UI_KEY = new Object();
 
+    /**
+     * The icon.
+     */
     protected Icon icon;
 
     private boolean defaults_initialized = false;
@@ -53,6 +56,13 @@
     // ********************************
     //        Create PLAF
     // ********************************
+
+    /**
+     * Returns an instance of {@code BasicRadioButtonUI}.
+     *
+     * @param b a component
+     * @return an instance of {@code BasicRadioButtonUI}
+     */
     public static ComponentUI createUI(JComponent b) {
         AppContext appContext = AppContext.getAppContext();
         BasicRadioButtonUI radioButtonUI =
@@ -87,6 +97,11 @@
         defaults_initialized = false;
     }
 
+    /**
+     * Returns the default icon.
+     *
+     * @return the default icon
+     */
     public Icon getDefaultIcon() {
         return icon;
     }
@@ -195,6 +210,13 @@
         }
     }
 
+    /**
+     * Paints focused radio button.
+     *
+     * @param g an instance of {@code Graphics}
+     * @param textRect bounds
+     * @param size the size of radio button
+     */
     protected void paintFocus(Graphics g, Rectangle textRect, Dimension size){
     }
 
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicRootPaneUI.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicRootPaneUI.java	Wed Jul 05 19:53:51 2017 +0200
@@ -48,6 +48,12 @@
                   PropertyChangeListener {
     private static RootPaneUI rootPaneUI = new BasicRootPaneUI();
 
+    /**
+     * Returns a new instance of {@code BasicRootPaneUI}.
+     *
+     * @param c a component
+     * @return a new instance of {@code BasicRootPaneUI}
+     */
     public static ComponentUI createUI(JComponent c) {
         return rootPaneUI;
     }
@@ -67,17 +73,37 @@
         uninstallKeyboardActions((JRootPane)c);
     }
 
+    /**
+     * Installs default properties.
+     *
+     * @param c an instance of {@code JRootPane}
+     */
     protected void installDefaults(JRootPane c){
         LookAndFeel.installProperty(c, "opaque", Boolean.FALSE);
     }
 
+    /**
+     * Installs components.
+     *
+     * @param root an instance of {@code JRootPane}
+     */
     protected void installComponents(JRootPane root) {
     }
 
+    /**
+     * Registers listeners.
+     *
+     * @param root an instance of {@code JRootPane}
+     */
     protected void installListeners(JRootPane root) {
         root.addPropertyChangeListener(this);
     }
 
+    /**
+     * Registers keyboard actions.
+     *
+     * @param root an instance of {@code JRootPane}
+     */
     protected void installKeyboardActions(JRootPane root) {
         InputMap km = getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW, root);
         SwingUtilities.replaceUIInputMap(root,
@@ -92,19 +118,39 @@
         updateDefaultButtonBindings(root);
     }
 
+    /**
+     * Uninstalls default properties.
+     *
+     * @param root an instance of {@code JRootPane}
+     */
     protected void uninstallDefaults(JRootPane root) {
     }
 
+    /**
+     * Unregisters components.
+     *
+     * @param root an instance of {@code JRootPane}
+     */
     protected void uninstallComponents(JRootPane root) {
     }
 
+    /**
+     * Unregisters listeners.
+     *
+     * @param root an instance of {@code JRootPane}
+     */
     protected void uninstallListeners(JRootPane root) {
         root.removePropertyChangeListener(this);
     }
 
+    /**
+     * Unregisters keyboard actions.
+     *
+     * @param root an instance of {@code JRootPane}
+     */
     protected void uninstallKeyboardActions(JRootPane root) {
         SwingUtilities.replaceUIInputMap(root, JComponent.
-                                       WHEN_IN_FOCUSED_WINDOW, null);
+                WHEN_IN_FOCUSED_WINDOW, null);
         SwingUtilities.replaceUIActionMap(root, null);
     }
 
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicScrollPaneUI.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicScrollPaneUI.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -52,21 +52,40 @@
 public class BasicScrollPaneUI
     extends ScrollPaneUI implements ScrollPaneConstants
 {
+    /**
+     * The instance of {@code JScrollPane}.
+     */
     protected JScrollPane scrollpane;
+
+    /**
+     * {@code ChangeListener} installed on the vertical scrollbar.
+     */
     protected ChangeListener vsbChangeListener;
+
+    /**
+     * {@code ChangeListener} installed on the horizontal scrollbar.
+     */
     protected ChangeListener hsbChangeListener;
+
+    /**
+     * {@code ChangeListener} installed on the viewport.
+     */
     protected ChangeListener viewportChangeListener;
+
+    /**
+     * {@code PropertyChangeListener} installed on the scroll pane.
+     */
     protected PropertyChangeListener spPropertyChangeListener;
     private MouseWheelListener mouseScrollListener;
     private int oldExtent = Integer.MIN_VALUE;
 
     /**
-     * PropertyChangeListener installed on the vertical scrollbar.
+     * {@code PropertyChangeListener} installed on the vertical scrollbar.
      */
     private PropertyChangeListener vsbPropertyChangeListener;
 
     /**
-     * PropertyChangeListener installed on the horizontal scrollbar.
+     * {@code PropertyChangeListener} installed on the horizontal scrollbar.
      */
     private PropertyChangeListener hsbPropertyChangeListener;
 
@@ -79,7 +98,12 @@
      */
     private boolean setValueCalled = false;
 
-
+    /**
+     * Returns a new instance of {@code BasicScrollPaneUI}.
+     *
+     * @param x a component.
+     * @return a new instance of {@code BasicScrollPaneUI}
+     */
     public static ComponentUI createUI(JComponent x) {
         return new BasicScrollPaneUI();
     }
@@ -115,7 +139,11 @@
         return new Dimension(Short.MAX_VALUE, Short.MAX_VALUE);
     }
 
-
+    /**
+     * Installs default properties.
+     *
+     * @param scrollpane an instance of {@code JScrollPane}
+     */
     protected void installDefaults(JScrollPane scrollpane)
     {
         LookAndFeel.installBorder(scrollpane, "ScrollPane.border");
@@ -132,7 +160,11 @@
         LookAndFeel.installProperty(scrollpane, "opaque", Boolean.TRUE);
     }
 
-
+    /**
+     * Registers listeners.
+     *
+     * @param c an instance of {@code JScrollPane}
+     */
     protected void installListeners(JScrollPane c)
     {
         vsbChangeListener = createVSBChangeListener();
@@ -165,6 +197,11 @@
 
     }
 
+    /**
+     * Registers keyboard actions.
+     *
+     * @param c an instance of {@code JScrollPane}
+     */
     protected void installKeyboardActions(JScrollPane c) {
         InputMap inputMap = getInputMap(JComponent.
                                   WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
@@ -201,7 +238,11 @@
         installKeyboardActions(scrollpane);
     }
 
-
+    /**
+     * Uninstalls default properties.
+     *
+     * @param c an instance of {@code JScrollPane}
+     */
     protected void uninstallDefaults(JScrollPane c) {
         LookAndFeel.uninstallBorder(scrollpane);
 
@@ -210,7 +251,11 @@
         }
     }
 
-
+    /**
+     * Unregisters listeners.
+     *
+     * @param c a component
+     */
     protected void uninstallListeners(JComponent c) {
         JViewport viewport = scrollpane.getViewport();
         JScrollBar vsb = scrollpane.getVerticalScrollBar();
@@ -242,7 +287,11 @@
         handler = null;
     }
 
-
+    /**
+     * Unregisters keyboard actions.
+     *
+     * @param c an instance of {@code JScrollPane}
+     */
     protected void uninstallKeyboardActions(JScrollPane c) {
         SwingUtilities.replaceUIActionMap(c, null);
         SwingUtilities.replaceUIInputMap(c, JComponent.
@@ -264,6 +313,9 @@
         return handler;
     }
 
+    /**
+     * Synchronizes the {@code JScrollPane} with {@code Viewport}.
+     */
     protected void syncScrollPaneWithViewport()
     {
         JViewport viewport = scrollpane.getViewport();
@@ -453,6 +505,11 @@
         }
     }
 
+    /**
+     * Returns an instance of viewport {@code ChangeListener}.
+     *
+     * @return an instance of viewport {@code ChangeListener}
+     */
     protected ChangeListener createViewportChangeListener() {
         return getHandler();
     }
@@ -483,6 +540,11 @@
         return getHandler();
     }
 
+    /**
+     * Returns an instance of horizontal scroll bar {@code ChangeListener}.
+     *
+     * @return an instance of horizontal scroll bar {@code ChangeListener}
+     */
     protected ChangeListener createHSBChangeListener() {
         return getHandler();
     }
@@ -514,6 +576,11 @@
         return getHandler();
     }
 
+    /**
+     * Returns an instance of vertical scroll bar {@code ChangeListener}.
+     *
+     * @return an instance of vertical scroll bar {@code ChangeListener}
+     */
     protected ChangeListener createVSBChangeListener() {
         return getHandler();
     }
@@ -565,12 +632,21 @@
         return getHandler();
     }
 
+    /**
+     * Updates a scroll bar display policy.
+     *
+     * @param e the property change event
+     */
     protected void updateScrollBarDisplayPolicy(PropertyChangeEvent e) {
         scrollpane.revalidate();
         scrollpane.repaint();
     }
 
-
+    /**
+     * Updates viewport.
+     *
+     * @param e the property change event
+     */
     protected void updateViewport(PropertyChangeEvent e)
     {
         JViewport oldViewport = (JViewport)(e.getOldValue());
@@ -599,7 +675,11 @@
         }
     }
 
-
+    /**
+     * Updates row header.
+     *
+     * @param e the property change event
+     */
     protected void updateRowHeader(PropertyChangeEvent e)
     {
         JViewport newRowHead = (JViewport)(e.getNewValue());
@@ -611,7 +691,11 @@
         }
     }
 
-
+    /**
+     * Updates column header.
+     *
+     * @param e the property change event
+     */
     protected void updateColumnHeader(PropertyChangeEvent e)
     {
         JViewport newColHead = (JViewport)(e.getNewValue());
@@ -679,9 +763,9 @@
 
 
     /**
-     * Creates an instance of PropertyChangeListener that's added to
-     * the JScrollPane by installUI().  Subclasses can override this method
-     * to return a custom PropertyChangeListener, e.g.
+     * Creates an instance of {@code PropertyChangeListener} that's added to
+     * the {@code JScrollPane} by {@code installUI()}. Subclasses can override
+     * this method to return a custom {@code PropertyChangeListener}, e.g.
      * <pre>
      * class MyScrollPaneUI extends BasicScrollPaneUI {
      *    protected PropertyChangeListener <b>createPropertyChangeListener</b>() {
@@ -698,6 +782,8 @@
      * }
      * </pre>
      *
+     * @return an instance of {@code PropertyChangeListener}
+     *
      * @see java.beans.PropertyChangeListener
      * @see #installUI
      */
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicSeparatorUI.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicSeparatorUI.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, 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,9 +45,22 @@
 
 public class BasicSeparatorUI extends SeparatorUI
 {
+    /**
+     * The color of the shadow.
+     */
     protected Color shadow;
+
+    /**
+     * The color of the highlighting.
+     */
     protected Color highlight;
 
+    /**
+     * Returns a new instance of {@code BasicSeparatorUI}.
+     *
+     * @param c a component
+     * @return a new instance of {@code BasicSeparatorUI}
+     */
     public static ComponentUI createUI( JComponent c )
     {
         return new BasicSeparatorUI();
@@ -65,20 +78,40 @@
         uninstallListeners( (JSeparator)c );
     }
 
+    /**
+     * Installs default properties.
+     *
+     * @param s an instance of {@code JSeparator}
+     */
     protected void installDefaults( JSeparator s )
     {
-        LookAndFeel.installColors( s, "Separator.background", "Separator.foreground" );
-        LookAndFeel.installProperty( s, "opaque", Boolean.FALSE);
+        LookAndFeel.installColors(s, "Separator.background", "Separator.foreground");
+        LookAndFeel.installProperty(s, "opaque", Boolean.FALSE);
     }
 
+    /**
+     * Uninstalls default properties.
+     *
+     * @param s an instance of {@code JSeparator}
+     */
     protected void uninstallDefaults( JSeparator s )
     {
     }
 
+    /**
+     * Registers listeners.
+     *
+     * @param s an instance of {@code JSeparator}
+     */
     protected void installListeners( JSeparator s )
     {
     }
 
+    /**
+     * Unregisters listeners.
+     *
+     * @param s an instance of {@code JSeparator}
+     */
     protected void uninstallListeners( JSeparator s )
     {
     }
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicSpinnerUI.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicSpinnerUI.java	Wed Jul 05 19:53:51 2017 +0200
@@ -400,6 +400,8 @@
      * The implementation of <code>replaceEditor</code> should be coordinated
      * with the <code>createEditor</code> method.
      *
+     * @param oldEditor an old instance of editor
+     * @param newEditor a new instance of editor
      * @see #createEditor
      * @see #createPropertyChangeListener
      */
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicSplitPaneDivider.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicSplitPaneDivider.java	Wed Jul 05 19:53:51 2017 +0200
@@ -65,9 +65,13 @@
 {
     /**
      * Width or height of the divider based on orientation
-     * BasicSplitPaneUI adds two to this.
+     * {@code BasicSplitPaneUI} adds two to this.
      */
     protected static final int ONE_TOUCH_SIZE = 6;
+
+    /**
+     * The offset of the divider.
+     */
     protected static final int ONE_TOUCH_OFFSET = 2;
 
     /**
@@ -136,8 +140,10 @@
 
 
     /**
-     * Creates an instance of BasicSplitPaneDivider. Registers this
+     * Creates an instance of {@code BasicSplitPaneDivider}. Registers this
      * instance for mouse events and mouse dragged events.
+     *
+     * @param ui an instance of {@code BasicSplitPaneUI}
      */
     public BasicSplitPaneDivider(BasicSplitPaneUI ui) {
         oneTouchSize = DefaultLookup.getInt(ui.getSplitPane(), ui,
@@ -163,7 +169,9 @@
     }
 
     /**
-     * Sets the SplitPaneUI that is using the receiver.
+     * Sets the {@code SplitPaneUI} that is using the receiver.
+     *
+     * @param newUI the new {@code SplitPaneUI}
      */
     public void setBasicSplitPaneUI(BasicSplitPaneUI newUI) {
         if (splitPane != null) {
@@ -198,8 +206,9 @@
 
 
     /**
-     * Returns the <code>SplitPaneUI</code> the receiver is currently
-     * in.
+     * Returns the {@code SplitPaneUI} the receiver is currently in.
+     *
+     * @return the {@code SplitPaneUI} the receiver is currently in
      */
     public BasicSplitPaneUI getBasicSplitPaneUI() {
         return splitPaneUI;
@@ -207,9 +216,11 @@
 
 
     /**
-     * Sets the size of the divider to <code>newSize</code>. That is
-     * the width if the splitpane is <code>HORIZONTAL_SPLIT</code>, or
-     * the height of <code>VERTICAL_SPLIT</code>.
+     * Sets the size of the divider to {@code newSize}. That is
+     * the width if the splitpane is {@code HORIZONTAL_SPLIT}, or
+     * the height of {@code VERTICAL_SPLIT}.
+     *
+     * @param newSize a new size
      */
     public void setDividerSize(int newSize) {
         dividerSize = newSize;
@@ -219,6 +230,8 @@
     /**
      * Returns the size of the divider, that is the width if the splitpane
      * is HORIZONTAL_SPLIT, or the height of VERTICAL_SPLIT.
+     *
+     * @return the size of the divider
      */
     public int getDividerSize() {
         return dividerSize;
@@ -227,6 +240,8 @@
 
     /**
      * Sets the border of this component.
+     *
+     * @param border a new border
      * @since 1.3
      */
     public void setBorder(Border border) {
@@ -382,8 +397,10 @@
 
 
     /**
-     * Creates and return an instance of JButton that can be used to
+     * Creates and return an instance of {@code JButton} that can be used to
      * collapse the left component in the split pane.
+     *
+     * @return an instance of {@code JButton}
      */
     protected JButton createLeftOneTouchButton() {
         JButton b = new JButton() {
@@ -438,8 +455,10 @@
 
 
     /**
-     * Creates and return an instance of JButton that can be used to
+     * Creates and return an instance of {@code JButton} that can be used to
      * collapse the right component in the split pane.
+     *
+     * @return an instance of {@code JButton}
      */
     protected JButton createRightOneTouchButton() {
         JButton b = new JButton() {
@@ -503,6 +522,8 @@
     /**
      * Messages the BasicSplitPaneUI with dragDividerTo that this instance
      * is contained in.
+     *
+     * @param location a location
      */
     protected void dragDividerTo(int location) {
         splitPaneUI.dragDividerTo(location);
@@ -512,6 +533,8 @@
     /**
      * Messages the BasicSplitPaneUI with finishDraggingTo that this instance
      * is contained in.
+     *
+     * @param location a location
      */
     protected void finishDraggingTo(int location) {
         splitPaneUI.finishDraggingTo(location);
@@ -694,7 +717,11 @@
          */
         int offset;
 
-
+        /**
+         * Constructs a new instance of {@code DragController}.
+         *
+         * @param e a mouse event
+         */
         protected DragController(MouseEvent e) {
             JSplitPane  splitPane = splitPaneUI.getSplitPane();
             Component   leftC = splitPane.getLeftComponent();
@@ -741,7 +768,9 @@
 
 
         /**
-         * Returns true if the dragging session is valid.
+         * Returns {@code true} if the dragging session is valid.
+         *
+         * @return {@code true} if the dragging session is valid
          */
         protected boolean isValid() {
             return (maxX > 0);
@@ -751,6 +780,9 @@
         /**
          * Returns the new position to put the divider at based on
          * the passed in MouseEvent.
+         *
+         * @param e a mouse event
+         * @return the new position
          */
         protected int positionForMouseEvent(MouseEvent e) {
             int newX = (e.getSource() == BasicSplitPaneDivider.this) ?
@@ -764,6 +796,10 @@
         /**
          * Returns the x argument, since this is used for horizontal
          * splits.
+         *
+         * @param x an X coordinate
+         * @param y an Y coordinate
+         * @return the X argument
          */
         protected int getNeededLocation(int x, int y) {
             int newX;
@@ -772,7 +808,13 @@
             return newX;
         }
 
-
+        /**
+         * Messages dragDividerTo with the new location for the mouse
+         * event.
+         *
+         * @param newX an X coordinate
+         * @param newY an Y coordinate
+         */
         protected void continueDrag(int newX, int newY) {
             dragDividerTo(getNeededLocation(newX, newY));
         }
@@ -781,12 +823,20 @@
         /**
          * Messages dragDividerTo with the new location for the mouse
          * event.
+         *
+         * @param e a mouse event
          */
         protected void continueDrag(MouseEvent e) {
             dragDividerTo(positionForMouseEvent(e));
         }
 
-
+        /**
+         * Messages finishDraggingTo with the new location for the mouse
+         * event.
+         *
+         * @param x an X coordinate
+         * @param y an Y coordinate
+         */
         protected void completeDrag(int x, int y) {
             finishDraggingTo(getNeededLocation(x, y));
         }
@@ -795,6 +845,8 @@
         /**
          * Messages finishDraggingTo with the new location for the mouse
          * event.
+         *
+         * @param e a mouse event
          */
         protected void completeDrag(MouseEvent e) {
             finishDraggingTo(positionForMouseEvent(e));
@@ -813,6 +865,11 @@
     protected class VerticalDragController extends DragController
     {
         /* DragControllers ivars are now in terms of y, not x. */
+        /**
+         * Constructs a new instance of {@code VerticalDragController}.
+         *
+         * @param e a mouse event
+         */
         protected VerticalDragController(MouseEvent e) {
             super(e);
             JSplitPane splitPane = splitPaneUI.getSplitPane();
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicSplitPaneUI.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicSplitPaneUI.java	Wed Jul 05 19:53:51 2017 +0200
@@ -286,7 +286,10 @@
 
 
     /**
-     * Creates a new BasicSplitPaneUI instance
+     * Creates a new instance of {@code BasicSplitPaneUI}.
+     *
+     * @param x a component
+     * @return a new instance of {@code BasicSplitPaneUI}
      */
     public static ComponentUI createUI(JComponent x) {
         return new BasicSplitPaneUI();
@@ -503,7 +506,9 @@
 
 
     /**
-     * Creates a PropertyChangeListener for the JSplitPane UI.
+     * Creates a {@code PropertyChangeListener} for the {@code JSplitPane} UI.
+     *
+     * @return an instance of {@code PropertyChangeListener}
      */
     protected PropertyChangeListener createPropertyChangeListener() {
         return getHandler();
@@ -518,7 +523,9 @@
 
 
     /**
-     * Creates a FocusListener for the JSplitPane UI.
+     * Creates a {@code FocusListener} for the {@code JSplitPane} UI.
+     *
+     * @return an instance of {@code FocusListener}
      */
     protected FocusListener createFocusListener() {
         return getHandler();
@@ -526,16 +533,17 @@
 
 
     /**
-     * As of Java 2 platform v1.3 this method is no
-     * longer used. Subclassers previously using this method should
-     * instead create an Action wrapping the ActionListener, and register
-     * that Action by overriding <code>installKeyboardActions</code> and
-     * placing the Action in the SplitPane's ActionMap. Please refer to
-     * the key bindings specification for further details.
+     * As of Java 2 platform v1.3 this method is no longer used.
+     * Subclassers previously using this method should instead create
+     * an {@code Action} wrapping the {@code ActionListener}, and register
+     * that {@code Action} by overriding {@code installKeyboardActions}
+     * and placing the {@code Action} in the {@code SplitPane's ActionMap}.
+     * Please refer to the key bindings specification for further details.
      * <p>
-     * Creates a ActionListener for the JSplitPane UI that listens for
-     * specific key presses.
+     * Creates an {@code ActionListener} for the {@code JSplitPane} UI that
+     * listens for specific key presses.
      *
+     * @return an instance of {@code ActionListener}
      * @deprecated As of Java 2 platform v1.3.
      */
     @Deprecated
@@ -545,16 +553,17 @@
 
 
     /**
-     * As of Java 2 platform v1.3 this method is no
-     * longer used. Subclassers previously using this method should
-     * instead create an Action wrapping the ActionListener, and register
-     * that Action by overriding <code>installKeyboardActions</code> and
-     * placing the Action in the SplitPane's ActionMap. Please refer to
-     * the key bindings specification for further details.
+     * As of Java 2 platform v1.3 this method is no longer used.
+     * Subclassers previously using this method should instead create
+     * an {@code Action} wrapping the {@code ActionListener}, and register
+     * that {@code Action} by overriding {@code installKeyboardActions}
+     * and placing the {@code Action} in the {@code SplitPane's ActionMap}.
+     * Please refer to the key bindings specification for further details.
      * <p>
-     * Creates a ActionListener for the JSplitPane UI that listens for
-     * specific key presses.
+     * Creates an {@code ActionListener} for the {@code JSplitPane} UI that
+     * listens for specific key presses.
      *
+     * @return an instance of {@code ActionListener}
      * @deprecated As of Java 2 platform v1.3.
      */
     @Deprecated
@@ -564,16 +573,17 @@
 
 
     /**
-     * As of Java 2 platform v1.3 this method is no
-     * longer used. Subclassers previously using this method should
-     * instead create an Action wrapping the ActionListener, and register
-     * that Action by overriding <code>installKeyboardActions</code> and
-     * placing the Action in the SplitPane's ActionMap. Please refer to
-     * the key bindings specification for further details.
+     * As of Java 2 platform v1.3 this method is no longer used.
+     * Subclassers previously using this method should instead create
+     * an {@code Action} wrapping the {@code ActionListener}, and register
+     * that {@code Action} by overriding {@code installKeyboardActions}
+     * and placing the {@code Action} in the {@code SplitPane's ActionMap}.
+     * Please refer to the key bindings specification for further details.
      * <p>
-     * Creates a ActionListener for the JSplitPane UI that listens for
-     * specific key presses.
+     * Creates an {@code ActionListener} for the {@code JSplitPane} UI that
+     * listens for specific key presses.
      *
+     * @return an instance of {@code ActionListener}
      * @deprecated As of Java 2 platform v1.3.
      */
     @Deprecated
@@ -583,16 +593,17 @@
 
 
     /**
-     * As of Java 2 platform v1.3 this method is no
-     * longer used. Subclassers previously using this method should
-     * instead create an Action wrapping the ActionListener, and register
-     * that Action by overriding <code>installKeyboardActions</code> and
-     * placing the Action in the SplitPane's ActionMap. Please refer to
-     * the key bindings specification for further details.
+     * As of Java 2 platform v1.3 this method is no longer used.
+     * Subclassers previously using this method should instead create
+     * an {@code Action} wrapping the {@code ActionListener}, and register
+     * that {@code Action} by overriding {@code installKeyboardActions}
+     * and placing the {@code Action} in the {@code SplitPane's ActionMap}.
+     * Please refer to the key bindings specification for further details.
      * <p>
-     * Creates a ActionListener for the JSplitPane UI that listens for
-     * specific key presses.
+     * Creates an {@code ActionListener} for the {@code JSplitPane} UI that
+     * listens for specific key presses.
      *
+     * @return an instance of {@code ActionListener}
      * @deprecated As of Java 2 platform v1.3.
      */
     @Deprecated
@@ -602,16 +613,17 @@
 
 
     /**
-     * As of Java 2 platform v1.3 this method is no
-     * longer used. Subclassers previously using this method should
-     * instead create an Action wrapping the ActionListener, and register
-     * that Action by overriding <code>installKeyboardActions</code> and
-     * placing the Action in the SplitPane's ActionMap. Please refer to
-     * the key bindings specification for further details.
+     * As of Java 2 platform v1.3 this method is no longer used.
+     * Subclassers previously using this method should instead create
+     * an {@code Action} wrapping the {@code ActionListener}, and register
+     * that {@code Action} by overriding {@code installKeyboardActions}
+     * and placing the {@code Action} in the {@code SplitPane's ActionMap}.
+     * Please refer to the key bindings specification for further details.
      * <p>
-     * Creates a ActionListener for the JSplitPane UI that listens for
-     * specific key presses.
+     * Creates an {@code ActionListener} for the {@code JSplitPane} UI that
+     * listens for specific key presses.
      *
+     * @return an instance of {@code ActionListener}
      * @deprecated As of Java 2 platform v1.3.
      */
     @Deprecated
@@ -621,7 +633,9 @@
 
 
     /**
-     * Returns the orientation for the JSplitPane.
+     * Returns the orientation for the {@code JSplitPane}.
+     *
+     * @return the orientation
      */
     public int getOrientation() {
         return orientation;
@@ -629,7 +643,9 @@
 
 
     /**
-     * Set the orientation for the JSplitPane.
+     * Set the orientation for the {@code JSplitPane}.
+     *
+     * @param orientation the orientation
      */
     public void setOrientation(int orientation) {
         this.orientation = orientation;
@@ -637,7 +653,9 @@
 
 
     /**
-     * Determines whether the JSplitPane is set to use a continuous layout.
+     * Determines whether the {@code JSplitPane} is set to use a continuous layout.
+     *
+     * @return {@code true} if a continuous layout is set
      */
     public boolean isContinuousLayout() {
         return continuousLayout;
@@ -646,6 +664,8 @@
 
     /**
      * Turn continuous layout on/off.
+     *
+     * @param b if {@code true} the continuous layout turns on
      */
     public void setContinuousLayout(boolean b) {
         continuousLayout = b;
@@ -653,7 +673,9 @@
 
 
     /**
-     * Returns the last drag location of the JSplitPane.
+     * Returns the last drag location of the {@code JSplitPane}.
+     *
+     * @return the last drag location
      */
     public int getLastDragLocation() {
         return lastDragLocation;
@@ -661,7 +683,9 @@
 
 
     /**
-     * Set the last drag location of the JSplitPane.
+     * Set the last drag location of the {@code JSplitPane}.
+     *
+     * @param l the drag location
      */
     public void setLastDragLocation(int l) {
         lastDragLocation = l;
@@ -819,6 +843,8 @@
 
     /**
      * Returns the divider between the top Components.
+     *
+     * @return the divider between the top Components
      */
     public BasicSplitPaneDivider getDivider() {
         return divider;
@@ -828,6 +854,8 @@
     /**
      * Returns the default non continuous layout divider, which is an
      * instance of {@code Canvas} that fills in the background with dark gray.
+     *
+     * @return the default non continuous layout divider
      */
     @SuppressWarnings("serial") // anonymous class
     protected Component createDefaultNonContinuousLayoutDivider() {
@@ -849,10 +877,12 @@
 
 
     /**
-     * Sets the divider to use when the splitPane is configured to
+     * Sets the divider to use when the {@code JSplitPane} is configured to
      * not continuously layout. This divider will only be used during a
      * dragging session. It is recommended that the passed in component
      * be a heavy weight.
+     *
+     * @param newDivider the new divider
      */
     protected void setNonContinuousLayoutDivider(Component newDivider) {
         setNonContinuousLayoutDivider(newDivider, true);
@@ -861,6 +891,9 @@
 
     /**
      * Sets the divider to use.
+     *
+     * @param newDivider the new divider
+     * @param rememberSizes if {@code true} the pane size is remembered
      */
     protected void setNonContinuousLayoutDivider(Component newDivider,
         boolean rememberSizes) {
@@ -903,9 +936,11 @@
 
 
     /**
-     * Returns the divider to use when the splitPane is configured to
+     * Returns the divider to use when the {@code JSplitPane} is configured to
      * not continuously layout. This divider will only be used during a
      * dragging session.
+     *
+     * @return the divider
      */
     public Component getNonContinuousLayoutDivider() {
         return nonContinuousLayoutDivider;
@@ -913,8 +948,10 @@
 
 
     /**
-     * Returns the splitpane this instance is currently contained
+     * Returns the {@code JSplitPane} this instance is currently contained
      * in.
+     *
+     * @return the instance of {@code JSplitPane}
      */
     public JSplitPane getSplitPane() {
         return splitPane;
@@ -923,6 +960,8 @@
 
     /**
      * Creates the default divider.
+     *
+     * @return the default divider
      */
     public BasicSplitPaneDivider createDefaultDivider() {
         return new BasicSplitPaneDivider(this);
@@ -1108,6 +1147,9 @@
     /**
      * Returns the insets. The insets are returned from the border insets
      * of the current border.
+     *
+     * @param jc a component
+     * @return the insets
      */
     public Insets getInsets(JComponent jc) {
         return null;
@@ -1187,8 +1229,10 @@
 
     /**
      * Messaged during a dragging session to move the divider to the
-     * passed in location. If continuousLayout is true the location is
-     * reset and the splitPane validated.
+     * passed in {@code location}. If {@code continuousLayout} is {@code true}
+     * the location is reset and the splitPane validated.
+     *
+     * @param location the location of divider
      */
     protected void dragDividerTo(int location) {
         if(getLastDragLocation() != location) {
@@ -1230,7 +1274,9 @@
 
     /**
      * Messaged to finish the dragging session. If not continuous display
-     * the dividers location will be reset.
+     * the dividers {@code location} will be reset.
+     *
+     * @param location the location of divider
      */
     protected void finishDraggingTo(int location) {
         dragDividerTo(location);
@@ -1259,6 +1305,7 @@
      * <p>
      * Returns the width of one side of the divider border.
      *
+     * @return the width of one side of the divider border
      * @deprecated As of Java 2 platform v1.3, instead set the border on the
      * divider.
      */
@@ -1275,7 +1322,13 @@
     public class BasicHorizontalLayoutManager implements LayoutManager2
     {
         /* left, right, divider. (in this exact order) */
+        /**
+         * The size of components.
+         */
         protected int[]         sizes;
+        /**
+         * The components.
+         */
         protected Component[]   components;
         /** Size of the splitpane the last time laid out. */
         private int             lastSplitPaneSize;
@@ -1596,6 +1649,8 @@
 
         /**
          * Resets the size of the Component at the passed in location.
+         *
+         * @param index the index of a component
          */
         protected void resetSizeAt(int index) {
             sizes[index] = 0;
@@ -1604,7 +1659,9 @@
 
 
         /**
-         * Sets the sizes to <code>newSizes</code>.
+         * Sets the sizes to {@code newSizes}.
+         *
+         * @param newSizes the new sizes
          */
         protected void setSizes(int[] newSizes) {
             System.arraycopy(newSizes, 0, sizes, 0, 3);
@@ -1613,6 +1670,8 @@
 
         /**
          * Returns the sizes of the components.
+         *
+         * @return the sizes of the components
          */
         protected int[] getSizes() {
             int[]         retSizes = new int[3];
@@ -1624,6 +1683,9 @@
 
         /**
          * Returns the width of the passed in Components preferred size.
+         *
+         * @param c a component
+         * @return the preferred width of the component
          */
         protected int getPreferredSizeOfComponent(Component c) {
             return getSizeForPrimaryAxis(c.getPreferredSize());
@@ -1632,6 +1694,9 @@
 
         /**
          * Returns the width of the passed in Components minimum size.
+         *
+         * @param c a component
+         * @return the minimum width of the component
          */
         int getMinimumSizeOfComponent(Component c) {
             return getSizeForPrimaryAxis(c.getMinimumSize());
@@ -1640,6 +1705,9 @@
 
         /**
          * Returns the width of the passed in component.
+         *
+         * @param c a component
+         * @return the width of the component
          */
         protected int getSizeOfComponent(Component c) {
             return getSizeForPrimaryAxis(c.getSize());
@@ -1648,7 +1716,11 @@
 
         /**
          * Returns the available width based on the container size and
-         * Insets.
+         * {@code Insets}.
+         *
+         * @param containerSize a container size
+         * @param insets an insets
+         * @return the available width
          */
         protected int getAvailableSize(Dimension containerSize,
                                        Insets insets) {
@@ -1661,8 +1733,11 @@
 
 
         /**
-         * Returns the left inset, unless the Insets are null in which case
+         * Returns the left inset, unless the {@code Insets} are null in which case
          * 0 is returned.
+         *
+         * @param insets the insets
+         * @return the left inset
          */
         protected int getInitialLocation(Insets insets) {
             if(insets != null)
@@ -1672,9 +1747,15 @@
 
 
         /**
-         * Sets the width of the component c to be size, placing its
-         * x location at location, y to the insets.top and height
-         * to the containersize.height less the top and bottom insets.
+         * Sets the width of the component {@code c} to be {@code size}, placing its
+         * x location at {@code location}, y to the {@code insets.top} and height
+         * to the {@code containerSize.height} less the top and bottom insets.
+         *
+         * @param c a component
+         * @param size a new width
+         * @param location a new X coordinate
+         * @param insets an insets
+         * @param containerSize a container size
          */
         protected void setComponentToSize(Component c, int size,
                                           int location, Insets insets,
@@ -2021,6 +2102,9 @@
     public class BasicVerticalLayoutManager extends
             BasicHorizontalLayoutManager
     {
+        /**
+         * Constructs a new instance of {@code BasicVerticalLayoutManager}.
+         */
         public BasicVerticalLayoutManager() {
             super(1);
         }
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicTableHeaderUI.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicTableHeaderUI.java	Wed Jul 05 19:53:51 2017 +0200
@@ -49,11 +49,19 @@
 // Instance Variables
 //
 
-    /** The JTableHeader that is delegating the painting to this UI. */
+    /**
+     *  The {@code JTableHeader} that is delegating the painting to this UI.
+     */
     protected JTableHeader header;
+
+    /**
+     * The instance of {@code CellRendererPane}.
+     */
     protected CellRendererPane rendererPane;
 
-    // Listeners that are attached to the JTable
+    /**
+     * Listeners that are attached to the {@code JTable}
+     */
     protected MouseInputListener mouseInputListener;
 
     // The column header over which the mouse currently is.
@@ -300,7 +308,9 @@
 //
 
     /**
-     * Creates the mouse listener for the JTableHeader.
+     * Creates the mouse listener for the {@code JTableHeader}.
+     *
+     * @return the mouse listener for the {@code JTableHeader}
      */
     protected MouseInputListener createMouseInputListener() {
         return new MouseInputHandler();
@@ -310,6 +320,12 @@
 //  The installation/uninstall procedures and support
 //
 
+    /**
+     * Returns a new instance of {@code BasicTableHeaderUI}.
+     *
+     * @param h a component.
+     * @return a new instance of {@code BasicTableHeaderUI}
+     */
     public static ComponentUI createUI(JComponent h) {
         return new BasicTableHeaderUI();
     }
@@ -376,8 +392,14 @@
         header = null;
     }
 
+    /**
+     * Uninstalls default properties
+     */
     protected void uninstallDefaults() {}
 
+    /**
+     * Unregisters listeners.
+     */
     protected void uninstallListeners() {
         header.removeMouseListener(mouseInputListener);
         header.removeMouseMotionListener(mouseInputListener);
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicTableUI.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicTableUI.java	Wed Jul 05 19:53:51 2017 +0200
@@ -64,12 +64,29 @@
 //
 
     // The JTable that is delegating the painting to this UI.
+    /**
+     * The instance of {@code JTable}.
+     */
     protected JTable table;
+
+    /**
+     * The instance of {@code CellRendererPane}.
+     */
     protected CellRendererPane rendererPane;
 
-    // Listeners that are attached to the JTable
+    /**
+     * {@code KeyListener} that are attached to the {@code JTable}.
+     */
     protected KeyListener keyListener;
+
+    /**
+     * {@code FocusListener} that are attached to the {@code JTable}.
+     */
     protected FocusListener focusListener;
+
+    /**
+     * {@code MouseInputListener} that are attached to the {@code JTable}.
+     */
     protected MouseInputListener mouseInputListener;
 
     private Handler handler;
@@ -1350,21 +1367,27 @@
     }
 
     /**
-     * Creates the key listener for handling keyboard navigation in the JTable.
+     * Creates the key listener for handling keyboard navigation in the {@code JTable}.
+     *
+     * @return the key listener for handling keyboard navigation in the {@code JTable}
      */
     protected KeyListener createKeyListener() {
         return null;
     }
 
     /**
-     * Creates the focus listener for handling keyboard navigation in the JTable.
+     * Creates the focus listener for handling keyboard navigation in the {@code JTable}.
+     *
+     * @return the focus listener for handling keyboard navigation in the {@code JTable}
      */
     protected FocusListener createFocusListener() {
         return getHandler();
     }
 
     /**
-     * Creates the mouse listener for the JTable.
+     * Creates the mouse listener for the {@code JTable}.
+     *
+     * @return the mouse listener for the {@code JTable}
      */
     protected MouseInputListener createMouseInputListener() {
         return getHandler();
@@ -1374,6 +1397,12 @@
 //  The installation/uninstall procedures and support
 //
 
+    /**
+     * Returns a new instance of {@code BasicTableUI}.
+     *
+     * @param c a component
+     * @return a new instance of {@code BasicTableUI}
+     */
     public static ComponentUI createUI(JComponent c) {
         return new BasicTableUI();
     }
@@ -1616,12 +1645,18 @@
         table = null;
     }
 
+    /**
+     * Uninstalls default properties.
+     */
     protected void uninstallDefaults() {
         if (table.getTransferHandler() instanceof UIResource) {
             table.setTransferHandler(null);
         }
     }
 
+    /**
+     * Unregisters listeners.
+     */
     protected void uninstallListeners() {
         table.removeFocusListener(focusListener);
         table.removeKeyListener(keyListener);
@@ -1638,6 +1673,9 @@
         handler = null;
     }
 
+    /**
+     * Unregisters keyboard actions.
+     */
     protected void uninstallKeyboardActions() {
         SwingUtilities.replaceUIInputMap(table, JComponent.
                                    WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, null);
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicTextUI.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicTextUI.java	Wed Jul 05 19:53:51 2017 +0200
@@ -443,6 +443,9 @@
     protected void uninstallListeners() {
     }
 
+    /**
+     * Registers keyboard actions.
+     */
     protected void installKeyboardActions() {
         // backward compatibility support... keymaps for the UI
         // are now installed in the more friendly input map.
@@ -637,6 +640,9 @@
         return map;
     }
 
+    /**
+     * Unregisters keyboard actions.
+     */
     protected void uninstallKeyboardActions() {
         editor.setKeymap(null);
         SwingUtilities.replaceUIInputMap(editor, JComponent.
@@ -1280,8 +1286,14 @@
         return null;
     }
 
+    /**
+     * Default implementation of the interface {@code Caret}.
+     */
     public static class BasicCaret extends DefaultCaret implements UIResource {}
 
+    /**
+     * Default implementation of the interface {@code Highlighter}.
+     */
     public static class BasicHighlighter extends DefaultHighlighter implements UIResource {}
 
     static class BasicCursor extends Cursor implements UIResource {
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicToggleButtonUI.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicToggleButtonUI.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -51,6 +51,13 @@
     // ********************************
     //          Create PLAF
     // ********************************
+
+    /**
+     * Returns an instance of {@code BasicToggleButtonUI}.
+     *
+     * @param b a component
+     * @return an instance of {@code BasicToggleButtonUI}
+     */
     public static ComponentUI createUI(JComponent b) {
         AppContext appContext = AppContext.getAppContext();
         BasicToggleButtonUI toggleButtonUI =
@@ -127,6 +134,13 @@
         }
     }
 
+    /**
+     * Paints an icon in the specified location.
+     *
+     * @param g an instance of {@code Graphics}
+     * @param b an instance of {@code Button}
+     * @param iconRect bounds of an icon
+     */
     protected void paintIcon(Graphics g, AbstractButton b, Rectangle iconRect) {
         ButtonModel model = b.getModel();
         Icon icon = null;
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicToolBarSeparatorUI.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicToolBarSeparatorUI.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014, 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,6 +45,12 @@
 
 public class BasicToolBarSeparatorUI extends BasicSeparatorUI
 {
+    /**
+     * Returns a new instance of {@code BasicToolBarSeparatorUI}.
+     *
+     * @param c a component
+     * @return a new instance of {@code BasicToolBarSeparatorUI}
+     */
     public static ComponentUI createUI( JComponent c )
     {
         return new BasicToolBarSeparatorUI();
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicToolBarUI.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicToolBarUI.java	Wed Jul 05 19:53:51 2017 +0200
@@ -50,29 +50,65 @@
  */
 public class BasicToolBarUI extends ToolBarUI implements SwingConstants
 {
+    /**
+     * The instance of {@code JToolBar}.
+     */
     protected JToolBar toolBar;
     private boolean floating;
     private int floatingX;
     private int floatingY;
     private JFrame floatingFrame;
     private RootPaneContainer floatingToolBar;
+    /**
+     * The instance of {@code DragWindow}.
+     */
     protected DragWindow dragWindow;
     private Container dockingSource;
     private int dockingSensitivity = 0;
+    /**
+     * The index of the focused component.
+     */
     protected int focusedCompIndex = -1;
 
+    /**
+     * The background color of the docking border.
+     */
     protected Color dockingColor = null;
+    /**
+     * The background color of the not docking border.
+     */
     protected Color floatingColor = null;
+    /**
+     * The color of the docking border.
+     */
     protected Color dockingBorderColor = null;
+    /**
+     * The color of the not docking border.
+     */
     protected Color floatingBorderColor = null;
 
+    /**
+     * The instance of a {@code MouseInputListener}.
+     */
     protected MouseInputListener dockingListener;
+    /**
+     * The instance of a {@code PropertyChangeListener}.
+     */
     protected PropertyChangeListener propertyListener;
 
+    /**
+     * The instance of a {@code ContainerListener}.
+     */
     protected ContainerListener toolBarContListener;
+    /**
+     * The instance of a {@code FocusListener}.
+     */
     protected FocusListener toolBarFocusListener;
     private Handler handler;
 
+    /**
+     * The layout before floating.
+     */
     protected String constraintBeforeFloating = BorderLayout.NORTH;
 
     // Rollover button implementation.
@@ -130,6 +166,12 @@
 
     private static String FOCUSED_COMP_INDEX = "JToolBar.focusedCompIndex";
 
+    /**
+     * Constructs a new instance of {@code BasicToolBarUI}.
+     *
+     * @param c a component
+     * @return a new instance of {@code BasicToolBarUI}
+     */
     public static ComponentUI createUI( JComponent c )
     {
         return new BasicToolBarUI();
@@ -180,6 +222,9 @@
         c.putClientProperty( FOCUSED_COMP_INDEX, Integer.valueOf( focusedCompIndex ) );
     }
 
+    /**
+     * Installs default properties.
+     */
     protected void installDefaults( )
     {
         LookAndFeel.installBorder(toolBar,"ToolBar.border");
@@ -222,6 +267,9 @@
         setRolloverBorders( isRolloverBorders() );
     }
 
+    /**
+     * Uninstalls default properties.
+     */
     protected void uninstallDefaults( )
     {
         LookAndFeel.uninstallBorder(toolBar);
@@ -237,14 +285,23 @@
         nonRolloverToggleBorder = null;
     }
 
+    /**
+     * Registers components.
+     */
     protected void installComponents( )
     {
     }
 
+    /**
+     * Unregisters components.
+     */
     protected void uninstallComponents( )
     {
     }
 
+    /**
+     * Registers listeners.
+     */
     protected void installListeners( )
     {
         dockingListener = createDockingListener( );
@@ -278,6 +335,9 @@
         }
     }
 
+    /**
+     * Unregisters listeners.
+     */
     protected void uninstallListeners( )
     {
         if ( dockingListener != null )
@@ -314,6 +374,9 @@
         handler = null;
     }
 
+    /**
+     * Registers keyboard actions.
+     */
     protected void installKeyboardActions( )
     {
         InputMap km = getInputMap(JComponent.
@@ -342,6 +405,9 @@
         map.put(new Actions(Actions.NAVIGATE_DOWN));
     }
 
+    /**
+     * Unregisters keyboard actions.
+     */
     protected void uninstallKeyboardActions( )
     {
         SwingUtilities.replaceUIActionMap(toolBar, null);
@@ -350,7 +416,12 @@
                                          null);
     }
 
-    protected void navigateFocusedComp( int direction )
+    /**
+     * Navigates the focused component.
+     *
+     * @param direction a direction
+     */
+    protected void navigateFocusedComp(int direction)
     {
         int nComp = toolBar.getComponentCount();
         int j;
@@ -411,6 +482,7 @@
      * <p>
      * Override this method to provide an alternate rollover border.
      *
+     * @return a rollover border for toolbar components
      * @since 1.4
      */
     protected Border createRolloverBorder() {
@@ -434,6 +506,7 @@
      * <p>
      * Override this method to provide an alternate rollover border.
      *
+     * @return the non rollover border for toolbar components
      * @since 1.4
      */
     protected Border createNonRolloverBorder() {
@@ -465,6 +538,9 @@
 
     /**
      * No longer used, use BasicToolBarUI.createFloatingWindow(JToolBar)
+     *
+     * @param toolbar an instance of {@code JToolBar}
+     * @return an instance of {@code JFrame}
      * @see #createFloatingWindow
      */
     protected JFrame createFloatingFrame(JToolBar toolbar) {
@@ -502,7 +578,9 @@
     /**
      * Creates a window which contains the toolbar after it has been
      * dragged out from its container
-     * @return a <code>RootPaneContainer</code> object, containing the toolbar.
+     *
+     * @param toolbar an instance of {@code JToolBar}
+     * @return a {@code RootPaneContainer} object, containing the toolbar
      * @since 1.4
      */
     protected RootPaneContainer createFloatingWindow(JToolBar toolbar) {
@@ -555,6 +633,12 @@
         return dialog;
     }
 
+    /**
+     * Returns an instance of {@code DragWindow}.
+     *
+     * @param toolbar an instance of {@code JToolBar}
+     * @return an instance of {@code DragWindow}
+     */
     protected DragWindow createDragWindow(JToolBar toolbar) {
         Window frame = null;
         if(toolBar != null) {
@@ -776,15 +860,32 @@
         }
     }
 
+    /**
+     * Sets the floating location.
+     *
+     * @param x an X coordinate
+     * @param y an Y coordinate
+     */
     public void setFloatingLocation(int x, int y) {
         floatingX = x;
         floatingY = y;
     }
 
+    /**
+     * Returns {@code true} if the {@code JToolBar} is floating
+     *
+     * @return {@code true} if the {@code JToolBar} is floating
+     */
     public boolean isFloating() {
         return floating;
     }
 
+    /**
+     * Sets the floating property.
+     *
+     * @param b {@code true} if the {@code JToolBar} is floating
+     * @param p the position
+     */
     public void setFloating(boolean b, Point p) {
         if (toolBar.isFloatable()) {
             boolean visible = false;
@@ -863,6 +964,11 @@
         return orientation;
     }
 
+    /**
+     * Sets the tool bar's orientation.
+     *
+     * @param orientation the new orientation
+     */
     public void setOrientation(int orientation)
     {
         toolBar.setOrientation( orientation );
@@ -873,6 +979,8 @@
 
     /**
      * Gets the color displayed when over a docking area
+     *
+     * @return the color displayed when over a docking area
      */
     public Color getDockingColor() {
         return dockingColor;
@@ -880,6 +988,8 @@
 
     /**
      * Sets the color displayed when over a docking area
+     *
+     * @param c the new color
      */
    public void setDockingColor(Color c) {
         this.dockingColor = c;
@@ -887,6 +997,8 @@
 
     /**
      * Gets the color displayed when over a floating area
+     *
+     * @return the color displayed when over a floating area
      */
     public Color getFloatingColor() {
         return floatingColor;
@@ -894,6 +1006,8 @@
 
     /**
      * Sets the color displayed when over a floating area
+     *
+     * @param c the new color
      */
     public void setFloatingColor(Color c) {
         this.floatingColor = c;
@@ -912,6 +1026,13 @@
         return false;
     }
 
+    /**
+     * Returns {@code true} if the {@code JToolBar} can dock at the given position.
+     *
+     * @param c a component
+     * @param p a position
+     * @return {@code true} if the {@code JToolBar} can dock at the given position
+     */
     public boolean canDock(Component c, Point p) {
         return (p != null && getDockingConstraint(c, p) != null);
     }
@@ -952,6 +1073,13 @@
         return null;
     }
 
+    /**
+     * The method is used to drag {@code DragWindow} during the {@code JToolBar}
+     * is being dragged.
+     *
+     * @param position the relative to the {@code JTollBar} position
+     * @param origin the screen position of {@code JToolBar} before dragging
+     */
     protected void dragTo(Point position, Point origin)
     {
         if (toolBar.isFloatable())
@@ -1002,6 +1130,13 @@
         }
     }
 
+    /**
+     * The method is called at end of dragging to place the frame in either
+     * its original place or in its floating frame.
+     *
+     * @param position the relative to the {@code JTollBar} position
+     * @param origin the screen position of {@code JToolBar} before dragging
+     */
     protected void floatAt(Point position, Point origin)
     {
         if(toolBar.isFloatable())
@@ -1044,26 +1179,51 @@
         return handler;
     }
 
+    /**
+     * Returns an instance of {@code ContainerListener}.
+     *
+     * @return an instance of {@code ContainerListener}
+     */
     protected ContainerListener createToolBarContListener( )
     {
         return getHandler();
     }
 
+    /**
+     * Returns an instance of {@code FocusListener}.
+     *
+     * @return an instance of {@code FocusListener}
+     */
     protected FocusListener createToolBarFocusListener( )
     {
         return getHandler();
     }
 
+    /**
+     * Returns an instance of {@code PropertyChangeListener}.
+     *
+     * @return an instance of {@code PropertyChangeListener}
+     */
     protected PropertyChangeListener createPropertyListener()
     {
         return getHandler();
     }
 
+    /**
+     * Returns an instance of {@code MouseInputListener}.
+     *
+     * @return an instance of {@code MouseInputListener}
+     */
     protected MouseInputListener createDockingListener( ) {
         getHandler().tb = toolBar;
         return getHandler();
     }
 
+    /**
+     * Constructs a new instance of {@code WindowListener}.
+     *
+     * @return a new instance of {@code WindowListener}
+     */
     protected WindowListener createFrameListener() {
         return new FrameListener();
     }
@@ -1241,6 +1401,9 @@
         }
     }
 
+    /**
+     * The class listens for window events.
+     */
     protected class FrameListener extends WindowAdapter {
         public void windowClosing(WindowEvent w) {
             if (toolBar.isFloatable()) {
@@ -1276,6 +1439,9 @@
 
     }
 
+    /**
+     * The class listens for component events.
+     */
     protected class ToolBarContListener implements ContainerListener {
         // NOTE: This class exists only for backward compatibility. All
         // its functionality has been moved into Handler. If you need to add
@@ -1291,6 +1457,9 @@
 
     }
 
+    /**
+     * The class listens for focus events.
+     */
     protected class ToolBarFocusListener implements FocusListener {
         // NOTE: This class exists only for backward compatibility. All
         // its functionality has been moved into Handler. If you need to add
@@ -1305,6 +1474,9 @@
             }
     }
 
+    /**
+     * The class listens for property changed events.
+     */
     protected class PropertyListener implements PropertyChangeListener {
         // NOTE: This class exists only for backward compatibility. All
         // its functionality has been moved into Handler. If you need to add
@@ -1324,10 +1496,24 @@
         // its functionality has been moved into Handler. If you need to add
         // new functionality add it to the Handler, but make sure this
         // class calls into the Handler.
+        /**
+         * The instance of {@code JToolBar}.
+         */
         protected JToolBar toolBar;
+        /**
+         * {@code true} if the {@code JToolBar} is being dragged.
+         */
         protected boolean isDragging = false;
+        /**
+         * The origin point.
+         */
         protected Point origin = null;
 
+        /**
+         * Constructs a new instance of {@code DockingListener}.
+         *
+         * @param t an instance of {@code JToolBar}
+         */
         public DockingListener(JToolBar t) {
             this.toolBar = t;
             getHandler().tb = t;
@@ -1373,6 +1559,9 @@
         }
     }
 
+    /**
+     * The window which appears during dragging the {@code JToolBar}.
+     */
     @SuppressWarnings("serial") // Same-version serialization only
     protected class DragWindow extends Window
     {
@@ -1396,6 +1585,11 @@
         return orientation;
     }
 
+        /**
+         * Sets the orientation.
+         *
+         * @param o the new orientation
+         */
         public void setOrientation(int o) {
             if(isShowing()) {
                 if (o == this.orientation)
@@ -1416,14 +1610,29 @@
             }
         }
 
+        /**
+         * Returns the offset.
+         *
+         * @return the offset
+         */
         public Point getOffset() {
             return offset;
         }
 
+        /**
+         * Sets the offset.
+         *
+         * @param p the new offset
+         */
         public void setOffset(Point p) {
             this.offset = p;
         }
 
+        /**
+         * Sets the border color.
+         *
+         * @param c the new border color
+         */
         public void setBorderColor(Color c) {
             if (this.borderColor == c)
                 return;
@@ -1431,6 +1640,11 @@
             repaint();
         }
 
+        /**
+         * Returns the border color.
+         *
+         * @return the border color
+         */
         public Color getBorderColor() {
             return this.borderColor;
         }
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicToolTipUI.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicToolTipUI.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -55,10 +55,19 @@
 
     private PropertyChangeListener propertyChangeListener;
 
+    /**
+     * Returns the instance of {@code BasicToolTipUI}.
+     *
+     * @param c a component
+     * @return the instance of {@code BasicToolTipUI}
+     */
     public static ComponentUI createUI(JComponent c) {
         return sharedInstance;
     }
 
+    /**
+     * Constructs a new instance of {@code BasicToolTipUI}.
+     */
     public BasicToolTipUI() {
         super();
     }
@@ -76,22 +85,32 @@
         uninstallListeners(c);
     }
 
+    /**
+     * Installs default properties.
+     *
+     * @param c a component
+     */
     protected void installDefaults(JComponent c){
         LookAndFeel.installColorsAndFont(c, "ToolTip.background",
-                                         "ToolTip.foreground",
-                                         "ToolTip.font");
+                "ToolTip.foreground",
+                "ToolTip.font");
         LookAndFeel.installProperty(c, "opaque", Boolean.TRUE);
         componentChanged(c);
     }
 
-   protected void uninstallDefaults(JComponent c){
+    /**
+     * Uninstalls default properties.
+     *
+     * @param c a component
+     */
+    protected void uninstallDefaults(JComponent c){
         LookAndFeel.uninstallBorder(c);
     }
 
     /* Unfortunately this has to remain private until we can make API additions.
      */
     private void installComponents(JComponent c){
-        BasicHTML.updateRenderer(c, ((JToolTip)c).getTipText());
+        BasicHTML.updateRenderer(c, ((JToolTip) c).getTipText());
     }
 
     /* Unfortunately this has to remain private until we can make API additions.
@@ -100,12 +119,22 @@
         BasicHTML.updateRenderer(c, "");
     }
 
+    /**
+     * Registers listeners.
+     *
+     * @param c a component
+     */
     protected void installListeners(JComponent c) {
         propertyChangeListener = createPropertyChangeListener(c);
 
         c.addPropertyChangeListener(propertyChangeListener);
     }
 
+    /**
+     * Unregisters listeners.
+     *
+     * @param c a component
+     */
     protected void uninstallListeners(JComponent c) {
         c.removePropertyChangeListener(propertyChangeListener);
 
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicTreeUI.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicTreeUI.java	Wed Jul 05 19:53:51 2017 +0200
@@ -63,7 +63,13 @@
     // Old actions forward to an instance of this.
     static private final Actions SHARED_ACTION = new Actions();
 
+    /**
+     * The collapsed icon.
+     */
     transient protected Icon        collapsedIcon;
+    /**
+     * The expanded icon.
+     */
     transient protected Icon        expandedIcon;
 
     /**
@@ -210,6 +216,12 @@
      */
     private MouseEvent releaseEvent;
 
+    /**
+     * Constructs a new instance of {@code BasicTreeUI}.
+     *
+     * @param x a component
+     * @return a new instance of {@code BasicTreeUI}
+     */
     public static ComponentUI createUI(JComponent x) {
         return new BasicTreeUI();
     }
@@ -279,19 +291,36 @@
         map.put(TransferHandler.getPasteAction());
     }
 
-
+    /**
+     * Constructs a new instance of {@code BasicTreeUI}.
+     */
     public BasicTreeUI() {
         super();
     }
 
+    /**
+     * Returns the hash color.
+     *
+     * @return the hash color
+     */
     protected Color getHashColor() {
         return hashColor;
     }
 
+    /**
+     * Sets the hash color.
+     *
+     * @param color the hash color
+     */
     protected void setHashColor(Color color) {
         hashColor = color;
     }
 
+    /**
+     * Sets the left child indent.
+     *
+     * @param newAmount the left child indent
+     */
     public void setLeftChildIndent(int newAmount) {
         leftChildIndent = newAmount;
         totalChildIndent = leftChildIndent + rightChildIndent;
@@ -300,10 +329,20 @@
         updateSize();
     }
 
+    /**
+     * Returns the left child indent.
+     *
+     * @return the left child indent
+     */
     public int getLeftChildIndent() {
         return leftChildIndent;
     }
 
+    /**
+     * Sets the right child indent.
+     *
+     * @param newAmount the right child indent
+     */
     public void setRightChildIndent(int newAmount) {
         rightChildIndent = newAmount;
         totalChildIndent = leftChildIndent + rightChildIndent;
@@ -312,22 +351,47 @@
         updateSize();
     }
 
+    /**
+     * Returns the right child indent.
+     *
+     * @return the right child indent
+     */
     public int getRightChildIndent() {
         return rightChildIndent;
     }
 
+    /**
+     * Sets the expanded icon.
+     *
+     * @param newG the expanded icon
+     */
     public void setExpandedIcon(Icon newG) {
         expandedIcon = newG;
     }
 
+    /**
+     * Returns the expanded icon.
+     *
+     * @return the expanded icon
+     */
     public Icon getExpandedIcon() {
         return expandedIcon;
     }
 
+    /**
+     * Sets the collapsed icon.
+     *
+     * @param newG the collapsed icon
+     */
     public void setCollapsedIcon(Icon newG) {
         collapsedIcon = newG;
     }
 
+    /**
+     * Returns the collapsed icon.
+     *
+     * @return the collapsed icon
+     */
     public Icon getCollapsedIcon() {
         return collapsedIcon;
     }
@@ -340,6 +404,8 @@
 
     /**
      * Updates the componentListener, if necessary.
+     *
+     * @param largeModel the new value
      */
     protected void setLargeModel(boolean largeModel) {
         if(getRowHeight() < 1)
@@ -354,12 +420,19 @@
         }
     }
 
+    /**
+     * Returns {@code true} if large model is set.
+     *
+     * @return {@code true} if large model is set
+     */
     protected boolean isLargeModel() {
         return largeModel;
     }
 
     /**
      * Sets the row height, this is forwarded to the treeState.
+     *
+     * @param rowHeight the row height
      */
     protected void setRowHeight(int rowHeight) {
         completeEditing();
@@ -370,13 +443,20 @@
         }
     }
 
+    /**
+     * Returns the row height.
+     *
+     * @return the row height
+     */
     protected int getRowHeight() {
         return (tree == null) ? -1 : tree.getRowHeight();
     }
 
     /**
-     * Sets the TreeCellRenderer to <code>tcr</code>. This invokes
-     * <code>updateRenderer</code>.
+     * Sets the {@code TreeCellRenderer} to {@code tcr}. This invokes
+     * {@code updateRenderer}.
+     *
+     * @param tcr the new value
      */
     protected void setCellRenderer(TreeCellRenderer tcr) {
         completeEditing();
@@ -388,15 +468,19 @@
     }
 
     /**
-     * Return currentCellRenderer, which will either be the trees
-     * renderer, or defaultCellRenderer, which ever wasn't null.
+     * Return {@code currentCellRenderer}, which will either be the trees
+     * renderer, or {@code defaultCellRenderer}, which ever wasn't null.
+     *
+     * @return an instance of {@code TreeCellRenderer}
      */
     protected TreeCellRenderer getCellRenderer() {
         return currentCellRenderer;
     }
 
     /**
-     * Sets the TreeModel.
+     * Sets the {@code TreeModel}.
+     *
+     * @param model the new value
      */
     protected void setModel(TreeModel model) {
         completeEditing();
@@ -414,12 +498,19 @@
         }
     }
 
+    /**
+     * Returns the tree model.
+     *
+     * @return the tree model
+     */
     protected TreeModel getModel() {
         return treeModel;
     }
 
     /**
      * Sets the root to being visible.
+     *
+     * @param newValue the new value
      */
     protected void setRootVisible(boolean newValue) {
         completeEditing();
@@ -431,12 +522,19 @@
         }
     }
 
+    /**
+     * Returns {@code true} if the tree root is visible.
+     *
+     * @return {@code true} if the tree root is visible
+     */
     protected boolean isRootVisible() {
         return (tree != null) ? tree.isRootVisible() : false;
     }
 
     /**
      * Determines whether the node handles are to be displayed.
+     *
+     * @param newValue the new value
      */
     protected void setShowsRootHandles(boolean newValue) {
         completeEditing();
@@ -447,28 +545,47 @@
         }
     }
 
+    /**
+     * Returns {@code true} if the root handles are to be displayed.
+     *
+     * @return {@code true} if the root handles are to be displayed
+     */
     protected boolean getShowsRootHandles() {
         return (tree != null) ? tree.getShowsRootHandles() : false;
     }
 
     /**
      * Sets the cell editor.
+     *
+     * @param editor the new cell editor
      */
     protected void setCellEditor(TreeCellEditor editor) {
         updateCellEditor();
     }
 
+    /**
+     * Returns an instance of {@code TreeCellEditor}.
+     *
+     * @return an instance of {@code TreeCellEditor}
+     */
     protected TreeCellEditor getCellEditor() {
         return (tree != null) ? tree.getCellEditor() : null;
     }
 
     /**
      * Configures the receiver to allow, or not allow, editing.
+     *
+     * @param newValue the new value
      */
     protected void setEditable(boolean newValue) {
         updateCellEditor();
     }
 
+    /**
+     * Returns {@code true} if the tree is editable.
+     *
+     * @return {@code true} if the tree is editable
+     */
     protected boolean isEditable() {
         return (tree != null) ? tree.isEditable() : false;
     }
@@ -476,6 +593,8 @@
     /**
      * Resets the selection model. The appropriate listener are installed
      * on the model.
+     *
+     * @param newLSM new selection model
      */
     protected void setSelectionModel(TreeSelectionModel newLSM) {
         completeEditing();
@@ -503,6 +622,11 @@
             tree.repaint();
     }
 
+    /**
+     * Returns the tree selection model.
+     *
+     * @return the tree selection model
+     */
     protected TreeSelectionModel getSelectionModel() {
         return treeSelectionModel;
     }
@@ -649,7 +773,7 @@
     }
 
     /**
-     * Invoked after the <code>tree</code> instance variable has been
+     * Invoked after the {@code tree} instance variable has been
      * set, but before any defaults/listeners have been installed.
      */
     protected void prepareForUIInstall() {
@@ -690,6 +814,9 @@
         updateSize();
     }
 
+    /**
+     * Installs default properties.
+     */
     protected void installDefaults() {
         if(tree.getBackground() == null ||
            tree.getBackground() instanceof UIResource) {
@@ -739,6 +866,9 @@
         }
     }
 
+    /**
+     * Registers listeners.
+     */
     protected void installListeners() {
         if ( (propertyChangeListener = createPropertyChangeListener())
              != null ) {
@@ -787,6 +917,9 @@
         LookAndFeel.installProperty(tree, "opaque", Boolean.TRUE);
     }
 
+    /**
+     * Registers keyboard actions.
+     */
     protected void installKeyboardActions() {
         InputMap km = getInputMap(JComponent.
                                   WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
@@ -837,8 +970,10 @@
     //
 
     /**
-     * Creates an instance of NodeDimensions that is able to determine
+     * Creates an instance of {@code NodeDimensions} that is able to determine
      * the size of a given node in the tree.
+     *
+     * @return an instance of {@code NodeDimensions}
      */
     protected AbstractLayoutCache.NodeDimensions createNodeDimensions() {
         return new NodeDimensionsHandler();
@@ -847,6 +982,8 @@
     /**
      * Creates a listener that is responsible that updates the UI based on
      * how the tree changes.
+     *
+     * @return an instance of the {@code PropertyChangeListener}
      */
     protected PropertyChangeListener createPropertyChangeListener() {
         return getHandler();
@@ -862,6 +999,8 @@
     /**
      * Creates the listener responsible for updating the selection based on
      * mouse events.
+     *
+     * @return an instance of the {@code MouseListener}
      */
     protected MouseListener createMouseListener() {
         return getHandler();
@@ -870,14 +1009,18 @@
     /**
      * Creates a listener that is responsible for updating the display
      * when focus is lost/gained.
+     *
+     * @return an instance of the {@code FocusListener}
      */
     protected FocusListener createFocusListener() {
         return getHandler();
     }
 
     /**
-     * Creates the listener reponsible for getting key events from
+     * Creates the listener responsible for getting key events from
      * the tree.
+     *
+     * @return an instance of the {@code KeyListener}
      */
     protected KeyListener createKeyListener() {
         return getHandler();
@@ -886,6 +1029,8 @@
     /**
      * Creates the listener responsible for getting property change
      * events from the selection model.
+     *
+     * @return an instance of the {@code PropertyChangeListener}
      */
     protected PropertyChangeListener createSelectionModelPropertyChangeListener() {
         return getHandler();
@@ -894,6 +1039,8 @@
     /**
      * Creates the listener that updates the display based on selection change
      * methods.
+     *
+     * @return an instance of the {@code TreeSelectionListener}
      */
     protected TreeSelectionListener createTreeSelectionListener() {
         return getHandler();
@@ -901,6 +1048,8 @@
 
     /**
      * Creates a listener to handle events from the current editor.
+     *
+     * @return an instance of the {@code CellEditorListener}
      */
     protected CellEditorListener createCellEditorListener() {
         return getHandler();
@@ -910,6 +1059,8 @@
      * Creates and returns a new ComponentHandler. This is used for
      * the large model to mark the validCachedPreferredSize as invalid
      * when the component moves.
+     *
+     * @return an instance of the {@code ComponentListener}
      */
     protected ComponentListener createComponentListener() {
         return new ComponentHandler();
@@ -918,6 +1069,8 @@
     /**
      * Creates and returns the object responsible for updating the treestate
      * when nodes expanded state changes.
+     *
+     * @return an instance of the {@code TreeExpansionListener}
      */
     protected TreeExpansionListener createTreeExpansionListener() {
         return getHandler();
@@ -926,6 +1079,8 @@
     /**
      * Creates the object responsible for managing what is expanded, as
      * well as the size of nodes.
+     *
+     * @return the object responsible for managing what is expanded
      */
     protected AbstractLayoutCache createLayoutCache() {
         if(isLargeModel() && getRowHeight() > 0) {
@@ -936,14 +1091,18 @@
 
     /**
      * Returns the renderer pane that renderer components are placed in.
+     *
+     * @return an instance of the {@code CellRendererPane}
      */
     protected CellRendererPane createCellRendererPane() {
         return new CellRendererPane();
     }
 
     /**
-      * Creates a default cell editor.
-      */
+     * Creates a default cell editor.
+     *
+     * @return a default cell editor
+     */
     protected TreeCellEditor createDefaultCellEditor() {
         if(currentCellRenderer != null &&
            (currentCellRenderer instanceof DefaultTreeCellRenderer)) {
@@ -956,15 +1115,19 @@
     }
 
     /**
-      * Returns the default cell renderer that is used to do the
-      * stamping of each node.
-      */
+     * Returns the default cell renderer that is used to do the
+     * stamping of each node.
+     *
+     * @return an instance of {@code TreeCellRenderer}
+     */
     protected TreeCellRenderer createDefaultCellRenderer() {
         return new DefaultTreeCellRenderer();
     }
 
     /**
      * Returns a listener that can update the tree when the model changes.
+     *
+     * @return an instance of the {@code TreeModelListener}.
      */
     protected TreeModelListener createTreeModelListener() {
         return getHandler();
@@ -987,9 +1150,15 @@
         completeUIUninstall();
     }
 
+    /**
+     * Invoked before unstallation of UI.
+     */
     protected void prepareForUIUninstall() {
     }
 
+    /**
+     * Uninstalls UI.
+     */
     protected void completeUIUninstall() {
         if(createdRenderer) {
             tree.setCellRenderer(null);
@@ -1016,12 +1185,18 @@
         treeExpansionListener = null;
     }
 
+    /**
+     * Uninstalls default properties.
+     */
     protected void uninstallDefaults() {
         if (tree.getTransferHandler() instanceof UIResource) {
             tree.setTransferHandler(null);
         }
     }
 
+    /**
+     * Unregisters listeners.
+     */
     protected void uninstallListeners() {
         if(componentListener != null) {
             tree.removeComponentListener(componentListener);
@@ -1059,6 +1234,9 @@
         handler = null;
     }
 
+    /**
+     * Unregisters keyboard actions.
+     */
     protected void uninstallKeyboardActions() {
         SwingUtilities.replaceUIActionMap(tree, null);
         SwingUtilities.replaceUIInputMap(tree, JComponent.
@@ -1340,8 +1518,18 @@
 
     /**
      * Paints the horizontal part of the leg. The receiver should
-     * NOT modify <code>clipBounds</code>, or <code>insets</code>.<p>
-     * NOTE: <code>parentRow</code> can be -1 if the root is not visible.
+     * NOT modify {@code clipBounds}, or {@code insets}.<p>
+     * NOTE: {@code parentRow} can be -1 if the root is not visible.
+     *
+     * @param g a graphics context
+     * @param clipBounds a clipped rectangle
+     * @param insets insets
+     * @param bounds a bounding rectangle
+     * @param path a tree path
+     * @param row a row
+     * @param isExpanded {@code true} if the path is expanded
+     * @param hasBeenExpanded {@code true} if the path has been expanded
+     * @param isLeaf {@code true} if the path is leaf
      */
     protected void paintHorizontalPartOfLeg(Graphics g, Rectangle clipBounds,
                                             Insets insets, Rectangle bounds,
@@ -1397,7 +1585,12 @@
 
     /**
      * Paints the vertical part of the leg. The receiver should
-     * NOT modify <code>clipBounds</code>, <code>insets</code>.
+     * NOT modify {@code clipBounds}, {@code insets}.
+     *
+     * @param g a graphics context
+     * @param clipBounds a clipped rectangle
+     * @param insets insets
+     * @param path a tree path
      */
     protected void paintVerticalPartOfLeg(Graphics g, Rectangle clipBounds,
                                           Insets insets, TreePath path) {
@@ -1472,7 +1665,17 @@
 
     /**
      * Paints the expand (toggle) part of a row. The receiver should
-     * NOT modify <code>clipBounds</code>, or <code>insets</code>.
+     * NOT modify {@code clipBounds}, or {@code insets}.
+     *
+     * @param g a graphics context
+     * @param clipBounds a clipped rectangle
+     * @param insets insets
+     * @param bounds a bounding rectangle
+     * @param path a tree path
+     * @param row a row
+     * @param isExpanded {@code true} if the path is expanded
+     * @param hasBeenExpanded {@code true} if the path has been expanded
+     * @param isLeaf {@code true} if the row is leaf
      */
     protected void paintExpandControl(Graphics g,
                                       Rectangle clipBounds, Insets insets,
@@ -1511,7 +1714,17 @@
 
     /**
      * Paints the renderer part of a row. The receiver should
-     * NOT modify <code>clipBounds</code>, or <code>insets</code>.
+     * NOT modify {@code clipBounds}, or {@code insets}.
+     *
+     * @param g a graphics context
+     * @param clipBounds a clipped rectangle
+     * @param insets insets
+     * @param bounds a bounding rectangle
+     * @param path a tree path
+     * @param row a row
+     * @param isExpanded {@code true} if the path is expanded
+     * @param hasBeenExpanded {@code true} if the path has been expanded
+     * @param isLeaf {@code true} if the path is leaf
      */
     protected void paintRow(Graphics g, Rectangle clipBounds,
                             Insets insets, Rectangle bounds, TreePath path,
@@ -1541,8 +1754,16 @@
     }
 
     /**
-     * Returns true if the expand (toggle) control should be drawn for
+     * Returns {@code true} if the expand (toggle) control should be drawn for
      * the specified row.
+     *
+     * @param path a tree path
+     * @param row a row
+     * @param isExpanded {@code true} if the path is expanded
+     * @param hasBeenExpanded {@code true} if the path has been expanded
+     * @param isLeaf {@code true} if the row is leaf
+     * @return {@code true} if the expand (toggle) control should be drawn
+     *         for the specified row
      */
     protected boolean shouldPaintExpandControl(TreePath path, int row,
                                                boolean isExpanded,
@@ -1561,6 +1782,12 @@
 
     /**
      * Paints a vertical line.
+     *
+     * @param g a graphics context
+     * @param c a component
+     * @param x an X coordinate
+     * @param top an Y1 coordinate
+     * @param bottom an Y2 coordinate
      */
     protected void paintVerticalLine(Graphics g, JComponent c, int x, int top,
                                     int bottom) {
@@ -1573,6 +1800,12 @@
 
     /**
      * Paints a horizontal line.
+     *
+     * @param g a graphics context
+     * @param c a component
+     * @param y an Y coordinate
+     * @param left an X1 coordinate
+     * @param right an X2 coordinate
      */
     protected void paintHorizontalLine(Graphics g, JComponent c, int y,
                                       int left, int right) {
@@ -1586,6 +1819,8 @@
     /**
      * The vertical element of legs between nodes starts at the bottom of the
      * parent node by default.  This method makes the leg start below that.
+     *
+     * @return the vertical leg buffer
      */
     protected int getVerticalLegBuffer() {
         return 0;
@@ -1595,6 +1830,8 @@
      * The horizontal element of legs between nodes starts at the
      * right of the left-hand side of the child node by default.  This
      * method makes the leg end before that.
+     *
+     * @return the horizontal leg buffer
      */
     protected int getHorizontalLegBuffer() {
         return 0;
@@ -1610,7 +1847,15 @@
     // Generic painting methods
     //
 
-    // Draws the icon centered at (x,y)
+    /**
+     * Draws the {@code icon} centered at (x,y).
+     *
+     * @param c a component
+     * @param graphics a graphics context
+     * @param icon an icon
+     * @param x an X coordinate
+     * @param y an Y coordinate
+     */
     protected void drawCentered(Component c, Graphics graphics, Icon icon,
                                 int x, int y) {
         icon.paintIcon(c, graphics,
@@ -1618,32 +1863,57 @@
                       y - icon.getIconHeight() / 2);
     }
 
-    // This method is slow -- revisit when Java2D is ready.
-    // assumes x1 <= x2
-    protected void drawDashedHorizontalLine(Graphics g, int y, int x1, int x2){
+    /**
+     * Draws a horizontal dashed line. It is assumed {@code x1} &lt;= {@code x2}.
+     * If {@code x1} is greater than {@code x2}, the method draws nothing.
+     *
+     * @param g an instance of {@code Graphics}
+     * @param y an Y coordinate
+     * @param x1 an X1 coordinate
+     * @param x2 an X2 coordinate
+     */
+    protected void drawDashedHorizontalLine(Graphics g, int y, int x1, int x2) {
         // Drawing only even coordinates helps join line segments so they
         // appear as one line.  This can be defeated by translating the
         // Graphics by an odd amount.
-        x1 += (x1 % 2);
-
-        for (int x = x1; x <= x2; x+=2) {
-            g.drawLine(x, y, x, y);
-        }
+        drawDashedLine(g, y, x1, x2, false);
     }
 
-    // This method is slow -- revisit when Java2D is ready.
-    // assumes y1 <= y2
+    /**
+     * Draws a vertical dashed line. It is assumed {@code y1} &lt;= {@code y2}.
+     * If {@code y1} is greater than {@code y2}, the method draws nothing.
+     *
+     * @param g an instance of {@code Graphics}
+     * @param x an X coordinate
+     * @param y1 an Y1 coordinate
+     * @param y2 an Y2 coordinate
+     */
     protected void drawDashedVerticalLine(Graphics g, int x, int y1, int y2) {
         // Drawing only even coordinates helps join line segments so they
         // appear as one line.  This can be defeated by translating the
         // Graphics by an odd amount.
-        y1 += (y1 % 2);
-
-        for (int y = y1; y <= y2; y+=2) {
-            g.drawLine(x, y, x, y);
-        }
+        drawDashedLine(g, x, y1, y2, true);
     }
 
+    private void drawDashedLine(Graphics g, int v, int v1, int v2, boolean isVertical) {
+        if (v1 >= v2) {
+            return;
+        }
+        v1 += (v1 % 2);
+        Graphics2D g2d = (Graphics2D) g;
+        Stroke oldStroke = g2d.getStroke();
+
+        BasicStroke dashedStroke = new BasicStroke(1, BasicStroke.CAP_BUTT,
+                BasicStroke.JOIN_ROUND, 0, new float[]{1}, 0);
+        g2d.setStroke(dashedStroke);
+        if (isVertical) {
+            g2d.drawLine(v, v1, v, v2);
+        } else {
+            g2d.drawLine(v1, v, v2, v);
+        }
+
+        g2d.setStroke(oldStroke);
+    }
     //
     // Various local methods
     //
@@ -1685,9 +1955,11 @@
     }
 
     /**
-     * Updates the expanded state of all the descendants of <code>path</code>
+     * Updates the expanded state of all the descendants of {@code path}
      * by getting the expanded descendants from the tree and forwarding
      * to the tree state.
+     *
+     * @param path a tree path
      */
     protected void updateExpandedDescendants(TreePath path) {
         completeEditing();
@@ -1708,7 +1980,10 @@
     }
 
     /**
-     * Returns a path to the last child of <code>parent</code>.
+     * Returns a path to the last child of {@code parent}.
+     *
+     * @param parent a tree path
+     * @return a path to the last child of {@code parent}
      */
     protected TreePath getLastChildPath(TreePath parent) {
         if(treeModel != null) {
@@ -1906,8 +2181,10 @@
     }
 
     /**
-      * Messaged from the VisibleTreeNode after it has been expanded.
-      */
+     * Messaged from the {@code VisibleTreeNode} after it has been expanded.
+     *
+     * @param path a tree path
+     */
     protected void pathWasExpanded(TreePath path) {
         if(tree != null) {
             tree.fireTreeExpanded(path);
@@ -1915,8 +2192,10 @@
     }
 
     /**
-      * Messaged from the VisibleTreeNode after it has collapsed.
-      */
+     * Messaged from the {@code VisibleTreeNode} after it has collapsed.
+     *
+     * @param path a tree path
+     */
     protected void pathWasCollapsed(TreePath path) {
         if(tree != null) {
             tree.fireTreeCollapsed(path);
@@ -1924,9 +2203,12 @@
     }
 
     /**
-      * Ensures that the rows identified by beginRow through endRow are
-      * visible.
-      */
+     * Ensures that the rows identified by {@code beginRow} through
+     * {@code endRow} are visible.
+     *
+     * @param beginRow the begin row
+     * @param endRow the end row
+     */
     protected void ensureRowsAreVisible(int beginRow, int endRow) {
         if(tree != null && beginRow >= 0 && endRow < getRowCount(tree)) {
             boolean scrollVert = DefaultLookup.getBoolean(tree, this,
@@ -1969,31 +2251,46 @@
         }
     }
 
-    /** Sets the preferred minimum size.
-      */
+    /**
+     * Sets the preferred minimum size.
+     *
+     * @param newSize the new preferred size
+     */
     public void setPreferredMinSize(Dimension newSize) {
         preferredMinSize = newSize;
     }
 
-    /** Returns the minimum preferred size.
-      */
+    /**
+     * Returns the minimum preferred size.
+     *
+     * @return the minimum preferred size
+     */
     public Dimension getPreferredMinSize() {
         if(preferredMinSize == null)
             return null;
         return new Dimension(preferredMinSize);
     }
 
-    /** Returns the preferred size to properly display the tree,
-      * this is a cover method for getPreferredSize(c, true).
-      */
+    /**
+     * Returns the preferred size to properly display the tree,
+     * this is a cover method for {@code getPreferredSize(c, true)}.
+     *
+     * @param c a component
+     * @return the preferred size to represent the tree in the component
+     */
     public Dimension getPreferredSize(JComponent c) {
         return getPreferredSize(c, true);
     }
 
-    /** Returns the preferred size to represent the tree in
-      * <I>c</I>.  If <I>checkConsistency</I> is true
-      * <b>checkConsistency</b> is messaged first.
-      */
+    /**
+     * Returns the preferred size to represent the tree in
+     * <I>c</I>.  If <I>checkConsistency</I> is {@code true}
+     * <b>checkConsistency</b> is messaged first.
+     *
+     * @param c a component
+     * @param checkConsistency if {@code true} consistency is checked
+     * @return the preferred size to represent the tree in the component
+     */
     public Dimension getPreferredSize(JComponent c,
                                       boolean checkConsistency) {
         Dimension       pSize = this.getPreferredMinSize();
@@ -2056,11 +2353,16 @@
     }
 
     /**
-      * Stops the editing session.  If messageStop is true the editor
-      * is messaged with stopEditing, if messageCancel is true the
-      * editor is messaged with cancelEditing. If messageTree is true
-      * the treeModel is messaged with valueForPathChanged.
-      */
+     * Stops the editing session. If {@code messageStop} is {@code true} the editor
+     * is messaged with {@code stopEditing}, if {@code messageCancel}
+     * is {@code true} the editor is messaged with {@code cancelEditing}.
+     * If {@code messageTree} is {@code true} the {@code treeModel} is messaged
+     * with {@code valueForPathChanged}.
+     *
+     * @param messageStop message to stop editing
+     * @param messageCancel message to cancel editing
+     * @param messageTree message to tree
+     */
     protected void completeEditing(boolean messageStop,
                                    boolean messageCancel,
                                    boolean messageTree) {
@@ -2112,10 +2414,14 @@
     }
 
     /**
-      * Will start editing for node if there is a cellEditor and
-      * shouldSelectCell returns true.<p>
-      * This assumes that path is valid and visible.
-      */
+     * Will start editing for node if there is a {@code cellEditor} and
+     * {@code shouldSelectCell} returns {@code true}.<p>
+     * This assumes that path is valid and visible.
+     *
+     * @param path a tree path
+     * @param event a mouse event
+     * @return {@code true} if the editing is successful
+     */
     protected boolean startEditing(TreePath path, MouseEvent event) {
         if (isEditing(tree) && tree.getInvokesStopCellEditing() &&
                                !stopEditing(tree)) {
@@ -2220,9 +2526,13 @@
     //
 
     /**
-     * If the <code>mouseX</code> and <code>mouseY</code> are in the
-     * expand/collapse region of the <code>row</code>, this will toggle
+     * If the {@code mouseX} and {@code mouseY} are in the
+     * expand/collapse region of the {@code row}, this will toggle
      * the row.
+     *
+     * @param path a tree path
+     * @param mouseX an X coordinate
+     * @param mouseY an Y coordinate
      */
     protected void checkForClickInExpandControl(TreePath path,
                                                 int mouseX, int mouseY) {
@@ -2232,9 +2542,15 @@
     }
 
     /**
-     * Returns true if <code>mouseX</code> and <code>mouseY</code> fall
+     * Returns {@code true} if {@code mouseX} and {@code mouseY} fall
      * in the area of row that is used to expand/collapse the node and
-     * the node at <code>row</code> does not represent a leaf.
+     * the node at {@code row} does not represent a leaf.
+     *
+     * @param path a tree path
+     * @param mouseX an X coordinate
+     * @param mouseY an Y coordinate
+     * @return {@code true} if the mouse cursor fall in the area of row that
+     *         is used to expand/collapse the node and the node is not a leaf.
      */
     protected boolean isLocationInExpandControl(TreePath path,
                                                 int mouseX, int mouseY) {
@@ -2265,7 +2581,11 @@
 
     /**
      * Messaged when the user clicks the particular row, this invokes
-     * toggleExpandState.
+     * {@code toggleExpandState}.
+     *
+     * @param path a tree path
+     * @param mouseX an X coordinate
+     * @param mouseY an Y coordinate
      */
     protected void handleExpandControlClick(TreePath path, int mouseX,
                                             int mouseY) {
@@ -2274,9 +2594,11 @@
 
     /**
      * Expands path if it is not expanded, or collapses row if it is expanded.
-     * If expanding a path and JTree scrolls on expand, ensureRowsAreVisible
-     * is invoked to scroll as many of the children to visible as possible
-     * (tries to scroll to last visible descendant of path).
+     * If expanding a path and {@code JTree} scrolls on expand,
+     * {@code ensureRowsAreVisible} is invoked to scroll as many of the children
+     * to visible as possible (tries to scroll to last visible descendant of path).
+     *
+     * @param path a tree path
      */
     protected void toggleExpandState(TreePath path) {
         if(!tree.isExpanded(path)) {
@@ -2299,8 +2621,11 @@
     }
 
     /**
-     * Returning true signifies a mouse event on the node should toggle
+     * Returning {@code true} signifies a mouse event on the node should toggle
      * the selection of only the row under mouse.
+     *
+     * @param event a mouse event
+     * @return {@code true} if a mouse event on the node should toggle the selection
      */
     protected boolean isToggleSelectionEvent(MouseEvent event) {
         return (SwingUtilities.isLeftMouseButton(event) &&
@@ -2308,8 +2633,12 @@
     }
 
     /**
-     * Returning true signifies a mouse event on the node should select
+     * Returning {@code true} signifies a mouse event on the node should select
      * from the anchor point.
+     *
+     * @param event a mouse event
+     * @return {@code true} if a mouse event on the node should select
+     *         from the anchor point
      */
     protected boolean isMultiSelectEvent(MouseEvent event) {
         return (SwingUtilities.isLeftMouseButton(event) &&
@@ -2317,9 +2646,12 @@
     }
 
     /**
-     * Returning true indicates the row under the mouse should be toggled
-     * based on the event. This is invoked after checkForClickInExpandControl,
-     * implying the location is not in the expand (toggle) control
+     * Returning {@code true} indicates the row under the mouse should be toggled
+     * based on the event. This is invoked after {@code checkForClickInExpandControl},
+     * implying the location is not in the expand (toggle) control.
+     *
+     * @param event a mouse event
+     * @return {@code true} if the row under the mouse should be toggled
      */
     protected boolean isToggleEvent(MouseEvent event) {
         if(!SwingUtilities.isLeftMouseButton(event)) {
@@ -2334,12 +2666,15 @@
     }
 
     /**
-     * Messaged to update the selection based on a MouseEvent over a
+     * Messaged to update the selection based on a {@code MouseEvent} over a
      * particular row. If the event is a toggle selection event, the
      * row is either selected, or deselected. If the event identifies
      * a multi selection event, the selection is updated from the
      * anchor point. Otherwise the row is selected, and if the event
      * specified a toggle event the row is expanded/collapsed.
+     *
+     * @param path the selected path
+     * @param event the mouse event
      */
     protected void selectPathForEvent(TreePath path, MouseEvent event) {
         /* Adjust from the anchor point. */
@@ -2397,7 +2732,10 @@
     }
 
     /**
-     * @return true if the node at <code>row</code> is a leaf.
+     * Returns {@code true} if the node at {@code row} is a leaf.
+     *
+     * @param row a row
+     * @return {@code true} if the node at {@code row} is a leaf
      */
     protected boolean isLeaf(int row) {
         TreePath          path = getPathForRow(tree, row);
@@ -2592,8 +2930,10 @@
         }
 
         /**
-         * Returns the JScrollPane housing the JTree, or null if one isn't
-         * found.
+         * Returns the {@code JScrollPane} housing the {@code JTree},
+         * or null if one isn't found.
+         *
+         * @return the {@code JScrollPane} housing the {@code JTree}
          */
         protected JScrollPane getScrollPane() {
             Component       c = tree.getParent();
@@ -2828,7 +3168,11 @@
         }
 
         /**
-         * @return amount to indent the given row.
+         * Returns amount to indent the given row.
+         *
+         * @param row a row
+         * @param depth a depth
+         * @return amount to indent the given row
          */
         protected int getRowX(int row, int depth) {
             return BasicTreeUI.this.getRowX(row, depth);
@@ -2924,6 +3268,12 @@
          * changes. */
         private boolean changeSelection;
 
+        /**
+         * Constructs a new instance of {@code TreeTraverseAction}.
+         *
+         * @param direction the direction
+         * @param name the name of action
+         */
         public TreeTraverseAction(int direction, String name) {
             this(direction, name, true);
         }
@@ -2956,6 +3306,12 @@
         private boolean       addToSelection;
         private boolean       changeSelection;
 
+        /**
+         * Constructs a new instance of {@code TreePageAction}.
+         *
+         * @param direction the direction
+         * @param name the name of action
+         */
         public TreePageAction(int direction, String name) {
             this(direction, name, false, true);
         }
@@ -2993,6 +3349,12 @@
         private boolean       addToSelection;
         private boolean       changeSelection;
 
+        /**
+         * Constructs a new instance of {@code TreeIncrementAction}.
+         *
+         * @param direction the direction
+         * @param name the name of action
+         */
         public TreeIncrementAction(int direction, String name) {
             this(direction, name, false, true);
         }
@@ -3024,11 +3386,20 @@
       */
     @SuppressWarnings("serial") // Superclass is not serializable across versions
     public class TreeHomeAction extends AbstractAction {
+        /**
+         * The direction.
+         */
         protected int            direction;
         /** Set to true if append to selection. */
         private boolean          addToSelection;
         private boolean          changeSelection;
 
+        /**
+         * Constructs a new instance of {@code TreeHomeAction}.
+         *
+         * @param direction the direction
+         * @param name the name of action
+         */
         public TreeHomeAction(int direction, String name) {
             this(direction, name, false, true);
         }
@@ -3059,6 +3430,11 @@
       */
     @SuppressWarnings("serial") // Superclass is not serializable across versions
     public class TreeToggleAction extends AbstractAction {
+        /**
+         * Constructs a new instance of {@code TreeToggleAction}.
+         *
+         * @param name the name of action
+         */
         public TreeToggleAction(String name) {
         }
 
@@ -3079,6 +3455,11 @@
      */
     @SuppressWarnings("serial") // Superclass is not serializable across versions
     public class TreeCancelEditingAction extends AbstractAction {
+        /**
+         * Constructs a new instance of {@code TreeCancelEditingAction}.
+         *
+         * @param name the name of action
+         */
         public TreeCancelEditingAction(String name) {
         }
 
@@ -3110,6 +3491,13 @@
         private Component          focusComponent;
         private boolean            dispatchedEvent;
 
+        /**
+         * Constructs a new instance of {@code MouseInputHandler}.
+         *
+         * @param source a source component
+         * @param destination a destination component
+         * @param event a mouse event
+         */
         public MouseInputHandler(Component source, Component destination,
                                       MouseEvent event){
             this(source, destination, event, null);
@@ -3173,6 +3561,9 @@
             removeFromSource();
         }
 
+        /**
+         * Removes an event from the source.
+         */
         protected void removeFromSource() {
             if(source != null) {
                 source.removeMouseListener(this);
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicViewportUI.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicViewportUI.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014, 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
@@ -43,6 +43,12 @@
     // Shared UI object
     private static ViewportUI viewportUI;
 
+    /**
+     * Returns an instance of {@code BasicViewportUI}.
+     *
+     * @param c a component
+     * @return an instance of {@code BasicViewportUI}
+     */
     public static ComponentUI createUI(JComponent c) {
         if(viewportUI == null) {
             viewportUI = new BasicViewportUI();
@@ -60,6 +66,11 @@
         super.uninstallUI(c);
     }
 
+    /**
+     * Installs view port properties.
+     *
+     * @param c a component
+     */
     protected void installDefaults(JComponent c) {
         LookAndFeel.installColorsAndFont(c,
                                          "Viewport.background",
@@ -68,6 +79,11 @@
         LookAndFeel.installProperty(c, "opaque", Boolean.TRUE);
     }
 
+    /**
+     * Uninstall view port properties.
+     *
+     * @param c a component
+     */
     protected void uninstallDefaults(JComponent c) {
     }
 }
--- a/jdk/src/share/classes/javax/swing/plaf/basic/ComboPopup.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/ComboPopup.java	Wed Jul 05 19:53:51 2017 +0200
@@ -69,6 +69,8 @@
      * Returns the list that is being used to draw the items in the combo box.
      * This method is highly implementation specific and should not be used
      * for general list manipulation.
+     *
+     * @return the list that is being used to draw the items in the combo box
      */
     public JList<Object> getList();
 
@@ -91,6 +93,8 @@
     /**
      * Returns a key listener that will be added to the combo box or null.
      * If this method returns null then it will not be added to the combo box.
+     *
+     * @return a key listener that will be added to the combo box or null
      */
     public KeyListener getKeyListener();
 
--- a/jdk/src/share/classes/javax/swing/plaf/basic/DefaultMenuLayout.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/DefaultMenuLayout.java	Wed Jul 05 19:53:51 2017 +0200
@@ -41,6 +41,17 @@
  */
 @SuppressWarnings("serial") // Superclass is not serializable across versions
 public class DefaultMenuLayout extends BoxLayout implements UIResource {
+
+    /**
+     * Constructs a new instance of {@code DefaultMenuLayout}.
+     *
+     * @param target the container that needs to be laid out
+     * @param axis the axis to lay out components along. Can be one of:
+     *              {@code BoxLayout.X_AXIS},
+     *              {@code BoxLayout.Y_AXIS},
+     *              {@code BoxLayout.LINE_AXIS} or
+     *              {@code BoxLayout.PAGE_AXIS}
+     */
     public DefaultMenuLayout(Container target, int axis) {
         super(target, axis);
     }
--- a/jdk/src/share/classes/javax/swing/plaf/metal/MetalLookAndFeel.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/swing/plaf/metal/MetalLookAndFeel.java	Wed Jul 05 19:53:51 2017 +0200
@@ -633,7 +633,7 @@
         LazyValue toolBarBorder = t -> new MetalBorders.ToolBarBorder();
 
         LazyValue progressBarBorder = t ->
-            new BorderUIResource.LineBorderUIResource(controlDarkShadow, new Integer(1));
+            new BorderUIResource.LineBorderUIResource(controlDarkShadow, 1);
 
         LazyValue toolTipBorder = t ->
             new BorderUIResource.LineBorderUIResource(primaryControlDarkShadow);
@@ -851,8 +851,8 @@
             "Slider.foreground", primaryControlShadow,
             "Slider.focus", focusColor,
             "Slider.focusInsets", zeroInsets,
-            "Slider.trackWidth", new Integer( 7 ),
-            "Slider.majorTickLength", new Integer( 6 ),
+            "Slider.trackWidth",  7 ,
+            "Slider.majorTickLength",  6 ,
             "Slider.horizontalThumbIcon",(LazyValue) t -> MetalIconFactory.getHorizontalSliderThumbIcon(),
             "Slider.verticalThumbIcon",(LazyValue) t -> MetalIconFactory.getVerticalSliderThumbIcon(),
             "Slider.focusInputMap",
@@ -914,7 +914,7 @@
                     new MetalBorders.OptionDialogBorder(),
             "InternalFrame.paletteBorder",(LazyValue) t ->
                     new MetalBorders.PaletteBorder(),
-            "InternalFrame.paletteTitleHeight", new Integer(11),
+            "InternalFrame.paletteTitleHeight", 11,
             "InternalFrame.paletteCloseIcon",(LazyValue) t ->
                     new MetalIconFactory.PaletteCloseIcon(),
             "InternalFrame.closeIcon",
@@ -1067,7 +1067,7 @@
             "ScrollBar.thumb", primaryControlShadow,
             "ScrollBar.thumbShadow", primaryControlDarkShadow,
             "ScrollBar.thumbHighlight", primaryControl,
-            "ScrollBar.width", new Integer( 17 ),
+            "ScrollBar.width",  17 ,
             "ScrollBar.allowsAbsolutePositioning", Boolean.TRUE,
             "ScrollBar.ancestorInputMap",
                new UIDefaults.LazyInputMap(new Object[] {
@@ -1238,8 +1238,8 @@
             "Menu.borderPainted", Boolean.TRUE,
             "Menu.menuPopupOffsetX", zero,
             "Menu.menuPopupOffsetY", zero,
-            "Menu.submenuPopupOffsetX", new Integer(-4),
-            "Menu.submenuPopupOffsetY", new Integer(-3),
+            "Menu.submenuPopupOffsetX", -4,
+            "Menu.submenuPopupOffsetY", -3,
             "Menu.font", menuTextValue,
             "Menu.selectionForeground", menuSelectedForeground,
             "Menu.selectionBackground", menuSelectedBackground,
@@ -1354,7 +1354,7 @@
 
             // SplitPane
 
-            "SplitPane.dividerSize", new Integer(10),
+            "SplitPane.dividerSize", 10,
             "SplitPane.ancestorInputMap",
                new UIDefaults.LazyInputMap(new Object[] {
                         "UP", "negativeIncrement",
--- a/jdk/src/share/classes/javax/swing/plaf/nimbus/Defaults.template	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/swing/plaf/nimbus/Defaults.template	Wed Jul 05 19:53:51 2017 +0200
@@ -398,7 +398,7 @@
         @Override
         public Object createValue(UIDefaults table) {
             try {
-                Class c;
+                Class<?> c;
                 Object cl;
                 // See if we should use a separate ClassLoader
                 if (table == null || !((cl = table.get("ClassLoader"))
@@ -412,7 +412,7 @@
                 }
 
                 c = Class.forName(className, true, (ClassLoader)cl);
-                Constructor constructor = c.getConstructor(
+                Constructor<?> constructor = c.getConstructor(
                         AbstractRegionPainter.PaintContext.class, int.class);
                 if (constructor == null) {
                     throw new NullPointerException(
@@ -564,7 +564,7 @@
                 //if c is not named, and parts[partIndex] has an expected class
                 //type registered, then check to make sure c is of the
                 //right type;
-                Class clazz = parts[partIndex].c;
+                Class<?> clazz = parts[partIndex].c;
                 if (clazz != null && clazz.isAssignableFrom(c.getClass())) {
                     //so far so good, recurse
                     return matches(c.getParent(), partIndex - 1);
@@ -636,7 +636,7 @@
             private String s;
             //true if this part represents a component name
             private boolean named;
-            private Class c;
+            private Class<?> c;
 
             Part(String s) {
                 named = s.charAt(0) == '"' && s.charAt(s.length() - 1) == '"';
@@ -816,7 +816,7 @@
 
     private static final class PainterBorder implements Border, UIResource {
         private Insets insets;
-        private Painter painter;
+        private Painter<Component> painter;
         private String painterKey;
         
         PainterBorder(String painterKey, Insets insets) {
@@ -827,7 +827,9 @@
         @Override
         public void paintBorder(Component c, Graphics g, int x, int y, int w, int h) {
             if (painter == null) {
-                painter = (Painter)UIManager.get(painterKey);
+                @SuppressWarnings("unchecked")
+                Painter<Component> temp = (Painter<Component>)UIManager.get(painterKey);
+                painter = temp;
                 if (painter == null) return;
             }
             
--- a/jdk/src/share/classes/javax/swing/plaf/nimbus/StateImpl.template	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/swing/plaf/nimbus/StateImpl.template	Wed Jul 05 19:53:51 2017 +0200
@@ -28,7 +28,7 @@
 import javax.swing.*;
 
 
-class ${STATE_NAME} extends State {
+class ${STATE_NAME} extends State<JComponent> {
     ${STATE_NAME}() {
         super("${STATE_KEY}");
     }
--- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthParser.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthParser.java	Wed Jul 05 19:53:51 2017 +0200
@@ -764,7 +764,7 @@
                 break;
             case 4: // integer
                 try {
-                    value = new Integer(Integer.parseInt(aValue));
+                    value = Integer.valueOf(aValue);
                 } catch (NumberFormatException nfe) {
                     throw new SAXException(property + " invalid value");
                 }
--- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthStyle.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthStyle.java	Wed Jul 05 19:53:51 2017 +0200
@@ -33,6 +33,7 @@
 import java.util.HashMap;
 import java.util.Map;
 import javax.swing.text.JTextComponent;
+import sun.swing.SwingUtilities2;
 
 /**
  * <code>SynthStyle</code> is a set of style properties.
@@ -303,7 +304,8 @@
               }));
 
         DEFAULT_VALUES.put("InternalFrame.icon",
-                           LookAndFeel.makeIcon(BasicLookAndFeel.class,
+                           SwingUtilities2.makeIcon(BasicLookAndFeel.class,
+                                                    BasicLookAndFeel.class,
                                                     "icons/JavaCup16.png"));
 
         DEFAULT_VALUES.put("InternalFrame.windowBindings",
--- a/jdk/src/share/classes/javax/swing/text/JTextComponent.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/swing/text/JTextComponent.java	Wed Jul 05 19:53:51 2017 +0200
@@ -2556,7 +2556,7 @@
             if (caretPos != dot) {
                 // the caret moved
                 firePropertyChange(ACCESSIBLE_CARET_PROPERTY,
-                    new Integer(caretPos), new Integer(dot));
+                    caretPos, dot);
                 caretPos = dot;
 
                 try {
--- a/jdk/src/share/classes/javax/swing/text/html/CSS.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/swing/text/html/CSS.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1934,13 +1934,13 @@
                 return Boolean.FALSE;
             } else if (key == StyleConstants.Alignment) {
                 if (svalue.equals("right")) {
-                    return new Integer(StyleConstants.ALIGN_RIGHT);
+                    return StyleConstants.ALIGN_RIGHT;
                 } else if (svalue.equals("center")) {
-                    return new Integer(StyleConstants.ALIGN_CENTER);
+                    return StyleConstants.ALIGN_CENTER;
                 } else if  (svalue.equals("justify")) {
-                    return new Integer(StyleConstants.ALIGN_JUSTIFIED);
+                    return StyleConstants.ALIGN_JUSTIFIED;
                 }
-                return new Integer(StyleConstants.ALIGN_LEFT);
+                return StyleConstants.ALIGN_LEFT;
             } else if (key == StyleConstants.StrikeThrough) {
                 if (svalue.indexOf("line-through") >= 0) {
                     return Boolean.TRUE;
--- a/jdk/src/share/classes/javax/swing/text/html/HTMLDocument.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/swing/text/html/HTMLDocument.java	Wed Jul 05 19:53:51 2017 +0200
@@ -623,7 +623,7 @@
      * @param n  the number of tokens to buffer
      */
     public void setTokenThreshold(int n) {
-        putProperty(TokenThreshold, new Integer(n));
+        putProperty(TokenThreshold, n);
     }
 
     /**
--- a/jdk/src/share/classes/javax/swing/text/rtf/RTFGenerator.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/javax/swing/text/rtf/RTFGenerator.java	Wed Jul 05 19:53:51 2017 +0200
@@ -165,14 +165,14 @@
         foregroundColor = StyleConstants.getForeground(a);
         if (foregroundColor != null &&
             colorTable.get(foregroundColor) == null) {
-            colorTable.put(foregroundColor, new Integer(colorCount));
+            colorTable.put(foregroundColor, colorCount);
             colorCount ++;
         }
 
         backgroundColor = a.getAttribute(StyleConstants.Background);
         if (backgroundColor != null &&
             colorTable.get(backgroundColor) == null) {
-            colorTable.put(backgroundColor, new Integer(colorCount));
+            colorTable.put(backgroundColor, colorCount);
             colorCount ++;
         }
 
@@ -183,7 +183,7 @@
 
         if (fontName != null &&
             fontTable.get(fontName) == null) {
-            fontTable.put(fontName, new Integer(fontCount));
+            fontTable.put(fontName, fontCount);
             fontCount ++;
         }
     }
@@ -200,7 +200,7 @@
             Integer aNum = styleTable.get(a);
             if (aNum == null) {
                 styleCount = styleCount + 1;
-                aNum = new Integer(styleCount);
+                aNum = styleCount;
                 styleTable.put(a, aNum);
             }
         }
--- a/jdk/src/share/classes/jdk/nio/zipfs/ZipFileAttributeView.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/jdk/nio/zipfs/ZipFileAttributeView.java	Wed Jul 05 19:53:51 2017 +0200
@@ -59,6 +59,7 @@
         this.isZipView = isZipView;
     }
 
+    @SuppressWarnings("unchecked") // Cast to V
     static <V extends FileAttributeView> V get(ZipPath path, Class<V> type) {
         if (type == null)
             throw new NullPointerException();
--- a/jdk/src/share/classes/jdk/nio/zipfs/ZipFileSystemProvider.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/jdk/nio/zipfs/ZipFileSystemProvider.java	Wed Jul 05 19:53:51 2017 +0200
@@ -271,6 +271,7 @@
     }
 
     @Override
+    @SuppressWarnings("unchecked") // Cast to A
     public <A extends BasicFileAttributes> A
         readAttributes(Path path, Class<A> type, LinkOption... options)
         throws IOException
--- a/jdk/src/share/classes/sun/applet/AppletClassLoader.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/applet/AppletClassLoader.java	Wed Jul 05 19:53:51 2017 +0200
@@ -137,7 +137,7 @@
      * Override loadClass so that class loading errors can be caught in
      * order to print better error messages.
      */
-    public synchronized Class loadClass(String name, boolean resolve)
+    public synchronized Class<?> loadClass(String name, boolean resolve)
         throws ClassNotFoundException
     {
         // First check if we have permission to access the package. This
@@ -166,7 +166,7 @@
      * Finds the applet class with the specified name. First searches
      * loaded JAR files then the applet code base for the class.
      */
-    protected Class findClass(String name) throws ClassNotFoundException {
+    protected Class<?> findClass(String name) throws ClassNotFoundException {
 
         int index = name.indexOf(';');
         String cookie = "";
@@ -192,9 +192,9 @@
         String encodedName = ParseUtil.encodePath(name.replace('.', '/'), false);
         final String path = (new StringBuffer(encodedName)).append(".class").append(cookie).toString();
         try {
-            byte[] b = (byte[]) AccessController.doPrivileged(
-                               new PrivilegedExceptionAction() {
-                public Object run() throws IOException {
+            byte[] b = AccessController.doPrivileged(
+                               new PrivilegedExceptionAction<byte[]>() {
+                public byte[] run() throws IOException {
                    try {
                         URL finalURL = new URL(base, path);
 
@@ -556,9 +556,10 @@
      * name. First checks loaded JAR files then the applet code base for all
      * available resources.
      */
-    public Enumeration findResources(String name) throws IOException {
+    @Override
+    public Enumeration<URL> findResources(String name) throws IOException {
 
-        final Enumeration e = super.findResources(name);
+        final Enumeration<URL> e = super.findResources(name);
 
         // 6215746:  Disable META-INF/* lookup from codebase in
         // applet/plugin classloader. [stanley.ho]
@@ -576,9 +577,9 @@
         }
 
         final URL url = u;
-        return new Enumeration() {
+        return new Enumeration<URL>() {
             private boolean done;
-            public Object nextElement() {
+            public URL nextElement() {
                 if (!done) {
                     if (e.hasMoreElements()) {
                         return e.nextElement();
@@ -601,7 +602,7 @@
      * attribute. The argument can either be the relative path
      * of the class file itself or just the name of the class.
      */
-    Class loadCode(String name) throws ClassNotFoundException {
+    Class<?> loadCode(String name) throws ClassNotFoundException {
         // first convert any '/' or native file separator to .
         name = name.replace('/', '.');
         name = name.replace(File.separatorChar, '.');
@@ -646,7 +647,7 @@
     public ThreadGroup getThreadGroup() {
       synchronized (threadGroupSynchronizer) {
         if (threadGroup == null || threadGroup.isDestroyed()) {
-            AccessController.doPrivileged(new PrivilegedAction() {
+            AccessController.doPrivileged(new PrivilegedAction<Object>() {
                 public Object run() {
                     threadGroup = new AppletThreadGroup(base + "-threadGroup");
                     // threadGroup.setDaemon(true);
@@ -770,8 +771,8 @@
 
 
     // Hash map to store applet compatibility info
-    private HashMap jdk11AppletInfo = new HashMap();
-    private HashMap jdk12AppletInfo = new HashMap();
+    private HashMap<String, Boolean> jdk11AppletInfo = new HashMap<>();
+    private HashMap<String, Boolean> jdk12AppletInfo = new HashMap<>();
 
     /**
      * Set applet target level as JDK 1.1.
@@ -780,7 +781,7 @@
      * @param bool true if JDK is targeted for JDK 1.1;
      *             false otherwise.
      */
-    void setJDK11Target(Class clazz, boolean bool)
+    void setJDK11Target(Class<?> clazz, boolean bool)
     {
          jdk11AppletInfo.put(clazz.toString(), Boolean.valueOf(bool));
     }
@@ -792,7 +793,7 @@
      * @param bool true if JDK is targeted for JDK 1.2;
      *             false otherwise.
      */
-    void setJDK12Target(Class clazz, boolean bool)
+    void setJDK12Target(Class<?> clazz, boolean bool)
     {
         jdk12AppletInfo.put(clazz.toString(), Boolean.valueOf(bool));
     }
@@ -805,9 +806,9 @@
      *         FALSE if applet is not;
      *         null if applet is unknown.
      */
-    Boolean isJDK11Target(Class clazz)
+    Boolean isJDK11Target(Class<?> clazz)
     {
-        return (Boolean) jdk11AppletInfo.get(clazz.toString());
+        return jdk11AppletInfo.get(clazz.toString());
     }
 
     /**
@@ -818,9 +819,9 @@
      *         FALSE if applet is not;
      *         null if applet is unknown.
      */
-    Boolean isJDK12Target(Class clazz)
+    Boolean isJDK12Target(Class<?> clazz)
     {
-        return (Boolean) jdk12AppletInfo.get(clazz.toString());
+        return jdk12AppletInfo.get(clazz.toString());
     }
 
     private static AppletMessageHandler mh =
--- a/jdk/src/share/classes/sun/applet/AppletImageRef.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/applet/AppletImageRef.java	Wed Jul 05 19:53:51 2017 +0200
@@ -65,7 +65,7 @@
      * invoke reconstitute().
      */
     public synchronized void flush() {
-        SoftReference s = soft;
+        SoftReference<Image> s = soft;
         if (s != null) s.clear();
         soft = null;
     }
@@ -74,9 +74,9 @@
      * Sets the thing to the specified object.
      * @param thing the specified object
      */
-    public synchronized void setThing(Object thing) {
+    public synchronized void setThing(Image thing) {
         flush();
-        soft = new SoftReference(thing);
+        soft = new SoftReference<>(thing);
     }
 
     /**
--- a/jdk/src/share/classes/sun/applet/AppletObjectInputStream.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/applet/AppletObjectInputStream.java	Wed Jul 05 19:53:51 2017 +0200
@@ -59,7 +59,7 @@
      * Make a primitive array class
      */
 
-    private Class primitiveType(char type) {
+    private Class<?> primitiveType(char type) {
         switch (type) {
         case 'B': return byte.class;
         case 'C': return char.class;
@@ -76,13 +76,13 @@
     /**
      * Use the given ClassLoader rather than using the system class
      */
-    protected Class resolveClass(ObjectStreamClass classDesc)
+    protected Class<?> resolveClass(ObjectStreamClass classDesc)
         throws IOException, ClassNotFoundException {
 
         String cname = classDesc.getName();
         if (cname.startsWith("[")) {
             // An array
-            Class component;            // component class
+            Class<?> component;            // component class
             int dcount;                 // dimension
             for (dcount=1; cname.charAt(dcount)=='['; dcount++) ;
             if (cname.charAt(dcount) == 'L') {
--- a/jdk/src/share/classes/sun/applet/AppletPanel.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/applet/AppletPanel.java	Wed Jul 05 19:53:51 2017 +0200
@@ -179,7 +179,7 @@
 
         handler = new Thread(appletGroup, this, "thread " + nm);
         // set the context class loader for this thread
-        AccessController.doPrivileged(new PrivilegedAction() {
+        AccessController.doPrivileged(new PrivilegedAction<Object>() {
                 @Override
                 public Object run() {
                     handler.setContextClassLoader(loader);
@@ -253,7 +253,7 @@
     /**
      * AppletEvent Queue
      */
-    private Queue queue = null;
+    private Queue<Integer> queue = null;
 
 
     synchronized public void addAppletListener(AppletListener l) {
@@ -282,7 +282,7 @@
         synchronized(this) {
             if (queue == null) {
                 //System.out.println("SEND0= " + id);
-                queue = new Queue();
+                queue = new Queue<>();
             }
             Integer eventId = Integer.valueOf(id);
             queue.enqueue(eventId);
@@ -309,7 +309,7 @@
         while (queue == null || queue.isEmpty()) {
             wait();
         }
-        Integer eventId = (Integer)queue.dequeue();
+        Integer eventId = queue.dequeue();
         return new AppletEvent(this, eventId.intValue(), null);
     }
 
@@ -631,14 +631,15 @@
      * calls KeyboardFocusManager directly.
      */
     private Component getMostRecentFocusOwnerForWindow(Window w) {
-        Method meth = (Method)AccessController.doPrivileged(new PrivilegedAction() {
+        Method meth = AccessController.doPrivileged(
+            new PrivilegedAction<Method>() {
                 @Override
-                public Object run() {
+                public Method run() {
                     Method meth = null;
                     try {
                         meth = KeyboardFocusManager.class.getDeclaredMethod(
                                 "getMostRecentFocusOwner",
-                                new Class[]{Window.class});
+                                new Class<?>[]{Window.class});
                         meth.setAccessible(true);
                     } catch (Exception e) {
                         // Must never happen
@@ -988,7 +989,7 @@
     /**
      * The class loaders
      */
-    private static HashMap classloaders = new HashMap();
+    private static HashMap<String, AppletClassLoader> classloaders = new HashMap<>();
 
     /**
      * Flush a class loader.
@@ -1001,7 +1002,7 @@
      * Flush all class loaders.
      */
     public static synchronized void flushClassLoaders() {
-        classloaders = new HashMap();
+        classloaders = new HashMap<>();
     }
 
     /**
@@ -1018,14 +1019,14 @@
      * Get a class loader. Create in a restricted context
      */
     synchronized AppletClassLoader getClassLoader(final URL codebase, final String key) {
-        AppletClassLoader c = (AppletClassLoader)classloaders.get(key);
+        AppletClassLoader c = classloaders.get(key);
         if (c == null) {
             AccessControlContext acc =
                 getAccessControlContext(codebase);
-            c = (AppletClassLoader)
-                AccessController.doPrivileged(new PrivilegedAction() {
+            c = AccessController.doPrivileged(
+                    new PrivilegedAction<AppletClassLoader>() {
                         @Override
-                        public Object run() {
+                        public AppletClassLoader run() {
                             AppletClassLoader ac = createClassLoader(codebase);
                             /* Should the creation of the classloader be
                              * within the class synchronized block?  Since
@@ -1043,8 +1044,7 @@
                              * (which timeout when called from the browser).
                              */
                             synchronized (getClass()) {
-                                AppletClassLoader res =
-                                    (AppletClassLoader)classloaders.get(key);
+                                AppletClassLoader res = classloaders.get(key);
                                 if (res == null) {
                                     classloaders.put(key, ac);
                                     return ac;
@@ -1066,10 +1066,10 @@
      */
     private AccessControlContext getAccessControlContext(final URL codebase) {
 
-        PermissionCollection perms = (PermissionCollection)
-            AccessController.doPrivileged(new PrivilegedAction() {
+        PermissionCollection perms = AccessController.doPrivileged(
+                new PrivilegedAction<PermissionCollection>() {
                     @Override
-                    public Object run() {
+                    public PermissionCollection run() {
                         Policy p = java.security.Policy.getPolicy();
                         if (p != null) {
                             return p.getPermissions(new CodeSource(null,
@@ -1172,13 +1172,15 @@
         // critical section of the window list in AppContext.
         synchronized (Window.class)
         {
-            WeakReference weakRef = null;
+            WeakReference<Window> weakRef = null;
             // Remove frame from the Window list in wrong AppContext
             {
                 // Lookup current frame's AppContext
-                Vector<WeakReference<Window>> windowList = (Vector<WeakReference<Window>>)oldAppContext.get(Window.class);
+                @SuppressWarnings("unchecked")
+                Vector<WeakReference<Window>> windowList =
+                    (Vector<WeakReference<Window>>)oldAppContext.get(Window.class);
                 if (windowList != null) {
-                    for (WeakReference ref : windowList) {
+                    for (WeakReference<Window> ref : windowList) {
                         if (ref.get() == frame) {
                             weakRef = ref;
                             break;
@@ -1195,7 +1197,9 @@
 
             // Insert frame into the Window list in the applet's AppContext map
             {
-                Vector<WeakReference<Window>> windowList = (Vector)newAppContext.get(Window.class);
+                @SuppressWarnings("unchecked")
+                Vector<WeakReference<Window>> windowList =
+                    (Vector<WeakReference<Window>>)newAppContext.get(Window.class);
                 if (windowList == null) {
                     windowList = new Vector<WeakReference<Window>>();
                     newAppContext.put(Window.class, windowList);
@@ -1224,7 +1228,7 @@
         // synchronized on applet class object, so calling from
         // different instances of the same applet will be
         // serialized.
-        Class appletClass = applet.getClass();
+        Class<?> appletClass = applet.getClass();
 
         synchronized(appletClass)  {
             // Determine if the JDK level of an applet has been
--- a/jdk/src/share/classes/sun/applet/AppletProps.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/applet/AppletProps.java	Wed Jul 05 19:53:51 2017 +0200
@@ -105,9 +105,9 @@
         String proxyPortValue = proxyPort.getText().trim();
 
         // Get properties
-        final Properties props = (Properties) AccessController.doPrivileged(
-             new PrivilegedAction() {
-                 public Object run() {
+        final Properties props = AccessController.doPrivileged(
+             new PrivilegedAction<Properties>() {
+                 public Properties run() {
                      return System.getProperties();
                  }
         });
@@ -148,7 +148,7 @@
         // Save properties
         try {
             reset();
-            AccessController.doPrivileged(new PrivilegedExceptionAction() {
+            AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() {
                 public Object run() throws IOException {
                     File dotAV = Main.theUserPropertiesFile;
                     FileOutputStream out = new FileOutputStream(dotAV);
--- a/jdk/src/share/classes/sun/applet/AppletSecurity.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/applet/AppletSecurity.java	Wed Jul 05 19:53:51 2017 +0200
@@ -80,7 +80,7 @@
     }
 
     // Cache to store known restricted packages
-    private HashSet restrictedPackages = new HashSet();
+    private HashSet<String> restrictedPackages = new HashSet<>();
 
     /**
      * Reset from Properties
@@ -90,11 +90,11 @@
         // Clear cache
         restrictedPackages.clear();
 
-        AccessController.doPrivileged(new PrivilegedAction() {
+        AccessController.doPrivileged(new PrivilegedAction<Object>() {
             public Object run()
             {
                 // Enumerate system properties
-                Enumeration e = System.getProperties().propertyNames();
+                Enumeration<?> e = System.getProperties().propertyNames();
 
                 while (e.hasMoreElements())
                 {
@@ -130,7 +130,7 @@
             return (AppletClassLoader)loader;
 
         // if that fails, get all the classes on the stack and check them.
-        Class[] context = getClassContext();
+        Class<?>[] context = getClassContext();
         for (int i = 0; i < context.length; i++) {
             loader = context[i].getClassLoader();
             if (loader instanceof AppletClassLoader)
@@ -148,37 +148,38 @@
             final ClassLoader currentLoader = context[i].getClassLoader();
 
             if (currentLoader instanceof URLClassLoader) {
-                loader = (ClassLoader) AccessController.doPrivileged(new PrivilegedAction() {
-                    public Object run() {
+                loader = AccessController.doPrivileged(
+                    new PrivilegedAction<ClassLoader>() {
+                        public ClassLoader run() {
+
+                            AccessControlContext acc = null;
+                            ProtectionDomain[] pds = null;
 
-                        AccessControlContext acc = null;
-                        ProtectionDomain[] pds = null;
+                            try {
+                                acc = (AccessControlContext) facc.get(currentLoader);
+                                if (acc == null) {
+                                    return null;
+                                }
 
-                        try {
-                            acc = (AccessControlContext) facc.get(currentLoader);
-                            if (acc == null) {
-                                return null;
+                                pds = (ProtectionDomain[]) fcontext.get(acc);
+                                if (pds == null) {
+                                    return null;
+                                }
+                            } catch (Exception e) {
+                                throw new UnsupportedOperationException(e);
                             }
 
-                            pds = (ProtectionDomain[]) fcontext.get(acc);
-                            if (pds == null) {
-                                return null;
-                            }
-                        } catch (Exception e) {
-                            throw new UnsupportedOperationException(e);
-                        }
+                            for (int i=0; i<pds.length; i++) {
+                                ClassLoader cl = pds[i].getClassLoader();
 
-                        for (int i=0; i<pds.length; i++) {
-                            ClassLoader cl = pds[i].getClassLoader();
-
-                            if (cl instanceof AppletClassLoader) {
-                                    return cl;
+                                if (cl instanceof AppletClassLoader) {
+                                        return cl;
+                                }
                             }
+
+                            return null;
                         }
-
-                        return null;
-                    }
-                });
+                    });
 
                 if (loader != null) {
                     return (AppletClassLoader) loader;
@@ -282,9 +283,9 @@
         super.checkPackageAccess(pkgname);
 
         // now check the list of restricted packages
-        for (Iterator iter = restrictedPackages.iterator(); iter.hasNext();)
+        for (Iterator<String> iter = restrictedPackages.iterator(); iter.hasNext();)
         {
-            String pkg = (String) iter.next();
+            String pkg = iter.next();
 
             // Prevent matching "sun" and "sunir" even if they
             // starts with similar beginning characters
--- a/jdk/src/share/classes/sun/applet/AppletViewer.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/applet/AppletViewer.java	Wed Jul 05 19:53:51 2017 +0200
@@ -94,7 +94,7 @@
 
     @Override
     public AppletViewer createAppletViewer(int x, int y,
-                                           URL doc, Hashtable atts) {
+                                           URL doc, Hashtable<String, String> atts) {
         return new AppletViewer(x, y, doc, atts, System.out, this);
     }
 
@@ -156,7 +156,7 @@
     /**
      * Create the applet viewer.
      */
-    public AppletViewer(int x, int y, URL doc, Hashtable atts,
+    public AppletViewer(int x, int y, URL doc, Hashtable<String, String> atts,
                         PrintStream statusMsgStream, AppletViewerFactory factory) {
         this.factory = factory;
         this.statusMsgStream = statusMsgStream;
@@ -350,7 +350,7 @@
      *             s.  Whitespace not stripped.
      */
     private String [] splitSeparator(String sep, String s) {
-        Vector v = new Vector();
+        Vector<String> v = new Vector<>();
         int tokenStart = 0;
         int tokenEnd   = 0;
 
@@ -370,7 +370,7 @@
      * Methods for java.applet.AppletContext
      */
 
-    private static Map audioClips = new HashMap();
+    private static Map<URL, AudioClip> audioClips = new HashMap<>();
 
     /**
      * Get an audio clip.
@@ -379,7 +379,7 @@
     public AudioClip getAudioClip(URL url) {
         checkConnect(url);
         synchronized (audioClips) {
-            AudioClip clip = (AudioClip)audioClips.get(url);
+            AudioClip clip = audioClips.get(url);
             if (clip == null) {
                 audioClips.put(url, clip = new AppletAudioClip(url));
             }
@@ -387,7 +387,7 @@
         }
     }
 
-    private static Map imageRefs = new HashMap();
+    private static Map<URL, AppletImageRef> imageRefs = new HashMap<>();
 
     /**
      * Get an image.
@@ -403,7 +403,7 @@
     static Image getCachedImage(URL url) {
         // System.getSecurityManager().checkConnection(url.getHost(), url.getPort());
         synchronized (imageRefs) {
-            AppletImageRef ref = (AppletImageRef)imageRefs.get(url);
+            AppletImageRef ref = imageRefs.get(url);
             if (ref == null) {
                 ref = new AppletImageRef(url);
                 imageRefs.put(url, ref);
@@ -419,7 +419,7 @@
         imageRefs.clear();
     }
 
-    static Vector appletPanels = new Vector();
+    static Vector<AppletPanel> appletPanels = new Vector<>();
 
     /**
      * Get an applet by name.
@@ -430,8 +430,8 @@
         name = name.toLowerCase();
         SocketPermission panelSp =
             new SocketPermission(panel.getCodeBase().getHost(), "connect");
-        for (Enumeration e = appletPanels.elements() ; e.hasMoreElements() ;) {
-            AppletPanel p = (AppletPanel)e.nextElement();
+        for (Enumeration<AppletPanel> e = appletPanels.elements() ; e.hasMoreElements() ;) {
+            AppletPanel p = e.nextElement();
             String param = p.getParameter("name");
             if (param != null) {
                 param = param.toLowerCase();
@@ -455,14 +455,14 @@
      * applets on this page.
      */
     @Override
-    public Enumeration getApplets() {
+    public Enumeration<Applet> getApplets() {
         AppletSecurity security = (AppletSecurity)System.getSecurityManager();
-        Vector v = new Vector();
+        Vector<Applet> v = new Vector<>();
         SocketPermission panelSp =
             new SocketPermission(panel.getCodeBase().getHost(), "connect");
 
-        for (Enumeration e = appletPanels.elements() ; e.hasMoreElements() ;) {
-            AppletPanel p = (AppletPanel)e.nextElement();
+        for (Enumeration<AppletPanel> e = appletPanels.elements() ; e.hasMoreElements() ;) {
+            AppletPanel p = e.nextElement();
             if (p.getDocumentBase().equals(panel.getDocumentBase())) {
 
                 SocketPermission sp =
@@ -509,7 +509,7 @@
     }
 
     @Override
-    public Iterator getStreamKeys(){
+    public Iterator<String> getStreamKeys(){
         // We do nothing.
         return null;
     }
@@ -517,7 +517,7 @@
     /**
      * System parameters.
      */
-    static Hashtable systemParam = new Hashtable();
+    static Hashtable<String, String> systemParam = new Hashtable<>();
 
     static {
         systemParam.put("codebase", "codebase");
@@ -533,32 +533,32 @@
     /**
      * Print the HTML tag.
      */
-    public static void printTag(PrintStream out, Hashtable atts) {
+    public static void printTag(PrintStream out, Hashtable<String, String> atts) {
         out.print("<applet");
 
-        String v = (String)atts.get("codebase");
+        String v = atts.get("codebase");
         if (v != null) {
             out.print(" codebase=\"" + v + "\"");
         }
 
-        v = (String)atts.get("code");
+        v = atts.get("code");
         if (v == null) {
             v = "applet.class";
         }
         out.print(" code=\"" + v + "\"");
-        v = (String)atts.get("width");
+        v = atts.get("width");
         if (v == null) {
             v = "150";
         }
         out.print(" width=" + v);
 
-        v = (String)atts.get("height");
+        v = atts.get("height");
         if (v == null) {
             v = "100";
         }
         out.print(" height=" + v);
 
-        v = (String)atts.get("name");
+        v = atts.get("name");
         if (v != null) {
             out.print(" name=\"" + v + "\"");
         }
@@ -568,8 +568,8 @@
         int len = atts.size();
         String params[] = new String[len];
         len = 0;
-        for (Enumeration e = atts.keys() ; e.hasMoreElements() ;) {
-            String param = (String)e.nextElement();
+        for (Enumeration<String> e = atts.keys() ; e.hasMoreElements() ;) {
+            String param = e.nextElement();
             int i = 0;
             for (; i < len ; i++) {
                 if (params[i].compareTo(param) >= 0) {
@@ -649,7 +649,7 @@
      * Save the applet to a well known file (for now) as a serialized object
      */
     void appletSave() {
-        AccessController.doPrivileged(new PrivilegedAction() {
+        AccessController.doPrivileged(new PrivilegedAction<Object>() {
 
             @Override
             public Object run() {
@@ -702,8 +702,10 @@
     void appletClone() {
         Point p = location();
         updateAtts();
+        @SuppressWarnings("unchecked")
+        Hashtable<String, String> tmp = (Hashtable<String, String>) panel.atts.clone();
         factory.createAppletViewer(p.x + XDELTA, p.y + YDELTA,
-                                   panel.documentURL, (Hashtable)panel.atts.clone());
+                                   panel.documentURL, tmp);
     }
 
     /**
@@ -884,8 +886,8 @@
             @Override
             public void run()
             {
-                for (Enumeration e = appletPanels.elements() ; e.hasMoreElements() ;) {
-                    AppletPanel p = (AppletPanel)e.nextElement();
+                for (Enumeration<AppletPanel> e = appletPanels.elements() ; e.hasMoreElements() ;) {
+                    AppletPanel p = e.nextElement();
                     appletShutdown(p);
                 }
                 appletSystemExit();
@@ -1016,8 +1018,8 @@
     /**
      * Scan tag
      */
-    public static Hashtable scanTag(Reader in) throws IOException {
-        Hashtable atts = new Hashtable();
+    public static Hashtable<String, String> scanTag(Reader in) throws IOException {
+        Hashtable<String, String> atts = new Hashtable<>();
         skipSpace(in);
         while (c >= 0 && c != '>') {
             String att = scanIdentifier(in);
@@ -1122,7 +1124,7 @@
         url = conn.getURL();
 
         int ydisp = 1;
-        Hashtable atts = null;
+        Hashtable<String, String> atts = null;
 
         while(true) {
             c = in.read();
@@ -1172,12 +1174,12 @@
                 else {
                     String nm = scanIdentifier(in);
                     if (nm.equalsIgnoreCase("param")) {
-                        Hashtable t = scanTag(in);
-                        String att = (String)t.get("name");
+                        Hashtable<String, String> t = scanTag(in);
+                        String att = t.get("name");
                         if (att == null) {
                             statusMsgStream.println(requiresNameWarning);
                         } else {
-                            String val = (String)t.get("value");
+                            String val = t.get("value");
                             if (val == null) {
                                 statusMsgStream.println(requiresNameWarning);
                             } else if (atts != null) {
@@ -1235,13 +1237,13 @@
                     }
                     else if (nm.equalsIgnoreCase("app")) {
                         statusMsgStream.println(appNotLongerSupportedWarning);
-                        Hashtable atts2 = scanTag(in);
-                        nm = (String)atts2.get("class");
+                        Hashtable<String, String> atts2 = scanTag(in);
+                        nm = atts2.get("class");
                         if (nm != null) {
                             atts2.remove("class");
                             atts2.put("code", nm + ".class");
                         }
-                        nm = (String)atts2.get("src");
+                        nm = atts2.get("src");
                         if (nm != null) {
                             atts2.remove("src");
                             atts2.put("codebase", nm);
--- a/jdk/src/share/classes/sun/applet/AppletViewerFactory.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/applet/AppletViewerFactory.java	Wed Jul 05 19:53:51 2017 +0200
@@ -35,7 +35,8 @@
 
 public
 interface AppletViewerFactory {
-        public AppletViewer createAppletViewer(int x, int y, URL doc, Hashtable atts);
+        public AppletViewer createAppletViewer(int x, int y, URL doc,
+                                               Hashtable<String, String> atts);
         public MenuBar getBaseMenuBar();
         public boolean isStandalone();
 }
--- a/jdk/src/share/classes/sun/applet/AppletViewerPanel.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/applet/AppletViewerPanel.java	Wed Jul 05 19:53:51 2017 +0200
@@ -59,7 +59,7 @@
     /**
      * The attributes of the applet.
      */
-    Hashtable atts;
+    Hashtable<String, String> atts;
 
     /*
      * JDK 1.1 serialVersionUID
@@ -69,7 +69,7 @@
     /**
      * Construct an applet viewer and start the applet.
      */
-    AppletViewerPanel(URL documentURL, Hashtable atts) {
+    AppletViewerPanel(URL documentURL, Hashtable<String, String> atts) {
         this.documentURL = documentURL;
         this.atts = atts;
 
@@ -105,7 +105,7 @@
      * Get an applet parameter.
      */
     public String getParameter(String name) {
-        return (String)atts.get(name.toLowerCase());
+        return atts.get(name.toLowerCase());
     }
 
     /**
--- a/jdk/src/share/classes/sun/applet/Main.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/applet/Main.java	Wed Jul 05 19:53:51 2017 +0200
@@ -84,7 +84,7 @@
     /**
      * The list of valid URLs passed in to AppletViewer.
      */
-    private static Vector urlList = new Vector(1);
+    private static Vector<URL> urlList = new Vector<>(1);
 
     // This is used in init().  Getting rid of this is desirable but depends
     // on whether the property that uses it is necessary/standard.
@@ -153,7 +153,7 @@
                 // XXX 5/17 this parsing method should be changed/fixed so that
                 // it doesn't do both parsing of the html file and launching of
                 // the AppletPanel
-                AppletViewer.parse((URL) urlList.elementAt(i), encoding);
+                AppletViewer.parse(urlList.elementAt(i), encoding);
             } catch (IOException e) {
                 System.err.println(lookup("main.err.io", e.getMessage()));
                 return 1;
@@ -307,10 +307,10 @@
         // 2) Reflection removes any build dependency between appletviewer
         // and jdb.
         try {
-            Class c = Class.forName("com.sun.tools.example.debug.tty.TTY", true,
+            Class<?> c = Class.forName("com.sun.tools.example.debug.tty.TTY", true,
                                     ClassLoader.getSystemClassLoader());
             Method m = c.getDeclaredMethod("main",
-                                           new Class[] { String[].class });
+                                           new Class<?>[] { String[].class });
             m.invoke(null, new Object[] { newArgs });
         } catch (ClassNotFoundException cnfe) {
             System.err.println(lookup("main.debug.cantfinddebug"));
@@ -367,7 +367,7 @@
         // Read in the System properties.  If something is going to be
         // over-written, warn about it.
         Properties sysProps = System.getProperties();
-        for (Enumeration e = sysProps.propertyNames(); e.hasMoreElements(); ) {
+        for (Enumeration<?> e = sysProps.propertyNames(); e.hasMoreElements(); ) {
             String key = (String) e.nextElement();
             String val = sysProps.getProperty(key);
             String oldVal;
--- a/jdk/src/share/classes/sun/audio/AudioData.java	Wed Jul 05 19:52:35 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,100 +0,0 @@
-/*
- * Copyright (c) 1999, 2013, 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * 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 sun.audio;
-
-import java.io.*;
-import java.util.Arrays;
-
-import javax.sound.sampled.*;
-
-
-/**
- * A clip of audio data. This data can be used to construct an
- * AudioDataStream, which can be played. <p>
- *
- * @author  Arthur van Hoff
- * @author  Kara Kytle
- * @see     AudioDataStream
- * @see     AudioPlayer
- */
-
- /*
-  * the idea here is that the AudioData object encapsulates the
-  * data you need to play an audio clip based on a defined set
-  * of data.  to do this, you require the audio data (a byte
-  * array rather than an arbitrary input stream) and a format
-  * object.
-  */
-
-
-public final class AudioData {
-
-    private static final AudioFormat DEFAULT_FORMAT =
-        new AudioFormat(AudioFormat.Encoding.ULAW,
-                        8000,   // sample rate
-                        8,      // sample size in bits
-                        1,      // channels
-                        1,      // frame size in bytes
-                        8000,   // frame rate
-                        true ); // bigendian (irrelevant for 8-bit data)
-
-    AudioFormat format;   // carry forth the format array amusement
-    byte buffer[];
-
-    /**
-     * Constructor
-     */
-    public AudioData(final byte[] buffer) {
-        // if we cannot extract valid format information, we resort to assuming
-        // the data will be 8k mono u-law in order to provide maximal backwards
-        // compatibility....
-        this(DEFAULT_FORMAT, buffer);
-
-        // okay, we need to extract the format and the byte buffer of data
-        try {
-            AudioInputStream ais = AudioSystem.getAudioInputStream(new ByteArrayInputStream(buffer));
-            this.format = ais.getFormat();
-            ais.close();
-            // $$fb 2002-10-27: buffer contains the file header now!
-        } catch (IOException e) {
-            // use default format
-        } catch (UnsupportedAudioFileException e1 ) {
-            // use default format
-        }
-    }
-
-
-    /**
-     * Non-public constructor; this is the one we use in ADS and CADS
-     * constructors.
-     */
-    AudioData(final AudioFormat format, final byte[] buffer) {
-        this.format = format;
-        if (buffer != null) {
-            this.buffer = Arrays.copyOf(buffer, buffer.length);
-        }
-    }
-}
--- a/jdk/src/share/classes/sun/audio/AudioDataStream.java	Wed Jul 05 19:52:35 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 1999, 2013, 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * 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 sun.audio;
-
-import java.io.*;
-
-/**
- * An input stream to play AudioData.
- *
- * @see AudioPlayer
- * @see AudioData
- * @author Arthur van Hoff
- * @author Kara Kytle
- */
-public class AudioDataStream extends ByteArrayInputStream {
-
-    private final AudioData ad;
-
-    /**
-     * Constructor
-     */
-    public AudioDataStream(final AudioData data) {
-
-        super(data.buffer);
-        this.ad = data;
-    }
-
-    final AudioData getAudioData() {
-        return ad;
-    }
-}
--- a/jdk/src/share/classes/sun/audio/AudioDevice.java	Wed Jul 05 19:52:35 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,419 +0,0 @@
-/*
- * Copyright (c) 1999, 2014, 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * 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 sun.audio;
-
-import java.util.Hashtable;
-import java.util.Vector;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.BufferedInputStream;
-
-import javax.sound.sampled.*;
-import javax.sound.midi.*;
-import com.sun.media.sound.DataPusher;
-import com.sun.media.sound.Toolkit;
-
-/**
- * This class provides an interface to the Headspace Audio engine through
- * the Java Sound API.
- *
- * This class emulates systems with multiple audio channels, mixing
- * multiple streams for the workstation's single-channel device.
- *
- * @see AudioData
- * @see AudioDataStream
- * @see AudioStream
- * @see AudioStreamSequence
- * @see ContinuousAudioDataStream
- * @author David Rivas
- * @author Kara Kytle
- * @author Jan Borgersen
- * @author Florian Bomers
- */
-
-public final class AudioDevice {
-
-    private boolean DEBUG = false  /*true*/ ;
-
-    private Vector<Info> infos;
-
-    /** Are we currently playing audio? */
-    private boolean playing = false;
-
-    /** Handle to the JS audio mixer. */
-    private Mixer mixer = null;
-
-
-
-    /**
-     * The default audio player. This audio player is initialized
-     * automatically.
-     */
-    public static final AudioDevice device = new AudioDevice();
-
-    /**
-     * Create an AudioDevice instance.
-     */
-    private AudioDevice() {
-        infos = new Vector<>();
-    }
-
-
-    private synchronized void startSampled( AudioInputStream as,
-                                            InputStream in ) throws UnsupportedAudioFileException,
-                                  LineUnavailableException {
-
-        Info info = null;
-        DataPusher datapusher = null;
-        DataLine.Info lineinfo = null;
-        SourceDataLine sourcedataline = null;
-
-        // if ALAW or ULAW, we must convert....
-        as = Toolkit.getPCMConvertedAudioInputStream(as);
-
-        if( as==null ) {
-            // could not convert
-            return;
-        }
-
-        lineinfo = new DataLine.Info(SourceDataLine.class,
-                                     as.getFormat());
-        if( !(AudioSystem.isLineSupported(lineinfo))) {
-            return;
-        }
-        sourcedataline = (SourceDataLine)AudioSystem.getLine(lineinfo);
-        datapusher = new DataPusher(sourcedataline, as);
-
-        info = new Info( null, in, datapusher );
-        infos.addElement( info );
-
-        datapusher.start();
-    }
-
-    private synchronized void startMidi( InputStream bis,
-                                         InputStream in ) throws InvalidMidiDataException,
-                                  MidiUnavailableException  {
-
-        Sequencer sequencer = null;
-        Info info = null;
-
-        sequencer = MidiSystem.getSequencer( );
-        sequencer.open();
-        try {
-            sequencer.setSequence( bis );
-        } catch( IOException e ) {
-            throw new InvalidMidiDataException( e.getMessage() );
-        }
-
-        info = new Info( sequencer, in, null );
-
-        infos.addElement( info );
-
-        // fix for bug 4302884: Audio device is not released when AudioClip stops
-        sequencer.addMetaEventListener(info);
-
-        sequencer.start();
-
-    }
-
-
-
-    /**
-     *  Open an audio channel.
-     */
-    public synchronized void openChannel(InputStream in) {
-
-
-        if(DEBUG) {
-            System.out.println("AudioDevice: openChannel");
-            System.out.println("input stream =" + in);
-        }
-
-        Info info = null;
-
-        // is this already playing?  if so, then just return
-        for(int i=0; i<infos.size(); i++) {
-            info = infos.elementAt(i);
-            if( info.in == in ) {
-
-                return;
-            }
-        }
-
-
-        AudioInputStream as = null;
-
-        if( in instanceof AudioStream ) {
-
-            if ( ((AudioStream)in).midiformat != null ) {
-
-                // it's a midi file
-                try {
-                    startMidi( ((AudioStream)in).stream, in );
-                } catch (Exception e) {
-                    return;
-                }
-
-
-            } else if( ((AudioStream)in).ais != null ) {
-
-                // it's sampled audio
-                try {
-                    startSampled( ((AudioStream)in).ais, in );
-                } catch (Exception e) {
-                    return;
-                }
-
-            }
-        } else if (in instanceof AudioDataStream ) {
-            if (in instanceof ContinuousAudioDataStream) {
-                try {
-                    AudioInputStream ais = new AudioInputStream(in,
-                                                                ((AudioDataStream)in).getAudioData().format,
-                                                                AudioSystem.NOT_SPECIFIED);
-                    startSampled(ais, in );
-                } catch (Exception e) {
-                    return;
-                }
-            }
-            else {
-                try {
-                    AudioInputStream ais = new AudioInputStream(in,
-                                                                ((AudioDataStream)in).getAudioData().format,
-                                                                ((AudioDataStream)in).getAudioData().buffer.length);
-                    startSampled(ais, in );
-                } catch (Exception e) {
-                    return;
-                }
-            }
-        } else {
-            BufferedInputStream bis = new BufferedInputStream( in, 1024 );
-
-            try {
-
-                try {
-                    as = AudioSystem.getAudioInputStream(bis);
-                } catch(IOException ioe) {
-                    return;
-                }
-
-                startSampled( as, in );
-
-            } catch( UnsupportedAudioFileException e ) {
-
-                try {
-                    try {
-                        MidiFileFormat mff =
-                            MidiSystem.getMidiFileFormat( bis );
-                    } catch(IOException ioe1) {
-                        return;
-                    }
-
-                    startMidi( bis, in );
-
-
-                } catch( InvalidMidiDataException e1 ) {
-
-                    // $$jb:08.01.99: adding this section to make some of our other
-                    // legacy classes work.....
-                    // not MIDI either, special case handling for all others
-
-                    AudioFormat defformat = new AudioFormat( AudioFormat.Encoding.ULAW,
-                                                             8000, 8, 1, 1, 8000, true );
-                    try {
-                        AudioInputStream defaif = new AudioInputStream( bis,
-                                                                        defformat, AudioSystem.NOT_SPECIFIED);
-                        startSampled( defaif, in );
-                    } catch (UnsupportedAudioFileException es) {
-                        return;
-                    } catch (LineUnavailableException es2) {
-                        return;
-                    }
-
-                } catch( MidiUnavailableException e2 ) {
-
-                    // could not open sequence
-                    return;
-                }
-
-            } catch( LineUnavailableException e ) {
-
-                return;
-            }
-        }
-
-        // don't forget adjust for a new stream.
-        notify();
-    }
-
-
-    /**
-     *  Close an audio channel.
-     */
-    public synchronized void closeChannel(InputStream in) {
-
-        if(DEBUG) {
-            System.out.println("AudioDevice.closeChannel");
-        }
-
-        if (in == null) return;         // can't go anywhere here!
-
-        Info info;
-
-        for(int i=0; i<infos.size(); i++) {
-
-            info = infos.elementAt(i);
-
-            if( info.in == in ) {
-
-                if( info.sequencer != null ) {
-
-                    info.sequencer.stop();
-                    //info.sequencer.close();
-                    infos.removeElement( info );
-
-                } else if( info.datapusher != null ) {
-
-                    info.datapusher.stop();
-                    infos.removeElement( info );
-                }
-            }
-        }
-        notify();
-    }
-
-
-    /**
-     * Open the device (done automatically)
-     */
-    public synchronized void open() {
-
-        // $$jb: 06.24.99: This is done on a per-stream
-        // basis using the new JS API now.
-    }
-
-
-    /**
-     * Close the device (done automatically)
-     */
-    public synchronized void close() {
-
-        // $$jb: 06.24.99: This is done on a per-stream
-        // basis using the new JS API now.
-
-    }
-
-
-    /**
-     * Play open audio stream(s)
-     */
-    public void play() {
-
-        // $$jb: 06.24.99:  Holdover from old architechture ...
-        // we now open/close the devices as needed on a per-stream
-        // basis using the JavaSound API.
-
-        if (DEBUG) {
-            System.out.println("exiting play()");
-        }
-    }
-
-    /**
-     * Close streams
-     */
-    public synchronized void closeStreams() {
-
-        Info info;
-
-        for(int i=0; i<infos.size(); i++) {
-
-            info = infos.elementAt(i);
-
-            if( info.sequencer != null ) {
-
-                info.sequencer.stop();
-                info.sequencer.close();
-                infos.removeElement( info );
-
-            } else if( info.datapusher != null ) {
-
-                info.datapusher.stop();
-                infos.removeElement( info );
-            }
-        }
-
-
-        if (DEBUG) {
-            System.err.println("Audio Device: Streams all closed.");
-        }
-        // Empty the hash table.
-        infos = new Vector<>();
-    }
-
-    /**
-     * Number of channels currently open.
-     */
-    public int openChannels() {
-        return infos.size();
-    }
-
-    /**
-     * Make the debug info print out.
-     */
-    void setVerbose(boolean v) {
-        DEBUG = v;
-    }
-
-
-
-
-
-
-    // INFO CLASS
-
-    final class Info implements MetaEventListener {
-
-        final Sequencer   sequencer;
-        final InputStream in;
-        final DataPusher  datapusher;
-
-        Info( Sequencer sequencer, InputStream in, DataPusher datapusher ) {
-
-            this.sequencer  = sequencer;
-            this.in         = in;
-            this.datapusher = datapusher;
-        }
-
-        public void meta(MetaMessage event) {
-            if (event.getType() == 47 && sequencer != null) {
-                sequencer.close();
-            }
-        }
-    }
-
-
-
-}
--- a/jdk/src/share/classes/sun/audio/AudioPlayer.java	Wed Jul 05 19:52:35 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,186 +0,0 @@
-/*
- * Copyright (c) 1999, 2014, 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * 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 sun.audio;
-
-import java.io.InputStream;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-
-
-/**
- * This class provides an interface to play audio streams.
- *
- * To play an audio stream use:
- * <pre>
- *      AudioPlayer.player.start(audiostream);
- * </pre>
- * To stop playing an audio stream use:
- * <pre>
- *      AudioPlayer.player.stop(audiostream);
- * </pre>
- * To play an audio stream from a URL use:
- * <pre>
- *      AudioStream audiostream = new AudioStream(url.openStream());
- *      AudioPlayer.player.start(audiostream);
- * </pre>
- * To play a continuous sound you first have to
- * create an AudioData instance and use it to construct a
- * ContinuousAudioDataStream.
- * For example:
- * <pre>
- *      AudioData data = new AudioStream(url.openStream()).getData();
- *      ContinuousAudioDataStream audiostream = new ContinuousAudioDataStream(data);
- *      AudioPlayer.player.start(audiostream);
- * </pre>
- *
- * @see AudioData
- * @see AudioDataStream
- * @see AudioDevice
- * @see AudioStream
- * @author Arthur van Hoff, Thomas Ball
- */
-
-public final class AudioPlayer extends Thread {
-
-        private final AudioDevice devAudio;
-        private final static boolean DEBUG = false /*true*/;
-
-        /**
-         * The default audio player. This audio player is initialized
-         * automatically.
-         */
-        public static final AudioPlayer player = getAudioPlayer();
-
-        private static ThreadGroup getAudioThreadGroup() {
-
-            if(DEBUG) { System.out.println("AudioPlayer.getAudioThreadGroup()"); }
-            ThreadGroup g = currentThread().getThreadGroup();
-            while ((g.getParent() != null) &&
-                   (g.getParent().getParent() != null)) {
-                g = g.getParent();
-            }
-            return g;
-        }
-
-        /**
-         * Create an AudioPlayer thread in a privileged block.
-         */
-
-        private static AudioPlayer getAudioPlayer() {
-
-            if(DEBUG) { System.out.println("> AudioPlayer.getAudioPlayer()"); }
-            PrivilegedAction<AudioPlayer> action = new PrivilegedAction<AudioPlayer>() {
-                    public AudioPlayer run() {
-                        AudioPlayer t = new AudioPlayer();
-                        t.setPriority(MAX_PRIORITY);
-                        t.setDaemon(true);
-                        t.start();
-                        return t;
-                    }
-                };
-            return  AccessController.doPrivileged(action);
-        }
-
-        /**
-         * Construct an AudioPlayer.
-         */
-        private AudioPlayer() {
-
-            super(getAudioThreadGroup(), "Audio Player");
-            if(DEBUG) { System.out.println("> AudioPlayer private constructor"); }
-            devAudio = AudioDevice.device;
-            devAudio.open();
-            if(DEBUG) { System.out.println("< AudioPlayer private constructor completed"); }
-        }
-
-
-        /**
-         * Start playing a stream. The stream will continue to play
-         * until the stream runs out of data, or it is stopped.
-         * @see AudioPlayer#stop
-         */
-        public synchronized void start(InputStream in) {
-
-            if(DEBUG) {
-                System.out.println("> AudioPlayer.start");
-                System.out.println("  InputStream = " + in);
-            }
-            devAudio.openChannel(in);
-            notify();
-            if(DEBUG) {
-                System.out.println("< AudioPlayer.start completed");
-            }
-        }
-
-        /**
-         * Stop playing a stream. The stream will stop playing,
-         * nothing happens if the stream wasn't playing in the
-         * first place.
-         * @see AudioPlayer#start
-         */
-        public synchronized void stop(InputStream in) {
-
-            if(DEBUG) {
-                System.out.println("> AudioPlayer.stop");
-            }
-
-            devAudio.closeChannel(in);
-            if(DEBUG) {
-                System.out.println("< AudioPlayer.stop completed");
-            }
-        }
-
-        /**
-         * Main mixing loop. This is called automatically when the AudioPlayer
-         * is created.
-         */
-        public void run() {
-
-            // $$jb: 06.24.99: With the JS API, mixing is no longer done by AudioPlayer
-            // or AudioDevice ... it's done by the API itself, so this bit of legacy
-            // code does nothing.
-            // $$jb: 10.21.99: But it appears that some legacy applications
-            // check to see if this thread is alive or not, so we need to spin here.
-
-            devAudio.play();
-            if(DEBUG) {
-                System.out.println("AudioPlayer mixing loop.");
-            }
-            while(true) {
-                try{
-                    Thread.sleep(5000);
-                    //wait();
-                } catch(Exception e) {
-                    break;
-                    // interrupted
-                }
-            }
-            if(DEBUG) {
-                System.out.println("AudioPlayer exited.");
-            }
-
-        }
-    }
--- a/jdk/src/share/classes/sun/audio/AudioSecurityAction.java	Wed Jul 05 19:52:35 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-/*
- * Copyright (c) 1999, 2002, 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * 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 sun.audio;
-
-public interface AudioSecurityAction {
-    Object run();
-}
--- a/jdk/src/share/classes/sun/audio/AudioSecurityExceptionAction.java	Wed Jul 05 19:52:35 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-/*
- * Copyright (c) 1999, 2002, 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * 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 sun.audio;
-
-public interface AudioSecurityExceptionAction {
-    Object run() throws Exception;
-}
--- a/jdk/src/share/classes/sun/audio/AudioStream.java	Wed Jul 05 19:52:35 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,142 +0,0 @@
-/*
- * Copyright (c) 1999, 2014, 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * 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 sun.audio;
-
-import java.io.InputStream;
-import java.io.FilterInputStream;
-import java.io.BufferedInputStream;
-import java.io.IOException;
-
-import javax.sound.sampled.*;
-import javax.sound.midi.*;
-
-/**
- * Convert an InputStream to an AudioStream.
- *
- */
-
-
-public final class AudioStream extends FilterInputStream {
-
-    // AudioContainerInputStream acis;
-    AudioInputStream ais = null;
-    AudioFormat format = null;
-    MidiFileFormat midiformat = null;
-    InputStream stream = null;
-
-
-    /*
-     * create the AudioStream; if we survive without throwing
-     * an exception, we should now have some subclass of
-     * ACIS with all the header info already read
-     */
-
-    public AudioStream(InputStream in) throws IOException {
-
-        super(in);
-
-        stream = in;
-
-        if( in.markSupported() == false ) {
-
-            stream = new BufferedInputStream( in, 1024 );
-        }
-
-        try {
-            ais = AudioSystem.getAudioInputStream( stream );
-            format = ais.getFormat();
-            this.in = ais;
-
-        } catch (UnsupportedAudioFileException e ) {
-
-            // not an audio file, see if it's midi...
-            try {
-                midiformat = MidiSystem.getMidiFileFormat( stream );
-
-            } catch (InvalidMidiDataException e1) {
-                throw new IOException("could not create audio stream from input stream");
-            }
-        }
-    }
-
-
-
-
-    /**
-     * A blocking read.
-     */
-    /*    public int read(byte buf[], int pos, int len) throws IOException {
-
-          return(acis.readFully(buf, pos, len));
-          }
-    */
-
-    /**
-     * Get the data.
-     */
-    public AudioData getData() throws IOException {
-        int length = getLength();
-
-        //limit the memory to 1M, so too large au file won't load
-        if (length < 1024*1024) {
-            byte [] buffer = new byte[length];
-            try {
-                ais.read(buffer, 0, length);
-            } catch (IOException ex) {
-                throw new IOException("Could not create AudioData Object");
-            }
-            return new AudioData(format, buffer);
-        }
-
-        /*              acis.setData();
-
-                        if (acis.stream instanceof ByteArrayInputStream) {
-                        Format[] format = acis.getFormat();
-                        byte[] bytes = acis.getBytes();
-                        if (bytes == null)
-                        throw new IOException("could not create AudioData object: no data received");
-                        return new AudioData((AudioFormat)format[0], bytes);
-                        }
-        */
-
-        throw new IOException("could not create AudioData object");
-    }
-
-
-    public int getLength() {
-
-        if( ais != null && format != null ) {
-            return (int) (ais.getFrameLength() *
-                          ais.getFormat().getFrameSize() );
-
-        } else if ( midiformat != null ) {
-            return midiformat.getByteLength();
-
-        } else {
-            return -1;
-        }
-    }
-}
--- a/jdk/src/share/classes/sun/audio/AudioStreamSequence.java	Wed Jul 05 19:52:35 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 1999, 2014, 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * 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 sun.audio;
-
-import java.io.InputStream;
-import java.io.SequenceInputStream;
-import java.util.Enumeration;
-
-/**
- * Convert a sequence of input streams into a single InputStream.
- * This class can be used to play two audio clips in sequence.<p>
- * For example:
- * <pre>
- *      Vector v = new Vector();
- *      v.addElement(audiostream1);
- *      v.addElement(audiostream2);
- *      AudioStreamSequence audiostream = new AudioStreamSequence(v.elements());
- *      AudioPlayer.player.start(audiostream);
- * </pre>
- * @see AudioPlayer
- * @author Arthur van Hoff
- */
-public final class AudioStreamSequence extends SequenceInputStream {
-        /**
-         * Create an AudioStreamSequence given an
-         * enumeration of streams.
-         */
-        public AudioStreamSequence(Enumeration<? extends InputStream> e) {
-            super(e);
-        }
-}
--- a/jdk/src/share/classes/sun/audio/AudioTranslatorStream.java	Wed Jul 05 19:52:35 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 1999, 2013, 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * 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 sun.audio;
-
-import java.io.InputStream;
-import java.io.IOException;
-
-/**
- * Translator for native audio formats (not implemented in this release).
- *
- */
-public final class AudioTranslatorStream extends NativeAudioStream {
-
-        private final int length = 0;
-
-        public AudioTranslatorStream(InputStream in) throws IOException {
-            super(in);
-            // No translators supported yet.
-            throw new InvalidAudioFormatException();
-        }
-
-        public int getLength() {
-            return length;
-        }
-    }
--- a/jdk/src/share/classes/sun/audio/ContinuousAudioDataStream.java	Wed Jul 05 19:52:35 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,82 +0,0 @@
-/*
- * Copyright (c) 1999, 2013, 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * 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 sun.audio;
-
-/**
- * Create a continuous audio stream. This wraps a stream
- * around an AudioData object, the stream is restarted
- * at the beginning everytime the end is reached, thus
- * creating continuous sound.<p>
- * For example:
- * <pre>
- *   AudioData data = AudioData.getAudioData(url);
- *   ContinuousAudioDataStream audiostream = new ContinuousAudioDataStream(data);
- *   AudioPlayer.player.start(audiostream);
- * </pre>
- *
- * @see AudioPlayer
- * @see AudioData
- * @author Arthur van Hoff
- */
-
-public final class ContinuousAudioDataStream extends AudioDataStream {
-
-
-    /**
-         * Create a continuous stream of audio.
-         */
-        public ContinuousAudioDataStream(AudioData data) {
-
-            super(data);
-        }
-
-
-        public int read() {
-
-            int i = super.read();
-
-            if (i == -1) {
-                reset();
-                i = super.read();
-            }
-
-            return i;
-        }
-
-
-        public int read(byte ab[], int i1, int j) {
-
-            int k;
-
-            for (k = 0; k < j; ) {
-                int i2 = super.read(ab, i1 + k, j - k);
-                if (i2 >= 0) k += i2;
-                else reset();
-            }
-
-            return k;
-        }
-    }
--- a/jdk/src/share/classes/sun/audio/InvalidAudioFormatException.java	Wed Jul 05 19:52:35 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-/*
- * Copyright (c) 1999, 2014, 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * 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 sun.audio;
-import java.io.IOException;
-
-/**
- * Signals an invalid audio stream for the stream handler.
- */
-@SuppressWarnings("serial") // JDK-implementation class
-final class InvalidAudioFormatException extends IOException {
-
-
-    /**
-     * Constructor.
-     */
-    InvalidAudioFormatException() {
-        super();
-    }
-
-    /**
-     * Constructor with a detail message.
-     */
-    InvalidAudioFormatException(String s) {
-        super(s);
-    }
-}
--- a/jdk/src/share/classes/sun/audio/NativeAudioStream.java	Wed Jul 05 19:52:35 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 1999, 2002, 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * 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 sun.audio;
-
-import java.io.InputStream;
-import java.io.DataInputStream;
-import java.io.FilterInputStream;
-import java.io.IOException;
-
-/**
- * A Sun-specific AudioStream that supports native audio formats.
- *
- */
-
- /*
- * note: this file used to do the real header reading and
- * format verification for .au files (the only kind supported).
- * now we are way more cool than that and don't need this
- * functionality here; i'm just gutting this class and letting
- * it contain an ACIS instead (so now it should work for
- * all the data types we support....).
- */
-
-public
-    class NativeAudioStream extends FilterInputStream {
-
-
-        public NativeAudioStream(InputStream in) throws IOException {
-
-            super(in);
-        }
-
-        public int getLength() {
-            return 0;
-        }
-    }
--- a/jdk/src/share/classes/sun/awt/AWTAccessor.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/awt/AWTAccessor.java	Wed Jul 05 19:53:51 2017 +0200
@@ -481,11 +481,16 @@
         void setAppContext(MenuComponent menuComp, AppContext appContext);
 
         /**
-         * Returns the menu container of the menu component
+         * Returns the menu container of the menu component.
          */
         MenuContainer getParent(MenuComponent menuComp);
 
         /**
+         * Sets the menu container of the menu component.
+         */
+        void  setParent(MenuComponent menuComp, MenuContainer menuContainer);
+
+        /**
          * Gets the font used for this menu component.
          */
         Font getFont_NoClientCode(MenuComponent menuComp);
--- a/jdk/src/share/classes/sun/java2d/SunGraphics2D.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/java2d/SunGraphics2D.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1322,7 +1322,7 @@
             return SunHints.Value.get(SunHints.INTKEY_FRACTIONALMETRICS,
                                       fractionalMetricsHint);
         case SunHints.INTKEY_AATEXT_LCD_CONTRAST:
-            return new Integer(lcdTextContrast);
+            return lcdTextContrast;
         case SunHints.INTKEY_INTERPOLATION:
             switch (interpolationHint) {
             case SunHints.INTVAL_INTERPOLATION_NEAREST_NEIGHBOR:
--- a/jdk/src/share/classes/sun/java2d/cmm/lcms/LCMSImageLayout.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/java2d/cmm/lcms/LCMSImageLayout.java	Wed Jul 05 19:53:51 2017 +0200
@@ -384,7 +384,8 @@
     }
     public static LCMSImageLayout createImageLayout(Raster r) {
         LCMSImageLayout l = new LCMSImageLayout();
-        if (r instanceof ByteComponentRaster) {
+        if (r instanceof ByteComponentRaster &&
+                r.getSampleModel() instanceof ComponentSampleModel) {
             ByteComponentRaster br = (ByteComponentRaster)r;
 
             ComponentSampleModel csm = (ComponentSampleModel)r.getSampleModel();
--- a/jdk/src/share/classes/sun/net/www/protocol/ftp/FtpURLConnection.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/net/www/protocol/ftp/FtpURLConnection.java	Wed Jul 05 19:53:51 2017 +0200
@@ -301,7 +301,7 @@
             throw new IOException(fe);
         }
         try {
-            ftp.login(user, password.toCharArray());
+            ftp.login(user, password == null ? null : password.toCharArray());
         } catch (sun.net.ftp.FtpProtocolException e) {
             ftp.close();
             // Backward compatibility
--- a/jdk/src/share/classes/sun/print/CustomMediaSizeName.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/print/CustomMediaSizeName.java	Wed Jul 05 19:53:51 2017 +0200
@@ -67,6 +67,22 @@
                                             MediaSize.INCH);
         } catch (IllegalArgumentException iae) {
         }
+        // The public API method finds a closest match even if it not
+        // all that close. Here we want to be sure its *really* close.
+        if (mediaName != null) {
+            MediaSize sz = MediaSize.getMediaSizeForName(mediaName);
+            if (sz == null) {
+                mediaName = null;
+            } else {
+                float w = sz.getX(MediaSize.INCH);
+                float h = sz.getY(MediaSize.INCH);
+                float dw = Math.abs(w - width);
+                float dh = Math.abs(h - length);
+                if (dw > 0.1 || dh > 0.1) {
+                    mediaName = null;
+                }
+            }
+        }
     }
 
     /**
--- a/jdk/src/share/classes/sun/print/PSPrinterJob.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/print/PSPrinterJob.java	Wed Jul 05 19:53:51 2017 +0200
@@ -168,13 +168,6 @@
     private static final String IMAGE_STR =     " string /imStr exch def";
     private static final String IMAGE_RESTORE = "imSave restore";
 
-    private static final String COORD_PREP =    " 0 exch translate "
-                                              + "1 -1 scale"
-                                              + "[72 " + PS_XRES + " div "
-                                              + "0 0 "
-                                              + "72 " + PS_YRES + " div "
-                                              + "0 0]concat";
-
     private static final String SetFontName = "F";
 
     private static final String DrawStringName = "S";
@@ -275,6 +268,9 @@
 
    private AffineTransform mLastTransform;
 
+   private double xres = PS_XRES;
+   private double yres = PS_XRES;
+
    /* non-null if printing EPS for Java Plugin */
    private EPSPrinter epsPrinter = null;
 
@@ -796,6 +792,15 @@
         }
     }
 
+    private String getCoordPrep() {
+        return " 0 exch translate "
+             + "1 -1 scale"
+             + "[72 " + getXRes() + " div "
+             + "0 0 "
+             + "72 " + getYRes() + " div "
+             + "0 0]concat";
+    }
+
     /**
      * The RasterPrintJob super class calls this method
      * at the start of each page.
@@ -852,7 +857,7 @@
             mPSStream.println(" >> setpagedevice");
         }
         mPSStream.println(PAGE_SAVE);
-        mPSStream.println(paperHeight + COORD_PREP);
+        mPSStream.println(paperHeight + getCoordPrep());
     }
 
     /**
@@ -1493,14 +1498,22 @@
      * to be rendered.
      */
     protected double getXRes() {
-        return PS_XRES;
+        return xres;
     }
     /**
      * Return the y resolution of the coordinates
      * to be rendered.
      */
     protected double getYRes() {
-        return PS_YRES;
+        return yres;
+    }
+
+    /**
+     * Set the resolution at which to print.
+     */
+    protected void setXYRes(double x, double y) {
+        xres = x;
+        yres = y;
     }
 
     /**
--- a/jdk/src/share/classes/sun/print/RasterPrinterJob.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/print/RasterPrinterJob.java	Wed Jul 05 19:53:51 2017 +0200
@@ -72,6 +72,7 @@
 import javax.print.attribute.AttributeSet;
 import javax.print.attribute.HashPrintRequestAttributeSet;
 import javax.print.attribute.PrintRequestAttributeSet;
+import javax.print.attribute.ResolutionSyntax;
 import javax.print.attribute.Size2DSyntax;
 import javax.print.attribute.standard.Chromaticity;
 import javax.print.attribute.standard.Copies;
@@ -86,6 +87,7 @@
 import javax.print.attribute.standard.MediaSizeName;
 import javax.print.attribute.standard.OrientationRequested;
 import javax.print.attribute.standard.PageRanges;
+import javax.print.attribute.standard.PrinterResolution;
 import javax.print.attribute.standard.PrinterState;
 import javax.print.attribute.standard.PrinterStateReason;
 import javax.print.attribute.standard.PrinterStateReasons;
@@ -283,6 +285,7 @@
     private String jobNameAttr;
     private String userNameAttr;
     private PageRanges pageRangesAttr;
+    protected PrinterResolution printerResAttr;
     protected Sides sidesAttr;
     protected String destinationAttr;
     protected boolean noJobSheet = false;
@@ -1064,6 +1067,14 @@
                                           attrset));
     }
 
+    /**
+     * Set the device resolution.
+     * Overridden and used only by the postscript code.
+     * Windows code pulls the information from the attribute set itself.
+     */
+    protected void setXYRes(double x, double y) {
+    }
+
     /* subclasses may need to pull extra information out of the attribute set
      * They can override this method & call super.setAttributes()
      */
@@ -1072,6 +1083,7 @@
         /*  reset all values to defaults */
         setCollated(false);
         sidesAttr = null;
+        printerResAttr = null;
         pageRangesAttr = null;
         copiesAttr = 0;
         jobNameAttr = null;
@@ -1117,6 +1129,18 @@
             sidesAttr = Sides.ONE_SIDED;
         }
 
+        printerResAttr = (PrinterResolution)attributes.get(PrinterResolution.class);
+        if (service.isAttributeCategorySupported(PrinterResolution.class)) {
+            if (!isSupportedValue(printerResAttr,  attributes)) {
+               printerResAttr = (PrinterResolution)
+                   service.getDefaultAttributeValue(PrinterResolution.class);
+            }
+            double xr =
+               printerResAttr.getCrossFeedResolution(ResolutionSyntax.DPI);
+            double yr = printerResAttr.getFeedResolution(ResolutionSyntax.DPI);
+            setXYRes(xr, yr);
+        }
+
         pageRangesAttr =  (PageRanges)attributes.get(PageRanges.class);
         if (!isSupportedValue(pageRangesAttr, attributes)) {
             pageRangesAttr = null;
--- a/jdk/src/share/classes/sun/print/ServiceDialog.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/print/ServiceDialog.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1017,8 +1017,8 @@
             format.setParseIntegerOnly(true);
             format.setDecimalSeparatorAlwaysShown(false);
             NumberFormatter nf = new NumberFormatter(format);
-            nf.setMinimum(new Integer(1));
-            nf.setMaximum(new Integer(Integer.MAX_VALUE));
+            nf.setMinimum(1);
+            nf.setMaximum(Integer.MAX_VALUE);
             nf.setAllowsInvalid(true);
             nf.setCommitsOnValidEdit(true);
             tfRangeFrom = new JFormattedTextField(nf);
@@ -1110,12 +1110,12 @@
 
             if (min < 1) {
                 min = 1;
-                tfRangeFrom.setValue(new Integer(1));
+                tfRangeFrom.setValue(1);
             }
 
             if (max < min) {
                 max = min;
-                tfRangeTo.setValue(new Integer(min));
+                tfRangeTo.setValue(min);
             }
 
             PageRanges pr = new PageRanges(min, max);
@@ -1165,8 +1165,8 @@
             } else { // RANGE
                 rbPages.setSelected(true);
             }
-            tfRangeFrom.setValue(new Integer(min));
-            tfRangeTo.setValue(new Integer(max));
+            tfRangeFrom.setValue(min);
+            tfRangeTo.setValue(max);
             rbAll.setEnabled(prSupported);
             rbPages.setEnabled(prSupported);
             setupRangeWidgets();
@@ -1274,14 +1274,14 @@
                 min = 1;
                 max = Integer.MAX_VALUE;
             }
-            snModel.setMinimum(new Integer(min));
-            snModel.setMaximum(new Integer(max));
+            snModel.setMinimum(min);
+            snModel.setMaximum(max);
 
             int value = cp.getValue();
             if ((value < min) || (value > max)) {
                 value = min;
             }
-            snModel.setValue(new Integer(value));
+            snModel.setValue(value);
 
             // setup Collate checkbox
             if (psCurrent.isAttributeCategorySupported(scCategory)) {
@@ -2762,7 +2762,7 @@
             if ((value < 1) || (value > 100)) {
                 value = 1;
             }
-            snModel.setValue(new Integer(value));
+            snModel.setValue(value);
             lblPriority.setEnabled(jpSupported);
             spinPriority.setEnabled(jpSupported);
 
--- a/jdk/src/share/classes/sun/security/provider/SecureRandom.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/security/provider/SecureRandom.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014, 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,6 +29,7 @@
 import java.security.MessageDigest;
 import java.security.SecureRandomSpi;
 import java.security.NoSuchAlgorithmException;
+import java.security.NoSuchProviderException;
 
 /**
  * <p>This class provides a crytpographically strong pseudo-random number
@@ -94,9 +95,19 @@
      */
     private void init(byte[] seed) {
         try {
-            digest = MessageDigest.getInstance("SHA");
-        } catch (NoSuchAlgorithmException e) {
-            throw new InternalError("internal error: SHA-1 not available.", e);
+            /*
+             * Use the local SUN implementation to avoid native
+             * performance overhead.
+             */
+            digest = MessageDigest.getInstance("SHA", "SUN");
+        } catch (NoSuchProviderException | NoSuchAlgorithmException e) {
+            // Fallback to any available.
+            try {
+                digest = MessageDigest.getInstance("SHA");
+            } catch (NoSuchAlgorithmException exc) {
+                throw new InternalError(
+                    "internal error: SHA-1 not available.", exc);
+            }
         }
 
         if (seed != null) {
@@ -265,9 +276,19 @@
         s.defaultReadObject ();
 
         try {
-            digest = MessageDigest.getInstance("SHA");
-        } catch (NoSuchAlgorithmException e) {
-            throw new InternalError("internal error: SHA-1 not available.", e);
+            /*
+             * Use the local SUN implementation to avoid native
+             * performance overhead.
+             */
+            digest = MessageDigest.getInstance("SHA", "SUN");
+        } catch (NoSuchProviderException | NoSuchAlgorithmException e) {
+            // Fallback to any available.
+            try {
+                digest = MessageDigest.getInstance("SHA");
+            } catch (NoSuchAlgorithmException exc) {
+                throw new InternalError(
+                    "internal error: SHA-1 not available.", exc);
+            }
         }
     }
 }
--- a/jdk/src/share/classes/sun/security/ssl/DHCrypt.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/security/ssl/DHCrypt.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2014, 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
@@ -188,7 +188,7 @@
      *         the same size as the Diffie-Hellman modulus.
      */
     SecretKey getAgreedSecret(BigInteger peerPublicValue,
-            boolean keyIsValidated) throws IOException {
+            boolean keyIsValidated) throws SSLHandshakeException {
         try {
             KeyFactory kf = JsseJce.getKeyFactory("DiffieHellman");
             DHPublicKeySpec spec =
@@ -211,7 +211,8 @@
             ka.doPhase(publicKey, true);
             return ka.generateSecret("TlsPremasterSecret");
         } catch (GeneralSecurityException e) {
-            throw new RuntimeException("Could not generate secret", e);
+            throw (SSLHandshakeException) new SSLHandshakeException(
+                "Could not generate secret").initCause(e);
         }
     }
 
--- a/jdk/src/share/classes/sun/security/ssl/ECDHCrypt.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/security/ssl/ECDHCrypt.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2014, 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,7 @@
 
 import javax.crypto.SecretKey;
 import javax.crypto.KeyAgreement;
+import javax.net.ssl.SSLHandshakeException;
 
 /**
  * Helper class for the ECDH key exchange. It generates the appropriate
@@ -88,19 +89,20 @@
     }
 
     // called by ClientHandshaker with either the server's static or ephemeral public key
-    SecretKey getAgreedSecret(PublicKey peerPublicKey) {
+    SecretKey getAgreedSecret(PublicKey peerPublicKey) throws SSLHandshakeException {
         try {
             KeyAgreement ka = JsseJce.getKeyAgreement("ECDH");
             ka.init(privateKey);
             ka.doPhase(peerPublicKey, true);
             return ka.generateSecret("TlsPremasterSecret");
         } catch (GeneralSecurityException e) {
-            throw new RuntimeException("Could not generate secret", e);
+            throw (SSLHandshakeException) new SSLHandshakeException(
+                "Could not generate secret").initCause(e);
         }
     }
 
     // called by ServerHandshaker
-    SecretKey getAgreedSecret(byte[] encodedPoint) {
+    SecretKey getAgreedSecret(byte[] encodedPoint) throws SSLHandshakeException {
         try {
             ECParameterSpec params = publicKey.getParams();
             ECPoint point = JsseJce.decodePoint(encodedPoint, params.getCurve());
@@ -108,10 +110,9 @@
             ECPublicKeySpec spec = new ECPublicKeySpec(point, params);
             PublicKey peerPublicKey = kf.generatePublic(spec);
             return getAgreedSecret(peerPublicKey);
-        } catch (GeneralSecurityException e) {
-            throw new RuntimeException("Could not generate secret", e);
-        } catch (java.io.IOException e) {
-            throw new RuntimeException("Could not generate secret", e);
+        } catch (GeneralSecurityException | java.io.IOException e) {
+            throw (SSLHandshakeException) new SSLHandshakeException(
+                "Could not generate secret").initCause(e);
         }
     }
 
--- a/jdk/src/share/classes/sun/security/ssl/Handshaker.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/security/ssl/Handshaker.java	Wed Jul 05 19:53:51 2017 +0200
@@ -656,8 +656,15 @@
      */
     ProtocolList getActiveProtocols() {
         if (activeProtocols == null) {
+            boolean enabledSSL20Hello = false;
             ArrayList<ProtocolVersion> protocols = new ArrayList<>(4);
             for (ProtocolVersion protocol : enabledProtocols.collection()) {
+                // Need not to check the SSL20Hello protocol.
+                if (protocol.v == ProtocolVersion.SSL20Hello.v) {
+                    enabledSSL20Hello = true;
+                    continue;
+                }
+
                 boolean found = false;
                 for (CipherSuite suite : enabledCipherSuites.collection()) {
                     if (suite.isAvailable() && suite.obsoleted > protocol.v &&
@@ -684,6 +691,11 @@
                         "No available cipher suite for " + protocol);
                 }
             }
+
+            if (!protocols.isEmpty() && enabledSSL20Hello) {
+                protocols.add(ProtocolVersion.SSL20Hello);
+            }
+
             activeProtocols = new ProtocolList(protocols);
         }
 
--- a/jdk/src/share/classes/sun/swing/PrintingStatus.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/swing/PrintingStatus.java	Wed Jul 05 19:53:51 2017 +0200
@@ -295,7 +295,7 @@
         private void updateStatusOnEDT(int pageIndex) {
             assert SwingUtilities.isEventDispatchThread();
             Object[] pageNumber = new Object[]{
-                new Integer(pageIndex + 1)};
+                pageIndex + 1};
             statusLabel.setText(statusFormat.format(pageNumber));
         }
     }
--- a/jdk/src/share/classes/sun/swing/SwingUtilities2.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/swing/SwingUtilities2.java	Wed Jul 05 19:53:51 2017 +0200
@@ -49,6 +49,8 @@
 import sun.print.ProxyPrintGraphics;
 import sun.awt.*;
 import java.io.*;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
 import java.util.*;
 import sun.font.FontDesignMetrics;
 import sun.font.FontUtilities;
@@ -1486,9 +1488,60 @@
     public static Object makeIcon(final Class<?> baseClass,
                                   final Class<?> rootClass,
                                   final String imageFile) {
+        return makeIcon(baseClass, rootClass, imageFile, true);
+    }
 
-        return new UIDefaults.LazyValue() {
-            public Object createValue(UIDefaults table) {
+    /**
+     * Utility method that creates a <code>UIDefaults.LazyValue</code> that
+     * creates an <code>ImageIcon</code> <code>UIResource</code> for the
+     * specified image file name. The image is loaded using
+     * <code>getResourceAsStream</code>, starting with a call to that method
+     * on the base class parameter. If it cannot be found, searching will
+     * continue through the base class' inheritance hierarchy, up to and
+     * including <code>rootClass</code>.
+     *
+     * Finds an image with a given name without privileges enabled.
+     *
+     * @param baseClass the first class to use in searching for the resource
+     * @param rootClass an ancestor of <code>baseClass</code> to finish the
+     *                  search at
+     * @param imageFile the name of the file to be found
+     * @return a lazy value that creates the <code>ImageIcon</code>
+     *         <code>UIResource</code> for the image,
+     *         or null if it cannot be found
+     */
+    public static Object makeIcon_Unprivileged(final Class<?> baseClass,
+                                  final Class<?> rootClass,
+                                  final String imageFile) {
+        return makeIcon(baseClass, rootClass, imageFile, false);
+    }
+
+    private static Object makeIcon(final Class<?> baseClass,
+                                  final Class<?> rootClass,
+                                  final String imageFile,
+                                  final boolean enablePrivileges) {
+        return (UIDefaults.LazyValue) (table) -> {
+            byte[] buffer = enablePrivileges ? AccessController.doPrivileged(
+                    (PrivilegedAction<byte[]>) ()
+                    -> getIconBytes(baseClass, rootClass, imageFile))
+                    : getIconBytes(baseClass, rootClass, imageFile);
+
+            if (buffer == null) {
+                return null;
+            }
+            if (buffer.length == 0) {
+                System.err.println("warning: " + imageFile
+                        + " is zero-length");
+                return null;
+            }
+
+            return new ImageIconUIResource(buffer);
+        };
+    }
+
+    private static byte[] getIconBytes(final Class<?> baseClass,
+                                  final Class<?> rootClass,
+                                  final String imageFile) {
                 /* Copy resource into a byte array.  This is
                  * necessary because several browsers consider
                  * Class.getResource a security risk because it
@@ -1496,60 +1549,38 @@
                  * Class.getResourceAsStream just returns raw
                  * bytes, which we can convert to an image.
                  */
-                byte[] buffer =
-                    java.security.AccessController.doPrivileged(
-                        new java.security.PrivilegedAction<byte[]>() {
-                    public byte[] run() {
-                        try {
-                            InputStream resource = null;
                             Class<?> srchClass = baseClass;
 
                             while (srchClass != null) {
-                                resource = srchClass.getResourceAsStream(imageFile);
 
-                                if (resource != null || srchClass == rootClass) {
+            try (InputStream resource =
+                    srchClass.getResourceAsStream(imageFile)) {
+                if (resource == null) {
+                    if (srchClass == rootClass) {
                                     break;
                                 }
-
                                 srchClass = srchClass.getSuperclass();
+                    continue;
                             }
 
-                            if (resource == null) {
-                                return null;
-                            }
-
-                            BufferedInputStream in =
-                                new BufferedInputStream(resource);
-                            ByteArrayOutputStream out =
-                                new ByteArrayOutputStream(1024);
+                try (BufferedInputStream in
+                        = new BufferedInputStream(resource);
+                        ByteArrayOutputStream out
+                        = new ByteArrayOutputStream(1024)) {
                             byte[] buffer = new byte[1024];
                             int n;
                             while ((n = in.read(buffer)) > 0) {
                                 out.write(buffer, 0, n);
                             }
-                            in.close();
                             out.flush();
                             return out.toByteArray();
+                }
                         } catch (IOException ioe) {
                             System.err.println(ioe.toString());
                         }
+        }
                         return null;
                     }
-                });
-
-                if (buffer == null) {
-                    return null;
-                }
-                if (buffer.length == 0) {
-                    System.err.println("warning: " + imageFile +
-                                       " is zero-length");
-                    return null;
-                }
-
-                return new ImageIconUIResource(buffer);
-            }
-        };
-    }
 
     /* Used to help decide if AA text rendering should be used, so
      * this local display test should be additionally qualified
--- a/jdk/src/share/classes/sun/tools/asm/Assembler.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/tools/asm/Assembler.java	Wed Jul 05 19:53:51 2017 +0200
@@ -238,7 +238,7 @@
         // if a local variable table is generated
         if ((field != null) && env.debug_vars()) {
             @SuppressWarnings("unchecked")
-            Vector<MemberDefinition> v = (Vector<MemberDefinition>)field.getArguments();
+            Vector<MemberDefinition> v = field.getArguments();
             if (v != null) {
                 for (Enumeration<MemberDefinition> e = v.elements() ; e.hasMoreElements() ;) {
                     MemberDefinition f = e.nextElement();
@@ -386,7 +386,7 @@
         if ((field != null) && field.getArguments() != null) {
               int sum = 0;
               @SuppressWarnings("unchecked")
-              Vector<MemberDefinition> v = (Vector<MemberDefinition>)field.getArguments();
+              Vector<MemberDefinition> v = field.getArguments();
               for (Enumeration<MemberDefinition> e = v.elements(); e.hasMoreElements(); ) {
                   MemberDefinition f = e.nextElement();
                   sum += f.getType().stackSize();
@@ -858,7 +858,7 @@
         if ((field != null) && (field.getArguments() != null)) {
             int reg = 0;
             @SuppressWarnings("unchecked")
-            Vector<MemberDefinition> v = (Vector<MemberDefinition>)field.getArguments();
+            Vector<MemberDefinition> v = field.getArguments();
             for (Enumeration<MemberDefinition> e = v.elements(); e.hasMoreElements(); ) {
                 MemberDefinition f = e.nextElement();
                 locals[reg] = f;
@@ -875,7 +875,7 @@
         if ((field != null) && (field.getArguments() != null)) {
             int reg = 0;
             @SuppressWarnings("unchecked")
-            Vector<MemberDefinition> v = (Vector<MemberDefinition>)field.getArguments();
+            Vector<MemberDefinition> v = field.getArguments();
             for (Enumeration<MemberDefinition> e = v.elements(); e.hasMoreElements(); ) {
                 MemberDefinition f = e.nextElement();
                 locals[reg] = f;
--- a/jdk/src/share/classes/sun/tools/asm/ConstantPool.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/tools/asm/ConstantPool.java	Wed Jul 05 19:53:51 2017 +0200
@@ -42,7 +42,7 @@
  */
 public final
 class ConstantPool implements RuntimeConstants {
-    Hashtable<Object,ConstantPoolData> hash = new Hashtable<>(101);
+    Hashtable<Object, ConstantPoolData> hash = new Hashtable<>(101);
 
     /**
      * Find an entry, may return 0
--- a/jdk/src/share/classes/sun/tools/asm/SwitchData.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/tools/asm/SwitchData.java	Wed Jul 05 19:53:51 2017 +0200
@@ -39,9 +39,9 @@
 class SwitchData {
     int minValue, maxValue;
     Label defaultLabel = new Label();
-    Hashtable<Integer,Label> tab = new Hashtable<>();
+    Hashtable<Integer, Label> tab = new Hashtable<>();
 // JCOV
-    Hashtable<Integer,Long> whereCaseTab = null;
+    Hashtable<Integer, Long> whereCaseTab = null;
 // end JCOV
 
     /**
@@ -92,13 +92,13 @@
 
 // JCOV
     public void initTableCase() {
-        whereCaseTab = new Hashtable<Integer,Long>();
+        whereCaseTab = new Hashtable<Integer, Long>();
     }
     public void addTableCase(int index, long where) {
         if (whereCaseTab != null)
             whereCaseTab.put(Integer.valueOf(index), Long.valueOf(where));
     }
-    // this puts String key into Hashtable<Integer,Long>
+    // this puts String key into Hashtable<Integer, Long>
     @SuppressWarnings("unchecked")
     public void addTableDefault(long where) {
         if (whereCaseTab != null)
@@ -123,7 +123,7 @@
      * hash table will be an Integer, with the value being a label.  The
      * enumeration returns the keys in sorted order.
      */
-    SwitchDataEnumeration(Hashtable<Integer,Label> tab) {
+    SwitchDataEnumeration(Hashtable<Integer, Label> tab) {
         table = new Integer[tab.size()];
         int i = 0;
         for (Enumeration<Integer> e = tab.keys() ; e.hasMoreElements() ; ) {
--- a/jdk/src/share/classes/sun/tools/java/BinaryClass.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/tools/java/BinaryClass.java	Wed Jul 05 19:53:51 2017 +0200
@@ -43,7 +43,7 @@
 class BinaryClass extends ClassDefinition implements Constants {
     BinaryConstantPool cpool;
     BinaryAttribute atts;
-    Vector dependencies;
+    Vector<ClassDeclaration> dependencies;
     private boolean haveLoadedNested = false;
 
     /**
@@ -51,7 +51,7 @@
      */
     public BinaryClass(Object source, ClassDeclaration declaration, int modifiers,
                            ClassDeclaration superClass, ClassDeclaration interfaces[],
-                           Vector dependencies) {
+                           Vector<ClassDeclaration> dependencies) {
         super(source, 0, declaration, modifiers, null, null);
         this.dependencies = dependencies;
         this.superClass = superClass;
@@ -134,7 +134,7 @@
         BinaryConstantPool cpool = new BinaryConstantPool(in);
 
         // The dependencies of this class
-        Vector dependencies = cpool.getDependencies(env);
+        Vector<ClassDeclaration> dependencies = cpool.getDependencies(env);
 
         // Read modifiers
         int classMod = in.readUnsignedShort() & ACCM_CLASS;  // JVM 4.1 ClassFile.access_flags
@@ -500,7 +500,7 @@
     /**
      * Get the dependencies
      */
-    public Enumeration getDependencies() {
+    public Enumeration<ClassDeclaration> getDependencies() {
         return dependencies.elements();
     }
 
--- a/jdk/src/share/classes/sun/tools/java/BinaryConstantPool.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/tools/java/BinaryConstantPool.java	Wed Jul 05 19:53:51 2017 +0200
@@ -222,8 +222,8 @@
      * Get a list of dependencies, ie: all the classes referenced in this
      * constant pool.
      */
-    public Vector getDependencies(Environment env) {
-        Vector v = new Vector();
+    public Vector<ClassDeclaration> getDependencies(Environment env) {
+        Vector<ClassDeclaration> v = new Vector<>();
         for (int i = 1 ; i < cpool.length ; i++) {
             switch(types[i]) {
               case CONSTANT_CLASS:
@@ -234,8 +234,9 @@
         return v;
     }
 
-    Hashtable indexHashObject, indexHashAscii;
-    Vector MoreStuff;
+    Hashtable<Object, Integer> indexHashObject;
+    Hashtable<Object, Integer> indexHashAscii;
+    Vector<String> MoreStuff;
 
     /**
      * Find the index of an Object in the constant pool
@@ -243,7 +244,7 @@
     public int indexObject(Object obj, Environment env) {
         if (indexHashObject == null)
             createIndexHash(env);
-        Integer result = (Integer)indexHashObject.get(obj);
+        Integer result = indexHashObject.get(obj);
         if (result == null)
             throw new IndexOutOfBoundsException("Cannot find object " + obj + " of type " +
                                 obj.getClass() + " in constant pool");
@@ -257,9 +258,9 @@
     public int indexString(String string, Environment env) {
         if (indexHashObject == null)
             createIndexHash(env);
-        Integer result = (Integer)indexHashAscii.get(string);
+        Integer result = indexHashAscii.get(string);
         if (result == null) {
-            if (MoreStuff == null) MoreStuff = new Vector();
+            if (MoreStuff == null) MoreStuff = new Vector<>();
             result = cpool.length + MoreStuff.size();
             MoreStuff.addElement(string);
             indexHashAscii.put(string, result);
@@ -273,8 +274,8 @@
      */
 
     public void createIndexHash(Environment env) {
-        indexHashObject = new Hashtable();
-        indexHashAscii = new Hashtable();
+        indexHashObject = new Hashtable<>();
+        indexHashAscii = new Hashtable<>();
         for (int i = 1; i < cpool.length; i++) {
             if (types[i] == CONSTANT_UTF8) {
                 indexHashAscii.put(cpool[i], i);
@@ -342,7 +343,7 @@
             }
         }
         for (int i = cpool.length; i < length; i++) {
-            String string = (String)(MoreStuff.elementAt(i - cpool.length));
+            String string = MoreStuff.elementAt(i - cpool.length);
             out.writeByte(CONSTANT_UTF8);
             out.writeUTF(string);
         }
--- a/jdk/src/share/classes/sun/tools/java/BinaryMember.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/tools/java/BinaryMember.java	Wed Jul 05 19:53:51 2017 +0200
@@ -82,9 +82,9 @@
     /**
      * Get arguments
      */
-    public Vector getArguments() {
+    public Vector<MemberDefinition> getArguments() {
         if (isConstructor() && (getClassDefinition().getSuperClass() == null)) {
-            Vector v = new Vector();
+            Vector<MemberDefinition> v = new Vector<>();
             v.addElement(new LocalMember(0, getClassDefinition(), 0,
                                         getClassDefinition().getType(), idThis));
             return v;
--- a/jdk/src/share/classes/sun/tools/java/ClassDefinition.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/tools/java/ClassDefinition.java	Wed Jul 05 19:53:51 2017 +0200
@@ -64,14 +64,14 @@
     protected boolean nestError;
     protected UplevelReference references;
     protected boolean referencesFrozen;
-    private Hashtable fieldHash = new Hashtable(31);
+    private Hashtable<Identifier, MemberDefinition> fieldHash = new Hashtable<>(31);
     private int abstr;
 
     // Table of local and anonymous classes whose internal names are constructed
     // using the current class as a prefix.  This is part of a fix for
     // bugid 4054523 and 4030421.  See also 'Environment.getClassDefinition'
     // and 'BatchEnvironment.makeClassDefinition'.  Allocated on demand.
-    private Hashtable localClasses = null;
+    private Hashtable<String, ClassDefinition> localClasses = null;
     private final int LOCAL_CLASSES_SIZE = 31;
 
     // The immediately surrounding context in which the class appears.
@@ -378,7 +378,7 @@
         return firstMember;
     }
     public final MemberDefinition getFirstMatch(Identifier name) {
-        return (MemberDefinition)fieldHash.get(name);
+        return fieldHash.get(name);
     }
 
     /**
@@ -519,9 +519,9 @@
 
         // We check for any abstract methods inherited or declared
         // by this class.
-        Iterator methods = getMethods();
+        Iterator<MemberDefinition> methods = getMethods();
         while (methods.hasNext()) {
-            MemberDefinition method = (MemberDefinition) methods.next();
+            MemberDefinition method = methods.next();
 
             if (method.isAbstract()) {
                 return true;
@@ -623,12 +623,11 @@
         // general can return methods which are not visible to the
         // current package.  We need to make sure that these do not
         // prevent this class from being implemented.
-        Iterator otherMethods = intDef.getMethods();
+        Iterator<MemberDefinition> otherMethods = intDef.getMethods();
 
         while (otherMethods.hasNext()) {
             // Get one of the methods from intDef...
-            MemberDefinition method =
-                (MemberDefinition) otherMethods.next();
+            MemberDefinition method = otherMethods.next();
 
             Identifier name = method.getName();
             Type type = method.getType();
@@ -996,14 +995,14 @@
         MemberDefinition tentative = null;
 
         // A list of other methods which may be maximally specific too.
-        List candidateList = null;
+        List<MemberDefinition> candidateList = null;
 
         // Get all the methods inherited by this class which
         // have the name `methodName'.
-        Iterator methods = allMethods.lookupName(methodName);
+        Iterator<MemberDefinition> methods = allMethods.lookupName(methodName);
 
         while (methods.hasNext()) {
-            MemberDefinition method = (MemberDefinition)methods.next();
+            MemberDefinition method = methods.next();
 
             // See if this method is applicable.
             if (!env.isApplicable(method, argumentTypes)) {
@@ -1046,7 +1045,7 @@
                     // list of other candidates.
                     if (!env.isMoreSpecific(tentative,method)) {
                         if (candidateList == null) {
-                            candidateList = new ArrayList();
+                            candidateList = new ArrayList<>();
                         }
                         candidateList.add(method);
                     }
@@ -1057,9 +1056,9 @@
         if (tentative != null && candidateList != null) {
             // Find out if our `tentative' match is a uniquely
             // maximally specific.
-            Iterator candidates = candidateList.iterator();
+            Iterator<MemberDefinition> candidates = candidateList.iterator();
             while (candidates.hasNext()) {
-                MemberDefinition method = (MemberDefinition)candidates.next();
+                MemberDefinition method = candidates.next();
                 if (!env.isMoreSpecific(tentative, method)) {
                     throw new AmbiguousMember(tentative, method);
                 }
@@ -1186,13 +1185,13 @@
     // methods so that we can correctly detect that this class is
     // indeed abstract and so that we can give somewhat comprehensible
     // error messages.
-    private List permanentlyAbstractMethods = new ArrayList();
+    private List<MemberDefinition> permanentlyAbstractMethods = new ArrayList<>();
 
     /**
      * This method returns an Iterator of all abstract methods
      * in our superclasses which we are unable to implement.
      */
-    protected Iterator getPermanentlyAbstractMethods() {
+    protected Iterator<MemberDefinition> getPermanentlyAbstractMethods() {
         // This method can only be called after collectInheritedMethods.
         if (allMethods == null) {
             throw new CompilerError("isPermanentlyAbstract() called early");
@@ -1239,10 +1238,10 @@
 
         try {
             ClassDefinition pClass = parent.getClassDefinition(env);
-            Iterator methods = pClass.getMethods(env);
+            Iterator<MemberDefinition> methods = pClass.getMethods(env);
             while (methods.hasNext()) {
                 MemberDefinition method =
-                    (MemberDefinition) methods.next();
+                    methods.next();
 
                 // Private methods are not inherited.
                 //
@@ -1522,7 +1521,7 @@
             // Make sure that we add all unimplementable methods from our
             // superclass to our list of unimplementable methods.
             ClassDefinition sc = scDecl.getClassDefinition();
-            Iterator supIter = sc.getPermanentlyAbstractMethods();
+            Iterator<MemberDefinition> supIter = sc.getPermanentlyAbstractMethods();
             while (supIter.hasNext()) {
                 permanentlyAbstractMethods.add(supIter.next());
             }
@@ -1587,7 +1586,7 @@
      * Get an Iterator of all methods which could be accessed in an
      * instance of this class.
      */
-    public Iterator getMethods(Environment env) {
+    public Iterator<MemberDefinition> getMethods(Environment env) {
         if (allMethods == null) {
             collectInheritedMethods(env);
         }
@@ -1599,7 +1598,7 @@
      * instance of this class.  Throw a compiler error if we haven't
      * generated this information yet.
      */
-    public Iterator getMethods() {
+    public Iterator<MemberDefinition> getMethods() {
         if (allMethods == null) {
             throw new CompilerError("getMethods: too early");
         }
@@ -1636,7 +1635,7 @@
      * affect our compilation.
      */
     protected void addMirandaMethods(Environment env,
-                                     Iterator mirandas) {
+                                     Iterator<MemberDefinition> mirandas) {
         // do nothing.
     }
 
@@ -1921,11 +1920,11 @@
             // insert this at the front, because of initialization order
             field.nextMember = firstMember;
             firstMember = field;
-            field.nextMatch = (MemberDefinition)fieldHash.get(field.name);
+            field.nextMatch = fieldHash.get(field.name);
         } else {
             lastMember.nextMember = field;
             lastMember = field;
-            field.nextMatch = (MemberDefinition)fieldHash.get(field.name);
+            field.nextMatch = fieldHash.get(field.name);
         }
         fieldHash.put(field.name, field);
     }
@@ -2013,13 +2012,13 @@
         if (localClasses == null) {
             return null;
         } else {
-            return (ClassDefinition)localClasses.get(name);
+            return localClasses.get(name);
         }
     }
 
     public void addLocalClass(ClassDefinition c, String name) {
         if (localClasses == null) {
-            localClasses = new Hashtable(LOCAL_CLASSES_SIZE);
+            localClasses = new Hashtable<>(LOCAL_CLASSES_SIZE);
         }
         localClasses.put(name, c);
     }
--- a/jdk/src/share/classes/sun/tools/java/ClassPath.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/tools/java/ClassPath.java	Wed Jul 05 19:53:51 2017 +0200
@@ -233,11 +233,11 @@
     /**
      * Returns list of files given a package name and extension.
      */
-    public Enumeration getFiles(String pkg, String ext) {
-        Hashtable files = new Hashtable();
+    public Enumeration<ClassFile> getFiles(String pkg, String ext) {
+        Hashtable<String, ClassFile> files = new Hashtable<>();
         for (int i = path.length; --i >= 0; ) {
             if (path[i].zip != null) {
-                Enumeration e = path[i].zip.entries();
+                Enumeration<? extends ZipEntry> e = path[i].zip.entries();
                 while (e.hasMoreElements()) {
                     ZipEntry entry = (ZipEntry)e.nextElement();
                     String name = entry.getName();
@@ -287,9 +287,9 @@
     File dir;
     ZipFile zip;
 
-    Hashtable subdirs = new Hashtable(29); // cache of sub-directory listings
+    Hashtable<String, String[]> subdirs = new Hashtable<>(29); // cache of sub-directory listings:
     String[] getFiles(String subdir) {
-        String files[] = (String[]) subdirs.get(subdir);
+        String files[] = subdirs.get(subdir);
         if (files == null) {
             // search the directory, exactly once
             File sd = new File(dir.getPath(), subdir);
--- a/jdk/src/share/classes/sun/tools/java/Identifier.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/tools/java/Identifier.java	Wed Jul 05 19:53:51 2017 +0200
@@ -58,7 +58,7 @@
     /**
      * The hashtable of identifiers
      */
-    static Hashtable hash = new Hashtable(3001, 0.5f);
+    static Hashtable<String, Identifier> hash = new Hashtable<>(3001, 0.5f);
 
     /**
      * The name of the identifier
@@ -115,7 +115,7 @@
      */
     public static synchronized Identifier lookup(String s) {
         //System.out.println("lookup(" + s + ")");
-        Identifier id = (Identifier)hash.get(s);
+        Identifier id = hash.get(s);
         if (id == null) {
             hash.put(s, id = new Identifier(s));
         }
--- a/jdk/src/share/classes/sun/tools/java/Imports.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/tools/java/Imports.java	Wed Jul 05 19:53:51 2017 +0200
@@ -67,20 +67,20 @@
     /**
      * The imported classes, including memoized imports from packages.
      */
-    Hashtable classes = new Hashtable();
+    Hashtable<Identifier, Identifier> classes = new Hashtable<>();
 
     /**
      * The imported package identifiers.  This will not contain duplicate
      * imports for the same package.  It will also not contain the
      * current package.
      */
-    Vector packages = new Vector();
+    Vector<IdentifierToken> packages = new Vector<>();
 
     /**
      * The (originally) imported classes.
      * A vector of IdentifierToken.
      */
-    Vector singles = new Vector();
+    Vector<IdentifierToken> singles = new Vector<>();
 
     /**
      * Are the import names checked yet?
@@ -134,9 +134,9 @@
         //     }
         // }
 
-        Vector resolvedPackages = new Vector();
-        for (Enumeration e = packages.elements() ; e.hasMoreElements() ;) {
-            IdentifierToken t = (IdentifierToken)e.nextElement();
+        Vector<IdentifierToken> resolvedPackages = new Vector<>();
+        for (Enumeration<IdentifierToken> e = packages.elements() ; e.hasMoreElements() ;) {
+            IdentifierToken t = e.nextElement();
             Identifier nm = t.getName();
             long where = t.getWhere();
 
@@ -175,8 +175,8 @@
         }
         packages = resolvedPackages;
 
-        for (Enumeration e = singles.elements() ; e.hasMoreElements() ;) {
-            IdentifierToken t = (IdentifierToken)e.nextElement();
+        for (Enumeration<IdentifierToken> e = singles.elements() ; e.hasMoreElements() ;) {
+            IdentifierToken t = e.nextElement();
             Identifier nm = t.getName();
             long where = t.getWhere();
             Identifier pkg = nm.getQualifier();
@@ -191,7 +191,7 @@
             Identifier snm = nm.getFlatName().getName();
 
             // make sure it isn't already imported explicitly
-            Identifier className = (Identifier)classes.get(snm);
+            Identifier className = classes.get(snm);
             if (className != null) {
                 Identifier f1 = Identifier.lookup(className.getQualifier(),
                                                   className.getFlatName());
@@ -280,7 +280,7 @@
         }
 
         // Check if it was imported before
-        Identifier className = (Identifier)classes.get(nm);
+        Identifier className = classes.get(nm);
         if (className != null) {
             if (tracing) env.dtExit("Imports.resolve: PREVIOUSLY IMPORTED " + nm);
             return className;
@@ -303,9 +303,9 @@
         } else {
             // If it isn't in the current package, try to find it in
             // our import-on-demands.
-            Enumeration e = packages.elements();
+            Enumeration<IdentifierToken> e = packages.elements();
             while (e.hasMoreElements()) {
-                IdentifierToken t = (IdentifierToken)e.nextElement();
+                IdentifierToken t = e.nextElement();
                 id = Identifier.lookup(t.getName(), nm);
 
                 if (importable(id, env)) {
@@ -386,7 +386,7 @@
         if (nm.isQualified())
             return nm;
 
-        Identifier className = (Identifier)classes.get(nm);
+        Identifier className = classes.get(nm);
         if (className != null) {
             return className;
         }
@@ -425,7 +425,7 @@
         // added to the list, ignore it.
         final int size = packages.size();
         for (int i = 0; i < size; i++) {
-            if (name == ((IdentifierToken)packages.elementAt(i)).getName()) {
+            if (name == (packages.elementAt(i)).getName()) {
                 return;
             }
         }
@@ -464,7 +464,7 @@
      * Return an unmodifiable list of IdentifierToken representing
      * packages specified as imports.
      */
-    public List getImportedPackages() {
+    public List<IdentifierToken> getImportedPackages() {
         return Collections.unmodifiableList(packages);
     }
 
@@ -472,7 +472,7 @@
      * Return an unmodifiable list of IdentifierToken representing
      * classes specified as imports.
      */
-    public List getImportedClasses() {
+    public List<IdentifierToken> getImportedClasses() {
         return Collections.unmodifiableList(singles);
     }
 
--- a/jdk/src/share/classes/sun/tools/java/MemberDefinition.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/tools/java/MemberDefinition.java	Wed Jul 05 19:53:51 2017 +0200
@@ -103,7 +103,7 @@
      * uniqueness of proxy objects.  See the makeProxyMember method
      * defined below.
      */
-    static private Map proxyCache;
+    static private Map<String,MemberDefinition> proxyCache;
 
     /**
      * Create a member which is externally the same as `field' but
@@ -126,12 +126,12 @@
                                                    Environment env) {
 
         if (proxyCache == null) {
-            proxyCache = new HashMap();
+            proxyCache = new HashMap<>();
         }
 
         String key = field.toString() + "@" + classDef.toString();
         // System.out.println("Key is : " + key);
-        MemberDefinition proxy = (MemberDefinition)proxyCache.get(key);
+        MemberDefinition proxy = proxyCache.get(key);
 
         if (proxy != null)
             return proxy;
@@ -217,8 +217,8 @@
     /**
      * Get arguments (a vector of LocalMember)
      */
-    public Vector getArguments() {
-        return isMethod() ? new Vector() : null;
+    public Vector<MemberDefinition> getArguments() {
+        return isMethod() ? new Vector<>() : null;
     }
 
     /**
--- a/jdk/src/share/classes/sun/tools/java/MethodSet.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/tools/java/MethodSet.java	Wed Jul 05 19:53:51 2017 +0200
@@ -46,7 +46,7 @@
      * A Map containing Lists of MemberDefinitions.  The Lists
      * contain methods which share the same name.
      */
-    private final Map lookupMap;
+    private final Map<Identifier,List<MemberDefinition>> lookupMap;
 
     /**
      * The number of methods stored in the MethodSet.
@@ -63,7 +63,7 @@
      */
     public MethodSet() {
         frozen = false;
-        lookupMap = new HashMap();
+        lookupMap = new HashMap<>();
         count = 0;
     }
 
@@ -89,12 +89,12 @@
             Identifier name = method.getName();
 
             // Get a List containing all methods of this name.
-            List methodList = (List) lookupMap.get(name);
+            List<MemberDefinition> methodList = lookupMap.get(name);
 
             if (methodList == null) {
                 // There is no method with this name already.
                 // Create a List, and insert it into the hash.
-                methodList = new ArrayList();
+                methodList = new ArrayList<>();
                 lookupMap.put(name, methodList);
             }
 
@@ -102,7 +102,7 @@
             // been added to the MethodSet.
             int size = methodList.size();
             for (int i = 0; i < size; i++) {
-                if (((MemberDefinition) methodList.get(i))
+                if ((methodList.get(i))
                     .getType().equalArguments(method.getType())) {
                     throw new CompilerError("duplicate addition");
                 }
@@ -128,12 +128,12 @@
             Identifier name = method.getName();
 
             // Get a List containing all methods of this name.
-            List methodList = (List) lookupMap.get(name);
+            List<MemberDefinition> methodList = lookupMap.get(name);
 
             if (methodList == null) {
                 // There is no method with this name already.
                 // Create a List, and insert it into the hash.
-                methodList = new ArrayList();
+                methodList = new ArrayList<>();
                 lookupMap.put(name, methodList);
             }
 
@@ -141,7 +141,7 @@
             // `method'.
             int size = methodList.size();
             for (int i = 0; i < size; i++) {
-                if (((MemberDefinition) methodList.get(i))
+                if ((methodList.get(i))
                     .getType().equalArguments(method.getType())) {
                     methodList.set(i, method);
                     return;
@@ -160,11 +160,11 @@
     public MemberDefinition lookupSig(Identifier name, Type type) {
         // Go through all methods of the same name and see if any
         // have the right signature.
-        Iterator matches = lookupName(name);
+        Iterator<MemberDefinition> matches = lookupName(name);
         MemberDefinition candidate;
 
         while (matches.hasNext()) {
-            candidate = (MemberDefinition) matches.next();
+            candidate = matches.next();
             if (candidate.getType().equalArguments(type)) {
                 return candidate;
             }
@@ -178,10 +178,10 @@
      * Returns an Iterator of all methods contained in the
      * MethodSet which have a given name.
      */
-    public Iterator lookupName(Identifier name) {
+    public Iterator<MemberDefinition> lookupName(Identifier name) {
         // Find the List containing all methods of this name, and
         // return that List's Iterator.
-        List methodList = (List) lookupMap.get(name);
+        List<MemberDefinition> methodList = lookupMap.get(name);
         if (methodList == null) {
             // If there is no method of this name, return a bogus, empty
             // Iterator.
@@ -193,22 +193,21 @@
     /**
      * Returns an Iterator of all methods in the MethodSet
      */
-    public Iterator iterator() {
+    public Iterator<MemberDefinition> iterator() {
 
         //----------------------------------------------------------
         // The inner class MethodIterator is used to create our
         // Iterator of all methods in the MethodSet.
-        class MethodIterator implements Iterator {
-            Iterator hashIter = lookupMap.values().iterator();
-            Iterator listIter = Collections.emptyIterator();
+        class MethodIterator implements Iterator<MemberDefinition> {
+            Iterator<List<MemberDefinition>> hashIter = lookupMap.values().iterator();
+            Iterator<MemberDefinition> listIter = Collections.emptyIterator();
 
             public boolean hasNext() {
                 if (listIter.hasNext()) {
                     return true;
                 } else {
                     if (hashIter.hasNext()) {
-                        listIter = ((List) hashIter.next())
-                            .iterator();
+                        listIter = hashIter.next().iterator();
 
                         // The following should be always true.
                         if (listIter.hasNext()) {
@@ -224,7 +223,7 @@
                 return false;
             }
 
-            public Object next() {
+            public MemberDefinition next() {
                 return listIter.next();
             }
 
@@ -262,7 +261,7 @@
     public String toString() {
         int len = size();
         StringBuilder sb = new StringBuilder();
-        Iterator all = iterator();
+        Iterator<MemberDefinition> all = iterator();
         sb.append("{");
 
         while (all.hasNext()) {
--- a/jdk/src/share/classes/sun/tools/java/Package.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/tools/java/Package.java	Wed Jul 05 19:53:51 2017 +0200
@@ -144,11 +144,11 @@
         return null;
     }
 
-    public Enumeration getSourceFiles() {
+    public Enumeration<ClassFile> getSourceFiles() {
         return sourcePath.getFiles(pkg, ".java");
     }
 
-    public Enumeration getBinaryFiles() {
+    public Enumeration<ClassFile> getBinaryFiles() {
         return binaryPath.getFiles(pkg, ".class");
     }
 
--- a/jdk/src/share/classes/sun/tools/java/Parser.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/tools/java/Parser.java	Wed Jul 05 19:53:51 2017 +0200
@@ -392,8 +392,8 @@
             if (superName == null) {
                 env.error(type.getWhere(), "type.expected");
             }
-            Vector ext = new Vector(1);
-            Vector impl = new Vector(0);
+            Vector<IdentifierToken> ext = new Vector<>(1);
+            Vector<IdentifierToken> impl = new Vector<>(0);
             ext.addElement(new IdentifierToken(idNull));
             if (token == IMPLEMENTS || token == EXTENDS) {
                 env.error(pos, "anonymous.extends");
@@ -1682,7 +1682,7 @@
             // Parse and ignore throws clause
             IdentifierToken exp[] = null;
             if (token == THROWS) {
-                Vector v = new Vector();
+                Vector<IdentifierToken> v = new Vector<>();
                 scan();
                 v.addElement(parseName(false));
                 while (token == COMMA) {
@@ -1890,8 +1890,8 @@
         long p = pos;
         expect(IDENT);
 
-        Vector ext = new Vector();
-        Vector impl = new Vector();
+        Vector<IdentifierToken> ext = new Vector<>();
+        Vector<IdentifierToken> impl = new Vector<>();
         parseInheritance(ext, impl);
 
         ClassDefinition tmp = parseClassBody(nm, mod, ctx, doc, ext, impl, p);
@@ -1901,7 +1901,7 @@
         return tmp;
     }
 
-    protected void parseInheritance(Vector ext, Vector impl) throws SyntaxError, IOException {
+    protected void parseInheritance(Vector<IdentifierToken> ext, Vector<IdentifierToken> impl) throws SyntaxError, IOException {
         // Parse extends clause
         if (token == EXTENDS) {
             scan();
@@ -1929,23 +1929,23 @@
      */
     protected ClassDefinition parseClassBody(IdentifierToken nm, int mod,
                                              int ctx, String doc,
-                                             Vector ext, Vector impl, long p
+                                             Vector<IdentifierToken> ext, Vector<IdentifierToken> impl, long p
                                              ) throws SyntaxError, IOException {
         // Decide which is the super class
         IdentifierToken sup = null;
         if ((mod & M_INTERFACE) != 0) {
             if (impl.size() > 0) {
-                env.error(((IdentifierToken)impl.elementAt(0)).getWhere(),
+                env.error(impl.elementAt(0).getWhere(),
                           "intf.impl.intf");
             }
             impl = ext;
         } else {
             if (ext.size() > 0) {
                 if (ext.size() > 1) {
-                    env.error(((IdentifierToken)ext.elementAt(1)).getWhere(),
+                    env.error(ext.elementAt(1).getWhere(),
                               "multiple.inherit");
                 }
-                sup = (IdentifierToken)ext.elementAt(0);
+                sup = ext.elementAt(0);
             }
         }
 
--- a/jdk/src/share/classes/sun/tools/java/Type.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/tools/java/Type.java	Wed Jul 05 19:53:51 2017 +0200
@@ -57,7 +57,7 @@
     /**
      * This hashtable is used to cache types
      */
-    private static final Hashtable typeHash = new Hashtable(231);
+    private static final Hashtable<String, Type> typeHash = new Hashtable<>(231);
 
     /**
      * The TypeCode of this type. The value of this field is one
@@ -169,7 +169,7 @@
      */
     public static synchronized Type tArray(Type elem) {
         String sig = new String(SIG_ARRAY + elem.getTypeSignature());
-        Type t = (Type)typeHash.get(sig);
+        Type t = typeHash.get(sig);
         if (t == null) {
             t = new ArrayType(sig, elem);
         }
@@ -213,7 +213,7 @@
             new String(SIG_CLASS +
                        className.toString().replace('.', SIGC_PACKAGE) +
                        SIG_ENDCLASS);
-        Type t = (Type)typeHash.get(sig);
+        Type t = typeHash.get(sig);
         if (t == null) {
             t = new ClassType(sig, className);
         }
@@ -283,7 +283,7 @@
         sb.append(returnType.getTypeSignature());
 
         String sig = sb.toString();
-        Type t = (Type)typeHash.get(sig);
+        Type t = typeHash.get(sig);
         if (t == null) {
             t = new MethodType(sig, returnType, argTypes);
         }
@@ -309,7 +309,7 @@
      * @exception CompilerError invalid type signature.
      */
     public static synchronized Type tType(String sig) {
-        Type t = (Type)typeHash.get(sig);
+        Type t = typeHash.get(sig);
         if (t != null) {
             return t;
         }
--- a/jdk/src/share/classes/sun/tools/javac/BatchEnvironment.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/tools/javac/BatchEnvironment.java	Wed Jul 05 19:53:51 2017 +0200
@@ -61,17 +61,17 @@
     /**
      * A hashtable of resource contexts.
      */
-    Hashtable packages = new Hashtable(31);
+    Hashtable<Identifier, Package> packages = new Hashtable<>(31);
 
     /**
      * The classes, in order of appearance.
      */
-    Vector classesOrdered = new Vector();
+    Vector<ClassDeclaration> classesOrdered = new Vector<>();
 
     /**
      * The classes, keyed by ClassDeclaration.
      */
-    Hashtable classes = new Hashtable(351);
+    Hashtable<Type, ClassDeclaration> classes = new Hashtable<>(351);
 
     /**
      * flags
@@ -106,7 +106,7 @@
     /**
      * A list of files containing deprecation warnings.
      */
-    Vector deprecationFiles = new Vector();
+    Vector<Object> deprecationFiles = new Vector<>();
 
         /**
          * writes out error messages
@@ -271,7 +271,7 @@
      * Return an enumeration of all the currently defined classes
      * in order of appearance to getClassDeclaration().
      */
-    public Enumeration getClasses() {
+    public Enumeration<ClassDeclaration> getClasses() {
         return classesOrdered.elements();
     }
 
@@ -280,7 +280,7 @@
      * check in Imports#resolve().  These are the current packages for
      * all classes being compiled as of the first call to isExemptPackage.
      */
-    private Set exemptPackages;
+    private Set<Identifier> exemptPackages;
 
     /**
      * Tells whether an Identifier refers to a package which should be
@@ -317,11 +317,11 @@
         // will be exempt from the "exists" check in
         // sun.tools.java.Imports#resolve().
 
-        exemptPackages = new HashSet(101);
+        exemptPackages = new HashSet<>(101);
 
         // Add all of the current packages and their prefixes to our set.
-        for (Enumeration e = getClasses(); e.hasMoreElements(); ) {
-            ClassDeclaration c = (ClassDeclaration) e.nextElement();
+        for (Enumeration<ClassDeclaration> e = getClasses(); e.hasMoreElements(); ) {
+            ClassDeclaration c = e.nextElement();
             if (c.getStatus() == CS_PARSED) {
                 SourceClass def = (SourceClass) c.getClassDefinition();
                 if (def.isLocal())
@@ -389,7 +389,7 @@
     }
 
     public ClassDeclaration getClassDeclaration(Type t) {
-        ClassDeclaration c = (ClassDeclaration)classes.get(t);
+        ClassDeclaration c = classes.get(t);
         if (c == null) {
             classes.put(t, c = new ClassDeclaration(t.getClassName()));
             classesOrdered.addElement(c);
@@ -407,7 +407,7 @@
         }
         Type t = Type.tClass(nm);
         try {
-            ClassDeclaration c = (ClassDeclaration)classes.get(t);
+            ClassDeclaration c = classes.get(t);
             return (c != null) ? c.getName().equals(nm) :
                 getPackage(nm.getQualifier()).classExists(nm.getName());
         } catch (IOException e) {
@@ -448,7 +448,7 @@
      * Get the package path for a package
      */
     public Package getPackage(Identifier pkg) throws IOException {
-        Package p = (Package)packages.get(pkg);
+        Package p = packages.get(pkg);
         if (p == null) {
             packages.put(pkg, p = new Package(sourcePath, binaryPath, pkg));
         }
@@ -527,10 +527,10 @@
             // (Fix for 4107960).
             //
             // The dependency code was previously in BatchParser.java.
-            Enumeration e = p.classes.elements();
+            Enumeration<SourceClass> e = p.classes.elements();
 
             // first will not be an inner class.
-            ClassDefinition first = (ClassDefinition) e.nextElement();
+            ClassDefinition first = e.nextElement();
             if (first.isInnerClass()) {
                 throw new CompilerError("BatchEnvironment, first is inner");
             }
@@ -538,7 +538,7 @@
             ClassDefinition current = first;
             ClassDefinition next;
             while (e.hasMoreElements()) {
-                next = (ClassDefinition) e.nextElement();
+                next = e.nextElement();
                 // Don't chain in inner classes.
                 if (next.isInnerClass()) {
                     continue;
@@ -607,7 +607,7 @@
     /**
      * Load a binary class
      */
-    boolean needsCompilation(Hashtable check, ClassDeclaration c) {
+    boolean needsCompilation(Hashtable<ClassDeclaration, ClassDeclaration> check, ClassDeclaration c) {
         switch (c.getStatus()) {
 
           case CS_UNDEFINED:
@@ -621,8 +621,8 @@
                 check.put(c, c);
 
                 BinaryClass bin = (BinaryClass)c.getClassDefinition();
-                for (Enumeration e = bin.getDependencies() ; e.hasMoreElements() ;) {
-                    ClassDeclaration dep = (ClassDeclaration)e.nextElement();
+                for (Enumeration<ClassDeclaration> e = bin.getDependencies() ; e.hasMoreElements() ;) {
+                    ClassDeclaration dep = e.nextElement();
                     if (needsCompilation(check, dep)) {
                         // It must be source, dependencies need compilation
                         c.setDefinition(bin, CS_SOURCE);
@@ -829,11 +829,11 @@
 
           case CS_UNDECIDED: {
             if (tracing) dtEvent("loadDefinition: STATUS IS UNDECIDED");
-            Hashtable tab = new Hashtable();
+            Hashtable<ClassDeclaration, ClassDeclaration> tab = new Hashtable<>();
             if (!needsCompilation(tab, c)) {
                 // All undecided classes that this class depends on must be binary
-                for (Enumeration e = tab.keys() ; e.hasMoreElements() ; ) {
-                    ClassDeclaration dep = (ClassDeclaration)e.nextElement();
+                for (Enumeration<ClassDeclaration> e = tab.keys() ; e.hasMoreElements() ; ) {
+                    ClassDeclaration dep = e.nextElement();
                     if (dep.getStatus() == CS_UNDECIDED) {
                         // must be binary, dependencies need compilation
                         dep.setDefinition(dep.getClassDefinition(), CS_BINARY);
@@ -1015,9 +1015,17 @@
         return sourceClass;
     }
 
+    /*
+     * makeMemberDefinition method is left with rawtypes and with lint messages suppressed.
+     * The addition of Generics to com.sun.tools.* has uncovered an inconsistency
+     * in usage though tools still work correctly as long as this function is allowed to
+     * function as is.
+     */
+
     /**
      * Create a new field.
      */
+    @SuppressWarnings({"rawtypes","unchecked"})
     public MemberDefinition makeMemberDefinition(Environment origEnv, long where,
                                                ClassDefinition clazz,
                                                String doc, int modifiers,
--- a/jdk/src/share/classes/sun/tools/javac/BatchParser.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/tools/javac/BatchParser.java	Wed Jul 05 19:53:51 2017 +0200
@@ -56,7 +56,7 @@
     /**
      * The classes defined in this file
      */
-    protected Vector classes;
+    protected Vector<SourceClass> classes;
 
 
     /**
@@ -76,7 +76,7 @@
         super(env, in);
 
         imports = new Imports(env);
-        classes = new Vector();
+        classes = new Vector<>();
         toplevelEnv = imports.newEnvironment(env);
     }
 
--- a/jdk/src/share/classes/sun/tools/javac/CompilerMember.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/tools/javac/CompilerMember.java	Wed Jul 05 19:53:51 2017 +0200
@@ -38,7 +38,7 @@
  */
 @Deprecated
 final
-class CompilerMember implements Comparable {
+class CompilerMember implements Comparable<Object> {
     MemberDefinition field;
     Assembler asm;
     Object value;
--- a/jdk/src/share/classes/sun/tools/javac/Main.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/tools/javac/Main.java	Wed Jul 05 19:53:51 2017 +0200
@@ -212,7 +212,7 @@
 //end JCOV
         int flags = F_WARNINGS | F_DEBUG_LINES | F_DEBUG_SOURCE;
         long tm = System.currentTimeMillis();
-        Vector v = new Vector();
+        Vector<String> v = new Vector<>();
         boolean nowrite = false;
         String props = null;
         String encoding = null;
@@ -500,8 +500,8 @@
 
         try {
             // Parse all input files
-            for (Enumeration e = v.elements() ; e.hasMoreElements() ;) {
-                File file = new File((String)e.nextElement());
+            for (Enumeration<String> e = v.elements() ; e.hasMoreElements() ;) {
+                File file = new File(e.nextElement());
                 try {
                     env.parseFile(new ClassFile(file));
                 } catch (FileNotFoundException ee) {
@@ -512,8 +512,8 @@
 
             // Do a post-read check on all newly-parsed classes,
             // after they have all been read.
-            for (Enumeration e = env.getClasses() ; e.hasMoreElements() ; ) {
-                ClassDeclaration c = (ClassDeclaration)e.nextElement();
+            for (Enumeration<ClassDeclaration> e = env.getClasses() ; e.hasMoreElements() ; ) {
+                ClassDeclaration c = e.nextElement();
                 if (c.getStatus() == CS_PARSED) {
                     if (c.getClassDefinition().isLocal())
                         continue;
@@ -531,8 +531,8 @@
             do {
                 done = true;
                 env.flushErrors();
-                for (Enumeration e = env.getClasses() ; e.hasMoreElements() ; ) {
-                    ClassDeclaration c = (ClassDeclaration)e.nextElement();
+                for (Enumeration<ClassDeclaration> e = env.getClasses() ; e.hasMoreElements() ; ) {
+                    ClassDeclaration c = e.nextElement();
                     SourceClass src;
 
                     switch (c.getStatus()) {
--- a/jdk/src/share/classes/sun/tools/javac/SourceClass.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/tools/javac/SourceClass.java	Wed Jul 05 19:53:51 2017 +0200
@@ -70,7 +70,7 @@
    /**
      * The list of class dependencies
      */
-    Hashtable deps = new Hashtable(11);
+    Hashtable<ClassDeclaration, ClassDeclaration> deps = new Hashtable<>(11);
 
     /**
      * The field used to represent "this" in all of my code.
@@ -357,7 +357,7 @@
                     f.addModifiers(M_ABSTRACT);
                 }
             }
-            Vector arguments = f.getArguments();
+            Vector<MemberDefinition> arguments = f.getArguments();
             if (arguments != null) {
                 // arguments can be null if this is an implicit abstract method
                 int argumentLength = arguments.size();
@@ -921,9 +921,9 @@
             // Tell the user which methods force this class to be abstract.
 
             // First list all of the "unimplementable" abstract methods.
-            Iterator iter = getPermanentlyAbstractMethods();
+            Iterator<MemberDefinition> iter = getPermanentlyAbstractMethods();
             while (iter.hasNext()) {
-                MemberDefinition method = (MemberDefinition) iter.next();
+                MemberDefinition method = iter.next();
                 // We couldn't override this method even if we
                 // wanted to.  Try to make the error message
                 // as non-confusing as possible.
@@ -937,7 +937,7 @@
             while (iter.hasNext()) {
                 // For each method, check if it is abstract.  If it is,
                 // output an appropriate error message.
-                MemberDefinition method = (MemberDefinition) iter.next();
+                MemberDefinition method = iter.next();
                 if (method.isAbstract()) {
                     env.error(where, "abstract.class",
                               getClassDeclaration(), method,
@@ -1163,11 +1163,10 @@
      * sun/tools/java/ClassDeclaration.java
      */
     protected void addMirandaMethods(Environment env,
-                                     Iterator mirandas) {
+                                     Iterator<MemberDefinition> mirandas) {
 
         while(mirandas.hasNext()) {
-            MemberDefinition method =
-                (MemberDefinition)mirandas.next();
+            MemberDefinition method = mirandas.next();
 
             addMember(method);
 
@@ -2040,7 +2039,7 @@
      * is used to stop two compilations from saving the
      * same class.
      */
-    private static Vector active = new Vector();
+    private static Vector<Object> active = new Vector<>();
 
     /**
      * Compile this class
@@ -2082,9 +2081,9 @@
 
     protected void compileClass(Environment env, OutputStream out)
                 throws IOException, ClassNotFound {
-        Vector variables = new Vector();
-        Vector methods = new Vector();
-        Vector innerClasses = new Vector();
+        Vector<CompilerMember> variables = new Vector<>();
+        Vector<CompilerMember> methods = new Vector<>();
+        Vector<ClassDefinition> innerClasses = new Vector<>();
         CompilerMember init = new CompilerMember(new MemberDefinition(getWhere(), this, M_STATIC, Type.tMethod(Type.tVoid), idClassInit, null, null), new Assembler());
         Context ctx = new Context((Context)null, init.field);
 
@@ -2243,8 +2242,8 @@
             methods.setElementAt(ordered_methods[i], i);
 
         // Optimize Code and Collect method constants
-        for (Enumeration e = methods.elements() ; e.hasMoreElements() ; ) {
-            CompilerMember f = (CompilerMember)e.nextElement();
+        for (Enumeration<CompilerMember> e = methods.elements() ; e.hasMoreElements() ; ) {
+            CompilerMember f = e.nextElement();
             try {
                 f.asm.optimize(env);
                 f.asm.collect(env, f.field, tab);
@@ -2262,8 +2261,8 @@
         }
 
         // Collect field constants
-        for (Enumeration e = variables.elements() ; e.hasMoreElements() ; ) {
-            CompilerMember f = (CompilerMember)e.nextElement();
+        for (Enumeration<CompilerMember> e = variables.elements() ; e.hasMoreElements() ; ) {
+            CompilerMember f = e.nextElement();
             tab.put(f.name);
             tab.put(f.sig);
 
@@ -2274,9 +2273,9 @@
         }
 
         // Collect inner class constants
-        for (Enumeration e = innerClasses.elements();
+        for (Enumeration<ClassDefinition> e = innerClasses.elements();
              e.hasMoreElements() ; ) {
-            ClassDefinition inner = (ClassDefinition)e.nextElement();
+            ClassDefinition inner = e.nextElement();
             tab.put(inner.getClassDeclaration());
 
             // If the inner class is local, we do not need to add its
@@ -2368,8 +2367,8 @@
         DataOutputStream databuf = new DataOutputStream(buf);
 
         data.writeShort(variables.size());
-        for (Enumeration e = variables.elements() ; e.hasMoreElements() ; ) {
-            CompilerMember f = (CompilerMember)e.nextElement();
+        for (Enumeration<CompilerMember> e = variables.elements() ; e.hasMoreElements() ; ) {
+            CompilerMember f = e.nextElement();
             Object val = f.field.getInitialValue();
 
             data.writeShort(f.field.getModifiers() & MM_FIELD);
@@ -2400,8 +2399,8 @@
         // write methods
 
         data.writeShort(methods.size());
-        for (Enumeration e = methods.elements() ; e.hasMoreElements() ; ) {
-            CompilerMember f = (CompilerMember)e.nextElement();
+        for (Enumeration<CompilerMember> e = methods.elements() ; e.hasMoreElements() ; ) {
+            CompilerMember f = e.nextElement();
 
             int xmods = f.field.getModifiers() & MM_METHOD;
             // Transform floating point modifiers.  M_STRICTFP
@@ -2530,7 +2529,7 @@
             data.writeShort(tab.index("InnerClasses"));
             data.writeInt(2 + 2*4*innerClasses.size());
             data.writeShort(innerClasses.size());
-            for (Enumeration e = innerClasses.elements() ;
+            for (Enumeration<ClassDefinition> e = innerClasses.elements() ;
                  e.hasMoreElements() ; ) {
                 // For each inner class name transformation, we have a record
                 // with the following fields:
@@ -2549,7 +2548,7 @@
                 // See also the initInnerClasses() method in BinaryClass.java.
 
                 // Generate inner_class_info_index.
-                ClassDefinition inner = (ClassDefinition)e.nextElement();
+                ClassDefinition inner = e.nextElement();
                 data.writeShort(tab.index(inner.getClassDeclaration()));
 
                 // Generate outer_class_info_index.
@@ -2662,8 +2661,8 @@
             //  where className1 is the name of the class we are in, and
             //        classname2 is the name of the class className1
             //          is dependent on.
-            for(Enumeration e = deps.elements();  e.hasMoreElements(); ) {
-                ClassDeclaration data = (ClassDeclaration) e.nextElement();
+            for(Enumeration<ClassDeclaration> e = deps.elements();  e.hasMoreElements(); ) {
+                ClassDeclaration data = e.nextElement();
                 // Mangle name of class dependend on.
                 String depName =
                     Type.mangleInnerType(data.getName()).toString();
--- a/jdk/src/share/classes/sun/tools/javac/SourceMember.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/tools/javac/SourceMember.java	Wed Jul 05 19:53:51 2017 +0200
@@ -46,7 +46,7 @@
     /**
      * The argument names (if it is a method)
      */
-    Vector args;
+    Vector<MemberDefinition> args;
 
     // set to the MemberDefinition in the interface if we have this field because
     // it has been forced on us
@@ -64,7 +64,7 @@
     static final int INLINED    = 4;
     static final int ERROR      = 5;
 
-    public Vector getArguments() {
+    public Vector<MemberDefinition> getArguments() {
         return args;
     }
 
@@ -74,7 +74,7 @@
      */
     public SourceMember(long where, ClassDefinition clazz,
                        String doc, int modifiers, Type type,
-                       Identifier name, Vector argNames,
+                       Identifier name, Vector<MemberDefinition> argNames,
                        IdentifierToken exp[], Node value) {
         super(where, clazz, modifiers, type, name, exp, value);
         this.documentation = doc;
@@ -86,17 +86,17 @@
         }
     }
 
-    void createArgumentFields(Vector argNames) {
+    void createArgumentFields(Vector<MemberDefinition> argNames) {
         // Create a list of arguments
         if (isMethod()) {
-            args = new Vector();
+            args = new Vector<>();
 
             if (isConstructor() || !(isStatic() || isInitializer())) {
                 args.addElement(((SourceClass)clazz).getThisArgument());
             }
 
             if (argNames != null) {
-                Enumeration e = argNames.elements();
+                Enumeration<MemberDefinition> e = argNames.elements();
                 Type argTypes[] = getType().getArgumentTypes();
                 for (int i = 0 ; i < argTypes.length ; i++) {
                     Object x = e.nextElement();
@@ -359,7 +359,7 @@
             getExceptions(env);
 
             if (isMethod()) {
-                Vector argNames = args; args = null;
+                Vector<MemberDefinition> argNames = args; args = null;
                 createArgumentFields(argNames);
                 // Add outer instance argument for constructors.
                 if (isConstructor()) {
@@ -523,7 +523,7 @@
                     // initialize vset, indication that each of the arguments
                     // to the function has a value
 
-                    for (Enumeration e = args.elements(); e.hasMoreElements();){
+                    for (Enumeration<MemberDefinition> e = args.elements(); e.hasMoreElements();){
                         LocalMember f = (LocalMember)e.nextElement();
                         vset.addVar(ctx.declare(env, f));
                     }
@@ -549,7 +549,7 @@
                     //System.out.println("VSET = " + vset);
                     ClassDeclaration exp[] = getExceptions(env);
                     int htsize = (exp.length > 3) ? 17 : 7;
-                    Hashtable thrown = new Hashtable(htsize);
+                    Hashtable<Object, Object> thrown = new Hashtable<>(htsize);
 
                     vset = s.checkMethod(env, ctx, vset, thrown);
 
@@ -558,7 +558,7 @@
                     ClassDeclaration ignore2 =
                         env.getClassDeclaration(idJavaLangRuntimeException);
 
-                    for (Enumeration e = thrown.keys(); e.hasMoreElements();) {
+                    for (Enumeration<Object> e = thrown.keys(); e.hasMoreElements();) {
                         ClassDeclaration c = (ClassDeclaration)e.nextElement();
                         ClassDefinition def = c.getClassDefinition(env);
                         if (def.subClassOf(env, ignore1)
@@ -606,7 +606,7 @@
                         }
                     }
                 } else {
-                    Hashtable thrown = new Hashtable(3);  // small & throw-away
+                    Hashtable<Object, Object> thrown = new Hashtable<>(3);  // small & throw-away
                     Expression val = (Expression)getValue();
 
                     vset = val.checkInitializer(env, ctx, vset,
@@ -636,7 +636,7 @@
                     ClassDeclaration ignore2 =
                         env.getClassDeclaration(idJavaLangRuntimeException);
 
-                    for (Enumeration e = thrown.keys(); e.hasMoreElements(); ) {
+                    for (Enumeration<Object> e = thrown.keys(); e.hasMoreElements(); ) {
                         ClassDeclaration c = (ClassDeclaration)e.nextElement();
                         ClassDefinition def = c.getClassDefinition(env);
 
@@ -707,7 +707,7 @@
                 if ((!isNative()) && (!isAbstract())) {
                     Statement s = (Statement)getValue();
                     Context ctx = new Context((Context)null, this);
-                    for (Enumeration e = args.elements() ; e.hasMoreElements() ;) {
+                    for (Enumeration<MemberDefinition> e = args.elements() ; e.hasMoreElements() ;) {
                         LocalMember local = (LocalMember)e.nextElement();
                         ctx.declare(env, local);
                     }
@@ -812,7 +812,7 @@
                 Context ctx = new Context((Context)null, this);
                 Statement s = (Statement)getValue();
 
-                for (Enumeration e = args.elements() ; e.hasMoreElements() ; ) {
+                for (Enumeration<MemberDefinition> e = args.elements() ; e.hasMoreElements() ; ) {
                     LocalMember f = (LocalMember)e.nextElement();
                     ctx.declare(env, f);
                     //ctx.declare(env, (LocalMember)e.nextElement());
--- a/jdk/src/share/classes/sun/tools/tree/AndExpression.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/tools/tree/AndExpression.java	Wed Jul 05 19:53:51 2017 +0200
@@ -54,7 +54,7 @@
      *        either the left or right hand side is false
      */
     public void checkCondition(Environment env, Context ctx, Vset vset,
-                               Hashtable exp, ConditionVars cvars) {
+                               Hashtable<Object, Object> exp, ConditionVars cvars) {
         // Find out when the left side is true/false
         left.checkCondition(env, ctx, vset, exp, cvars);
         left = convert(env, ctx, Type.tBoolean, left);
--- a/jdk/src/share/classes/sun/tools/tree/ArrayAccessExpression.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/tools/tree/ArrayAccessExpression.java	Wed Jul 05 19:53:51 2017 +0200
@@ -62,7 +62,7 @@
     /**
      * Check expression type
      */
-    public Vset checkValue(Environment env, Context ctx, Vset vset, Hashtable exp) {
+    public Vset checkValue(Environment env, Context ctx, Vset vset, Hashtable<Object, Object> exp) {
         vset = right.checkValue(env, ctx, vset, exp);
         if (index == null) {
             env.error(where, "array.index.required");
@@ -83,7 +83,7 @@
     }
 
     public Vset checkAmbigName(Environment env, Context ctx,
-                               Vset vset, Hashtable exp,
+                               Vset vset, Hashtable<Object, Object> exp,
                                UnaryExpression loc) {
         if (index == null) {
             vset = right.checkAmbigName(env, ctx, vset, exp, this);
@@ -109,7 +109,7 @@
      * Check the array if it appears on the LHS of an assignment
      */
     public Vset checkLHS(Environment env, Context ctx,
-                         Vset vset, Hashtable exp) {
+                         Vset vset, Hashtable<Object, Object> exp) {
         return checkValue(env, ctx, vset, exp);
     }
 
@@ -117,7 +117,7 @@
      * Check the array if it appears on the LHS of an op= expression
      */
     public Vset checkAssignOp(Environment env, Context ctx,
-                              Vset vset, Hashtable exp, Expression outside) {
+                              Vset vset, Hashtable<Object, Object> exp, Expression outside) {
         return checkValue(env, ctx, vset, exp);
     }
 
--- a/jdk/src/share/classes/sun/tools/tree/ArrayExpression.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/tools/tree/ArrayExpression.java	Wed Jul 05 19:53:51 2017 +0200
@@ -47,11 +47,11 @@
     /**
      * Check expression type
      */
-    public Vset checkValue(Environment env, Context ctx, Vset vset, Hashtable exp) {
+    public Vset checkValue(Environment env, Context ctx, Vset vset, Hashtable<Object, Object> exp) {
         env.error(where, "invalid.array.expr");
         return vset;
     }
-    public Vset checkInitializer(Environment env, Context ctx, Vset vset, Type t, Hashtable exp) {
+    public Vset checkInitializer(Environment env, Context ctx, Vset vset, Type t, Hashtable<Object, Object> exp) {
         if (!t.isType(TC_ARRAY)) {
             if (!t.isType(TC_ERROR)) {
                 env.error(where, "invalid.array.init", t);
--- a/jdk/src/share/classes/sun/tools/tree/AssignExpression.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/tools/tree/AssignExpression.java	Wed Jul 05 19:53:51 2017 +0200
@@ -50,7 +50,7 @@
     /**
      * Check an assignment expression
      */
-    public Vset checkValue(Environment env, Context ctx, Vset vset, Hashtable exp) {
+    public Vset checkValue(Environment env, Context ctx, Vset vset, Hashtable<Object, Object> exp) {
         if (left instanceof IdentifierExpression) {
             // we don't want to mark an identifier as having a value
             // until having evaluated the right-hand side
--- a/jdk/src/share/classes/sun/tools/tree/AssignOpExpression.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/tools/tree/AssignOpExpression.java	Wed Jul 05 19:53:51 2017 +0200
@@ -149,7 +149,7 @@
     /**
      * Check an assignment expression
      */
-    public Vset checkValue(Environment env, Context ctx, Vset vset, Hashtable exp) {
+    public Vset checkValue(Environment env, Context ctx, Vset vset, Hashtable<Object, Object> exp) {
         vset = left.checkAssignOp(env, ctx, vset, exp, this);
         vset = right.checkValue(env, ctx, vset, exp);
         int tm = left.type.getTypeMask() | right.type.getTypeMask();
--- a/jdk/src/share/classes/sun/tools/tree/BinaryAssignExpression.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/tools/tree/BinaryAssignExpression.java	Wed Jul 05 19:53:51 2017 +0200
@@ -67,7 +67,7 @@
     /**
      * Check void expression
      */
-    public Vset check(Environment env, Context ctx, Vset vset, Hashtable exp) {
+    public Vset check(Environment env, Context ctx, Vset vset, Hashtable<Object,Object> exp) {
         return checkValue(env, ctx, vset, exp);
     }
 
--- a/jdk/src/share/classes/sun/tools/tree/BinaryExpression.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/tools/tree/BinaryExpression.java	Wed Jul 05 19:53:51 2017 +0200
@@ -64,7 +64,7 @@
     /**
      * Check a binary expression
      */
-    public Vset checkValue(Environment env, Context ctx, Vset vset, Hashtable exp) {
+    public Vset checkValue(Environment env, Context ctx, Vset vset, Hashtable<Object, Object> exp) {
         vset = left.checkValue(env, ctx, vset, exp);
         vset = right.checkValue(env, ctx, vset, exp);
 
--- a/jdk/src/share/classes/sun/tools/tree/BinaryLogicalExpression.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/tools/tree/BinaryLogicalExpression.java	Wed Jul 05 19:53:51 2017 +0200
@@ -46,7 +46,7 @@
      * Check a binary expression
      */
     public Vset checkValue(Environment env, Context ctx,
-                           Vset vset, Hashtable exp) {
+                           Vset vset, Hashtable<Object, Object> exp) {
         ConditionVars cvars = new ConditionVars();
         // evaluate the logical expression, determining which variables are
         // set if the resulting value is true or false
@@ -61,7 +61,7 @@
      */
     abstract
     public void checkCondition(Environment env, Context ctx, Vset vset,
-                               Hashtable exp, ConditionVars cvars);
+                               Hashtable<Object, Object> exp, ConditionVars cvars);
 
 
     /**
--- a/jdk/src/share/classes/sun/tools/tree/BooleanExpression.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/tools/tree/BooleanExpression.java	Wed Jul 05 19:53:51 2017 +0200
@@ -86,7 +86,7 @@
      */
 
     public void checkCondition(Environment env, Context ctx,
-                               Vset vset, Hashtable exp, ConditionVars cvars) {
+                               Vset vset, Hashtable<Object, Object> exp, ConditionVars cvars) {
         if (value) {
             cvars.vsFalse = Vset.DEAD_END;
             cvars.vsTrue = vset;
--- a/jdk/src/share/classes/sun/tools/tree/BreakStatement.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/tools/tree/BreakStatement.java	Wed Jul 05 19:53:51 2017 +0200
@@ -51,7 +51,7 @@
     /**
      * Check statement
      */
-    Vset check(Environment env, Context ctx, Vset vset, Hashtable exp) {
+    Vset check(Environment env, Context ctx, Vset vset, Hashtable<Object, Object> exp) {
         reach(env, vset);
         checkLabel(env, ctx);
         CheckContext destctx = (CheckContext)new CheckContext(ctx, this).getBreakContext(lbl);
--- a/jdk/src/share/classes/sun/tools/tree/CaseStatement.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/tools/tree/CaseStatement.java	Wed Jul 05 19:53:51 2017 +0200
@@ -49,7 +49,7 @@
     /**
      * Check statement
      */
-    Vset check(Environment env, Context ctx, Vset vset, Hashtable exp) {
+    Vset check(Environment env, Context ctx, Vset vset, Hashtable<Object, Object> exp) {
         if (expr != null) {
             expr.checkValue(env, ctx, vset, exp);
             expr = convert(env, ctx, Type.tInt, expr);
--- a/jdk/src/share/classes/sun/tools/tree/CastExpression.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/tools/tree/CastExpression.java	Wed Jul 05 19:53:51 2017 +0200
@@ -48,7 +48,7 @@
     /**
      * Check the expression
      */
-    public Vset checkValue(Environment env, Context ctx, Vset vset, Hashtable exp) {
+    public Vset checkValue(Environment env, Context ctx, Vset vset, Hashtable<Object, Object> exp) {
         type = left.toType(env, ctx);
         vset = right.checkValue(env, ctx, vset, exp);
 
--- a/jdk/src/share/classes/sun/tools/tree/CatchStatement.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/tools/tree/CatchStatement.java	Wed Jul 05 19:53:51 2017 +0200
@@ -67,7 +67,7 @@
     /**
      * Check statement
      */
-    Vset check(Environment env, Context ctx, Vset vset, Hashtable exp) {
+    Vset check(Environment env, Context ctx, Vset vset, Hashtable<Object, Object> exp) {
         vset = reach(env, vset);
         ctx = new Context(ctx, this);
         Type type = texpr.toType(env, ctx);
--- a/jdk/src/share/classes/sun/tools/tree/CommaExpression.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/tools/tree/CommaExpression.java	Wed Jul 05 19:53:51 2017 +0200
@@ -46,7 +46,7 @@
     /**
      * Check void expression
      */
-    public Vset check(Environment env, Context ctx, Vset vset, Hashtable exp) {
+    public Vset check(Environment env, Context ctx, Vset vset, Hashtable<Object, Object> exp) {
         vset = left.check(env, ctx, vset, exp);
         vset = right.check(env, ctx, vset, exp);
         return vset;
--- a/jdk/src/share/classes/sun/tools/tree/CompoundStatement.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/tools/tree/CompoundStatement.java	Wed Jul 05 19:53:51 2017 +0200
@@ -70,7 +70,7 @@
     /**
      * Check statement
      */
-    Vset check(Environment env, Context ctx, Vset vset, Hashtable exp) {
+    Vset check(Environment env, Context ctx, Vset vset, Hashtable<Object, Object> exp) {
         checkLabel(env, ctx);
         if (args.length > 0) {
             vset = reach(env, vset);
--- a/jdk/src/share/classes/sun/tools/tree/ConditionalExpression.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/tools/tree/ConditionalExpression.java	Wed Jul 05 19:53:51 2017 +0200
@@ -64,7 +64,7 @@
     /**
      * Check the expression
      */
-    public Vset checkValue(Environment env, Context ctx, Vset vset, Hashtable exp) {
+    public Vset checkValue(Environment env, Context ctx, Vset vset, Hashtable<Object, Object> exp) {
         ConditionVars cvars = cond.checkCondition(env, ctx, vset, exp);
         vset = left.checkValue(env, ctx, cvars.vsTrue, exp).join(
                right.checkValue(env, ctx, cvars.vsFalse, exp) );
@@ -107,7 +107,7 @@
         return vset;
     }
 
-    public Vset check(Environment env, Context ctx, Vset vset, Hashtable exp) {
+    public Vset check(Environment env, Context ctx, Vset vset, Hashtable<Object, Object> exp) {
         vset = cond.checkValue(env, ctx, vset, exp);
         cond = convert(env, ctx, Type.tBoolean, cond);
         return left.check(env, ctx, vset.copy(), exp).join(right.check(env, ctx, vset, exp));
--- a/jdk/src/share/classes/sun/tools/tree/ContinueStatement.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/tools/tree/ContinueStatement.java	Wed Jul 05 19:53:51 2017 +0200
@@ -52,7 +52,7 @@
      * Check statement
      */
 
-    Vset check(Environment env, Context ctx, Vset vset, Hashtable exp) {
+    Vset check(Environment env, Context ctx, Vset vset, Hashtable<Object, Object> exp) {
         checkLabel(env, ctx);
         reach(env, vset);
         // A new context is established here because the 'continue' statement
--- a/jdk/src/share/classes/sun/tools/tree/ConvertExpression.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/tools/tree/ConvertExpression.java	Wed Jul 05 19:53:51 2017 +0200
@@ -47,7 +47,7 @@
     /**
      * Check the value
      */
-    public Vset checkValue(Environment env, Context ctx, Vset vset, Hashtable exp) {
+    public Vset checkValue(Environment env, Context ctx, Vset vset, Hashtable<Object, Object> exp) {
         return right.checkValue(env, ctx, vset, exp);
     }
 
--- a/jdk/src/share/classes/sun/tools/tree/DeclarationStatement.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/tools/tree/DeclarationStatement.java	Wed Jul 05 19:53:51 2017 +0200
@@ -55,11 +55,11 @@
      * Check statement
      * Report an error unless the call is checkBlockStatement.
      */
-    Vset check(Environment env, Context ctx, Vset vset, Hashtable exp) {
+    Vset check(Environment env, Context ctx, Vset vset, Hashtable<Object, Object> exp) {
         env.error(where, "invalid.decl");
         return checkBlockStatement(env, ctx, vset, exp);
     }
-    Vset checkBlockStatement(Environment env, Context ctx, Vset vset, Hashtable exp) {
+    Vset checkBlockStatement(Environment env, Context ctx, Vset vset, Hashtable<Object, Object> exp) {
         if (labels != null) {
             env.error(where, "declaration.with.label", labels[0]);
         }
--- a/jdk/src/share/classes/sun/tools/tree/DoStatement.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/tools/tree/DoStatement.java	Wed Jul 05 19:53:51 2017 +0200
@@ -53,7 +53,7 @@
     /**
      * Check statement
      */
-    Vset check(Environment env, Context ctx, Vset vset, Hashtable exp) {
+    Vset check(Environment env, Context ctx, Vset vset, Hashtable<Object, Object> exp) {
         checkLabel(env,ctx);
         CheckContext newctx = new CheckContext(ctx, this);
         // remember what was unassigned on entry
--- a/jdk/src/share/classes/sun/tools/tree/ExprExpression.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/tools/tree/ExprExpression.java	Wed Jul 05 19:53:51 2017 +0200
@@ -49,7 +49,7 @@
      * Check a condition.  We must pass it on to our unparenthesised form.
      */
     public void checkCondition(Environment env, Context ctx, Vset vset,
-                               Hashtable exp, ConditionVars cvars) {
+                               Hashtable<Object, Object> exp, ConditionVars cvars) {
         right.checkCondition(env, ctx, vset, exp, cvars);
         type = right.type;
     }
@@ -60,7 +60,7 @@
      * (Part of fix for 4090372)
      */
     public Vset checkAssignOp(Environment env, Context ctx,
-                              Vset vset, Hashtable exp, Expression outside) {
+                              Vset vset, Hashtable<Object, Object> exp, Expression outside) {
         vset = right.checkAssignOp(env, ctx, vset, exp, outside);
         type = right.type;
         return vset;
@@ -80,7 +80,7 @@
     // going to clammer for this one.
     //
     // public Vset checkLHS(Environment env, Context ctx,
-    //     Vset vset, Hashtable exp) {
+    //     Vset vset, Hashtable<Object, Object> exp) {
     //     vset = right.check(env, ctx, vset, exp);
     //     type = right.type;
     //     return vset;
--- a/jdk/src/share/classes/sun/tools/tree/Expression.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/tools/tree/Expression.java	Wed Jul 05 19:53:51 2017 +0200
@@ -192,18 +192,18 @@
     /**
      * Check an expression
      */
-    public Vset checkValue(Environment env, Context ctx, Vset vset, Hashtable exp) {
+    public Vset checkValue(Environment env, Context ctx, Vset vset, Hashtable<Object, Object> exp) {
         return vset;
     }
-    public Vset checkInitializer(Environment env, Context ctx, Vset vset, Type t, Hashtable exp) {
+    public Vset checkInitializer(Environment env, Context ctx, Vset vset, Type t, Hashtable<Object, Object> exp) {
         return checkValue(env, ctx, vset, exp);
     }
-    public Vset check(Environment env, Context ctx, Vset vset, Hashtable exp) {
+    public Vset check(Environment env, Context ctx, Vset vset, Hashtable<Object, Object> exp) {
         throw new CompilerError("check failed");
     }
 
     public Vset checkLHS(Environment env, Context ctx,
-                            Vset vset, Hashtable exp) {
+                            Vset vset, Hashtable<Object, Object> exp) {
         env.error(where, "invalid.lhs.assignment");
         type = Type.tError;
         return vset;
@@ -243,7 +243,7 @@
     }
 
     public Vset checkAssignOp(Environment env, Context ctx,
-                              Vset vset, Hashtable exp, Expression outside) {
+                              Vset vset, Hashtable<Object, Object> exp, Expression outside) {
         if (outside instanceof IncDecExpression)
             env.error(where, "invalid.arg", opNames[outside.op]);
         else
@@ -266,7 +266,7 @@
      * and act appropriately to verify the full package name.
      * @arg loc the expression containing the ambiguous expression
      */
-    public Vset checkAmbigName(Environment env, Context ctx, Vset vset, Hashtable exp,
+    public Vset checkAmbigName(Environment env, Context ctx, Vset vset, Hashtable<Object, Object> exp,
                                UnaryExpression loc) {
         return checkValue(env, ctx, vset, exp);
     }
@@ -277,7 +277,7 @@
      * the condition is false.
      */
     public ConditionVars checkCondition(Environment env, Context ctx,
-                                        Vset vset, Hashtable exp) {
+                                        Vset vset, Hashtable<Object, Object> exp) {
         ConditionVars cvars = new ConditionVars();
         checkCondition(env, ctx, vset, exp, cvars);
         return cvars;
@@ -295,7 +295,7 @@
      */
 
     public void checkCondition(Environment env, Context ctx,
-                               Vset vset, Hashtable exp, ConditionVars cvars) {
+                               Vset vset, Hashtable<Object, Object> exp, ConditionVars cvars) {
         cvars.vsTrue = cvars.vsFalse = checkValue(env, ctx, vset, exp);
         // unshare side effects:
         cvars.vsFalse = cvars.vsFalse.copy();
--- a/jdk/src/share/classes/sun/tools/tree/ExpressionStatement.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/tools/tree/ExpressionStatement.java	Wed Jul 05 19:53:51 2017 +0200
@@ -50,7 +50,7 @@
     /**
      * Check statement
      */
-    Vset check(Environment env, Context ctx, Vset vset, Hashtable exp) {
+    Vset check(Environment env, Context ctx, Vset vset, Hashtable<Object, Object> exp) {
         checkLabel(env, ctx);
         return expr.check(env, ctx, reach(env, vset), exp);
     }
--- a/jdk/src/share/classes/sun/tools/tree/FieldExpression.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/tools/tree/FieldExpression.java	Wed Jul 05 19:53:51 2017 +0200
@@ -219,7 +219,7 @@
      */
 
     public Vset checkAmbigName(Environment env, Context ctx,
-                               Vset vset, Hashtable exp,
+                               Vset vset, Hashtable<Object, Object> exp,
                                UnaryExpression loc) {
         if (id == idThis || id == idClass) {
             loc = null;         // this cannot be a type or package
@@ -232,7 +232,7 @@
      */
 
     public Vset checkValue(Environment env, Context ctx,
-                           Vset vset, Hashtable exp) {
+                           Vset vset, Hashtable<Object, Object> exp) {
         vset = checkCommon(env, ctx, vset, exp, null, false);
         if (id == idSuper && type != Type.tError) {
             // "super" is not allowed in this context.
@@ -416,7 +416,7 @@
      */
 
     private Vset checkCommon(Environment env, Context ctx,
-                             Vset vset, Hashtable exp,
+                             Vset vset, Hashtable<Object, Object> exp,
                              UnaryExpression loc, boolean isLHS) {
 
         // Handle class literal, e.g., 'x.class'.
@@ -850,7 +850,7 @@
      * Finish checking it.
      */
     private Vset checkInnerClass(Environment env, Context ctx,
-                                 Vset vset, Hashtable exp,
+                                 Vset vset, Hashtable<Object, Object> exp,
                                  UnaryExpression loc) {
         ClassDefinition inner = field.getInnerClass();
         type = inner.getType();
@@ -903,7 +903,7 @@
      * Check the expression if it appears on the LHS of an assignment
      */
     public Vset checkLHS(Environment env, Context ctx,
-                         Vset vset, Hashtable exp) {
+                         Vset vset, Hashtable<Object, Object> exp) {
         boolean hadField = (field != null);
 
         //checkValue(env, ctx, vset, exp);
@@ -945,7 +945,7 @@
      * Check the expression if it appears on the LHS of an op= expression
      */
     public Vset checkAssignOp(Environment env, Context ctx,
-                              Vset vset, Hashtable exp, Expression outside) {
+                              Vset vset, Hashtable<Object, Object> exp, Expression outside) {
 
         //checkValue(env, ctx, vset, exp);
         checkCommon(env, ctx, vset, exp, null, true);
--- a/jdk/src/share/classes/sun/tools/tree/FinallyStatement.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/tools/tree/FinallyStatement.java	Wed Jul 05 19:53:51 2017 +0200
@@ -68,9 +68,9 @@
     /**
      * Check statement
      */
-    Vset check(Environment env, Context ctx, Vset vset, Hashtable exp) {
+    Vset check(Environment env, Context ctx, Vset vset, Hashtable<Object, Object> exp) {
         vset = reach(env, vset);
-        Hashtable newexp = new Hashtable();
+        Hashtable<Object, Object> newexp = new Hashtable<>();
 
         // Handle the proposed 'try (init) { stmts } finally { stmts }' syntax.
         // This feature has not been adopted, and support is presently disabled.
@@ -182,7 +182,7 @@
         // generated by the body into exp.
         if (finallyCanFinish) {
             // Add newexp's back into exp; cf. ThrowStatement.check().
-            for (Enumeration e = newexp.keys() ; e.hasMoreElements() ; ) {
+            for (Enumeration<?> e = newexp.keys() ; e.hasMoreElements() ; ) {
                 Object def = e.nextElement();
                 exp.put(def, newexp.get(def));
             }
--- a/jdk/src/share/classes/sun/tools/tree/ForStatement.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/tools/tree/ForStatement.java	Wed Jul 05 19:53:51 2017 +0200
@@ -57,7 +57,7 @@
     /**
      * Check statement
      */
-    Vset check(Environment env, Context ctx, Vset vset, Hashtable exp) {
+    Vset check(Environment env, Context ctx, Vset vset, Hashtable<Object, Object> exp) {
         checkLabel(env, ctx);
         vset = reach(env, vset);
         Context initctx = new Context(ctx, this);
--- a/jdk/src/share/classes/sun/tools/tree/IdentifierExpression.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/tools/tree/IdentifierExpression.java	Wed Jul 05 19:53:51 2017 +0200
@@ -231,7 +231,7 @@
     /**
      * Check expression
      */
-    public Vset checkValue(Environment env, Context ctx, Vset vset, Hashtable exp) {
+    public Vset checkValue(Environment env, Context ctx, Vset vset, Hashtable<Object, Object> exp) {
         if (field != null) {
             // An internally pre-set field, such as an argument copying
             // an uplevel value.  Do not re-check it.
@@ -250,7 +250,7 @@
      * Check the expression if it appears on the LHS of an assignment
      */
     public Vset checkLHS(Environment env, Context ctx,
-                         Vset vset, Hashtable exp) {
+                         Vset vset, Hashtable<Object, Object> exp) {
         if (!bind(env, ctx))
             return vset;
         vset = assign(env, ctx, vset);
@@ -263,7 +263,7 @@
      * Check the expression if it appears on the LHS of an op= expression
      */
     public Vset checkAssignOp(Environment env, Context ctx,
-                              Vset vset, Hashtable exp, Expression outside) {
+                              Vset vset, Hashtable<Object, Object> exp, Expression outside) {
         if (!bind(env, ctx))
             return vset;
         vset = assign(env, ctx, get(env, ctx, vset));
@@ -293,7 +293,7 @@
     /**
      * Check if the present name is part of a scoping prefix.
      */
-    public Vset checkAmbigName(Environment env, Context ctx, Vset vset, Hashtable exp,
+    public Vset checkAmbigName(Environment env, Context ctx, Vset vset, Hashtable<Object, Object> exp,
                                UnaryExpression loc) {
         try {
             if (ctx.getField(env, id) != null) {
@@ -474,4 +474,4 @@
             implementation.print(out);
         }
     }
-}
\ No newline at end of file
+}
--- a/jdk/src/share/classes/sun/tools/tree/IfStatement.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/tools/tree/IfStatement.java	Wed Jul 05 19:53:51 2017 +0200
@@ -55,7 +55,7 @@
     /**
      * Check statement
      */
-    Vset check(Environment env, Context ctx, Vset vset, Hashtable exp) {
+    Vset check(Environment env, Context ctx, Vset vset, Hashtable<Object, Object> exp) {
         checkLabel(env, ctx);
         CheckContext newctx = new CheckContext(ctx, this);
         // Vset vsExtra = vset.copy();  // See comment below.
--- a/jdk/src/share/classes/sun/tools/tree/IncDecExpression.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/tools/tree/IncDecExpression.java	Wed Jul 05 19:53:51 2017 +0200
@@ -49,7 +49,7 @@
     /**
      * Check an increment or decrement expression
      */
-    public Vset checkValue(Environment env, Context ctx, Vset vset, Hashtable exp) {
+    public Vset checkValue(Environment env, Context ctx, Vset vset, Hashtable<Object, Object> exp) {
         vset = right.checkAssignOp(env, ctx, vset, exp, this);
         if (right.type.inMask(TM_NUMBER)) {
             type = right.type;
@@ -66,7 +66,7 @@
     /**
      * Check void expression
      */
-    public Vset check(Environment env, Context ctx, Vset vset, Hashtable exp) {
+    public Vset check(Environment env, Context ctx, Vset vset, Hashtable<Object, Object> exp) {
         return checkValue(env, ctx, vset, exp);
     }
 
--- a/jdk/src/share/classes/sun/tools/tree/InstanceOfExpression.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/tools/tree/InstanceOfExpression.java	Wed Jul 05 19:53:51 2017 +0200
@@ -48,7 +48,7 @@
     /**
      * Check the expression
      */
-    public Vset checkValue(Environment env, Context ctx, Vset vset, Hashtable exp) {
+    public Vset checkValue(Environment env, Context ctx, Vset vset, Hashtable<Object, Object> exp) {
         vset = left.checkValue(env, ctx, vset, exp);
         right = new TypeExpression(right.where, right.toType(env, ctx));
 
--- a/jdk/src/share/classes/sun/tools/tree/LengthExpression.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/tools/tree/LengthExpression.java	Wed Jul 05 19:53:51 2017 +0200
@@ -46,7 +46,7 @@
     /**
      * Select the type of the expression
      */
-    public Vset checkValue(Environment env, Context ctx, Vset vset, Hashtable exp) {
+    public Vset checkValue(Environment env, Context ctx, Vset vset, Hashtable<Object, Object> exp) {
         vset = right.checkValue(env, ctx, vset, exp);
         if (!right.type.isType(TC_ARRAY)) {
             env.error(where, "invalid.length", right.type);
--- a/jdk/src/share/classes/sun/tools/tree/LocalMember.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/tools/tree/LocalMember.java	Wed Jul 05 19:53:51 2017 +0200
@@ -163,7 +163,7 @@
      * May inline copies of all the arguments of the given method.
      */
     static public LocalMember[] copyArguments(Context ctx, MemberDefinition field) {
-        Vector v = field.getArguments();
+        Vector<MemberDefinition> v = field.getArguments();
         LocalMember res[] = new LocalMember[v.size()];
         v.copyInto(res);
         for (int i = 0; i < res.length; i++) {
--- a/jdk/src/share/classes/sun/tools/tree/MethodExpression.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/tools/tree/MethodExpression.java	Wed Jul 05 19:53:51 2017 +0200
@@ -78,7 +78,7 @@
     /**
      * Check expression type
      */
-    public Vset checkValue(Environment env, Context ctx, Vset vset, Hashtable exp) {
+    public Vset checkValue(Environment env, Context ctx, Vset vset, Hashtable<Object, Object> exp) {
         ClassDeclaration c = null;
         boolean isArray = false;
         boolean staticRef = false;
@@ -587,7 +587,7 @@
     /**
      * Check void expression
      */
-    public Vset check(Environment env, Context ctx, Vset vset, Hashtable exp) {
+    public Vset check(Environment env, Context ctx, Vset vset, Hashtable<Object, Object> exp) {
         return checkValue(env, ctx, vset, exp);
     }
 
--- a/jdk/src/share/classes/sun/tools/tree/NewArrayExpression.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/tools/tree/NewArrayExpression.java	Wed Jul 05 19:53:51 2017 +0200
@@ -55,7 +55,7 @@
     /**
      * Check
      */
-    public Vset checkValue(Environment env, Context ctx, Vset vset, Hashtable exp) {
+    public Vset checkValue(Environment env, Context ctx, Vset vset, Hashtable<Object, Object> exp) {
         type = right.toType(env, ctx);
 
         boolean flag = (init != null);  // flag says that dims are forbidden
--- a/jdk/src/share/classes/sun/tools/tree/NewInstanceExpression.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/tools/tree/NewInstanceExpression.java	Wed Jul 05 19:53:51 2017 +0200
@@ -83,7 +83,7 @@
     /**
      * Check expression type
      */
-    public Vset checkValue(Environment env, Context ctx, Vset vset, Hashtable exp) {
+    public Vset checkValue(Environment env, Context ctx, Vset vset, Hashtable<Object, Object> exp) {
         // What type?
         ClassDefinition def = null;
 
@@ -366,7 +366,7 @@
     /**
      * Check void expression
      */
-    public Vset check(Environment env, Context ctx, Vset vset, Hashtable exp) {
+    public Vset check(Environment env, Context ctx, Vset vset, Hashtable<Object, Object> exp) {
         return checkValue(env, ctx, vset, exp);
     }
 
--- a/jdk/src/share/classes/sun/tools/tree/NotExpression.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/tools/tree/NotExpression.java	Wed Jul 05 19:53:51 2017 +0200
@@ -65,7 +65,7 @@
      */
 
     public void checkCondition(Environment env, Context ctx, Vset vset,
-                               Hashtable exp, ConditionVars cvars) {
+                               Hashtable<Object, Object> exp, ConditionVars cvars) {
         right.checkCondition(env, ctx, vset, exp, cvars);
         right = convert(env, ctx, Type.tBoolean, right);
         // swap true and false
--- a/jdk/src/share/classes/sun/tools/tree/OrExpression.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/tools/tree/OrExpression.java	Wed Jul 05 19:53:51 2017 +0200
@@ -54,7 +54,7 @@
      *        both the left or right hand side are false
      */
     public void checkCondition(Environment env, Context ctx, Vset vset,
-                               Hashtable exp, ConditionVars cvars) {
+                               Hashtable<Object, Object> exp, ConditionVars cvars) {
         // Find out when the left side is true/false
         left.checkCondition(env, ctx, vset, exp, cvars);
         left = convert(env, ctx, Type.tBoolean, left);
--- a/jdk/src/share/classes/sun/tools/tree/ReturnStatement.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/tools/tree/ReturnStatement.java	Wed Jul 05 19:53:51 2017 +0200
@@ -51,7 +51,7 @@
     /**
      * Check statement
      */
-    Vset check(Environment env, Context ctx, Vset vset, Hashtable exp) {
+    Vset check(Environment env, Context ctx, Vset vset, Hashtable<Object, Object> exp) {
         checkLabel(env, ctx);
         vset = reach(env, vset);
         if (expr != null) {
--- a/jdk/src/share/classes/sun/tools/tree/Statement.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/tools/tree/Statement.java	Wed Jul 05 19:53:51 2017 +0200
@@ -100,7 +100,7 @@
     /**
      * Check a statement
      */
-    public Vset checkMethod(Environment env, Context ctx, Vset vset, Hashtable exp) {
+    public Vset checkMethod(Environment env, Context ctx, Vset vset, Hashtable<Object, Object> exp) {
         // Set up ctx.getReturnContext() for the sake of ReturnStatement.check().
         CheckContext mctx = new CheckContext(ctx, new Statement(METHOD, 0));
         ctx = mctx;
@@ -130,7 +130,7 @@
 
         return vset;
     }
-    Vset checkDeclaration(Environment env, Context ctx, Vset vset, int mod, Type t, Hashtable exp) {
+    Vset checkDeclaration(Environment env, Context ctx, Vset vset, int mod, Type t, Hashtable<Object, Object> exp) {
         throw new CompilerError("checkDeclaration");
     }
 
@@ -164,12 +164,12 @@
         }
     }
 
-    Vset check(Environment env, Context ctx, Vset vset, Hashtable exp) {
+    Vset check(Environment env, Context ctx, Vset vset, Hashtable<Object, Object> exp) {
         throw new CompilerError("check");
     }
 
     /** This is called in contexts where declarations are valid. */
-    Vset checkBlockStatement(Environment env, Context ctx, Vset vset, Hashtable exp) {
+    Vset checkBlockStatement(Environment env, Context ctx, Vset vset, Hashtable<Object, Object> exp) {
         return check(env, ctx, vset, exp);
     }
 
--- a/jdk/src/share/classes/sun/tools/tree/SuperExpression.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/tools/tree/SuperExpression.java	Wed Jul 05 19:53:51 2017 +0200
@@ -61,7 +61,7 @@
     /**
      * Check expression
      */
-    public Vset checkValue(Environment env, Context ctx, Vset vset, Hashtable exp) {
+    public Vset checkValue(Environment env, Context ctx, Vset vset, Hashtable<Object, Object> exp) {
         vset = checkCommon(env, ctx, vset, exp);
         if (type != Type.tError) {
             // "super" is not allowed in this context:
@@ -74,13 +74,13 @@
      * Check if the present name is part of a scoping prefix.
      */
     public Vset checkAmbigName(Environment env, Context ctx,
-                               Vset vset, Hashtable exp,
+                               Vset vset, Hashtable<Object, Object> exp,
                                UnaryExpression loc) {
         return checkCommon(env, ctx, vset, exp);
     }
 
     /** Common code for checkValue and checkAmbigName */
-    private Vset checkCommon(Environment env, Context ctx, Vset vset, Hashtable exp) {
+    private Vset checkCommon(Environment env, Context ctx, Vset vset, Hashtable<Object, Object> exp) {
         ClassDeclaration superClass = ctx.field.getClassDefinition().getSuperClass();
         if (superClass == null) {
             env.error(where, "undef.var", idSuper);
--- a/jdk/src/share/classes/sun/tools/tree/SwitchStatement.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/tools/tree/SwitchStatement.java	Wed Jul 05 19:53:51 2017 +0200
@@ -54,7 +54,7 @@
     /**
      * Check statement
      */
-    Vset check(Environment env, Context ctx, Vset vset, Hashtable exp) {
+    Vset check(Environment env, Context ctx, Vset vset, Hashtable<Object, Object> exp) {
         checkLabel(env, ctx);
         CheckContext newctx = new CheckContext(ctx, this);
         vset = expr.checkValue(env, newctx, reach(env, vset), exp);
@@ -62,7 +62,7 @@
 
         expr = convert(env, newctx, Type.tInt, expr);
 
-        Hashtable tab = new Hashtable();
+        Hashtable<Expression, Statement> tab = new Hashtable<>();
         boolean hasDefault = false;
         // Note that vs is reset to vset.copy() on every case label.
         // If the first substatement is not a case label, it is unreached.
--- a/jdk/src/share/classes/sun/tools/tree/SynchronizedStatement.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/tools/tree/SynchronizedStatement.java	Wed Jul 05 19:53:51 2017 +0200
@@ -56,7 +56,7 @@
     /**
      * Check statement
      */
-    Vset check(Environment env, Context ctx, Vset vset, Hashtable exp) {
+    Vset check(Environment env, Context ctx, Vset vset, Hashtable<Object, Object> exp) {
         checkLabel(env, ctx);
         CheckContext newctx = new CheckContext(ctx, this);
         vset = reach(env, vset);
--- a/jdk/src/share/classes/sun/tools/tree/ThisExpression.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/tools/tree/ThisExpression.java	Wed Jul 05 19:53:51 2017 +0200
@@ -87,7 +87,7 @@
     /**
      * Check expression
      */
-    public Vset checkValue(Environment env, Context ctx, Vset vset, Hashtable exp) {
+    public Vset checkValue(Environment env, Context ctx, Vset vset, Hashtable<Object, Object> exp) {
         if (ctx.field.isStatic()) {
             env.error(where, "undef.var", opNames[op]);
             type = Type.tError;
--- a/jdk/src/share/classes/sun/tools/tree/ThrowStatement.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/tools/tree/ThrowStatement.java	Wed Jul 05 19:53:51 2017 +0200
@@ -50,7 +50,7 @@
     /**
      * Check statement
      */
-    Vset check(Environment env, Context ctx, Vset vset, Hashtable exp) {
+    Vset check(Environment env, Context ctx, Vset vset, Hashtable<Object, Object> exp) {
         checkLabel(env, ctx);
         try {
             vset = reach(env, vset);
--- a/jdk/src/share/classes/sun/tools/tree/TryStatement.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/tools/tree/TryStatement.java	Wed Jul 05 19:53:51 2017 +0200
@@ -57,11 +57,11 @@
     /**
      * Check statement
      */
-    Vset check(Environment env, Context ctx, Vset vset, Hashtable exp) {
+    Vset check(Environment env, Context ctx, Vset vset, Hashtable<Object, Object> exp) {
         checkLabel(env, ctx);
         try {
             vset = reach(env, vset);
-            Hashtable newexp = new Hashtable();
+            Hashtable<Object, Object> newexp = new Hashtable<>();
             CheckContext newctx =  new CheckContext(ctx, this);
 
             // Check 'try' block.  A variable is DA (DU) before the try
@@ -131,7 +131,7 @@
 
                 // Make sure the exception is actually throw in that part of the code
                 boolean ok = false;
-                for (Enumeration e = newexp.keys() ; e.hasMoreElements() ; ) {
+                for (Enumeration<?> e = newexp.keys() ; e.hasMoreElements() ; ) {
                     ClassDeclaration c = (ClassDeclaration)e.nextElement();
                     if (def.superClassOf(env, c) || def.subClassOf(env, c)) {
                         ok = true;
@@ -149,7 +149,7 @@
             }
 
             // Only carry over exceptions that are not caught
-            for (Enumeration e = newexp.keys() ; e.hasMoreElements() ; ) {
+            for (Enumeration<?> e = newexp.keys() ; e.hasMoreElements() ; ) {
                 ClassDeclaration c = (ClassDeclaration)e.nextElement();
                 ClassDefinition def = c.getClassDefinition(env);
                 boolean add = true;
--- a/jdk/src/share/classes/sun/tools/tree/TypeExpression.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/tools/tree/TypeExpression.java	Wed Jul 05 19:53:51 2017 +0200
@@ -53,13 +53,13 @@
     /**
      * Check an expression
      */
-    public Vset checkValue(Environment env, Context ctx, Vset vset, Hashtable exp) {
+    public Vset checkValue(Environment env, Context ctx, Vset vset, Hashtable<Object, Object> exp) {
         env.error(where, "invalid.term");
         type = Type.tError;
         return vset;
     }
 
-    public Vset checkAmbigName(Environment env, Context ctx, Vset vset, Hashtable exp,
+    public Vset checkAmbigName(Environment env, Context ctx, Vset vset, Hashtable<Object, Object> exp,
                                UnaryExpression loc) {
         return vset;
     }
--- a/jdk/src/share/classes/sun/tools/tree/UnaryExpression.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/tools/tree/UnaryExpression.java	Wed Jul 05 19:53:51 2017 +0200
@@ -69,7 +69,7 @@
     /**
      * Check a unary expression
      */
-    public Vset checkValue(Environment env, Context ctx, Vset vset, Hashtable exp) {
+    public Vset checkValue(Environment env, Context ctx, Vset vset, Hashtable<Object, Object> exp) {
         vset = right.checkValue(env, ctx, vset, exp);
 
         int tm = right.type.getTypeMask();
--- a/jdk/src/share/classes/sun/tools/tree/VarDeclarationStatement.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/tools/tree/VarDeclarationStatement.java	Wed Jul 05 19:53:51 2017 +0200
@@ -57,7 +57,7 @@
     /**
      * Check statement
      */
-    Vset checkDeclaration(Environment env, Context ctx, Vset vset, int mod, Type t, Hashtable exp) {
+    Vset checkDeclaration(Environment env, Context ctx, Vset vset, int mod, Type t, Hashtable<Object, Object> exp) {
         if (labels != null) {
             env.error(where, "declaration.with.label", labels[0]);
         }
--- a/jdk/src/share/classes/sun/tools/tree/WhileStatement.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/tools/tree/WhileStatement.java	Wed Jul 05 19:53:51 2017 +0200
@@ -53,7 +53,7 @@
     /**
      * Check a while statement
      */
-    Vset check(Environment env, Context ctx, Vset vset, Hashtable exp) {
+    Vset check(Environment env, Context ctx, Vset vset, Hashtable<Object, Object> exp) {
         checkLabel(env, ctx);
         CheckContext newctx = new CheckContext(ctx, this);
         // remember what was unassigned on entry
--- a/jdk/src/share/classes/sun/tools/util/CommandLine.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/classes/sun/tools/util/CommandLine.java	Wed Jul 05 19:53:51 2017 +0200
@@ -54,7 +54,7 @@
     public static String[] parse(String[] args)
         throws IOException
     {
-        ArrayList newArgs = new ArrayList(args.length);
+        ArrayList<String> newArgs = new ArrayList<>(args.length);
         for (int i = 0; i < args.length; i++) {
             String arg = args[i];
             if (arg.length() > 1 && arg.charAt(0) == '@') {
@@ -68,10 +68,10 @@
                 newArgs.add(arg);
             }
         }
-        return (String[])newArgs.toArray(new String[newArgs.size()]);
+        return newArgs.toArray(new String[newArgs.size()]);
     }
 
-    private static void loadCmdFile(String name, List args)
+    private static void loadCmdFile(String name, List<String> args)
         throws IOException
     {
         Reader r = new BufferedReader(new FileReader(name));
--- a/jdk/src/share/native/sun/awt/image/awt_parseImage.c	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/native/sun/awt/image/awt_parseImage.c	Wed Jul 05 19:53:51 2017 +0200
@@ -508,6 +508,7 @@
     cmP->csType = (*env)->GetIntField(env, cmP->jcmodel, g_CMcsTypeID);
 
     cmP->cmType = getColorModelType(env, jcmodel);
+    JNU_CHECK_EXCEPTION_RETURN(env, -1);
 
     cmP->isDefaultCM = FALSE;
     cmP->isDefaultCompatCM = FALSE;
--- a/jdk/src/share/native/sun/java2d/opengl/OGLBufImgOps.c	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/native/sun/java2d/opengl/OGLBufImgOps.c	Wed Jul 05 19:53:51 2017 +0200
@@ -636,6 +636,9 @@
                 "OGLBufImgOps_EnableLookupOp: short=%d num=%d len=%d off=%d",
                 shortData, numBands, bandLength, offset);
 
+    for (i = 0; i < 4; i++) {
+        bands[i] = NULL;
+    }
     RETURN_IF_NULL(oglc);
     RETURN_IF_NULL(srcOps);
     RESET_PREVIOUS_OP();
--- a/jdk/src/share/native/sun/tracing/dtrace/JVM.c	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/share/native/sun/tracing/dtrace/JVM.c	Wed Jul 05 19:53:51 2017 +0200
@@ -144,32 +144,34 @@
         env, provider, &(jvm_provider->argsAttributes));
 }
 
-static void readProviderData(
+static int readProviderData(
         JNIEnv* env, jobject provider, JVM_DTraceProvider* jvm_provider) {
     jmethodID mid;
     jobjectArray probes;
     jsize i;
-    jclass clazz = (*env)->GetObjectClass(env, provider); CHECK
+    jclass clazz = (*env)->GetObjectClass(env, provider); CHECK_(0)
     mid = (*env)->GetMethodID(
-        env, clazz, "getProbes", "()[Lsun/tracing/dtrace/DTraceProbe;"); CHECK
+        env, clazz, "getProbes", "()[Lsun/tracing/dtrace/DTraceProbe;"); CHECK_(0)
     probes = (jobjectArray)(*env)->CallObjectMethod(
-        env, provider, mid); CHECK
+        env, provider, mid); CHECK_(0)
 
     // Fill JVM structure, describing provider
-    jvm_provider->probe_count = (*env)->GetArrayLength(env, probes); CHECK
+    jvm_provider->probe_count = (*env)->GetArrayLength(env, probes); CHECK_(0)
     jvm_provider->probes = (JVM_DTraceProbe*)calloc(
         jvm_provider->probe_count, sizeof(*jvm_provider->probes));
     mid = (*env)->GetMethodID(
-        env, clazz, "getProviderName", "()Ljava/lang/String;"); CHECK
+        env, clazz, "getProviderName", "()Ljava/lang/String;"); CHECK_(0)
     jvm_provider->name = (jstring)(*env)->CallObjectMethod(
-        env, provider, mid); CHECK
+        env, provider, mid); CHECK_(0)
 
-    readInterfaceAttributes(env, provider, jvm_provider); CHECK
+    readInterfaceAttributes(env, provider, jvm_provider); CHECK_(0)
 
     for (i = 0; i < jvm_provider->probe_count; ++i) {
-        jobject probe = (*env)->GetObjectArrayElement(env, probes, i); CHECK
-        readProbeData(env, probe, &jvm_provider->probes[i]); CHECK
+        jobject probe = (*env)->GetObjectArrayElement(env, probes, i); CHECK_(0)
+        readProbeData(env, probe, &jvm_provider->probes[i]); CHECK_(0)
     }
+
+    return 1;
 }
 
 /*
@@ -182,6 +184,7 @@
     jlong handle = 0;
     jsize num_providers;
     jsize i;
+    jsize count = 0;
     JVM_DTraceProvider* jvm_providers;
 
     initialize();
@@ -195,16 +198,23 @@
     jvm_providers = (JVM_DTraceProvider*)calloc(
         num_providers, sizeof(*jvm_providers));
 
-    for (i = 0; i < num_providers; ++i) {
-        JVM_DTraceProvider* p = &(jvm_providers[i]);
+    for (; count < num_providers; ++count) {
+        JVM_DTraceProvider* p = &(jvm_providers[count]);
         jobject provider = (*env)->GetObjectArrayElement(
-            env, providers, i);
-        readProviderData(env, provider, p);
+            env, providers, count);
+        if ((*env)->ExceptionOccurred(env) ||
+            ! readProviderData(env, provider, p)) {
+            // got an error, bail out!
+            break;
+        }
     }
 
-    handle = jvm_symbols->Activate(
-        env, JVM_TRACING_DTRACE_VERSION, moduleName,
-        num_providers, jvm_providers);
+    if (count == num_providers) {
+        // all providers successfully loaded - get the handle
+        handle = jvm_symbols->Activate(
+            env, JVM_TRACING_DTRACE_VERSION, moduleName,
+            num_providers, jvm_providers);
+    }
 
     for (i = 0; i < num_providers; ++i) {
         JVM_DTraceProvider* p = &(jvm_providers[i]);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/solaris/classes/sun/awt/datatransfer/flavormap.properties	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,71 @@
+#
+# This properties file is used to initialize the default
+# java.awt.datatransfer.SystemFlavorMap. It contains the X11 platform-specific,
+# default mappings between common X11 selection atoms and platform-independent
+# MIME type strings, which will be converted into
+# java.awt.datatransfer.DataFlavors.
+#
+# The standard format is:
+#
+# <native>=<MIME type>,<MIME type>, ...
+#
+# <native> should be a string identifier that the native platform will
+# recognize as a valid data format. <MIME type> should specify both a MIME
+# primary type and a MIME subtype separated by a '/'. The MIME type may include
+# parameters, where each parameter is a key/value pair separated by '=', and
+# where each parameter to the MIME type is separated by a ';'.
+#
+# Because SystemFlavorMap implements FlavorTable, developers are free to
+# duplicate DataFlavor values and set multiple values for a single native by
+# separating them with ",". If a mapping contains a duplicate key or value,
+# earlier mappings which included this key or value will be preferred.
+#
+# Mappings whose values specify DataFlavors with primary MIME types of
+# "text", and which support the charset parameter, should specify the exact
+# format in which the native platform expects the data. The "charset"
+# parameter specifies the char to byte encoding, the "eoln" parameter
+# specifies the end-of-line marker, and the "terminators" parameter specifies
+# the number of terminating NUL bytes. Note that "eoln" and "terminators"
+# are not standardized MIME type parameters. They are specific to this file
+# format ONLY. They will not appear in any of the DataFlavors returned by the
+# SystemFlavorMap at the Java level.
+#
+# If the "charset" parameter is omitted, or has zero length, the platform
+# default encoding is assumed. If the "eoln" parameter is omitted, or has
+# zero length, "\n" is assumed. If the "terminators" parameter is omitted,
+# or has a value less than zero, zero is assumed.
+#
+# Upon initialization, the data transfer subsystem will record the specified
+# details of the native text format, but the default SystemFlavorMap will
+# present a large set of synthesized DataFlavors which map, in both
+# directions, to the native. After receiving data from the application in one
+# of the synthetic DataFlavors, the data transfer subsystem will transform
+# the data stream into the format specified in this file before passing the
+# transformed stream to the native system.
+#
+# Mappings whose values specify DataFlavors with primary MIME types of
+# "text", but which do not support the charset parameter, will be treated as
+# opaque, 8-bit data. They will not undergo any transformation process, and
+# any "charset", "eoln", or "terminators" parameters specified in this file
+# will be ignored.
+#
+# See java.awt.datatransfer.DataFlavor.selectBestTextFlavor for a list of
+# text flavors which support the charset parameter.
+
+UTF8_STRING=text/plain;charset=UTF-8;eoln="\n";terminators=0
+
+# The COMPOUND_TEXT support for inter-client text transfer is disabled by 
+# default. The reason is that many native applications prefer this format over 
+# other native text formats, but are unable to decode the textual data in this 
+# format properly. This results in java-to-native text transfer failures.
+# To enable the COMPOUND_TEXT support for this JRE installation uncomment 
+# the line below.
+
+# COMPOUND_TEXT=text/plain;charset=x-compound-text;eoln="\n";terminators=0
+
+TEXT=text/plain;eoln="\n";terminators=0
+STRING=text/plain;charset=iso8859-1;eoln="\n";terminators=0
+FILE_NAME=application/x-java-file-list;class=java.util.List
+text/uri-list=application/x-java-file-list;class=java.util.List
+PNG=image/x-java-image;class=java.awt.Image
+JFIF=image/x-java-image;class=java.awt.Image
--- a/jdk/src/solaris/classes/sun/nio/ch/InheritedChannel.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/solaris/classes/sun/nio/ch/InheritedChannel.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, 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
@@ -165,7 +165,7 @@
         // Have to use reflection and also make assumption on how FD
         // is implemented.
 
-        Class paramTypes[] = { int.class };
+        Class<?> paramTypes[] = { int.class };
         Constructor<?> ctr = Reflect.lookupConstructor("java.io.FileDescriptor",
                                                        paramTypes);
         Object args[] = { new Integer(fdVal) };
--- a/jdk/src/solaris/classes/sun/print/CUPSPrinter.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/solaris/classes/sun/print/CUPSPrinter.java	Wed Jul 05 19:53:51 2017 +0200
@@ -39,6 +39,7 @@
 import javax.print.attribute.standard.MediaSize;
 import javax.print.attribute.standard.MediaTray;
 import javax.print.attribute.standard.MediaPrintableArea;
+import javax.print.attribute.standard.PrinterResolution;
 import javax.print.attribute.Size2DSyntax;
 import javax.print.attribute.Attribute;
 import javax.print.attribute.EnumSyntax;
@@ -57,6 +58,8 @@
     // CUPS does not support multi-threading.
     private static synchronized native String[] getMedia(String printer);
     private static synchronized native float[] getPageSizes(String printer);
+    private static synchronized native void
+        getResolutions(String printer, ArrayList<Integer> resolutionList);
     //public static boolean useIPPMedia = false; will be used later
 
     private MediaPrintableArea[] cupsMediaPrintables;
@@ -68,6 +71,7 @@
     public  int nTrays = 0;
     private  String[] media;
     private  float[] pageSizes;
+    int[]   resolutionsArray;
     private String printer;
 
     private static boolean libFound;
@@ -119,6 +123,12 @@
                 nTrays = media.length/2-nPageSizes;
                 assert (nTrays >= 0);
             }
+            ArrayList<Integer> resolutionList = new ArrayList<>();
+            getResolutions(printer, resolutionList);
+            resolutionsArray = new int[resolutionList.size()];
+            for (int i=0; i < resolutionList.size(); i++) {
+                resolutionsArray[i] = resolutionList.get(i);
+            }
         }
     }
 
@@ -160,6 +170,12 @@
         return cupsMediaTrays;
     }
 
+    /**
+     * return the raw packed array of supported printer resolutions.
+     */
+    int[] getRawResolutions() {
+        return resolutionsArray;
+    }
 
     /**
      * Initialize media by translating PPD info to PrintService attributes.
--- a/jdk/src/solaris/classes/sun/print/IPPPrintService.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/solaris/classes/sun/print/IPPPrintService.java	Wed Jul 05 19:53:51 2017 +0200
@@ -96,6 +96,8 @@
     private MediaSizeName[] mediaSizeNames;
     private CustomMediaSizeName[] customMediaSizeNames;
     private int defaultMediaIndex;
+    private int[] rawResolutions = null;
+    private PrinterResolution[] printerResolutions = null;
     private boolean isCupsPrinter;
     private boolean init;
     private Boolean isPS;
@@ -414,6 +416,7 @@
                     mediaTrays = cps.getMediaTrays();
                     customMediaSizeNames = cps.getCustomMediaSizeNames();
                     defaultMediaIndex = cps.getDefaultMediaIndex();
+                    rawResolutions = cps.getRawResolutions();
                     urlConnection.disconnect();
                     init = true;
                     return;
@@ -765,6 +768,15 @@
                     return sidesSup;
                 }
             }
+        } else if (category == PrinterResolution.class) {
+            PrinterResolution[] supportedRes = getPrintResolutions();
+            if (supportedRes == null) {
+                return null;
+            }
+            PrinterResolution []arr =
+                new PrinterResolution[supportedRes.length];
+            System.arraycopy(supportedRes, 0, arr, 0, supportedRes.length);
+            return arr;
         }
 
         return null;
@@ -1043,6 +1055,14 @@
         if (getAttMap != null && getAttMap.containsKey("color-supported")) {
             catList.add(Chromaticity.class);
         }
+
+        // CUPS does not report printer resolution via IPP but it
+        // may be gleaned from the PPD.
+        PrinterResolution[] supportedRes = getPrintResolutions();
+        if (supportedRes != null && (supportedRes.length > 0)) {
+            catList.add(PrinterResolution.class);
+        }
+
         supportedCats = new Class<?>[catList.size()];
         catList.toArray(supportedCats);
         return supportedCats;
@@ -1362,6 +1382,10 @@
                 }
             }
             return false;
+        } if (attr.getCategory() == PrinterResolution.class) {
+            if (attr instanceof PrinterResolution) {
+                return isSupportedResolution((PrinterResolution)attr);
+            }
         }
         return true;
     }
@@ -1523,11 +1547,48 @@
                 }
             }
             return Sides.ONE_SIDED;
+        } else if (category == PrinterResolution.class) {
+             PrinterResolution[] supportedRes = getPrintResolutions();
+             if ((supportedRes != null) && (supportedRes.length > 0)) {
+                return supportedRes[0];
+             } else {
+                 return new PrinterResolution(300, 300, PrinterResolution.DPI);
+             }
         }
 
         return null;
     }
 
+    private PrinterResolution[] getPrintResolutions() {
+        if (printerResolutions == null) {
+            if (rawResolutions == null) {
+              printerResolutions = new PrinterResolution[0];
+            } else {
+                int numRes = rawResolutions.length / 2;
+                PrinterResolution[] pres = new PrinterResolution[numRes];
+                for (int i=0; i < numRes; i++) {
+                    pres[i] =  new PrinterResolution(rawResolutions[i*2],
+                                                     rawResolutions[i*2+1],
+                                                     PrinterResolution.DPI);
+                }
+                printerResolutions = pres;
+            }
+        }
+        return printerResolutions;
+    }
+
+    private boolean isSupportedResolution(PrinterResolution res) {
+        PrinterResolution[] supportedRes = getPrintResolutions();
+        if (supportedRes != null) {
+            for (int i=0; i<supportedRes.length; i++) {
+                if (res.equals(supportedRes[i])) {
+                    return true;
+                }
+            }
+        }
+        return false;
+    }
+
     public ServiceUIFactory getServiceUIFactory() {
         return null;
     }
--- a/jdk/src/solaris/lib/flavormap.properties	Wed Jul 05 19:52:35 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,78 +0,0 @@
-#
-# This properties file is used to initialize the default
-# java.awt.datatransfer.SystemFlavorMap. It contains the X11 platform-specific,
-# default mappings between common X11 selection atoms and platform-independent
-# MIME type strings, which will be converted into
-# java.awt.datatransfer.DataFlavors.
-#
-# These default mappings may be augmented by specifying the
-#
-#       AWT.DnD.flavorMapFileURL 
-#
-# property in the appropriate awt.properties file. The specified properties URL
-# will be loaded into the SystemFlavorMap.
-#
-# The standard format is:
-#
-# <native>=<MIME type>
-#
-# <native> should be a string identifier that the native platform will
-# recognize as a valid data format. <MIME type> should specify both a MIME
-# primary type and a MIME subtype separated by a '/'. The MIME type may include
-# parameters, where each parameter is a key/value pair separated by '=', and
-# where each parameter to the MIME type is separated by a ';'.
-#
-# Because SystemFlavorMap implements FlavorTable, developers are free to
-# duplicate both native keys and DataFlavor values. If a mapping contains a
-# duplicate key or value, earlier mappings which included this key or value
-# will be preferred.
-#
-# Mappings whose values specify DataFlavors with primary MIME types of
-# "text", and which support the charset parameter, should specify the exact
-# format in which the native platform expects the data. The "charset"
-# parameter specifies the char to byte encoding, the "eoln" parameter
-# specifies the end-of-line marker, and the "terminators" parameter specifies
-# the number of terminating NUL bytes. Note that "eoln" and "terminators"
-# are not standardized MIME type parameters. They are specific to this file
-# format ONLY. They will not appear in any of the DataFlavors returned by the
-# SystemFlavorMap at the Java level.
-#
-# If the "charset" parameter is omitted, or has zero length, the platform
-# default encoding is assumed. If the "eoln" parameter is omitted, or has
-# zero length, "\n" is assumed. If the "terminators" parameter is omitted,
-# or has a value less than zero, zero is assumed.
-#
-# Upon initialization, the data transfer subsystem will record the specified
-# details of the native text format, but the default SystemFlavorMap will
-# present a large set of synthesized DataFlavors which map, in both
-# directions, to the native. After receiving data from the application in one
-# of the synthetic DataFlavors, the data transfer subsystem will transform
-# the data stream into the format specified in this file before passing the
-# transformed stream to the native system.
-#
-# Mappings whose values specify DataFlavors with primary MIME types of
-# "text", but which do not support the charset parameter, will be treated as
-# opaque, 8-bit data. They will not undergo any transformation process, and
-# any "charset", "eoln", or "terminators" parameters specified in this file
-# will be ignored.
-#
-# See java.awt.datatransfer.DataFlavor.selectBestTextFlavor for a list of
-# text flavors which support the charset parameter.
-
-UTF8_STRING=text/plain;charset=UTF-8;eoln="\n";terminators=0
-
-# The COMPOUND_TEXT support for inter-client text transfer is disabled by 
-# default. The reason is that many native applications prefer this format over 
-# other native text formats, but are unable to decode the textual data in this 
-# format properly. This results in java-to-native text transfer failures.
-# To enable the COMPOUND_TEXT support for this JRE installation uncomment 
-# the line below.
-
-# COMPOUND_TEXT=text/plain;charset=x-compound-text;eoln="\n";terminators=0
-
-TEXT=text/plain;eoln="\n";terminators=0
-STRING=text/plain;charset=iso8859-1;eoln="\n";terminators=0
-FILE_NAME=application/x-java-file-list;class=java.util.List
-text/uri-list=application/x-java-file-list;class=java.util.List
-PNG=image/x-java-image;class=java.awt.Image
-JFIF=image/x-java-image;class=java.awt.Image
--- a/jdk/src/solaris/native/sun/awt/CUPSfuncs.c	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/solaris/native/sun/awt/CUPSfuncs.c	Wed Jul 05 19:53:51 2017 +0200
@@ -394,3 +394,112 @@
     unlink(filename);
     return sizeArray;
 }
+
+/*
+ * Populates the supplied ArrayList<Integer> with resolutions.
+ * The first pair of elements will be the default resolution.
+ * If resolution isn't supported the list will be empty.
+ * If needed we can add a 2nd ArrayList<String> which would
+ * be populated with the corresponding UI name.
+ * PPD specifies the syntax for resolution as either "Ndpi" or "MxNdpi",
+ * eg 300dpi or 600x600dpi. The former is a shorthand where xres==yres.
+ * We will always expand to the latter as we use a single array list.
+ * Note: getMedia() and getPageSizes() both open the ppd file
+ * This is not going to scale forever so if we add anymore we
+ * should look to consolidate this.
+ */
+JNIEXPORT void JNICALL
+Java_sun_print_CUPSPrinter_getResolutions(JNIEnv *env,
+                                          jobject printObj,
+                                          jstring printer,
+                                          jobject arrayList)
+{
+    ppd_file_t *ppd = NULL;
+    ppd_option_t *resolution;
+    int defx = 0, defy = 0;
+    int resx = 0, resy = 0;
+    jclass intCls, cls;
+    jmethodID intCtr, arrListAddMID;
+    int i;
+
+    intCls = (*env)->FindClass(env, "java/lang/Integer");
+    CHECK_NULL(intCls);
+    intCtr = (*env)->GetMethodID(env, intCls, "<init>", "(I)V");
+    CHECK_NULL(intCtr);
+    cls = (*env)->FindClass(env, "java/util/ArrayList");
+    CHECK_NULL(cls);
+    arrListAddMID =
+        (*env)->GetMethodID(env, cls, "add", "(Ljava/lang/Object;)Z");
+    CHECK_NULL(arrListAddMID);
+
+    const char *name = (*env)->GetStringUTFChars(env, printer, NULL);
+    if (name == NULL) {
+        (*env)->ExceptionClear(env);
+        JNU_ThrowOutOfMemoryError(env, "Could not create printer name");
+    }
+    const char *filename;
+
+    // NOTE: cupsGetPPD returns a pointer to a filename of a temporary file.
+    // unlink() must be called to remove the file after using it.
+    filename = j2d_cupsGetPPD(name);
+    (*env)->ReleaseStringUTFChars(env, printer, name);
+    CHECK_NULL(filename);
+    if ((ppd = j2d_ppdOpenFile(filename)) == NULL) {
+        unlink(filename);
+        DPRINTF("unable to open PPD  %s\n", filename)
+    }
+    resolution = j2d_ppdFindOption(ppd, "Resolution");
+    if (resolution != NULL) {
+        int matches = sscanf(resolution->defchoice, "%dx%ddpi", &defx, &defy);
+        if (matches == 2) {
+           if (defx <= 0 || defy <= 0) {
+              defx = 0;
+              defy = 0;
+           }
+        } else {
+            matches = sscanf(resolution->defchoice, "%ddpi", &defx);
+            if (matches == 1) {
+                if (defx <= 0) {
+                   defx = 0;
+                } else {
+                   defy = defx;
+                }
+            }
+        }
+        if (defx > 0) {
+          jobject rxObj = (*env)->NewObject(env, intCls, intCtr, defx);
+          jobject ryObj = (*env)->NewObject(env, intCls, intCtr, defy);
+          (*env)->CallBooleanMethod(env, arrayList, arrListAddMID, rxObj);
+          (*env)->CallBooleanMethod(env, arrayList, arrListAddMID, ryObj);
+        }
+
+        for (i = 0; i < resolution->num_choices; i++) {
+            char *resStr = resolution->choices[i].choice;
+            int matches = sscanf(resStr, "%dx%ddpi", &resx, &resy);
+            if (matches == 2) {
+               if (resx <= 0 || resy <= 0) {
+                  resx = 0;
+                  resy = 0;
+               }
+            } else {
+                matches = sscanf(resStr, "%ddpi", &resx);
+                if (matches == 1) {
+                    if (resx <= 0) {
+                       resx = 0;
+                    } else {
+                       resy = resx;
+                    }
+                }
+            }
+            if (resx > 0 && (resx != defx || resy != defy )) {
+              jobject rxObj = (*env)->NewObject(env, intCls, intCtr, resx);
+              jobject ryObj = (*env)->NewObject(env, intCls, intCtr, resy);
+              (*env)->CallBooleanMethod(env, arrayList, arrListAddMID, rxObj);
+              (*env)->CallBooleanMethod(env, arrayList, arrListAddMID, ryObj);
+            }
+        }
+    }
+
+    j2d_ppdClose(ppd);
+    unlink(filename);
+}
--- a/jdk/src/solaris/native/sun/awt/gtk2_interface.c	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/solaris/native/sun/awt/gtk2_interface.c	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2014, 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
@@ -433,7 +433,8 @@
             result = TRUE;
         }
 
-        dlclose(lib);
+        // 8048289: workaround for https://bugzilla.gnome.org/show_bug.cgi?id=733065
+        // dlclose(lib);
 
         return result;
     }
--- a/jdk/src/solaris/native/sun/java2d/x11/X11PMBlitLoops.c	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/solaris/native/sun/java2d/x11/X11PMBlitLoops.c	Wed Jul 05 19:53:51 2017 +0200
@@ -241,9 +241,12 @@
                                       width, height, 1);
         if (xsdo->bitmask == 0) {
             AWT_UNLOCK();
-            JNU_ThrowOutOfMemoryError(env,
-                                      "Cannot create bitmask for "
-                                      "offscreen surface");
+            if (!(*env)->ExceptionCheck(env))
+            {
+                JNU_ThrowOutOfMemoryError(env,
+                                          "Cannot create bitmask for "
+                                          "offscreen surface");
+            }
             return;
         }
     }
@@ -253,7 +256,10 @@
                          1, XYBitmap, 0, NULL, width, height, 32, 0);
     if (image == NULL) {
         AWT_UNLOCK();
-        JNU_ThrowOutOfMemoryError(env, "Cannot allocate bitmask for mask");
+        if (!(*env)->ExceptionCheck(env))
+        {
+             JNU_ThrowOutOfMemoryError(env, "Cannot allocate bitmask for mask");
+        }
         return;
     }
     dstScan = image->bytes_per_line;
@@ -261,7 +267,10 @@
     if (image->data == NULL) {
         XFree(image);
         AWT_UNLOCK();
-        JNU_ThrowOutOfMemoryError(env, "Cannot allocate bitmask for mask");
+        if (!(*env)->ExceptionCheck(env))
+        {
+            JNU_ThrowOutOfMemoryError(env, "Cannot allocate bitmask for mask");
+        }
         return;
     }
     pDst = (unsigned char *)image->data;
--- a/jdk/src/solaris/native/sun/java2d/x11/X11SurfaceData.c	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/solaris/native/sun/java2d/x11/X11SurfaceData.c	Wed Jul 05 19:53:51 2017 +0200
@@ -454,6 +454,7 @@
             AWT_LOCK();
             xsdo->drawable = X11SD_CreateSharedPixmap(xsdo);
             AWT_UNLOCK();
+            JNU_CHECK_EXCEPTION_RETURN(env, JNI_FALSE);
             if (xsdo->drawable) {
                 xsdo->shmPMData.usingShmPixmap = JNI_TRUE;
                 xsdo->shmPMData.shmPixmap = xsdo->drawable;
@@ -469,6 +470,7 @@
                                      xsdo->configData->awt_visInfo.screen),
                           width, height, depth);
         AWT_UNLOCK();
+        JNU_CHECK_EXCEPTION_RETURN(env, JNI_FALSE);
 #ifdef MITSHM
         xsdo->shmPMData.usingShmPixmap = JNI_FALSE;
         xsdo->shmPMData.pixmap = xsdo->drawable;
@@ -504,6 +506,7 @@
 
     if (xsdo->configData->awt_cmap == (Colormap)NULL) {
         awtJNI_CreateColorData(env, xsdo->configData, 1);
+        JNU_CHECK_EXCEPTION(env);
     }
     /* color_data will be initialized in awtJNI_CreateColorData for
        8-bit visuals */
@@ -805,7 +808,10 @@
          xsdo->cData->awt_icmLUT == NULL))
     {
         AWT_UNLOCK();
-        JNU_ThrowNullPointerException(env, "colormap lookup table");
+        if (!(*env)->ExceptionCheck(env))
+        {
+             JNU_ThrowNullPointerException(env, "colormap lookup table");
+        }
         return SD_FAILURE;
     }
     if ((lockflags & SD_LOCK_INVCOLOR) != 0 &&
@@ -816,7 +822,10 @@
          xsdo->cData->img_oda_blue == NULL))
     {
         AWT_UNLOCK();
-        JNU_ThrowNullPointerException(env, "inverse colormap lookup table");
+        if (!(*env)->ExceptionCheck(env))
+        {
+             JNU_ThrowNullPointerException(env, "inverse colormap lookup table");
+        }
         return SD_FAILURE;
     }
     if ((lockflags & SD_LOCK_INVGRAY) != 0 &&
@@ -824,7 +833,10 @@
          xsdo->cData->pGrayInverseLutData == NULL))
     {
         AWT_UNLOCK();
-        JNU_ThrowNullPointerException(env, "inverse gray lookup table");
+        if (!(*env)->ExceptionCheck(env))
+        {
+            JNU_ThrowNullPointerException(env, "inverse gray lookup table");
+        }
         return SD_FAILURE;
     }
     if (xsdo->dgaAvailable && (lockflags & (SD_LOCK_RD_WR))) {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/windows/classes/sun/awt/datatransfer/flavormap.properties	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,69 @@
+#
+# This properties file is used to initialize the default
+# java.awt.datatransfer.SystemFlavorMap. It contains the Win32 platform-
+# specific, default mappings between common Win32 Clipboard atoms and platform-
+# independent MIME type strings, which will be converted into
+# java.awt.datatransfer.DataFlavors.
+#
+# The standard format is:
+#
+# <native>=<MIME type>,<MIME type>, ...
+#
+# <native> should be a string identifier that the native platform will
+# recognize as a valid data format. <MIME type> should specify both a MIME
+# primary type and a MIME subtype separated by a '/'. The MIME type may include
+# parameters, where each parameter is a key/value pair separated by '=', and
+# where each parameter to the MIME type is separated by a ';'.
+#
+# Because SystemFlavorMap implements FlavorTable, developers are free to
+# duplicate DataFlavor values and set multiple values for a single native by
+# separating them with ",". If a mapping contains a duplicate key or value,
+# earlier mappings which included this key or value will be preferred.#
+# Mappings whose values specify DataFlavors with primary MIME types of
+# "text", and which support the charset parameter, should specify the exact
+# format in which the native platform expects the data. The "charset"
+# parameter specifies the char to byte encoding, the "eoln" parameter
+# specifies the end-of-line marker, and the "terminators" parameter specifies
+# the number of terminating NUL bytes. Note that "eoln" and "terminators"
+# are not standardized MIME type parameters. They are specific to this file
+# format ONLY. They will not appear in any of the DataFlavors returned by the
+# SystemFlavorMap at the Java level.
+#
+# If the "charset" parameter is omitted, or has zero length, the platform
+# default encoding is assumed. If the "eoln" parameter is omitted, or has
+# zero length, "\n" is assumed. If the "terminators" parameter is omitted,
+# or has a value less than zero, zero is assumed.
+#
+# Upon initialization, the data transfer subsystem will record the specified
+# details of the native text format, but the default SystemFlavorMap will
+# present a large set of synthesized DataFlavors which map, in both
+# directions, to the native. After receiving data from the application in one
+# of the synthetic DataFlavors, the data transfer subsystem will transform
+# the data stream into the format specified in this file before passing the
+# transformed stream to the native system.
+#
+# Mappings whose values specify DataFlavors with primary MIME types of
+# "text", but which do not support the charset parameter, will be treated as
+# opaque, 8-bit data. They will not undergo any transformation process, and
+# any "charset", "eoln", or "terminators" parameters specified in this file
+# will be ignored.
+#
+# See java.awt.datatransfer.DataFlavor.selectBestTextFlavor for a list of
+# text flavors which support the charset parameter.
+
+UNICODE\ TEXT=text/plain;charset=utf-16le;eoln="\r\n";terminators=2
+TEXT=text/plain;eoln="\r\n";terminators=1
+HTML\ Format=text/html;charset=utf-8;eoln="\r\n";terminators=1
+Rich\ Text\ Format=text/rtf
+HDROP=application/x-java-file-list;class=java.util.List
+PNG=image/x-java-image;class=java.awt.Image
+JFIF=image/x-java-image;class=java.awt.Image
+DIB=image/x-java-image;class=java.awt.Image
+ENHMETAFILE=image/x-java-image;class=java.awt.Image
+METAFILEPICT=image/x-java-image;class=java.awt.Image
+LOCALE=application/x-java-text-encoding;class="[B"
+UniformResourceLocator=application/x-java-url;class=java.net.URL,\
+                       text/uri-list;eoln="\r\n";terminators=1,\
+                       text/plain;eoln="\r\n";terminators=1
+FileGroupDescriptorW=application/x-java-file-list;class=java.util.List
+FileGroupDescriptor=application/x-java-file-list;class=java.util.List
--- a/jdk/src/windows/lib/flavormap.properties	Wed Jul 05 19:52:35 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,77 +0,0 @@
-#
-# This properties file is used to initialize the default
-# java.awt.datatransfer.SystemFlavorMap. It contains the Win32 platform-
-# specific, default mappings between common Win32 Clipboard atoms and platform-
-# independent MIME type strings, which will be converted into
-# java.awt.datatransfer.DataFlavors.
-#
-# These default mappings may be augmented by specifying the
-#
-#       AWT.DnD.flavorMapFileURL 
-#
-# property in the appropriate awt.properties file. The specified properties URL
-# will be loaded into the SystemFlavorMap.
-#
-# The standard format is:
-#
-# <native>=<MIME type>
-#
-# <native> should be a string identifier that the native platform will
-# recognize as a valid data format. <MIME type> should specify both a MIME
-# primary type and a MIME subtype separated by a '/'. The MIME type may include
-# parameters, where each parameter is a key/value pair separated by '=', and
-# where each parameter to the MIME type is separated by a ';'.
-#
-# Because SystemFlavorMap implements FlavorTable, developers are free to
-# duplicate both native keys and DataFlavor values. If a mapping contains a
-# duplicate key or value, earlier mappings which included this key or value
-# will be preferred.
-#
-# Mappings whose values specify DataFlavors with primary MIME types of
-# "text", and which support the charset parameter, should specify the exact
-# format in which the native platform expects the data. The "charset"
-# parameter specifies the char to byte encoding, the "eoln" parameter
-# specifies the end-of-line marker, and the "terminators" parameter specifies
-# the number of terminating NUL bytes. Note that "eoln" and "terminators"
-# are not standardized MIME type parameters. They are specific to this file
-# format ONLY. They will not appear in any of the DataFlavors returned by the
-# SystemFlavorMap at the Java level.
-#
-# If the "charset" parameter is omitted, or has zero length, the platform
-# default encoding is assumed. If the "eoln" parameter is omitted, or has
-# zero length, "\n" is assumed. If the "terminators" parameter is omitted,
-# or has a value less than zero, zero is assumed.
-#
-# Upon initialization, the data transfer subsystem will record the specified
-# details of the native text format, but the default SystemFlavorMap will
-# present a large set of synthesized DataFlavors which map, in both
-# directions, to the native. After receiving data from the application in one
-# of the synthetic DataFlavors, the data transfer subsystem will transform
-# the data stream into the format specified in this file before passing the
-# transformed stream to the native system.
-#
-# Mappings whose values specify DataFlavors with primary MIME types of
-# "text", but which do not support the charset parameter, will be treated as
-# opaque, 8-bit data. They will not undergo any transformation process, and
-# any "charset", "eoln", or "terminators" parameters specified in this file
-# will be ignored.
-#
-# See java.awt.datatransfer.DataFlavor.selectBestTextFlavor for a list of
-# text flavors which support the charset parameter.
-
-UNICODE\ TEXT=text/plain;charset=utf-16le;eoln="\r\n";terminators=2
-TEXT=text/plain;eoln="\r\n";terminators=1
-HTML\ Format=text/html;charset=utf-8;eoln="\r\n";terminators=1
-Rich\ Text\ Format=text/rtf
-HDROP=application/x-java-file-list;class=java.util.List
-PNG=image/x-java-image;class=java.awt.Image
-JFIF=image/x-java-image;class=java.awt.Image
-DIB=image/x-java-image;class=java.awt.Image
-ENHMETAFILE=image/x-java-image;class=java.awt.Image
-METAFILEPICT=image/x-java-image;class=java.awt.Image
-LOCALE=application/x-java-text-encoding;class="[B"
-UniformResourceLocator=application/x-java-url;class=java.net.URL
-UniformResourceLocator=text/uri-list;eoln="\r\n";terminators=1
-UniformResourceLocator=text/plain;eoln="\r\n";terminators=1
-FileGroupDescriptorW=application/x-java-file-list;class=java.util.List
-FileGroupDescriptor=application/x-java-file-list;class=java.util.List
--- a/jdk/src/windows/native/sun/java2d/d3d/D3DBufImgOps.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/windows/native/sun/java2d/d3d/D3DBufImgOps.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -201,6 +201,9 @@
     int i;
     jint flags = 0;
 
+    for (i = 0; i < 4; i++) {
+        bands[i] = NULL;
+    }
     J2dTraceLn4(J2D_TRACE_INFO,
                 "D3DBufImgOps_EnableLookupOp: short=%d num=%d len=%d off=%d",
                 shortData, numBands, bandLength, offset);
--- a/jdk/src/windows/native/sun/nio/ch/FileDispatcherImpl.c	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/windows/native/sun/nio/ch/FileDispatcherImpl.c	Wed Jul 05 19:53:51 2017 +0200
@@ -406,6 +406,14 @@
     result = LockFileEx(h, flags, 0, lowNumBytes, highNumBytes, &o);
     if (result == 0) {
         int error = GetLastError();
+        if (error == ERROR_IO_PENDING) {
+            LPDWORD dwBytes;
+            result = GetOverlappedResult(h, &o, &dwBytes, TRUE);
+            if (result != 0) {
+                return sun_nio_ch_FileDispatcherImpl_LOCKED;
+            }
+            error = GetLastError();
+        }
         if (error != ERROR_LOCK_VIOLATION) {
             JNU_ThrowIOExceptionWithLastError(env, "Lock failed");
             return sun_nio_ch_FileDispatcherImpl_NO_LOCK;
--- a/jdk/src/windows/native/sun/security/mscapi/security.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/windows/native/sun/security/mscapi/security.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2014, 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
@@ -74,7 +74,10 @@
     const char* pszHashAlgorithm = NULL;
     ALG_ID algId = 0;
 
-    pszHashAlgorithm = env->GetStringUTFChars(jHashAlgorithm, NULL);
+    if ((pszHashAlgorithm = env->GetStringUTFChars(jHashAlgorithm, NULL))
+        == NULL) {
+        return algId;
+    }
 
     if ((strcmp("SHA", pszHashAlgorithm) == 0) ||
         (strcmp("SHA1", pszHashAlgorithm) == 0) ||
@@ -179,7 +182,9 @@
          */
         if (length < 0) {
             length = env->GetArrayLength(seed);
-            reseedBytes = env->GetByteArrayElements(seed, 0);
+            if ((reseedBytes = env->GetByteArrayElements(seed, 0)) == NULL) {
+                __leave;
+            }
 
             if (::CryptGenRandom(
                 hCryptProv,
@@ -211,7 +216,9 @@
         } else { // length == 0
 
             length = env->GetArrayLength(seed);
-            seedBytes = env->GetByteArrayElements(seed, 0);
+            if ((seedBytes = env->GetByteArrayElements(seed, 0)) == NULL) {
+                __leave;
+            }
 
             if (::CryptGenRandom(
                 hCryptProv,
@@ -275,7 +282,10 @@
     __try
     {
         // Open a system certificate store.
-        pszCertStoreName = env->GetStringUTFChars(jCertStoreName, NULL);
+        if ((pszCertStoreName = env->GetStringUTFChars(jCertStoreName, NULL))
+            == NULL) {
+            __leave;
+        }
         if ((hCertStore = ::CertOpenSystemStore(NULL, pszCertStoreName))
             == NULL) {
 
@@ -710,7 +720,10 @@
 
     __try
     {
-        pszKeyContainerName = env->GetStringUTFChars(keyContainerName, NULL);
+        if ((pszKeyContainerName =
+            env->GetStringUTFChars(keyContainerName, NULL)) == NULL) {
+            __leave;
+        }
 
         // Acquire a CSP context (create a new key container).
         // Prefer a PROV_RSA_AES CSP, when available, due to its support
@@ -847,7 +860,10 @@
     __try
     {
         // Open a system certificate store.
-        pszCertStoreName = env->GetStringUTFChars(jCertStoreName, NULL);
+        if ((pszCertStoreName = env->GetStringUTFChars(jCertStoreName, NULL))
+            == NULL) {
+            __leave;
+        }
         if ((hCertStore = ::CertOpenSystemStore(NULL, pszCertStoreName)) == NULL) {
             ThrowException(env, KEYSTORE_EXCEPTION, GetLastError());
             __leave;
@@ -1086,7 +1102,10 @@
     __try
     {
         // Open a system certificate store.
-        pszCertStoreName = env->GetStringUTFChars(jCertStoreName, NULL);
+        if ((pszCertStoreName = env->GetStringUTFChars(jCertStoreName, NULL))
+            == NULL) {
+            __leave;
+        }
         if ((hCertStore = ::CertOpenSystemStore(NULL, pszCertStoreName)) == NULL) {
             ThrowException(env, KEYSTORE_EXCEPTION, GetLastError());
             __leave;
@@ -1123,7 +1142,10 @@
                 cchNameString);
 
             // Compare the certificate's friendly name with supplied alias name
-            pszCertAliasName = env->GetStringUTFChars(jCertAliasName, NULL);
+            if ((pszCertAliasName = env->GetStringUTFChars(jCertAliasName, NULL))
+                == NULL) {
+                __leave;
+            }
             if (strcmp(pszCertAliasName, pszNameString) == 0) {
 
                 // Only delete the certificate if the alias names matches
@@ -1181,7 +1203,10 @@
 
     __try
     {
-        pszKeyContainerName = env->GetStringUTFChars(keyContainerName, NULL);
+        if ((pszKeyContainerName =
+            env->GetStringUTFChars(keyContainerName, NULL)) == NULL) {
+            __leave;
+        }
 
         // Destroying the default key container is not permitted
         // (because it may contain more one keypair).
@@ -1234,8 +1259,14 @@
 
     __try
     {
-        pszCertStoreName = env->GetStringUTFChars(jCertStoreName, NULL);
-        pszCertAliasName = env->GetStringUTFChars(jCertAliasName, NULL);
+        if ((pszCertStoreName = env->GetStringUTFChars(jCertStoreName, NULL))
+            == NULL) {
+            __leave;
+        }
+        if ((pszCertAliasName = env->GetStringUTFChars(jCertAliasName, NULL))
+            == NULL) {
+            __leave;
+        }
 
         // Open a system certificate store.
         if ((hCertStore = ::CertOpenSystemStore(NULL, pszCertStoreName)) == NULL) {
@@ -1530,7 +1561,9 @@
     __try {
 
         jsize length = env->GetArrayLength(jKeyBlob);
-        keyBlob = env->GetByteArrayElements(jKeyBlob, 0);
+        if ((keyBlob = env->GetByteArrayElements(jKeyBlob, 0)) == NULL) {
+            __leave;
+        }
 
         PUBLICKEYSTRUC* pPublicKeyStruc = (PUBLICKEYSTRUC *) keyBlob;
 
@@ -1580,7 +1613,9 @@
     __try {
 
         jsize length = env->GetArrayLength(jKeyBlob);
-        keyBlob = env->GetByteArrayElements(jKeyBlob, 0);
+        if ((keyBlob = env->GetByteArrayElements(jKeyBlob, 0)) == NULL) {
+            __leave;
+        }
 
         PUBLICKEYSTRUC* pPublicKeyStruc = (PUBLICKEYSTRUC *) keyBlob;
 
@@ -1632,6 +1667,9 @@
     }
 
     jbyte* sourceBytes = env->GetByteArrayElements(source, 0);
+    if (sourceBytes == NULL) {
+        return -1;
+    }
 
     // Copy bytes from the end of the source array to the beginning of the
     // destination array (until the destination array is full).
@@ -1740,45 +1778,61 @@
         }
         // The length argument must be the smaller of jPublicExponentLength
         // and sizeof(pRsaPubKey->pubkey)
-        convertToLittleEndian(env, jPublicExponent,
-            (jbyte *) &(pRsaPubKey->pubexp), jPublicExponentLength);
+        if ((jElementLength = convertToLittleEndian(env, jPublicExponent,
+            (jbyte *) &(pRsaPubKey->pubexp), jPublicExponentLength)) < 0) {
+            __leave;
+        }
 
         // Modulus n
         jBlobElement =
             (jbyte *) (jBlobBytes + sizeof(PUBLICKEYSTRUC) + sizeof(RSAPUBKEY));
-        jElementLength = convertToLittleEndian(env, jModulus, jBlobElement,
-            jKeyByteLength);
+        if ((jElementLength = convertToLittleEndian(env, jModulus, jBlobElement,
+            jKeyByteLength)) < 0) {
+            __leave;
+        }
 
         if (bGeneratePrivateKeyBlob) {
             // Prime p
             jBlobElement += jElementLength;
-            jElementLength = convertToLittleEndian(env, jPrimeP, jBlobElement,
-                jKeyByteLength / 2);
+            if ((jElementLength = convertToLittleEndian(env, jPrimeP,
+                jBlobElement, jKeyByteLength / 2)) < 0) {
+                __leave;
+            }
 
             // Prime q
             jBlobElement += jElementLength;
-            jElementLength = convertToLittleEndian(env, jPrimeQ, jBlobElement,
-                jKeyByteLength / 2);
+            if ((jElementLength = convertToLittleEndian(env, jPrimeQ,
+                jBlobElement, jKeyByteLength / 2)) < 0) {
+                __leave;
+            }
 
             // Prime exponent p
             jBlobElement += jElementLength;
-            jElementLength = convertToLittleEndian(env, jExponentP,
-                jBlobElement, jKeyByteLength / 2);
+            if ((jElementLength = convertToLittleEndian(env, jExponentP,
+                jBlobElement, jKeyByteLength / 2)) < 0) {
+                __leave;
+            }
 
             // Prime exponent q
             jBlobElement += jElementLength;
-            jElementLength = convertToLittleEndian(env, jExponentQ,
-                jBlobElement, jKeyByteLength / 2);
+            if ((jElementLength = convertToLittleEndian(env, jExponentQ,
+                jBlobElement, jKeyByteLength / 2)) < 0) {
+                __leave;
+            }
 
             // CRT coefficient
             jBlobElement += jElementLength;
-            jElementLength = convertToLittleEndian(env, jCrtCoefficient,
-                jBlobElement, jKeyByteLength / 2);
+            if ((jElementLength = convertToLittleEndian(env, jCrtCoefficient,
+                jBlobElement, jKeyByteLength / 2)) < 0) {
+                __leave;
+            }
 
             // Private exponent
             jBlobElement += jElementLength;
-            convertToLittleEndian(env, jPrivateExponent, jBlobElement,
-                jKeyByteLength);
+            if ((jElementLength = convertToLittleEndian(env, jPrivateExponent,
+                jBlobElement, jKeyByteLength)) < 0) {
+                __leave;
+            }
         }
 
         jBlob = env->NewByteArray(jBlobLength);
@@ -1849,9 +1903,15 @@
 
     __try
     {
-        pszKeyContainerName = env->GetStringUTFChars(keyContainerName, NULL);
+        if ((pszKeyContainerName =
+            env->GetStringUTFChars(keyContainerName, NULL)) == NULL) {
+            __leave;
+        }
         dwBlobLen = env->GetArrayLength(keyBlob);
-        pbKeyBlob = (BYTE *) env->GetByteArrayElements(keyBlob, 0);
+        if ((pbKeyBlob = (BYTE *) env->GetByteArrayElements(keyBlob, 0))
+            == NULL) {
+            __leave;
+        }
 
         // Acquire a CSP context (create a new key container).
         if (::CryptAcquireContext(
@@ -1923,7 +1983,10 @@
     __try
     {
         dwBlobLen = env->GetArrayLength(keyBlob);
-        pbKeyBlob = (BYTE *) env->GetByteArrayElements(keyBlob, 0);
+        if ((pbKeyBlob = (BYTE *) env->GetByteArrayElements(keyBlob, 0))
+            == NULL) {
+            __leave;
+        }
 
         // Acquire a CSP context (create a new key container).
         // Prefer a PROV_RSA_AES CSP, when available, due to its support
--- a/jdk/src/windows/native/sun/windows/awt_Component.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/windows/native/sun/windows/awt_Component.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -6935,9 +6935,9 @@
 {
     TRY;
 
-    return JNI_IS_TRUE(AwtToolkit::GetInstance().SyncCall(
+    return (jboolean)AwtToolkit::GetInstance().SyncCall(
         (void *(*)(void *))AwtComponent::_NativeHandlesWheelScrolling,
-        env->NewGlobalRef(self)));
+        env->NewGlobalRef(self));
     // global ref is deleted in _NativeHandlesWheelScrolling
 
     CATCH_BAD_ALLOC_RET(NULL);
@@ -6956,9 +6956,9 @@
 
     jobject selfGlobalRef = env->NewGlobalRef(self);
 
-    return JNI_IS_TRUE(AwtToolkit::GetInstance().SyncCall(
+    return (jboolean)AwtToolkit::GetInstance().SyncCall(
         (void*(*)(void*))AwtComponent::_IsObscured,
-        (void *)selfGlobalRef));
+        (void *)selfGlobalRef);
     // selfGlobalRef is deleted in _IsObscured
 
     CATCH_BAD_ALLOC_RET(NULL);
--- a/jdk/src/windows/native/sun/windows/awt_List.cpp	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/src/windows/native/sun/windows/awt_List.cpp	Wed Jul 05 19:53:51 2017 +0200
@@ -1018,8 +1018,8 @@
     ses->list = env->NewGlobalRef(self);
     ses->index = index;
 
-    return JNI_IS_TRUE(AwtToolkit::GetInstance().SyncCall(
-                       (void *(*)(void *))AwtList::_IsSelected, ses));
+    return (jboolean)AwtToolkit::GetInstance().SyncCall(
+        (void *(*)(void *))AwtList::_IsSelected, ses);
     // global ref and ses are deleted in _IsSelected
 
     CATCH_BAD_ALLOC_RET(FALSE);
--- a/jdk/test/ProblemList.txt	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/test/ProblemList.txt	Wed Jul 05 19:53:51 2017 +0200
@@ -204,10 +204,8 @@
 sun/security/pkcs11/ec/TestKeyFactory.java                      generic-all
 
 # 7164518: no PortUnreachableException on Mac
-sun/security/krb5/auto/Unreachable.java                         macosx-all
-
-# 7147060
-com/sun/org/apache/xml/internal/security/transforms/ClassLoaderTest.java	generic-all
+# 8051952: Unreachable.java test failing on Windows
+sun/security/krb5/auto/Unreachable.java                         windows-all,macosx-all
 
 # 6988842: 4 tests failing on Solaris 5.10
 sun/security/pkcs11/Secmod/AddPrivateKey.java                   solaris-all
@@ -215,7 +213,7 @@
 sun/security/pkcs11/ec/ReadPKCS12.java                          solaris-all
 sun/security/pkcs11/sslecc/ClientJSSEServerJSSE.java            solaris-all
 
-# 7041639, Solaris DSA keypair generation bug
+# 7041639: Solaris DSA keypair generation bug
 java/security/KeyPairGenerator/SolarisShortDSA.java             solaris-all
 sun/security/tools/keytool/standard.sh                          solaris-all
 
@@ -240,8 +238,8 @@
 # jdk_tools
 
 # Tests take too long, on sparcs see 7143279
-tools/pack200/CommandLineTests.java                             solaris-all, macosx-all
-tools/pack200/Pack200Test.java                                  solaris-all, macosx-all
+tools/pack200/CommandLineTests.java                             solaris-all,macosx-all
+tools/pack200/Pack200Test.java                                  solaris-all,macosx-all
 
 # 8007410
 tools/launcher/FXLauncherTest.java                              linux-all
@@ -251,7 +249,7 @@
 # jdk_jdi
 
 # 6983531
-com/sun/jdi/BadHandshakeTest.java                               linux-all, windows-all
+com/sun/jdi/BadHandshakeTest.java                               linux-all,windows-all
 
 # 8004127
 com/sun/jdi/RedefineImplementor.sh                              generic-all
--- a/jdk/test/com/sun/jdi/ExclusiveBind.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/test/com/sun/jdi/ExclusiveBind.java	Wed Jul 05 19:53:51 2017 +0200
@@ -108,7 +108,7 @@
                 "process1",
                 process1,
                 line -> line.equals("Listening for transport dt_socket at address: " + address),
-                Math.round(5000 * Utils.TIMEOUT_FACTOR),
+                Utils.adjustTimeout(5000),
                 TimeUnit.MILLISECONDS
         );
 
--- a/jdk/test/com/sun/org/apache/xml/internal/security/transforms/ClassLoaderTest.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/test/com/sun/org/apache/xml/internal/security/transforms/ClassLoaderTest.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2014, 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,9 +24,9 @@
 /**
  * @test
  * @author Sean Mullan
- * @bug 6461674 8009217
+ * @bug 6461674 8009217 7147060
  * @compile -XDignore.symbol.file ClassLoaderTest.java MyTransform.java
- * @run main ClassLoaderTest
+ * @run main/othervm ClassLoaderTest
  * @summary Ensure Transform.register works with transform implementations
  *   loaded by class loader other than system/boot class loader
  */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Frame/MaximizedUndecorated/MaximizedUndecorated.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,100 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.Frame;
+import javax.swing.JFrame;
+import java.awt.GraphicsEnvironment;
+import java.awt.Toolkit;
+import java.awt.EventQueue;
+import java.awt.FlowLayout;
+import java.awt.Rectangle;
+import java.lang.reflect.InvocationTargetException;
+/*
+ * @test
+ * @bug 8022302
+ * @summary Set extendedState Frame.MAXIMIZED_BOTH for undecorated Frame and JFrame.
+ *          Check if resulted size is equal to GraphicsEnvironment.getMaximumWindowBounds().
+ *
+ * @library ../../../../lib/testlibrary
+ * @build ExtendedRobot
+ * @run main MaximizedUndecorated
+ */
+
+
+public class MaximizedUndecorated {
+    private Frame frame;
+    private ExtendedRobot robot;
+    public static void main(String args[]) {
+        if (!Toolkit.getDefaultToolkit().isFrameStateSupported(Frame.MAXIMIZED_BOTH)) {
+            return;
+        }
+        MaximizedUndecorated test = new MaximizedUndecorated();
+        boolean doPass = true;
+        try{
+            if( !test.doTest(true) ) {
+                System.out.println("Actual bounds differ from Maximum Window Bounds for JFrame");
+                doPass = false;
+            }
+            if( !test.doTest(false) ) {
+                System.out.println("Actual bounds differ from Maximum Window Bounds for Frame");
+                doPass = false;
+            }
+        }catch(Exception ie) {
+            ie.printStackTrace();
+            throw new RuntimeException("Interrupted or InvocationTargetException occured");
+        }
+        if(!doPass) {
+            throw new RuntimeException("Actual bounds of undecorated frame differ from Maximum Windows Bounds for this platform");
+        }
+    }
+    MaximizedUndecorated() {
+        try {
+            robot = new ExtendedRobot();
+        }catch(Exception ex) {
+            ex.printStackTrace();
+            throw new RuntimeException("Cannot create robot");
+        }
+    }
+    boolean doTest(boolean swingFrame) throws InterruptedException, InvocationTargetException {
+        EventQueue.invokeAndWait( () -> {
+            frame = swingFrame? new JFrame("Test Frame") : new Frame("Test Frame");
+            frame.setLayout(new FlowLayout());
+            frame.setBounds(50,50,300,300);
+            frame.setUndecorated(true);
+            frame.setVisible(true);
+        });
+        robot.waitForIdle(2000);
+        EventQueue.invokeAndWait( () -> {
+            frame.setExtendedState(Frame.MAXIMIZED_BOTH);
+        });
+        robot.waitForIdle(2000);
+        Rectangle actualBounds = frame.getBounds();
+        Rectangle expectedBounds = GraphicsEnvironment.
+               getLocalGraphicsEnvironment().getMaximumWindowBounds();
+        EventQueue.invokeAndWait( () -> {
+            frame.dispose();
+        });
+
+        return actualBounds.equals(expectedBounds);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDDAppModalTest.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.Dialog;
+
+/*
+ * @test
+ * @bug 8049617
+ * @summary Check whether an application modal Dialog created with a Dialog
+ *          constructor receives focus, whether its components receive focus
+ *          and respond to key events. Check also the correctness
+ *          of blocking behavior for the parent Dialog.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @run main BlockingDDAppModalTest
+ */
+
+public class BlockingDDAppModalTest {
+
+    public static void main(String[] args) throws Exception {
+        (new BlockingDDTest(Dialog.ModalityType.APPLICATION_MODAL)).doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDDDocModalTest.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.Dialog;
+
+/*
+ * @test
+ * @bug 8049617
+ * @summary Check whether a document modal Dialog created with a Dialog
+ *          constructor receives focus, whether its components receive focus
+ *          and respond to key events. Check also the correctness
+ *          of blocking behavior for the parent Dialog.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @run main BlockingDDDocModalTest
+ */
+
+public class BlockingDDDocModalTest {
+
+    public static void main(String[] args) throws Exception {
+        (new BlockingDDTest(Dialog.ModalityType.DOCUMENT_MODAL)).doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDDModelessTest.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.Dialog;
+
+/*
+ * @test
+ * @bug 8049617
+ * @summary Check whether a modeless Dialog created with a Dialog
+ *          constructor receives focus, whether its components receive focus
+ *          and respond to key events. Check also the correctness
+ *          of blocking behavior for the parent Dialog.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @run main BlockingDDModelessTest
+ */
+
+public class BlockingDDModelessTest {
+
+    public static void main(String[] args) throws Exception {
+        (new BlockingDDTest(Dialog.ModalityType.MODELESS)).doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDDNonModalTest.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2007, 2014, 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 8049617
+ * @summary Check whether a non-modal Dialog created with a Dialog
+ *          constructor receives focus, whether its components receive focus
+ *          and respond to key events. Check also the correctness
+ *          of blocking behavior for the parent Dialog.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @run main BlockingDDNonModalTest
+ */
+
+public class BlockingDDNonModalTest {
+
+    public static void main(String[] args) throws Exception {
+        (new BlockingDDTest(null)).doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDDSetModalTest.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2007, 2014, 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 8049617
+ * @summary Check whether a modal Dialog created with a Dialog
+ *          constructor receives focus, whether its components receive focus
+ *          and respond to key events. Check also the correctness
+ *          of blocking behavior for the parent Dialog.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @run main BlockingDDSetModalTest
+ */
+
+public class BlockingDDSetModalTest {
+
+    public static void main(String[] args) throws Exception {
+        (new BlockingDDTest()).doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDDTest.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,124 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.*;
+import static jdk.testlibrary.Asserts.*;
+
+// DD: Dialog -> Dialog
+
+public class BlockingDDTest {
+
+    private TestDialog parent, dialog;
+
+    private static final int delay = 1000;
+    private final ExtendedRobot robot;
+
+    private final Dialog.ModalityType modalityType;
+    private final boolean setModal;
+
+    private BlockingDDTest(Dialog.ModalityType modType, boolean modal) throws Exception {
+
+        modalityType = modType;
+        setModal = modal;
+        robot = new ExtendedRobot();
+        createGUI();
+    }
+
+    public BlockingDDTest(Dialog.ModalityType modType) throws Exception {
+        this(modType, false);
+    }
+
+    public BlockingDDTest() throws Exception {
+        this(null, true);
+    }
+
+
+    private void showParent() {
+
+        parent = new TestDialog((Frame) null);
+        parent.setTitle("Parent");
+        parent.setLocation(50, 50);
+        parent.setVisible(true);
+    }
+
+    private void showChild() {
+
+        dialog = new TestDialog(parent);
+        if (setModal) {
+            dialog.setModal(true);
+        } else if (modalityType != null) {
+            dialog.setModalityType(modalityType);
+        }
+
+        dialog.setLocation(250, 50);
+        dialog.setVisible(true);
+    }
+
+
+    private void createGUI() throws Exception {
+
+        EventQueue.invokeAndWait(this::showParent);
+        robot.waitForIdle(delay);
+        EventQueue.invokeLater(this::showChild);
+        robot.waitForIdle(delay);
+    }
+
+    public void doTest() throws Exception {
+
+        try {
+            dialog.activated.waitForFlagTriggered();
+            assertTrue(dialog.activated.flag(), "Dialog did not trigger " +
+                "Window Activated event when it became visible");
+
+            dialog.closeGained.waitForFlagTriggered();
+            assertTrue(dialog.closeGained.flag(), "the 1st Dialog button " +
+                "did not gain focus when it became visible");
+
+            assertTrue(dialog.closeButton.hasFocus(), "the 1st Dialog button " +
+                "gained the focus but lost it afterwards");
+
+            dialog.checkUnblockedDialog(robot, "Modal Dialog shouldn't be blocked.");
+
+            if ((modalityType == Dialog.ModalityType.APPLICATION_MODAL) ||
+                (modalityType == Dialog.ModalityType.DOCUMENT_MODAL) ||
+                (modalityType == Dialog.ModalityType.TOOLKIT_MODAL) ||
+                dialog.isModal())
+            {
+                parent.checkBlockedDialog(robot,
+                    "Dialog is the parent of a visible " + modalityType + " Dialog.");
+            } else {
+                parent.checkUnblockedDialog(robot,
+                    "Dialog is the parent of a visible " + modalityType + " Dialog.");
+            }
+
+            robot.waitForIdle(delay);
+        } finally {
+            EventQueue.invokeAndWait(this::closeAll);
+        }
+    }
+
+    private void closeAll() {
+        if (parent != null) { parent.dispose(); }
+        if (dialog != null) { dialog.dispose(); }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDDToolkitModalTest.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.Dialog;
+
+/*
+ * @test
+ * @bug 8049617
+ * @summary Check whether a toolkit modal Dialog created with a Dialog
+ *          constructor receives focus, whether its components receive focus
+ *          and respond to key events. Check also the correctness
+ *          of blocking behavior for the parent Dialog.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @run main BlockingDDToolkitModalTest
+ */
+
+public class BlockingDDToolkitModalTest {
+
+    public static void main(String[] args) throws Exception {
+        (new BlockingDDTest(Dialog.ModalityType.TOOLKIT_MODAL)).doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDFAppModalTest.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.Dialog;
+
+/*
+ * @test
+ * @bug 8049617
+ * @summary Check whether an application modal Dialog created with a Frame
+ *          constructor receives focus, whether its components receive focus
+ *          and respond to key events. Check also the correctness
+ *          of blocking behavior for the parent Frame.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @run main BlockingDFAppModalTest
+ */
+
+public class BlockingDFAppModalTest {
+
+    public static void main(String[] args) throws Exception {
+        (new BlockingDFTest(Dialog.ModalityType.APPLICATION_MODAL)).doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDFSetModalTest.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.Dialog;
+
+/*
+ * @test
+ * @bug 8049617
+ * @summary Check whether a modal Dialog created with a Frame
+ *          constructor receives focus, whether its components receive focus
+ *          and respond to key events. Check also the correctness
+ *          of blocking behavior for the parent Frame.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @run main BlockingDFSetModalTest
+ */
+
+public class BlockingDFSetModalTest {
+
+    public static void main(String[] args) throws Exception {
+        (new BlockingDFTest()).doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDFTest.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,97 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.*;
+import static jdk.testlibrary.Asserts.*;
+
+
+// DF: Dialog -> Frame
+
+public class BlockingDFTest {
+
+    private TestDialog dialog;
+    private TestFrame  frame;
+
+    private static final int delay = 500;
+    private final ExtendedRobot robot;
+
+    private BlockingDFTest(Dialog.ModalityType modalityType,
+                           boolean             setModal) throws Exception {
+
+        robot = new ExtendedRobot();
+        EventQueue.invokeLater(() -> { createGUI(modalityType, setModal); });
+    }
+
+    public BlockingDFTest(Dialog.ModalityType modalityType) throws Exception {
+        this(modalityType, false);
+    }
+
+    public BlockingDFTest() throws Exception { this(null, true); }
+
+
+    private void createGUI(Dialog.ModalityType modalityType,
+                           boolean             setModal) {
+
+        frame = new TestFrame();
+        frame.setLocation(50, 50);
+        frame.setVisible(true);
+
+        dialog = new TestDialog((Dialog) null);
+        dialog.setLocation(250, 50);
+        if (setModal) {
+            dialog.setModal(true);
+        } else if (modalityType != null) {
+            dialog.setModalityType(modalityType);
+        }
+
+        dialog.setVisible(true);
+    }
+
+    public void doTest() throws Exception {
+
+        try {
+
+            robot.waitForIdle(delay);
+            dialog.activated.waitForFlagTriggered();
+            assertTrue(dialog.activated.flag(), "Dialog did not trigger " +
+                "Window Activated event when it became visible");
+
+            dialog.closeGained.waitForFlagTriggered();
+            assertTrue(dialog.closeGained.flag(), "The 1st button did not " +
+                "gain focus when the dialog became visible");
+
+            dialog.checkUnblockedDialog(robot, "");
+            frame.checkBlockedFrame(robot, "");
+            robot.waitForIdle(delay);
+
+        } finally {
+            EventQueue.invokeAndWait(this::closeAll);
+        }
+    }
+
+    private void closeAll() {
+        if (frame  != null) {  frame.dispose(); }
+        if (dialog != null) { dialog.dispose(); }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDFToolkitModalTest.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.Dialog;
+
+/*
+ * @test
+ * @bug 8049617
+ * @summary Check whether a toolkit modal Dialog created with a Frame
+ *          constructor receives focus, whether its components receives focus
+ *          and respond to key events. Check also the correctness
+ *          of blocking behavior for the parent Frame.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @run main BlockingDFToolkitModalTest
+ */
+
+public class BlockingDFToolkitModalTest {
+
+    public static void main(String[] args) throws Exception {
+        (new BlockingDFTest(Dialog.ModalityType.TOOLKIT_MODAL)).doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDFWModeless1Test.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.Dialog;
+
+/*
+ * @test
+ * @bug 8049617
+ * @summary Check whether a modeless Dialog created with a Frame
+ *          constructor receives focus, whether its components receive focus
+ *          and respond to key events. Check also if the other windows
+ *          receive mouse and key events.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @build TestWindow
+ * @run main BlockingDFWModeless1Test
+ */
+
+public class BlockingDFWModeless1Test {
+
+    public static void main(String[] args) throws Exception {
+        (new BlockingDFWTest(
+            BlockingDFWTest.Parent.FRAME,
+            Dialog.ModalityType.MODELESS)).doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDFWModeless2Test.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.Dialog;
+
+/*
+ * @test
+ * @bug 8049617
+ * @summary Check whether a modeless Dialog created with a Dialog
+ *          constructor receives focus, whether its components receive focus
+ *          and respond to key events. Check also if the other windows
+ *          receive mouse and key events.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @build TestWindow
+ * @run main BlockingDFWModeless2Test
+ */
+
+public class BlockingDFWModeless2Test {
+
+    public static void main(String[] args) throws Exception {
+        (new BlockingDFWTest(
+            BlockingDFWTest.Parent.DIALOG,
+            Dialog.ModalityType.MODELESS)).doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDFWNonModal1Test.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2007, 2014, 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 8049617
+ * @summary Check whether a non-modal Dialog created with a Frame
+ *          constructor receives focus, whether its components receive focus
+ *          and respond to key events. Check also if the other windows
+ *          receive mouse and key events.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @build TestWindow
+ * @run main BlockingDFWNonModal1Test
+ */
+
+public class BlockingDFWNonModal1Test {
+
+    public static void main(String[] args) throws Exception {
+        (new BlockingDFWTest(
+            BlockingDFWTest.Parent.FRAME, null)).doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDFWNonModal2Test.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2007, 2014, 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 8049617
+ * @summary Check whether a non-modal Dialog created with a Dialog
+ *          constructor receives focus, whether its components receive focus
+ *          and respond to key events. Check also if the other windows
+ *          receive mouse and key events.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @build TestWindow
+ * @run main BlockingDFWNonModal2Test
+ */
+
+public class BlockingDFWNonModal2Test {
+
+    public static void main(String[] args) throws Exception {
+        (new BlockingDFWTest(
+            BlockingDFWTest.Parent.DIALOG, null)).doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDFWTest.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,162 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.*;
+import java.awt.event.KeyEvent;
+import static jdk.testlibrary.Asserts.*;
+
+// DFW: Dialog -> Frame -> Window
+
+public class BlockingDFWTest {
+
+    private static final int delay = 500;
+    private final ExtendedRobot robot;
+
+    public enum Parent {DIALOG, FRAME};
+
+    private ParentDialog parentDialog;
+    private ParentFrame  parentFrame;
+    private TestDialog dialog;
+    private TestFrame frame;
+    private TestWindow window;
+
+
+    public BlockingDFWTest(Parent parentWin, Dialog.ModalityType modalityType) throws Exception {
+
+        robot = new ExtendedRobot();
+        EventQueue.invokeLater(() -> { createGUI(parentWin, modalityType); });
+    }
+
+    private void createGUI(Parent parentWin, Dialog.ModalityType modalityType) {
+
+        Window p = null;
+        switch (parentWin) {
+            case DIALOG:
+                parentDialog = new ParentDialog((Dialog) null);
+                dialog = new CustomDialog(parentDialog);
+                p = parentDialog;
+                break;
+            case FRAME:
+                parentFrame = new ParentFrame();
+                dialog = new CustomDialog(parentFrame);
+                p = parentFrame;
+                break;
+        }
+
+        assertFalse(p == null, "invalid parent");
+        p.setLocation(50, 50);
+        dialog.setLocation(250, 50);
+        if (modalityType != null) { dialog.setModalityType(modalityType); }
+
+        frame = new TestFrame();
+        frame.setLocation(50, 250);
+        window = new TestWindow(frame);
+        window.setLocation(250, 250);
+
+        p.setVisible(true);
+    }
+
+    public void doTest() throws Exception {
+
+        try {
+
+            robot.waitForIdle(delay);
+
+            if (parentDialog != null) { parentDialog.clickOpenButton(robot); }
+            else if (parentFrame != null) { parentFrame.clickOpenButton(robot); }
+            robot.waitForIdle(delay);
+
+            dialog.activated.waitForFlagTriggered();
+            assertTrue(dialog.activated.flag(), "Dialog did not trigger " +
+                "Window Activated event when it became visible");
+
+            dialog.closeGained.waitForFlagTriggered();
+            assertTrue(dialog.closeGained.flag(), "the 1st button did not gain " +
+                "focus when the dialog became visible");
+
+            assertTrue(dialog.closeButton.hasFocus(), "the 1st dialog button " +
+                "gained focus, but lost it afterwards");
+
+            dialog.openGained.reset();
+            robot.type(KeyEvent.VK_TAB);
+
+            dialog.openGained.waitForFlagTriggered();
+            assertTrue(dialog.openGained.flag(), "Tab navigation did not happen " +
+                "properly; open button did not gain focus on tab press " +
+                "when parent frame is visible");
+
+            dialog.clickOpenButton(robot);
+            robot.waitForIdle(delay);
+
+            frame.activated.waitForFlagTriggered();
+            assertTrue(frame.activated.flag(), "Frame did not trigger " +
+                "Window Activated event when made visible.");
+
+            frame.checkUnblockedFrame(robot, "Frame should not be blocked.");
+            window.checkUnblockedWindow(robot, "Window should not be blocked.");
+            robot.waitForIdle(delay);
+
+        } finally {
+            EventQueue.invokeAndWait(this::closeAll);
+        }
+    }
+
+    private void closeAll() {
+        if (dialog != null) { dialog.dispose(); }
+        if ( frame != null) {  frame.dispose(); }
+        if (window != null) { window.dispose(); }
+        if (parentDialog != null) { parentDialog.dispose(); }
+        if (parentFrame  != null) {  parentFrame.dispose(); }
+    }
+
+
+    class ParentDialog extends TestDialog {
+
+        public ParentDialog(Dialog d) { super(d); }
+
+        @Override
+        public void doOpenAction() {
+            if (dialog != null) { dialog.setVisible(true); }
+        }
+    }
+
+    class ParentFrame extends TestFrame {
+
+        @Override
+        public void doOpenAction() {
+            if (dialog != null) { dialog.setVisible(true); }
+        }
+    }
+
+    class CustomDialog extends TestDialog {
+
+        public CustomDialog(Dialog d) { super(d); }
+        public CustomDialog(Frame  f) { super(f); }
+
+        @Override
+        public void doOpenAction() {
+            if (frame  != null) {  frame.setVisible(true); }
+            if (window != null) { window.setVisible(true); }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDocModalTest.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,153 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.*;
+import static jdk.testlibrary.Asserts.*;
+
+
+/*
+ * @test
+ * @bug 8049617
+ * @summary Test if a document modality works as expected:
+ *          whether all the windows lying down the document root
+ *          (Frame) get blocked.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @build TestWindow
+ * @run main BlockingDocModalTest
+ */
+
+
+public class BlockingDocModalTest {
+
+    private static final int delay = 500;
+    private final ExtendedRobot robot;
+
+    private TestDialog dialog, childDialog;
+    private TestFrame  frame;
+    private TestWindow window;
+
+
+    public BlockingDocModalTest() throws Exception {
+
+        robot = new ExtendedRobot();
+        EventQueue.invokeLater(this::createGUI);
+    }
+
+    private void createGUI() {
+
+        frame = new CustomFrame();
+        frame.setLocation(50, 50);
+        frame.setVisible(true);
+
+        dialog = new TestDialog(frame);
+        dialog.setLocation(250, 250);
+        dialog.setVisible(true);
+
+        childDialog = new CustomDialog(dialog);
+        childDialog.setLocation(250, 50);
+        childDialog.setModalityType(Dialog.ModalityType.DOCUMENT_MODAL);
+
+        window = new TestWindow(frame);
+        window.setLocation(50, 250);
+    }
+
+    public void doTest() throws Exception {
+
+        try {
+
+            robot.waitForIdle(delay);
+
+            frame.clickOpenButton(robot);
+            robot.waitForIdle(delay);
+
+            childDialog.activated.waitForFlagTriggered();
+            assertTrue(childDialog.activated.flag(), "Dialog did not trigger " +
+                "Window Activated event when it became visible");
+
+            childDialog.closeGained.waitForFlagTriggered();
+            assertTrue(childDialog.closeGained.flag(), "the 1st button did not " +
+                "gain focus when the Dialog became visible");
+
+            assertTrue(childDialog.closeButton.hasFocus(), "the 1st dialog button " +
+                "gained focus but lost it afterwards");
+
+            frame.checkBlockedFrame(robot, "A document modal Dialog from " +
+                "this Frame's child hierarchy should block this frame");
+
+            childDialog.checkUnblockedDialog(robot,
+                "This is a document modal childDialog.");
+
+            childDialog.clickOpenButton(robot);
+            robot.waitForIdle(delay);
+
+            window.checkBlockedWindow(robot,
+                "A document modal dialog having a parent belonging " +
+                "to this Window's document hierarchy is displayed.");
+
+            dialog.checkBlockedDialog(robot,
+                "A document modal child dialog should block this Dialog.");
+
+            robot.waitForIdle(delay);
+
+        } finally {
+            EventQueue.invokeAndWait(this::closeAll);
+        }
+    }
+
+    private void closeAll() {
+        if (dialog != null) { dialog.dispose(); }
+        if ( frame != null) {  frame.dispose(); }
+        if (window != null) { window.dispose(); }
+        if (childDialog != null) { childDialog.dispose(); }
+    }
+
+
+    class CustomFrame extends TestFrame {
+
+        @Override
+        public void doOpenAction() {
+            if (childDialog != null) { childDialog.setVisible(true); }
+        }
+    }
+
+    class CustomDialog extends TestDialog {
+
+        public CustomDialog(Dialog d) { super(d); }
+
+        @Override
+        public void doOpenAction() {
+            if (window != null) { window.setVisible(true); }
+        }
+    }
+
+
+    public static void main(String[] args) throws Exception {
+        (new BlockingDocModalTest()).doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDAppModalTest.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.Dialog;
+
+/*
+ * @test
+ * @bug 8049617
+ * @summary Check whether an application modal Dialog created with a Frame
+ *          constructor receives focus, whether its components receive focus
+ *          and respond to key events. Check also the correctness
+ *          of the blocking behavior for the parent Frame.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @run main BlockingFDAppModalTest
+ */
+
+public class BlockingFDAppModalTest {
+
+    public static void main(String[] args) throws Exception {
+        (new BlockingFDTest(Dialog.ModalityType.APPLICATION_MODAL)).doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDDocModalTest.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.Dialog;
+
+/*
+ * @test
+ * @bug 8049617
+ * @summary Check whether a document modal Dialog created with a Frame
+ *          constructor receives focus, whether its components receive focus
+ *          and respond to key events. Check also the correctness
+ *          of the blocking behavior for the parent Frame.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @run main BlockingFDDocModalTest
+ */
+
+public class BlockingFDDocModalTest {
+
+    public static void main(String[] args) throws Exception {
+        (new BlockingFDTest(Dialog.ModalityType.DOCUMENT_MODAL)).doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDModelessTest.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.Dialog;
+
+/*
+ * @test
+ * @bug 8049617
+ * @summary Check whether a modeless Dialog created with a Frame
+ *          constructor receives focus, whether its components receive focus
+ *          and respond to key events. Check also the correctness
+ *          of the blocking behavior for the parent Frame.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @run main BlockingFDModelessTest
+ */
+
+public class BlockingFDModelessTest {
+
+    public static void main(String[] args) throws Exception {
+        (new BlockingFDTest(Dialog.ModalityType.MODELESS)).doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDNonModalTest.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2007, 2014, 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 8049617
+ * @summary Check whether a non-modal Dialog created with a Frame
+ *          constructor receives focus, whether its components receive focus
+ *          and respond to key events. Check also the correctness
+ *          of the blocking behavior for the parent Frame.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @run main BlockingFDNonModalTest
+ */
+
+public class BlockingFDNonModalTest {
+
+    public static void main(String[] args) throws Exception {
+        (new BlockingFDTest(null)).doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDSetModalTest.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2007, 2014, 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 8049617
+ * @summary Check whether a modal Dialog created with a Frame
+ *          constructor receives focus, whether its components receive focus
+ *          and respond to key events. Check also the correctness
+ *          of the blocking behavior for the parent Frame.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @run main BlockingFDSetModalTest
+ */
+
+public class BlockingFDSetModalTest {
+
+    public static void main(String[] args) throws Exception {
+        (new BlockingFDTest()).doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDTest.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,124 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.*;
+import static jdk.testlibrary.Asserts.*;
+
+
+// FD: Frame -> Dialog
+
+public class BlockingFDTest {
+
+    private TestFrame  frame;
+    private TestDialog dialog;
+
+    private static final int delay = 500;
+    private final ExtendedRobot robot;
+
+    private final Dialog.ModalityType modalityType;
+    private final boolean setModal;
+
+    private BlockingFDTest(Dialog.ModalityType modType, boolean modal) throws Exception {
+
+        modalityType = modType;
+        setModal = modal;
+
+        robot = new ExtendedRobot();
+        EventQueue.invokeLater(this::createGUI);
+    }
+
+    public BlockingFDTest(Dialog.ModalityType modType) throws Exception {
+        this(modType, false);
+    }
+
+    public BlockingFDTest() throws Exception {
+        this(null, true);
+    }
+
+    private void createGUI() {
+
+        frame = new CustomFrame();
+        frame.setLocation(50, 50);
+        dialog = new TestDialog(frame);
+        if (setModal) {
+            dialog.setModal(true);
+        } else if (modalityType != null) {
+            dialog.setModalityType(modalityType);
+        }
+        dialog.setLocation(250, 50);
+
+        frame.setVisible(true);
+    }
+
+    public void doTest() throws Exception {
+
+        try {
+
+            robot.waitForIdle(delay);
+
+            frame.clickOpenButton(robot);
+            robot.waitForIdle(delay);
+
+            dialog.activated.waitForFlagTriggered();
+            assertTrue(dialog.activated.flag(), "Dialog did not trigger " +
+                "Window Activated event when it became visible");
+
+            dialog.closeGained.waitForFlagTriggered();
+            assertTrue(dialog.closeGained.flag(), "the 1st Dialog button " +
+                "did not gain focus when it became visible");
+
+            assertTrue(dialog.closeButton.hasFocus(), "the 1st Dialog button " +
+                "gained the focus but lost it afterwards");
+
+            if ((modalityType == Dialog.ModalityType.APPLICATION_MODAL) ||
+                (modalityType == Dialog.ModalityType.DOCUMENT_MODAL) ||
+                (modalityType == Dialog.ModalityType.TOOLKIT_MODAL) ||
+                setModal)
+            {
+                frame.checkBlockedFrame(robot,
+                    "Frame is the parent of a visible " + modalityType + " Dialog.");
+            } else {
+                frame.checkUnblockedFrame(robot,
+                    "Frame is the parent of a visible " + modalityType + " Dialog.");
+            }
+            robot.waitForIdle(delay);
+
+        } finally {
+            EventQueue.invokeAndWait(this::closeAll);
+        }
+    }
+
+    private void closeAll() {
+        if (frame  != null) {  frame.dispose(); }
+        if (dialog != null) { dialog.dispose(); }
+    }
+
+
+    class CustomFrame extends TestFrame {
+
+        @Override
+        public void doOpenAction() {
+            if (dialog != null) { dialog.setVisible(true); }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDToolkitModalTest.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.Dialog;
+
+/*
+ * @test
+ * @bug 8049617
+ * @summary Check whether a toolkit modal Dialog created with a Frame
+ *          constructor receives focus, whether its components receive focus
+ *          and respond to key events. Check also the correctness
+ *          of the blocking behavior for the parent Frame.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @run main BlockingFDToolkitModalTest
+ */
+
+public class BlockingFDToolkitModalTest {
+
+    public static void main(String[] args) throws Exception {
+        (new BlockingFDTest(Dialog.ModalityType.TOOLKIT_MODAL)).doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDWDocModal1Test.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.Dialog;
+
+/*
+ * @test
+ * @bug 8049617
+ * @summary Check whether a document modal Dialog created with a null Frame
+ *          constructor receives focus; whether its components receive focus
+ *          and respond to key events, when there are other windows shown.
+ *          Check also the correctness of blocking behavior for other windows shown.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @build TestWindow
+ * @run main BlockingFDWDocModal1Test
+ */
+
+public class BlockingFDWDocModal1Test {
+
+    public static void main(String[] args) throws Exception {
+        (new BlockingFDWTest(Dialog.ModalityType.DOCUMENT_MODAL,
+            BlockingFDWTest.DialogOwner.NULL_FRAME)).doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDWDocModal2Test.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.Dialog;
+
+/*
+ * @test
+ * @bug 8049617
+ * @summary Check whether a document modal Dialog created with a null Dialog
+ *          constructor receives focus; whether its components receive focus
+ *          and respond to key events, when there are other windows shown.
+ *          Check also the correctness of blocking behavior for other windows shown.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @build TestWindow
+ * @run main BlockingFDWDocModal2Test
+ */
+
+public class BlockingFDWDocModal2Test {
+
+    public static void main(String[] args) throws Exception {
+        (new BlockingFDWTest(Dialog.ModalityType.DOCUMENT_MODAL,
+            BlockingFDWTest.DialogOwner.NULL_DIALOG)).doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDWDocModal3Test.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.Dialog;
+
+/*
+ * @test
+ * @bug 8049617
+ * @summary Check whether a document modal Dialog created with a hidden Frame
+ *          constructor receives focus; whether its components receive focus
+ *          and respond to key events, when there are other windows shown.
+ *          Check also the correctness of blocking behavior for other windows shown.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @build TestWindow
+ * @run main BlockingFDWDocModal3Test
+ */
+
+public class BlockingFDWDocModal3Test {
+
+    public static void main(String[] args) throws Exception {
+        (new BlockingFDWTest(Dialog.ModalityType.DOCUMENT_MODAL,
+            BlockingFDWTest.DialogOwner.HIDDEN_FRAME)).doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDWDocModal4Test.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.Dialog;
+
+/*
+ * @test
+ * @bug 8049617
+ * @summary Check whether a document modal Dialog created with a hidden Dialog
+ *          constructor receives focus; whether its components receive focus
+ *          and respond to key events, when there are other windows shown.
+ *          Check also the correctness of blocking behavior for other windows shown.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @build TestWindow
+ * @run main BlockingFDWDocModal4Test
+ */
+
+public class BlockingFDWDocModal4Test {
+
+    public static void main(String[] args) throws Exception {
+        (new BlockingFDWTest(Dialog.ModalityType.DOCUMENT_MODAL,
+            BlockingFDWTest.DialogOwner.HIDDEN_DIALOG)).doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDWModeless1Test.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.Dialog;
+
+/*
+ * @test
+ * @bug 8049617
+ * @summary Check whether a modeless Dialog created with a null Frame
+ *          constructor receives focus; whether its components receive focus
+ *          and respond to key events, when there are other windows shown.
+ *          Check also the correctness of blocking behavior for other windows shown.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @build TestWindow
+ * @run main BlockingFDWModeless1Test
+ */
+
+public class BlockingFDWModeless1Test {
+
+    public static void main(String[] args) throws Exception {
+        (new BlockingFDWTest(Dialog.ModalityType.MODELESS,
+            BlockingFDWTest.DialogOwner.NULL_FRAME)).doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDWModeless2Test.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.Dialog;
+
+/*
+ * @test
+ * @bug 8049617
+ * @summary Check whether a modeless Dialog created with a null Dialog
+ *          constructor receives focus; whether its components receive focus
+ *          and respond to key events, when there are other windows shown.
+ *          Check also the correctness of blocking behavior for other windows shown.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @build TestWindow
+ * @run main BlockingFDWModeless2Test
+ */
+
+public class BlockingFDWModeless2Test {
+
+    public static void main(String[] args) throws Exception {
+        (new BlockingFDWTest(Dialog.ModalityType.MODELESS,
+            BlockingFDWTest.DialogOwner.NULL_DIALOG)).doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDWModeless3Test.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.Dialog;
+
+/*
+ * @test
+ * @bug 8049617
+ * @summary Check whether a modeless Dialog created with a hidden Frame
+ *          constructor receives focus; whether its components receive focus
+ *          and respond to key events, when there are other windows shown.
+ *          Check also the correctness of blocking behavior for other windows shown.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @build TestWindow
+ * @run main BlockingFDWModeless3Test
+ */
+
+public class BlockingFDWModeless3Test {
+
+    public static void main(String[] args) throws Exception {
+        (new BlockingFDWTest(Dialog.ModalityType.MODELESS,
+            BlockingFDWTest.DialogOwner.HIDDEN_FRAME)).doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDWModeless4Test.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.Dialog;
+
+/*
+ * @test
+ * @bug 8049617
+ * @summary Check whether a modeless Dialog created with a hidden Dialog
+ *          constructor receives focus; whether its components receive focus
+ *          and respond to key events, when there are other windows shown.
+ *          Check also the correctness of blocking behavior for other windows shown.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @build TestWindow
+ * @run main BlockingFDWModeless4Test
+ */
+
+public class BlockingFDWModeless4Test {
+
+    public static void main(String[] args) throws Exception {
+        (new BlockingFDWTest(Dialog.ModalityType.MODELESS,
+            BlockingFDWTest.DialogOwner.HIDDEN_DIALOG)).doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDWNonModal1Test.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2007, 2014, 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 8049617
+ * @summary Check whether a non-modal Dialog created with a null Frame
+ *          constructor receives focus; whether its components receive focus
+ *          and respond to key events, when there are other windows shown.
+ *          Check also the correctness of blocking behavior for other windows shown.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @build TestWindow
+ * @run main BlockingFDWNonModal1Test
+ */
+
+public class BlockingFDWNonModal1Test {
+
+    public static void main(String[] args) throws Exception {
+        (new BlockingFDWTest(null,
+            BlockingFDWTest.DialogOwner.NULL_FRAME)).doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDWNonModal2Test.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2007, 2014, 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 8049617
+ * @summary Check whether a non-modal Dialog created with a null Dialog
+ *          constructor receives focus; whether its components receive focus
+ *          and respond to key events, when there are other windows shown.
+ *          Check also the correctness of blocking behavior for other windows shown.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @build TestWindow
+ * @run main BlockingFDWNonModal2Test
+ */
+
+public class BlockingFDWNonModal2Test {
+
+    public static void main(String[] args) throws Exception {
+        (new BlockingFDWTest(null,
+            BlockingFDWTest.DialogOwner.NULL_DIALOG)).doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDWNonModal3Test.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2007, 2014, 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 8049617
+ * @summary Check whether a non-modal Dialog created with a hidden Frame
+ *          constructor receives focus; whether its components receive focus
+ *          and respond to key events, when there are other windows shown.
+ *          Check also the correctness of blocking behavior for other windows shown.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @build TestWindow
+ * @run main BlockingFDWNonModal3Test
+ */
+
+public class BlockingFDWNonModal3Test {
+
+    public static void main(String[] args) throws Exception {
+        (new BlockingFDWTest(null,
+            BlockingFDWTest.DialogOwner.HIDDEN_FRAME)).doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDWNonModal4Test.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2007, 2014, 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 8049617
+ * @summary Check whether a non-modal Dialog created with a hidden Dialog
+ *          constructor receives focus; whether its components receive focus
+ *          and respond to key events, when there are other windows shown.
+ *          Check also the correctness of blocking behavior for other windows shown.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @build TestWindow
+ * @run main BlockingFDWNonModal4Test
+ */
+
+public class BlockingFDWNonModal4Test {
+
+    public static void main(String[] args) throws Exception {
+        (new BlockingFDWTest(null,
+            BlockingFDWTest.DialogOwner.HIDDEN_DIALOG)).doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDWTest.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,162 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.*;
+import static jdk.testlibrary.Asserts.*;
+
+
+// FDW: Frame -> Dialog -> Window
+
+public class BlockingFDWTest {
+
+    private TestFrame  frame;
+    private TestDialog dialog;
+    private TestWindow window;
+
+    private Dialog hiddenDialog;
+    private Frame  hiddenFrame;
+
+    private static final int delay = 500;
+    private final ExtendedRobot robot;
+
+    public enum DialogOwner {HIDDEN_DIALOG, NULL_DIALOG, HIDDEN_FRAME, NULL_FRAME};
+
+    public BlockingFDWTest(Dialog.ModalityType modalityType,
+                           DialogOwner         owner) throws Exception {
+
+        robot = new ExtendedRobot();
+        EventQueue.invokeLater(() -> { createGUI(modalityType, owner); });
+    }
+
+    private void createGUI(Dialog.ModalityType modalityType,
+                           DialogOwner         owner) {
+
+        frame = new CustomFrame();
+        frame.setLocation(50, 50);
+
+        switch (owner) {
+            case HIDDEN_DIALOG:
+                hiddenDialog = new Dialog((Frame) null);
+                dialog = new CustomDialog(hiddenDialog);
+                break;
+            case NULL_DIALOG:
+                dialog = new CustomDialog((Dialog) null);
+                break;
+            case HIDDEN_FRAME:
+                hiddenFrame = new Frame();
+                dialog = new CustomDialog(hiddenFrame);
+                break;
+            case NULL_FRAME:
+                dialog = new CustomDialog((Frame) null);
+                break;
+        }
+
+        assertFalse(dialog == null, "error: null dialog");
+
+        dialog.setLocation(250, 50);
+        if (modalityType != null) {
+            dialog.setModalityType(modalityType);
+        }
+
+        window = new TestWindow(frame);
+        window.setLocation(450, 50);
+
+        frame.setVisible(true);
+    }
+
+    public void doTest() throws Exception {
+
+        try {
+
+            robot.waitForIdle(delay);
+
+            frame.clickOpenButton(robot);
+            robot.waitForIdle(delay);
+
+            dialog.activated.waitForFlagTriggered();
+            assertTrue(dialog.activated.flag(), "Dialog did not trigger " +
+                "Window Activated event when it became visible");
+
+            dialog.closeGained.waitForFlagTriggered();
+            assertTrue(dialog.closeGained.flag(), "the 1st Dialog button " +
+                "did not gain focus when it became visible");
+
+            assertTrue(dialog.closeButton.hasFocus(), "the 1st Dialog button " +
+                "gained the focus but lost it afterwards");
+
+            frame.checkUnblockedFrame(robot, "A " + dialog.getModalityType() + " dialog is visible.");
+
+            dialog.checkUnblockedDialog(robot, "A Frame is visible.");
+
+            dialog.openClicked.reset();
+            dialog.clickOpenButton(robot);
+            robot.waitForIdle(delay);
+
+            window.checkUnblockedWindow(robot,
+                "A Frame and a " + dialog.getModalityType() + " Dialog are visible.");
+            robot.waitForIdle(delay);
+
+        } finally {
+            EventQueue.invokeAndWait(this::closeAll);
+        }
+    }
+
+    private void closeAll() {
+        if (frame  != null) {  frame.dispose(); }
+        if (dialog != null) { dialog.dispose(); }
+        if (window != null) { window.dispose(); }
+        if (hiddenDialog != null) { hiddenDialog.dispose(); }
+        if (hiddenFrame  != null) {  hiddenFrame.dispose(); }
+    }
+
+
+    class CustomFrame extends TestFrame {
+
+        @Override
+        public void doOpenAction() {
+            if (dialog != null) { dialog.setVisible(true); }
+        }
+    }
+
+    class CustomDialog extends TestDialog {
+
+        public CustomDialog(Dialog dialog) {
+            super(dialog);
+        }
+
+        public CustomDialog(Frame frame) {
+            super(frame);
+        }
+
+        @Override
+        public void doOpenAction() {
+            if (window != null) { window.setVisible(true); }
+        }
+
+        @Override
+        public void doCloseAction() {
+            this.dispose();
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsAppModal1Test.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.Dialog;
+
+/*
+ * @test
+ * @bug 8049617
+ * @summary Check whether an application modal Dialog created with a null Frame
+ *          constructor receives focus; whether its components receive focus
+ *          and respond to key events, when there are other windows shown.
+ *          Also check the correctness of blocking behavior for other windows shown.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @build TestWindow
+ * @run main BlockingWindowsAppModal1Test
+ */
+
+public class BlockingWindowsAppModal1Test {
+
+    public static void main(String[] args) throws Exception {
+        (new BlockingWindowsTest(Dialog.ModalityType.APPLICATION_MODAL,
+                BlockingWindowsTest.DialogOwner.NULL_FRAME)).doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsAppModal2Test.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.Dialog;
+
+/*
+ * @test
+ * @bug 8049617
+ * @summary Check whether an application modal Dialog created with a null Dialog
+ *          constructor receives focus; whether its components receive focus
+ *          and respond to key events, when there are other windows shown.
+ *          Also check the correctness of blocking behavior for other windows shown.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @build TestWindow
+ * @run main BlockingWindowsAppModal2Test
+ */
+
+public class BlockingWindowsAppModal2Test {
+
+    public static void main(String[] args) throws Exception {
+        (new BlockingWindowsTest(Dialog.ModalityType.APPLICATION_MODAL,
+                BlockingWindowsTest.DialogOwner.NULL_DIALOG)).doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsAppModal3Test.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.Dialog;
+
+/*
+ * @test
+ * @bug 8049617
+ * @summary Check whether an application modal Dialog created with a hidden Frame
+ *          constructor receives focus; whether its components receive focus
+ *          and respond to key events, when there are other windows shown.
+ *          Also check the correctness of blocking behavior for other windows shown.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @build TestWindow
+ * @run main BlockingWindowsAppModal3Test
+ */
+
+public class BlockingWindowsAppModal3Test {
+
+    public static void main(String[] args) throws Exception {
+        (new BlockingWindowsTest(Dialog.ModalityType.APPLICATION_MODAL,
+                BlockingWindowsTest.DialogOwner.HIDDEN_FRAME)).doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsAppModal4Test.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.Dialog;
+
+/*
+ * @test
+ * @bug 8049617
+ * @summary Check whether an application modal Dialog created with a hidden Dialog
+ *          constructor receives focus; whether its components receive focus
+ *          and respond to key events, when there are other windows shown.
+ *          Also check the correctness of blocking behavior for other windows shown.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @build TestWindow
+ * @run main BlockingWindowsAppModal4Test
+ */
+
+public class BlockingWindowsAppModal4Test {
+
+    public static void main(String[] args) throws Exception {
+        (new BlockingWindowsTest(Dialog.ModalityType.APPLICATION_MODAL,
+                BlockingWindowsTest.DialogOwner.HIDDEN_DIALOG)).doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsAppModal5Test.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.Dialog;
+
+/*
+ * @test
+ * @bug 8049617
+ * @summary Check whether an application modal Dialog created with a Frame
+ *          constructor receives focus; whether its components receive focus
+ *          and respond to key events, when there are other windows shown.
+ *          Also check the correctness of blocking behavior for other windows shown.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @build TestWindow
+ * @run main BlockingWindowsAppModal5Test
+ */
+
+public class BlockingWindowsAppModal5Test {
+
+    public static void main(String[] args) throws Exception {
+        (new BlockingWindowsTest(Dialog.ModalityType.APPLICATION_MODAL,
+                BlockingWindowsTest.DialogOwner.FRAME)).doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsAppModal6Test.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.Dialog;
+
+/*
+ * @test
+ * @bug 8049617
+ * @summary Check whether an application modal Dialog created with a Dialog
+ *          constructor receives focus; whether its components receive focus
+ *          and respond to key events, when there are other windows shown.
+ *          Also check the correctness of blocking behavior for other windows shown.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @build TestWindow
+ * @run main BlockingWindowsAppModal6Test
+ */
+
+public class BlockingWindowsAppModal6Test {
+
+    public static void main(String[] args) throws Exception {
+        (new BlockingWindowsTest(Dialog.ModalityType.APPLICATION_MODAL,
+                BlockingWindowsTest.DialogOwner.DIALOG)).doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsDocModal1Test.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.Dialog;
+
+/*
+ * @test
+ * @bug 8049617
+ * @summary Check whether a document modal Dialog created with a Frame
+ *          constructor receives focus; whether its components receive focus
+ *          and respond to key events, when there are other windows shown.
+ *          Also check the correctness of blocking behavior for other windows shown.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @build TestWindow
+ * @run main BlockingWindowsDocModal1Test
+ */
+
+public class BlockingWindowsDocModal1Test {
+
+    public static void main(String[] args) throws Exception {
+        (new BlockingWindowsDocModalTest(
+                BlockingWindowsDocModalTest.Parent.FRAME)).doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsDocModal2Test.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.Dialog;
+
+/*
+ * @test
+ * @bug 8049617
+ * @summary Check whether a document modal Dialog created with a Dialog
+ *          constructor receives focus; whether its components receive focus
+ *          and respond to key events, when there are other windows shown.
+ *          Also check the correctness of blocking behavior for other windows shown.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @build TestWindow
+ * @run main BlockingWindowsDocModal2Test
+ */
+
+public class BlockingWindowsDocModal2Test {
+
+    public static void main(String[] args) throws Exception {
+        (new BlockingWindowsDocModalTest(
+                BlockingWindowsDocModalTest.Parent.DIALOG)).doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsDocModalTest.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,211 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.*;
+import java.awt.event.KeyEvent;
+import static jdk.testlibrary.Asserts.*;
+
+import java.util.List;
+import java.util.ArrayList;
+
+public class BlockingWindowsDocModalTest {
+
+    private ParentDialog parentDialog;
+    private ParentFrame  parentFrame;
+    private CustomDialog dialog;
+    private TestDialog secondDialog, childDialog;
+    private TestFrame  secondFrame;
+    private TestWindow window, childWindow, secondWindow;
+
+
+    private static final int delay = 500;
+    private final ExtendedRobot robot;
+
+    private List<Window> allWindows;
+
+    public enum Parent {DIALOG, FRAME};
+    private Parent root;
+
+    public BlockingWindowsDocModalTest(Parent p) throws Exception {
+
+        root = p;
+
+        robot = new ExtendedRobot();
+        EventQueue.invokeLater(this::createGUI);
+    }
+
+    private void createGUI() {
+
+        allWindows = new ArrayList<>();
+
+        switch (root) {
+            case DIALOG:
+                parentDialog = new ParentDialog((Dialog) null);
+                parentDialog.setLocation(50, 50);
+                parentDialog.setVisible(true);
+                allWindows.add(parentDialog);
+
+                dialog = new CustomDialog(parentDialog);
+                secondDialog = new TestDialog(parentDialog);
+                window = new TestWindow(parentDialog);
+                break;
+            case FRAME:
+                parentFrame = new ParentFrame();
+                parentFrame.setLocation(50, 50);
+                parentFrame.setVisible(true);
+                allWindows.add(parentFrame);
+
+                dialog = new CustomDialog(parentFrame);
+                secondDialog = new TestDialog(parentFrame);
+                window = new TestWindow(parentFrame);
+                break;
+        }
+
+        allWindows.add(dialog);
+        allWindows.add(secondDialog);
+        allWindows.add(window);
+
+        dialog.setModalityType(Dialog.ModalityType.DOCUMENT_MODAL);
+        dialog.setLocation(250, 50);
+        window.setLocation(450, 50);
+        secondDialog.setLocation(450, 250);
+
+        secondFrame = new TestFrame();
+        allWindows.add(secondFrame);
+        secondFrame.setLocation(50, 250);
+
+        secondWindow = new TestWindow(secondFrame);
+        allWindows.add(secondWindow);
+        secondWindow.setLocation(250, 250);
+
+        childDialog = new TestDialog(dialog);
+        allWindows.add(childDialog);
+        childDialog.setLocation(250, 450);
+
+        childWindow = new TestWindow(dialog);
+        allWindows.add(childWindow);
+        childWindow.setLocation(50, 450);
+    }
+
+    public void doTest() throws Exception {
+
+        try {
+            robot.waitForIdle(delay);
+
+            if (root == Parent.DIALOG) {
+                parentDialog.clickOpenButton(robot);
+            } else { //Parent.FRAME
+                parentFrame.clickOpenButton(robot);
+            }
+            robot.waitForIdle(delay);
+
+            dialog.activated.waitForFlagTriggered();
+            assertTrue(dialog.activated.flag(), "Dialog did not trigger " +
+                "Window Acivated event when it became visible");
+
+            dialog.closeGained.waitForFlagTriggered();
+            assertTrue(dialog.closeGained.flag(),
+                "the 1st Dialog button didn't gain focus");
+
+            assertTrue(dialog.closeButton.hasFocus(), "the 1st Dialog button " +
+                "gained focus but lost it afterwards");
+
+            dialog.openGained.reset();
+            robot.type(KeyEvent.VK_TAB);
+
+            dialog.openGained.waitForFlagTriggered();
+            assertTrue(dialog.openGained.flag(), "Tab navigation did not happen properly on Dialog; " +
+                "Open button did not gain focus on tab press when parent frame is visible");
+
+            dialog.clickOpenButton(robot);
+            robot.waitForIdle(delay);
+
+            secondFrame.checkUnblockedFrame(robot,
+                "A document modal dialog and its parent are visible.");
+            secondWindow.checkUnblockedWindow(robot,
+                "A Frame and a document modal Dialog are visible.");
+
+            if (root == Parent.DIALOG) {
+                parentDialog.checkBlockedDialog(robot, "Dialog is a parent of a document modal dialog.");
+            } else { //Parent.FRAME
+                parentFrame.checkBlockedFrame(robot, "Frame is a parent of a document modal dialog.");
+            }
+
+            secondDialog.checkBlockedDialog(robot,
+                "The parent of the Dialog is also the parent of a document modal dialog");
+            window.checkBlockedWindow(robot,
+                "The parent of the Window is also the parent of a document modal dialog");
+
+            childWindow.checkUnblockedWindow(robot,
+                "The parent of the Window is a document modal dialog");
+            childDialog.checkUnblockedDialog(robot,
+                "The parent of the Dialog is a document modal dialog");
+            robot.waitForIdle(delay);
+
+        } finally {
+            EventQueue.invokeAndWait(this::closeAll);
+        }
+    }
+
+    private void closeAll() {
+        for (Window w: allWindows) {
+            if (w != null) { w.dispose(); }
+        }
+    }
+
+    class ParentDialog extends TestDialog {
+
+        public ParentDialog(Dialog d) { super(d); }
+
+        @Override
+        public void doOpenAction() {
+            if (dialog != null) { dialog.setVisible(true); }
+        }
+    }
+
+    class ParentFrame extends TestFrame {
+
+        @Override
+        public void doOpenAction() {
+            if (dialog != null) { dialog.setVisible(true); }
+        }
+
+    }
+
+    class CustomDialog extends TestDialog {
+
+        public CustomDialog(Dialog d) { super(d); }
+        public CustomDialog(Frame f)  { super(f); }
+
+        @Override
+        public void doOpenAction() {
+            if (secondFrame  != null) {  secondFrame.setVisible(true); }
+            if (secondWindow != null) { secondWindow.setVisible(true); }
+            if (secondDialog != null) { secondDialog.setVisible(true); }
+            if (window != null) { window.setVisible(true); }
+            if (childWindow != null) { childWindow.setVisible(true); }
+            if (childDialog != null) { childDialog.setVisible(true); }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsSetModal1Test.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2007, 2014, 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 8049617
+ * @summary Check whether a modal Dialog created with a null Frame
+ *          constructor receives focus; whether its components receive focus
+ *          and respond to key events, when there are other windows shown.
+ *          Also check the correctness of blocking behavior for other windows shown.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @build TestWindow
+ * @run main BlockingWindowsSetModal1Test
+ */
+
+public class BlockingWindowsSetModal1Test {
+
+    public static void main(String[] args) throws Exception {
+        (new BlockingWindowsTest(
+                BlockingWindowsTest.DialogOwner.NULL_FRAME)).doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsSetModal2Test.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2007, 2014, 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 8049617
+ * @summary Check whether a modal Dialog created with a null Dialog
+ *          constructor receives focus; whether its components receive focus
+ *          and respond to key events, when there are other windows shown.
+ *          Also check the correctness of blocking behavior for other windows shown.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @build TestWindow
+ * @run main BlockingWindowsSetModal2Test
+ */
+
+public class BlockingWindowsSetModal2Test {
+
+    public static void main(String[] args) throws Exception {
+        (new BlockingWindowsTest(
+                BlockingWindowsTest.DialogOwner.NULL_DIALOG)).doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsSetModal3Test.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2007, 2014, 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 8049617
+ * @summary Check whether a modal Dialog created with a hidden Frame
+ *          constructor receives focus; whether its components receive focus
+ *          and respond to key events, when there are other windows shown.
+ *          Also check the correctness of blocking behavior for other windows shown.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @build TestWindow
+ * @run main BlockingWindowsSetModal3Test
+ */
+
+public class BlockingWindowsSetModal3Test {
+
+    public static void main(String[] args) throws Exception {
+        (new BlockingWindowsTest(
+                BlockingWindowsTest.DialogOwner.HIDDEN_FRAME)).doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsSetModal4Test.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2007, 2014, 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 8049617
+ * @summary Check whether a modal Dialog created with a hidden Dialog
+ *          constructor receives focus; whether its components receive focus
+ *          and respond to key events, when there are other windows shown.
+ *          Also check the correctness of blocking behavior for other windows shown.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @build TestWindow
+ * @run main BlockingWindowsSetModal4Test
+ */
+
+public class BlockingWindowsSetModal4Test {
+
+    public static void main(String[] args) throws Exception {
+        (new BlockingWindowsTest(
+                BlockingWindowsTest.DialogOwner.HIDDEN_DIALOG)).doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsSetModal5Test.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2007, 2014, 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 8049617
+ * @summary Check whether a modal Dialog created with a Frame
+ *          constructor receives focus; whether its components receive focus
+ *          and respond to key events, when there are other windows shown.
+ *          Also check the correctness of blocking behavior for other windows shown.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @build TestWindow
+ * @run main BlockingWindowsSetModal5Test
+ */
+
+public class BlockingWindowsSetModal5Test {
+
+    public static void main(String[] args) throws Exception {
+        (new BlockingWindowsTest(
+                BlockingWindowsTest.DialogOwner.FRAME)).doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsSetModal6Test.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2007, 2014, 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 8049617
+ * @summary Check whether a modal Dialog created with a Dialog
+ *          constructor receives focus; whether its components receive focus
+ *          and respond to key events, when there are other windows shown.
+ *          Also check the correctness of blocking behavior for other windows shown.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @build TestWindow
+ * @run main BlockingWindowsSetModal6Test
+ */
+
+public class BlockingWindowsSetModal6Test {
+
+    public static void main(String[] args) throws Exception {
+        (new BlockingWindowsTest(
+                BlockingWindowsTest.DialogOwner.DIALOG)).doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsTest.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,299 @@
+/*
+ * Copyright (c) 2007, 2014, 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 jdk.testlibrary.Asserts.*;
+
+import java.awt.*;
+import java.util.List;
+import java.util.ArrayList;
+
+public class BlockingWindowsTest {
+
+    private TestDialog dialog, childDialog, secondDialog, dummyDialog, parentDialog;
+    private TestFrame frame, secondFrame;
+    private TestWindow window, childWindow;
+
+    private static final int delay = 500;
+    private final ExtendedRobot robot;
+
+    private List<Window> allWindows;
+
+    private Dialog hiddenDialog;
+    private Frame  hiddenFrame;
+
+    private Dialog.ModalityType modalityType;
+
+    public enum DialogOwner {HIDDEN_DIALOG, NULL_DIALOG, HIDDEN_FRAME, NULL_FRAME, DIALOG, FRAME};
+
+    private BlockingWindowsTest(Dialog.ModalityType modType,
+                                boolean             setModal,
+                                DialogOwner         owner) throws Exception {
+
+        modalityType = modType;
+        robot = new ExtendedRobot();
+        EventQueue.invokeLater(() -> {
+            createGUI(setModal, owner);
+        });
+    }
+
+    public BlockingWindowsTest(
+            Dialog.ModalityType modalityType, DialogOwner owner) throws Exception {
+        this(modalityType, false, owner);
+    }
+
+    public BlockingWindowsTest(DialogOwner owner) throws Exception {
+        this(null, true, owner);
+    }
+
+    private void createGUI(boolean     setModal,
+                           DialogOwner owner) {
+
+        allWindows = new ArrayList<>();
+
+        if (owner != DialogOwner.DIALOG) {
+            frame = new CustomFrame();
+            frame.setLocation(50, 50);
+            frame.setVisible(true);
+            allWindows.add(frame);
+        }
+
+        switch (owner) {
+            case DIALOG:
+                parentDialog = new ParentDialog((Dialog) null);
+                parentDialog.setLocation(50, 50);
+                parentDialog.setVisible(true);
+                allWindows.add(parentDialog);
+                dialog = new CustomDialog(parentDialog);
+                break;
+            case FRAME:
+                dialog = new CustomDialog(frame);
+                break;
+            case HIDDEN_DIALOG:
+                hiddenDialog = new Dialog((Frame) null);
+                dialog = new CustomDialog(hiddenDialog);
+                allWindows.add(hiddenDialog);
+                break;
+            case NULL_DIALOG:
+                dialog = new CustomDialog((Dialog) null);
+                break;
+            case HIDDEN_FRAME:
+                hiddenFrame = new Frame();
+                dialog = new CustomDialog(hiddenFrame);
+                allWindows.add(hiddenFrame);
+                break;
+            case NULL_FRAME:
+                dialog = new CustomDialog((Frame) null);
+                break;
+        }
+
+        assertFalse(dialog == null, "error: null dialog");
+
+        if (setModal) {
+            dialog.setModal(true);
+        } else if (modalityType != null) {
+            dialog.setModalityType(modalityType);
+        }
+
+        dialog.setLocation(250, 50);
+        allWindows.add(dialog);
+
+        if (owner == DialogOwner.DIALOG) {
+            window = new TestWindow(parentDialog);
+        } else {
+            window = new TestWindow(frame);
+        }
+
+        window.setLocation(50, 250);
+        allWindows.add(window);
+
+        if (owner == DialogOwner.DIALOG) {
+            dummyDialog = new TestDialog(parentDialog);
+        } else {
+            dummyDialog = new TestDialog(frame);
+        }
+        dummyDialog.setLocation(450, 450);
+        allWindows.add(dummyDialog);
+
+        childWindow = new CustomWindow(dialog);
+        childWindow.setLocation(450, 50);
+        allWindows.add(childWindow);
+
+        childDialog = new TestDialog(dialog);
+        childDialog.setLocation(450, 250);
+        allWindows.add(childDialog);
+
+        if (owner == DialogOwner.DIALOG) {
+            secondDialog = new CustomDialog(parentDialog);
+        } else {
+            secondDialog = new CustomDialog(frame);
+        }
+        if (setModal) {
+            secondDialog.setModal(true);
+        } else if (modalityType != null) {
+            secondDialog.setModalityType(modalityType);
+        }
+
+        secondDialog.setLocation(50, 450);
+        allWindows.add(secondDialog);
+
+        secondFrame = new TestFrame();
+        secondFrame.setLocation(250, 450);
+        allWindows.add(secondFrame);
+    }
+
+    public void doTest() throws Exception {
+
+        try {
+
+            robot.waitForIdle(delay);
+
+            if (parentDialog == null) { frame.clickOpenButton(robot); }
+            else { parentDialog.clickOpenButton(robot); }
+            robot.waitForIdle(delay);
+
+            dialog.activated.waitForFlagTriggered();
+            assertTrue(dialog.activated.flag(), "Dialog did not trigger " +
+                "Window Activated event when it became visible");
+
+            dialog.closeGained.waitForFlagTriggered();
+            assertTrue(dialog.closeGained.flag(), "The first button did not gain focus " +
+                "when the dialog became visible");
+
+            assertTrue(dialog.closeButton.hasFocus(), "The first dialog button " +
+                "gained focus, but lost it afterwards");
+
+            if (parentDialog == null) {
+                frame.checkBlockedFrame(robot, modalityType + " Dialog is visible.");
+            } else {
+                parentDialog.checkBlockedDialog(robot, modalityType + " Dialog is visible.");
+            }
+
+            dialog.checkUnblockedDialog(robot, "A Frame is visible.");
+
+            dialog.openClicked.reset();
+            dialog.clickOpenButton(robot);
+            robot.waitForIdle(delay);
+
+            assertFalse(window.focusGained.flag(), "Window gained focus on becoming " +
+                "visible when Frame and Dialog are visible");
+
+            window.checkBlockedWindow(robot,
+                "The parent of the Window is blocked by " + modalityType + " Dialog.");
+
+            dummyDialog.checkBlockedDialog(robot,
+                "The parent of the Dialog is blocked by " + modalityType + " Dialog.");
+
+            childDialog.checkUnblockedDialog(robot,
+                "The parent of the Dialog is " + modalityType + " Dialog");
+
+            childWindow.checkUnblockedWindow(robot,
+                "The parent of the Window is " + modalityType + " Dialog");
+
+            childWindow.openClicked.reset();
+            childWindow.clickOpenButton(robot);
+            robot.waitForIdle(delay);
+
+            secondDialog.checkUnblockedDialog(robot,
+                "The dialog is " + modalityType + ", the parent of the dialog " +
+                "is blocked by another " + modalityType + " dialog.");
+
+            secondFrame.checkBlockedFrame(robot,
+                modalityType + " dialog is displayed immediately after showing " +
+                "this frame. Another modal dialog is alreay visible");
+
+            secondDialog.clickCloseButton(robot);
+            robot.waitForIdle(delay);
+
+            childWindow.checkUnblockedWindow(robot, "A blocking dialog was closed.");
+            robot.waitForIdle(delay);
+
+        } finally {
+            EventQueue.invokeAndWait(this::closeAll);
+        }
+    }
+
+    private void closeAll() {
+        for (Window w: allWindows) {
+            if (w != null) { w.dispose(); }
+        }
+    }
+
+
+    class CustomFrame extends TestFrame {
+
+        @Override
+        public void doOpenAction() {
+            if (dialog != null) { dialog.setVisible(true); }
+        }
+    }
+
+    class CustomDialog extends TestDialog {
+
+        public CustomDialog(Dialog dialog) {
+            super(dialog);
+        }
+
+        public CustomDialog(Frame frame) {
+            super(frame);
+        }
+
+        @Override
+        public void doOpenAction() {
+            if (window != null) { window.setVisible(true); }
+            if (dummyDialog != null) { dummyDialog.setVisible(true); }
+            if (childWindow != null) { childWindow.setVisible(true); }
+            if (childDialog != null) { childDialog.setVisible(true); }
+        }
+
+        @Override
+        public void doCloseAction() {
+            this.dispose();
+        }
+    }
+
+    class CustomWindow extends TestWindow {
+
+        public CustomWindow(Window parent) {
+            super(parent);
+        }
+
+        @Override
+        public void doOpenAction() {
+            if (secondFrame  != null) {  secondFrame.setVisible(true); }
+            if (secondDialog != null) { secondDialog.setVisible(true); }
+        }
+    }
+
+    class ParentDialog extends TestDialog {
+
+        public ParentDialog(Dialog d) { super(d); }
+
+        @Override
+        public void doOpenAction() {
+            if (dialog != null) {
+                dialog.setVisible(true);
+            }
+        }
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsToolkitModal1Test.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.Dialog;
+
+/*
+ * @test
+ * @bug 8049617
+ * @summary Check whether a toolkit modal Dialog created with a null Frame
+ *          constructor receives focus; whether its components receive focus
+ *          and respond to key events, when there are other windows shown.
+ *          Also check the correctness of blocking behavior for other windows shown.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @build TestWindow
+ * @run main BlockingWindowsToolkitModal1Test
+ */
+
+public class BlockingWindowsToolkitModal1Test {
+
+    public static void main(String[] args) throws Exception {
+        (new BlockingWindowsTest(Dialog.ModalityType.TOOLKIT_MODAL,
+                BlockingWindowsTest.DialogOwner.NULL_FRAME)).doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsToolkitModal2Test.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.Dialog;
+
+/*
+ * @test
+ * @bug 8049617
+ * @summary Check whether a toolkit modal Dialog created with a null Dialog
+ *          constructor receives focus; whether its components receive focus
+ *          and respond to key events, when there are other windows shown.
+ *          Also check the correctness of blocking behavior for other windows shown.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @build TestWindow
+ * @run main BlockingWindowsToolkitModal2Test
+ */
+
+public class BlockingWindowsToolkitModal2Test {
+
+    public static void main(String[] args) throws Exception {
+        (new BlockingWindowsTest(Dialog.ModalityType.TOOLKIT_MODAL,
+                BlockingWindowsTest.DialogOwner.NULL_DIALOG)).doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsToolkitModal3Test.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.Dialog;
+
+/*
+ * @test
+ * @bug 8049617
+ * @summary Check whether a toolkit modal Dialog created with a hidden Frame
+ *          constructor receives focus; whether its components receive focus
+ *          and respond to key events, when there are other windows shown.
+ *          Also check the correctness of blocking behavior for other windows shown.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @build TestWindow
+ * @run main BlockingWindowsToolkitModal3Test
+ */
+
+public class BlockingWindowsToolkitModal3Test {
+
+    public static void main(String[] args) throws Exception {
+        (new BlockingWindowsTest(Dialog.ModalityType.TOOLKIT_MODAL,
+                BlockingWindowsTest.DialogOwner.HIDDEN_FRAME)).doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsToolkitModal4Test.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.Dialog;
+
+/*
+ * @test
+ * @bug 8049617
+ * @summary Check whether a toolkit modal Dialog created with a hidden Dialog
+ *          constructor receives focus; whether its components receive focus
+ *          and respond to key events, when there are other windows shown.
+ *          Also check the correctness of blocking behavior for other windows shown.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @build TestWindow
+ * @run main BlockingWindowsToolkitModal4Test
+ */
+
+public class BlockingWindowsToolkitModal4Test {
+
+    public static void main(String[] args) throws Exception {
+        (new BlockingWindowsTest(Dialog.ModalityType.TOOLKIT_MODAL,
+                BlockingWindowsTest.DialogOwner.HIDDEN_DIALOG)).doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsToolkitModal5Test.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.Dialog;
+
+/*
+ * @test
+ * @bug 8049617
+ * @summary Check whether a toolkit modal Dialog created with a Frame
+ *          constructor receives focus; whether its components receive focus
+ *          and respond to key events, when there are other windows shown.
+ *          Also check the correctness of blocking behavior for other windows shown.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @build TestWindow
+ * @run main BlockingWindowsToolkitModal5Test
+ */
+
+public class BlockingWindowsToolkitModal5Test {
+
+    public static void main(String[] args) throws Exception {
+        (new BlockingWindowsTest(Dialog.ModalityType.TOOLKIT_MODAL,
+                BlockingWindowsTest.DialogOwner.FRAME)).doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsToolkitModal6Test.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.Dialog;
+
+/*
+ * @test
+ * @bug 8049617
+ * @summary Check whether a toolkit modal Dialog created with a Dialog
+ *          constructor receives focus; whether its components receive focus
+ *          and respond to key events, when there are other windows shown.
+ *          Also check the correctness of blocking behavior for other windows shown.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @build TestWindow
+ * @run main BlockingWindowsToolkitModal6Test
+ */
+
+public class BlockingWindowsToolkitModal6Test {
+
+    public static void main(String[] args) throws Exception {
+        (new BlockingWindowsTest(Dialog.ModalityType.TOOLKIT_MODAL,
+                BlockingWindowsTest.DialogOwner.DIALOG)).doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/UnblockedDialogAppModalTest.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.Dialog;
+
+/*
+ * @test
+ * @bug 8049617
+ * @summary Check whether an application modal Dialog receives focus; check
+ *          if its components receive focus and respond to key events
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @run main UnblockedDialogAppModalTest
+ */
+
+public class UnblockedDialogAppModalTest {
+
+    public static void main(String[] args) throws Exception {
+        (new UnblockedDialogTest(Dialog.ModalityType.APPLICATION_MODAL)).doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/UnblockedDialogDocModalTest.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.Dialog;
+
+/*
+ * @test
+ * @bug 8049617
+ * @summary Check whether a document modal Dialog receives focus; check
+ *          if its components receive focus and respond to key events
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @run main UnblockedDialogDocModalTest
+ */
+
+public class UnblockedDialogDocModalTest {
+
+    public static void main(String[] args) throws Exception {
+        (new UnblockedDialogTest(Dialog.ModalityType.DOCUMENT_MODAL)).doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/UnblockedDialogModelessTest.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.Dialog;
+
+/*
+ * @test
+ * @bug 8049617
+ * @summary Check whether a modeless Dialog receives focus; check
+ *          if its components receive focus and respond to key events
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @run main UnblockedDialogModelessTest
+ */
+
+public class UnblockedDialogModelessTest {
+
+    public static void main(String[] args) throws Exception {
+        (new UnblockedDialogTest(Dialog.ModalityType.MODELESS)).doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/UnblockedDialogNonModalTest.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2007, 2014, 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 8049617
+ * @summary Check whether a non-modal Dialog receives focus; check
+ *          if its components receive focus and respond to key events
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @run main UnblockedDialogNonModalTest
+ */
+
+public class UnblockedDialogNonModalTest {
+
+    public static void main(String[] args) throws Exception {
+        (new UnblockedDialogTest(null)).doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/UnblockedDialogSetModalTest.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2007, 2014, 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 8049617
+ * @summary Check whether a modal Dialog receives focus; check
+ *          if its components receive focus and respond to key events
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @run main UnblockedDialogSetModalTest
+ */
+
+public class UnblockedDialogSetModalTest {
+
+    public static void main(String[] args) throws Exception {
+        (new UnblockedDialogTest()).doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/UnblockedDialogTest.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,123 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.*;
+import static jdk.testlibrary.Asserts.*;
+
+
+public class UnblockedDialogTest {
+
+    private TestDialog dialog;
+
+    private static final int delay = 500;
+    private final ExtendedRobot robot;
+
+    private Dialog parentDialog;
+    private Frame  parentFrame;
+
+    private enum DialogOwner {HIDDEN_DIALOG, HIDDEN_FRAME, NULL_DIALOG, NULL_FRAME};
+
+    Dialog.ModalityType modalityType;
+    boolean setModal;
+
+    private UnblockedDialogTest(Dialog.ModalityType modType,
+                                boolean             set) throws Exception {
+
+        robot = new ExtendedRobot();
+        modalityType = modType;
+        setModal = set;
+    }
+
+    public UnblockedDialogTest(Dialog.ModalityType modType) throws Exception {
+        this(modType, false);
+    }
+
+    public UnblockedDialogTest() throws Exception { this(null, true); }
+
+
+    private void createGUI(DialogOwner owner) {
+
+        switch (owner) {
+            case HIDDEN_DIALOG:
+                parentDialog = new Dialog((Frame) null);
+                dialog = new TestDialog(parentDialog);
+                break;
+            case NULL_DIALOG:
+                dialog = new TestDialog((Dialog) null);
+                break;
+            case HIDDEN_FRAME:
+                parentFrame = new Frame();
+                dialog = new TestDialog(parentFrame);
+                break;
+            case NULL_FRAME:
+                dialog = new TestDialog((Frame) null);
+                break;
+        }
+
+        assertFalse(dialog == null, "error: null dialog");
+
+        dialog.setLocation(50, 50);
+        if (setModal) {
+            dialog.setModal(true);
+        } else if (modalityType != null) {
+            dialog.setModalityType(modalityType);
+        }
+
+        dialog.setVisible(true);
+    }
+
+    public void doTest() throws Exception {
+
+        try {
+
+            robot.waitForIdle(delay);
+
+            for (DialogOwner owner: DialogOwner.values()) {
+
+                EventQueue.invokeLater(() -> { createGUI(owner); });
+
+                robot.waitForIdle(delay);
+
+                dialog.activated.waitForFlagTriggered();
+                assertTrue(dialog.activated.flag(), "Dialog did not trigger " +
+                    "Window Activated event when it became visible");
+
+                dialog.closeGained.waitForFlagTriggered();
+                assertTrue(dialog.closeGained.flag(), "The 1st button did not " +
+                    "gain focus when the dialog became visible");
+
+                dialog.checkUnblockedDialog(robot, "");
+                robot.waitForIdle(delay);
+            }
+
+        } finally {
+            EventQueue.invokeAndWait(this::closeAll);
+        }
+    }
+
+    private void closeAll() {
+        if (dialog != null) { dialog.dispose(); }
+        if (parentDialog != null) { parentDialog.dispose(); }
+        if (parentFrame  != null) {  parentFrame.dispose(); }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/UnblockedDialogToolkitModalTest.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.Dialog;
+
+/*
+ * @test
+ * @bug 8049617
+ * @summary Check whether a toolkit modal Dialog receives focus; check
+ *          if its components receive focus and respond to key events
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @run main UnblockedDialogToolkitModalTest
+ */
+
+public class UnblockedDialogToolkitModalTest {
+
+    public static void main(String[] args) throws Exception {
+        (new UnblockedDialogTest(Dialog.ModalityType.TOOLKIT_MODAL)).doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDWFAppModalTest.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.Dialog;
+
+/*
+ * @test
+ * @bug 8047367
+ * @summary Check whether the focus transfer between windows occurs correctly when the following
+ *          happens: an application modal dialog (D) having null frame owner is shown;
+ *          a window having D as owner is shown; a frame is shown.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @build TestWindow
+ * @run main FocusTransferDWFAppModalTest
+ */
+
+public class FocusTransferDWFAppModalTest {
+
+    public static void main(String[] args) throws Exception {
+        FocusTransferDWFTest test = new FocusTransferDWFTest(
+                Dialog.ModalityType.APPLICATION_MODAL);
+        test.doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDWFDocModalTest.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.Dialog;
+
+/*
+ * @test
+ * @bug 8047367 8049339
+ * @summary Check whether the focus transfer between windows occurs correctly when the
+ *          following happens: a document modal dialog (D) having null frame owner is shown;
+ *          a window having D as owner is shown; a frame is shown.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @build TestWindow
+ * @run main FocusTransferDWFDocModalTest
+ */
+
+public class FocusTransferDWFDocModalTest {
+
+    public static void main(String[] args) throws Exception {
+        FocusTransferDWFTest test = new FocusTransferDWFTest(
+                Dialog.ModalityType.DOCUMENT_MODAL);
+        test.doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDWFModelessTest.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.Dialog;
+
+/*
+ * @test
+ * @bug 8047367 8049339
+ * @summary Check whether the focus transfer between windows occurs correctly when the
+ *          following happens: a modeless dialog (D) having null frame owner is shown;
+ *          a window having D as owner is shown; a frame is shown.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @build TestWindow
+ * @run main FocusTransferDWFModelessTest
+ */
+
+public class FocusTransferDWFModelessTest {
+
+    public static void main(String[] args) throws Exception {
+        FocusTransferDWFTest test = new FocusTransferDWFTest(
+                Dialog.ModalityType.MODELESS);
+        test.doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDWFNonModalTest.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.Dialog;
+
+/*
+ * @test
+ * @bug 8047367 8049339
+ * @summary Check whether the focus transfer between windows occurs correctly when the following
+ *          happens: a non-modal dialog (D) having null frame owner is shown; a window having D
+ *          as owner is shown; a frame is shown.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @build TestWindow
+ * @run main FocusTransferDWFNonModalTest
+ */
+
+public class FocusTransferDWFNonModalTest {
+
+    public static void main(String[] args) throws Exception {
+        FocusTransferDWFTest test = new FocusTransferDWFTest(null);
+        test.doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDWFTest.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,186 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.*;
+
+import static jdk.testlibrary.Asserts.*;
+
+// DWF: Dialog -> Window -> Frame
+public class FocusTransferDWFTest {
+
+    class CustomDialog extends TestDialog {
+
+        public CustomDialog(Frame f) {
+            super(f);
+        }
+
+        @Override
+        public void doOpenAction() {
+            if (window != null) {
+                window.setVisible(true);
+            }
+        }
+
+        @Override
+        public void doCloseAction() {
+            this.dispose();
+        }
+    }
+
+    class CustomFrame extends TestFrame {
+
+        @Override
+        public void doCloseAction() {
+            this.dispose();
+        }
+    }
+
+    class CustomWindow extends TestWindow {
+
+        public CustomWindow(Dialog d) {
+            super(d);
+        }
+
+        @Override
+        public void doOpenAction() {
+            if (frame != null) {
+                frame.setVisible(true);
+            }
+        }
+
+        @Override
+        public void doCloseAction() {
+            this.dispose();
+        }
+    }
+
+    private TestDialog dialog;
+    private TestFrame  frame;
+    private TestWindow window;
+
+    private static final int delay = 1000;
+
+    private final ExtendedRobot robot;
+
+    private Dialog.ModalityType modalityType;
+
+    FocusTransferDWFTest(Dialog.ModalityType modType) throws Exception {
+
+        modalityType = modType;
+
+        robot = new ExtendedRobot();
+        EventQueue.invokeLater(this::createGUI);
+    }
+
+    private void createGUI() {
+
+        frame = new CustomFrame();
+        frame.setLocation(50, 50);
+
+        dialog = new CustomDialog((Frame) null);
+        if (modalityType == null) {
+            modalityType = Dialog.ModalityType.MODELESS;
+        } else {
+            dialog.setModalityType(modalityType);
+        }
+        dialog.setLocation(250, 50);
+
+        window = new CustomWindow(dialog);
+        window.setLocation(450, 50);
+        dialog.setVisible(true);
+    }
+
+    private void closeAll() {
+        if (dialog != null) { dialog.dispose(); }
+        if ( frame != null) {  frame.dispose(); }
+        if (window != null) { window.dispose(); }
+    }
+
+    public void doTest() throws Exception {
+
+        robot.waitForIdle(delay);
+
+        try {
+
+            dialog.checkCloseButtonFocusGained(true);
+
+            dialog.clickOpenButton(robot);
+            robot.waitForIdle(delay);
+
+            window.checkCloseButtonFocusGained(true);
+            dialog.checkOpenButtonFocusLost(true);
+
+            window.clickOpenButton(robot);
+            robot.waitForIdle(delay);
+
+            switch (modalityType) {
+                case APPLICATION_MODAL:
+                    frame.checkCloseButtonFocusGained(false, 10);
+                    window.checkOpenButtonFocusLost(false, 10);
+
+                    frame.closeGained.reset();
+
+                    dialog.clickCloseButton(robot);
+                    robot.waitForIdle(delay);
+
+                    frame.checkCloseButtonFocusGained(true);
+                    assertFalse(window.isVisible(), "window shouldn't be visible");
+
+                    break;
+
+                case DOCUMENT_MODAL:
+                case MODELESS:
+                    frame.checkCloseButtonFocusGained(true);
+                    window.checkOpenButtonFocusLost(true);
+
+                    window.openGained.reset();
+
+                    frame.clickCloseButton(robot);
+                    robot.waitForIdle(delay);
+
+                    window.checkOpenButtonFocusGained(true);
+
+                    dialog.openGained.reset();
+                    window.clickCloseButton(robot);
+                    robot.waitForIdle(delay);
+
+                    dialog.checkOpenButtonFocusGained(true);
+
+                    break;
+            }
+
+        } catch (Exception e) {
+
+            // make screenshot before exit
+            Rectangle rect = new Rectangle(0, 0, 650, 250);
+            java.awt.image.BufferedImage img = robot.createScreenCapture(rect);
+            javax.imageio.ImageIO.write(img, "jpg", new java.io.File("NOK.jpg"));
+
+            throw e;
+        }
+
+        robot.waitForIdle(delay);
+
+        EventQueue.invokeAndWait(this::closeAll);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDialogsAppModalTest.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.Dialog;
+
+/*
+ * @test
+ * @bug 8047367
+ * @summary Check whether the focus transfer between windows occurs correctly when
+ *          the following happens: an application modal dialog (D1) having a null
+ *          frame owner is shown; a dialog (D2) having D1 owner is shown; a dialog
+ *          with a hidden frame owner is shown.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @build TestWindow
+ * @run main FocusTransferDialogsAppModalTest
+ */
+
+public class FocusTransferDialogsAppModalTest {
+
+    public static void main(String[] args) throws Exception {
+        FocusTransferDialogsTest test = new FocusTransferDialogsTest(
+                Dialog.ModalityType.APPLICATION_MODAL);
+        test.doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDialogsDocModalTest.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.Dialog;
+
+/*
+ * @test
+ * @bug 8047367
+ * @summary Check whether the focus transfer between windows occurs correctly when
+ *          the following happens: a document modal dialog (D1) having a null
+ *          frame owner is shown; a dialog (D2) having D1 owner is shown; a dialog
+ *          with a hidden frame owner is shown.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @build TestWindow
+ * @run main FocusTransferDialogsDocModalTest
+ */
+
+public class FocusTransferDialogsDocModalTest {
+
+    public static void main(String[] args) throws Exception {
+        FocusTransferDialogsTest test = new FocusTransferDialogsTest(
+                Dialog.ModalityType.DOCUMENT_MODAL);
+        test.doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDialogsModelessTest.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.Dialog;
+
+/*
+ * @test
+ * @bug 8047367
+ * @summary Check whether the focus transfer between windows occurs correctly when
+ *          the following happens: a modeless dialog (D1) having a null
+ *          frame owner is shown; a dialog (D2) having D1 owner is shown; a dialog
+ *          with a hidden frame owner is shown.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @build TestWindow
+ * @run main FocusTransferDialogsModelessTest
+ */
+
+public class FocusTransferDialogsModelessTest {
+
+    public static void main(String[] args) throws Exception {
+        FocusTransferDialogsTest test = new FocusTransferDialogsTest(
+                Dialog.ModalityType.MODELESS);
+        test.doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDialogsNonModalTest.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.Dialog;
+
+/*
+ * @test
+ * @bug 8047367
+ * @summary Check whether the focus transfer between windows occurs correctly when
+ *          the following happens: a non-modal dialog (D1) having a null
+ *          frame owner is shown; a dialog (D2) having D1 owner is shown; a dialog
+ *          with a hidden frame owner is shown.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @build TestWindow
+ * @run main FocusTransferDialogsNonModalTest
+ */
+
+public class FocusTransferDialogsNonModalTest {
+
+    public static void main(String[] args) throws Exception {
+        FocusTransferDialogsTest test = new FocusTransferDialogsTest(null);
+        test.doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDialogsTest.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,193 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.*;
+
+
+public class FocusTransferDialogsTest {
+
+    class CustomDialog1 extends TestDialog {
+
+        public CustomDialog1(Frame f) {
+            super(f);
+        }
+
+        @Override
+        public void doOpenAction() {
+            if (dialog2 != null) {
+                dialog2.setVisible(true);
+            }
+        }
+
+        @Override
+        public void doCloseAction() {
+            this.dispose();
+        }
+    }
+
+    class CustomDialog2 extends TestDialog {
+
+        public CustomDialog2(Dialog d) {
+            super(d);
+        }
+
+        @Override
+        public void doOpenAction() {
+            if (dialog3 != null) {
+                dialog3.setVisible(true);
+            }
+        }
+
+        @Override
+        public void doCloseAction() {
+            this.dispose();
+        }
+    }
+
+    class CustomDialog3 extends TestDialog {
+
+        public CustomDialog3(Frame f) {
+            super(f);
+        }
+
+        public CustomDialog3(Dialog d) {
+            super(d);
+        }
+
+        @Override
+        public void doCloseAction() {
+            this.dispose();
+        }
+    }
+
+
+    private TestDialog dialog1, dialog2, dialog3;
+    private Frame parentFrame;
+
+    private static final int delay = 1000;
+    private final ExtendedRobot robot;
+    private Dialog.ModalityType modalityType;
+
+    FocusTransferDialogsTest(Dialog.ModalityType modType) throws Exception {
+
+        modalityType = modType;
+        robot = new ExtendedRobot();
+        EventQueue.invokeLater(this::createGUI);
+    }
+
+    private void createGUI() {
+
+        dialog1 = new CustomDialog1((Frame) null);
+        dialog1.setTitle("Dialog1");
+        dialog1.setLocation(50, 50);
+
+        if (modalityType != null) {
+            dialog1.setModalityType(modalityType);
+        } else {
+            modalityType = Dialog.ModalityType.MODELESS;
+        }
+
+        dialog2 = new CustomDialog2(dialog1);
+        dialog2.setTitle("Dialog2");
+        dialog2.setLocation(250, 50);
+
+        parentFrame = new Frame();
+        dialog3 = new CustomDialog3(parentFrame);
+        dialog3.setTitle("Dialog3");
+        dialog3.setLocation(450, 50);
+
+        dialog1.setVisible(true);
+    }
+
+    private void closeAll() {
+        if (dialog1 != null) { dialog1.dispose(); }
+        if (dialog2 != null) { dialog2.dispose(); }
+        if (dialog3 != null) { dialog3.dispose(); }
+        if (parentFrame != null) { parentFrame.dispose(); }
+    }
+
+    public void doTest() throws Exception {
+
+        robot.waitForIdle(delay);
+
+        try {
+
+            dialog1.checkCloseButtonFocusGained(true);
+
+            dialog1.clickOpenButton(robot);
+            robot.waitForIdle(delay);
+
+            dialog2.checkCloseButtonFocusGained(true);
+            dialog1.checkOpenButtonFocusLost(true);
+
+            dialog1.openGained.reset();
+            dialog2.clickOpenButton(robot);
+            robot.waitForIdle(delay);
+
+            switch (modalityType) {
+                case APPLICATION_MODAL:
+
+                    dialog3.checkCloseButtonFocusGained(false, 10);
+                    dialog2.checkOpenButtonFocusLost(true);
+
+                    dialog1.checkCloseButtonFocusGained(true);
+                    dialog3.closeGained.reset();
+
+                    dialog1.clickCloseButton(robot);
+                    robot.waitForIdle(delay);
+
+                    dialog3.checkCloseButtonFocusGained(true);
+
+                    break;
+
+                case DOCUMENT_MODAL:
+                case MODELESS:
+
+                    dialog3.checkCloseButtonFocusGained(true);
+                    dialog2.checkOpenButtonFocusLost(true);
+
+                    dialog1.openGained.reset();
+
+                    dialog2.clickCloseButton(robot);
+                    robot.waitForIdle(delay);
+
+                    dialog1.checkOpenButtonFocusGained(true);
+
+                    break;
+            }
+
+        } catch (Exception e) {
+
+            // make screenshot before exit
+            Rectangle rect = new Rectangle(0, 0, 650, 250);
+            java.awt.image.BufferedImage img = robot.createScreenCapture(rect);
+            javax.imageio.ImageIO.write(img, "jpg", new java.io.File("NOK.jpg"));
+
+            throw e;
+        }
+
+        robot.waitForIdle(delay);
+        EventQueue.invokeAndWait(this::closeAll);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFDWAppModalTest.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.Dialog;
+
+/*
+ * @test
+ * @bug 8047367
+ * @summary Check whether the focus transfer between windows occurs correctly when
+ *          the following happens: a frame is shown; an application modal dialog (D)
+ *          having a null frame owner is shown; a window having D as owner is shown.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @build TestWindow
+ * @run main FocusTransferFDWAppModalTest
+ */
+
+public class FocusTransferFDWAppModalTest {
+
+    public static void main(String[] args) throws Exception {
+        FocusTransferFDWTest test = new FocusTransferFDWTest(
+                Dialog.ModalityType.APPLICATION_MODAL);
+        test.doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFDWDocModalTest.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.Dialog;
+
+/*
+ * @test
+ * @bug 8047367
+ * @summary Check whether the focus transfer between windows occurs correctly when
+ *          the following happens: a frame is shown; a document modal dialog (D)
+ *          having a null frame owner is shown; a window having D as owner is shown.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @build TestWindow
+ * @run main FocusTransferFDWDocModalTest
+ */
+
+public class FocusTransferFDWDocModalTest {
+
+    public static void main(String[] args) throws Exception {
+        FocusTransferFDWTest test = new FocusTransferFDWTest(
+                Dialog.ModalityType.DOCUMENT_MODAL);
+        test.doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFDWModelessTest.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.Dialog;
+
+/*
+ * @test
+ * @bug 8047367
+ * @summary Check whether the focus transfer between windows occurs correctly when
+ *          the following happens: a frame is shown; a modeless dialog (D)
+ *          having a null frame owner is shown; a window having D as owner is shown.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @build TestWindow
+ * @run main FocusTransferFDWModelessTest
+ */
+
+public class FocusTransferFDWModelessTest {
+
+    public static void main(String[] args) throws Exception {
+        FocusTransferFDWTest test = new FocusTransferFDWTest(
+                Dialog.ModalityType.MODELESS);
+        test.doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFDWNonModalTest.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.Dialog;
+
+/*
+ * @test
+ * @bug 8047367
+ * @summary Check whether the focus transfer between windows occurs correctly when
+ *          the following happens: a frame is shown; a non-modal dialog (D)
+ *          having a null frame owner is shown; a window having D as owner is shown.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @build TestWindow
+ * @run main FocusTransferFDWNonModalTest
+ */
+
+public class FocusTransferFDWNonModalTest {
+
+    public static void main(String[] args) throws Exception {
+        FocusTransferFDWTest test = new FocusTransferFDWTest(null);
+        test.doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFDWTest.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,152 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.*;
+
+// FDW: Frame -> Dialog -> Window
+public class FocusTransferFDWTest {
+
+    class CustomFrame extends TestFrame {
+
+        @Override
+        public void doOpenAction() {
+            if (dialog != null) {
+                dialog.setVisible(true);
+            }
+        }
+    }
+
+    class CustomWindow extends TestWindow {
+
+        public CustomWindow(Dialog d) {
+            super(d);
+        }
+
+        @Override
+        public void doCloseAction() {
+            this.dispose();
+        }
+    }
+
+    class CustomDialog extends TestDialog {
+
+        public CustomDialog(Frame f) {
+            super(f);
+        }
+
+        @Override
+        public void doOpenAction() {
+            if (window != null) {
+                window.setVisible(true);
+            }
+        }
+
+        @Override
+        public void doCloseAction() {
+            this.dispose();
+        }
+    }
+
+    private TestDialog dialog;
+    private TestFrame  frame;
+    private TestWindow window;
+
+    private static final int delay = 1000;
+
+    private final ExtendedRobot robot;
+
+    private final Dialog.ModalityType modalityType;
+
+    FocusTransferFDWTest(Dialog.ModalityType modType) throws Exception {
+
+        modalityType = modType;
+
+        robot = new ExtendedRobot();
+        EventQueue.invokeLater(this::createGUI);
+    }
+
+    private void createGUI() {
+
+        frame = new CustomFrame();
+        frame.setLocation(50, 50);
+        dialog = new CustomDialog((Frame) null);
+        if (modalityType != null) {
+            dialog.setModalityType(modalityType);
+        }
+        dialog.setLocation(250, 50);
+        window = new CustomWindow(dialog);
+        window.setLocation(450, 50);
+        frame.setVisible(true);
+    }
+
+    private void closeAll() {
+        if (dialog != null) { dialog.dispose(); }
+        if ( frame != null) {  frame.dispose(); }
+        if (window != null) { window.dispose(); }
+    }
+
+    public void doTest() throws Exception {
+
+        robot.waitForIdle(delay);
+
+        try {
+
+            frame.checkCloseButtonFocusGained(true);
+
+            frame.clickOpenButton(robot);
+            robot.waitForIdle(delay);
+
+            dialog.checkCloseButtonFocusGained(true);
+
+            frame.checkOpenButtonFocusLost(true);
+
+            dialog.clickOpenButton(robot);
+            robot.waitForIdle(delay);
+
+            window.checkCloseButtonFocusGained(true);
+            dialog.checkOpenButtonFocusLost(true);
+
+            dialog.openGained.reset();
+            window.clickCloseButton(robot);
+
+            dialog.checkOpenButtonFocusGained(true);
+
+            frame.openGained.reset();
+            dialog.clickCloseButton(robot);
+
+            frame.checkOpenButtonFocusGained(true);
+
+        } catch (Exception e) {
+
+            // make screenshot before exit
+            Rectangle rect = new Rectangle(0, 0, 650, 250);
+            java.awt.image.BufferedImage img = robot.createScreenCapture(rect);
+            javax.imageio.ImageIO.write(img, "jpg", new java.io.File("NOK.jpg"));
+
+            throw e;
+        }
+
+        robot.waitForIdle(delay);
+        EventQueue.invokeAndWait(this::closeAll);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDAppModal1Test.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.Dialog;
+
+/*
+ * @test
+ * @bug 8047367 8049339
+ * @summary Check whether the focus transfer between windows occurs correctly when the following happens:
+ *          a frame (F) is shown; a window having F as owner is shown; an application modal dialog having
+ *          a hidden dialog owner is shown.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @build TestWindow
+ * @run main FocusTransferFWDAppModal1Test
+ */
+
+public class FocusTransferFWDAppModal1Test {
+
+    public static void main(String[] args) throws Exception {
+        FocusTransferFWDTest test = new FocusTransferFWDTest(
+                Dialog.ModalityType.APPLICATION_MODAL,
+                FocusTransferFWDTest.DialogParent.HIDDEN_DIALOG);
+        test.doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDAppModal2Test.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.Dialog;
+
+/*
+ * @test
+ * @bug 8047367 8049339
+ * @summary Check whether the focus transfer between windows occurs correctly when the following happens:
+ *          a frame (F) is shown; a window having F as owner is shown; an application modal dialog having
+ *          a hidden frame owner is shown.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @build TestWindow
+ * @run main FocusTransferFWDAppModal2Test
+ */
+
+public class FocusTransferFWDAppModal2Test {
+
+    public static void main(String[] args) throws Exception {
+        FocusTransferFWDTest test = new FocusTransferFWDTest(
+                Dialog.ModalityType.APPLICATION_MODAL,
+                FocusTransferFWDTest.DialogParent.HIDDEN_FRAME);
+        test.doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDAppModal3Test.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.Dialog;
+
+/*
+ * @test
+ * @bug 8047367 8049339
+ * @summary Check whether the focus transfer between windows occurs correctly when the following happens:
+ *          a frame (F) is shown; a window having F as owner is shown; an application modal dialog having
+ *          a null dialog owner is shown.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @build TestWindow
+ * @run main FocusTransferFWDAppModal3Test
+ */
+
+public class FocusTransferFWDAppModal3Test {
+
+    public static void main(String[] args) throws Exception {
+        FocusTransferFWDTest test = new FocusTransferFWDTest(
+                Dialog.ModalityType.APPLICATION_MODAL,
+                FocusTransferFWDTest.DialogParent.NULL_DIALOG);
+        test.doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDAppModal4Test.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.Dialog;
+
+/*
+ * @test
+ * @bug 8047367 8049339
+ * @summary Check whether the focus transfer between windows occurs correctly when the following happens:
+ *          a frame (F) is shown; a window having F as owner is shown; an application modal dialog having
+ *          a null frame owner is shown.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @build TestWindow
+ * @run main FocusTransferFWDAppModal4Test
+ */
+
+public class FocusTransferFWDAppModal4Test {
+
+    public static void main(String[] args) throws Exception {
+        FocusTransferFWDTest test = new FocusTransferFWDTest(
+                Dialog.ModalityType.APPLICATION_MODAL,
+                FocusTransferFWDTest.DialogParent.NULL_FRAME);
+        test.doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDDocModal1Test.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.Dialog;
+
+/*
+ * @test
+ * @bug 8047367 8049339
+ * @summary Check whether the focus transfer between windows occurs correctly when the following happens:
+ *          a frame (F) is shown; a window having F as owner is shown; a document modal dialog having
+ *          a hidden dialog owner is shown.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @build TestWindow
+ * @run main FocusTransferFWDDocModal1Test
+ */
+
+public class FocusTransferFWDDocModal1Test {
+
+    public static void main(String[] args) throws Exception {
+        FocusTransferFWDTest test = new FocusTransferFWDTest(
+                Dialog.ModalityType.DOCUMENT_MODAL,
+                FocusTransferFWDTest.DialogParent.HIDDEN_DIALOG);
+        test.doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDDocModal2Test.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.Dialog;
+
+/*
+ * @test
+ * @bug 8047367 8049339
+ * @summary Check whether the focus transfer between windows occurs correctly when the following happens:
+ *          a frame (F) is shown; a window having F as owner is shown; a document modal dialog having
+ *          a hidden frame owner is shown.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @build TestWindow
+ * @run main FocusTransferFWDDocModal2Test
+ */
+
+public class FocusTransferFWDDocModal2Test {
+
+    public static void main(String[] args) throws Exception {
+        FocusTransferFWDTest test = new FocusTransferFWDTest(
+                Dialog.ModalityType.DOCUMENT_MODAL,
+                FocusTransferFWDTest.DialogParent.HIDDEN_FRAME);
+        test.doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDDocModal3Test.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.Dialog;
+
+/*
+ * @test
+ * @bug 8047367 8049339
+ * @summary Check whether the focus transfer between windows occurs correctly when the following happens:
+ *          a frame (F) is shown; a window having F as owner is shown; a document modal dialog having
+ *          a null dialog owner is shown.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @build TestWindow
+ * @run main FocusTransferFWDDocModal3Test
+ */
+
+public class FocusTransferFWDDocModal3Test {
+
+    public static void main(String[] args) throws Exception {
+        FocusTransferFWDTest test = new FocusTransferFWDTest(
+                Dialog.ModalityType.DOCUMENT_MODAL,
+                FocusTransferFWDTest.DialogParent.NULL_DIALOG);
+        test.doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDDocModal4Test.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.Dialog;
+
+/*
+ * @test
+ * @bug 8047367 8049339
+ * @summary Check whether the focus transfer between windows occurs correctly when the following happens:
+ *          a frame (F) is shown; a window having F as owner is shown; a document modal dialog having
+ *          a null frame owner is shown.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @build TestWindow
+ * @run main FocusTransferFWDDocModal4Test
+ */
+
+public class FocusTransferFWDDocModal4Test {
+
+    public static void main(String[] args) throws Exception {
+        FocusTransferFWDTest test = new FocusTransferFWDTest(
+                Dialog.ModalityType.DOCUMENT_MODAL,
+                FocusTransferFWDTest.DialogParent.NULL_FRAME);
+        test.doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDModeless1Test.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.Dialog;
+
+/*
+ * @test
+ * @bug 8047367 8049339
+ * @summary Check whether the focus transfer between windows occurs correctly when the following happens:
+ *          a frame (F) is shown; a window having F as owner is shown; a modeless dialog having
+ *          a hidden dialog owner is shown.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @build TestWindow
+ * @run main FocusTransferFWDModeless1Test
+ */
+
+public class FocusTransferFWDModeless1Test {
+
+    public static void main(String[] args) throws Exception {
+        FocusTransferFWDTest test = new FocusTransferFWDTest(
+            Dialog.ModalityType.MODELESS,
+            FocusTransferFWDTest.DialogParent.HIDDEN_DIALOG);
+        test.doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDModeless2Test.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.Dialog;
+
+/*
+ * @test
+ * @bug 8047367 8049339
+ * @summary Check whether the focus transfer between windows occurs correctly when the following happens:
+ *          a frame (F) is shown; a window having F as owner is shown; a modeless dialog having
+ *          a hidden frame owner is shown.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @build TestWindow
+ * @run main FocusTransferFWDModeless2Test
+ */
+
+public class FocusTransferFWDModeless2Test {
+
+    public static void main(String[] args) throws Exception {
+        FocusTransferFWDTest test = new FocusTransferFWDTest(
+            Dialog.ModalityType.MODELESS,
+            FocusTransferFWDTest.DialogParent.HIDDEN_FRAME);
+        test.doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDModeless3Test.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.Dialog;
+
+/*
+ * @test
+ * @bug 8047367 8049339
+ * @summary Check whether the focus transfer between windows occurs correctly when the following happens:
+ *          a frame (F) is shown; a window having F as owner is shown; a modeless dialog having
+ *          a null dialog owner is shown.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @build TestWindow
+ * @run main FocusTransferFWDModeless3Test
+ */
+
+public class FocusTransferFWDModeless3Test {
+
+    public static void main(String[] args) throws Exception {
+        FocusTransferFWDTest test = new FocusTransferFWDTest(
+            Dialog.ModalityType.MODELESS,
+            FocusTransferFWDTest.DialogParent.NULL_DIALOG);
+        test.doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDModeless4Test.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.Dialog;
+
+/*
+ * @test
+ * @bug 8047367 8049339
+ * @summary Check whether the focus transfer between windows occurs correctly when the following happens:
+ *          a frame (F) is shown; a window having F as owner is shown; a modeless dialog having
+ *          a null frame owner is shown.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @build TestWindow
+ * @run main FocusTransferFWDModeless4Test
+ */
+
+public class FocusTransferFWDModeless4Test {
+
+    public static void main(String[] args) throws Exception {
+        FocusTransferFWDTest test = new FocusTransferFWDTest(
+            Dialog.ModalityType.MODELESS,
+            FocusTransferFWDTest.DialogParent.NULL_FRAME);
+        test.doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDNonModal1Test.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.Dialog;
+
+/*
+ * @test
+ * @bug 8047367 8049339
+ * @summary Check whether the focus transfer between windows occurs correctly when the following happens:
+ *          a frame (F) is shown; a window having F as owner is shown; a non-modal dialog having
+ *          a hidden dialog owner is shown.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @build TestWindow
+ * @run main FocusTransferFWDNonModal1Test
+ */
+
+public class FocusTransferFWDNonModal1Test {
+
+    public static void main(String[] args) throws Exception {
+        FocusTransferFWDTest test = new FocusTransferFWDTest(
+            null, FocusTransferFWDTest.DialogParent.HIDDEN_DIALOG);
+        test.doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDNonModal2Test.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.Dialog;
+
+/*
+ * @test
+ * @bug 8047367 8049339
+ * @summary Check whether the focus transfer between windows occurs correctly when the following happens:
+ *          a frame (F) is shown; a window having F as owner is shown; a non-modal dialog having
+ *          a hidden frame owner is shown.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @build TestWindow
+ * @run main FocusTransferFWDNonModal2Test
+ */
+
+public class FocusTransferFWDNonModal2Test {
+
+    public static void main(String[] args) throws Exception {
+        FocusTransferFWDTest test = new FocusTransferFWDTest(
+            null, FocusTransferFWDTest.DialogParent.HIDDEN_FRAME);
+        test.doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDNonModal3Test.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.Dialog;
+
+/*
+ * @test
+ * @bug 8047367 8049339
+ * @summary Check whether the focus transfer between windows occurs correctly when the following happens:
+ *          a frame (F) is shown; a window having F as owner is shown; a non-modal dialog having
+ *          a null dialog owner is shown.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @build TestWindow
+ * @run main FocusTransferFWDNonModal3Test
+ */
+
+public class FocusTransferFWDNonModal3Test {
+
+    public static void main(String[] args) throws Exception {
+        FocusTransferFWDTest test = new FocusTransferFWDTest(
+            null, FocusTransferFWDTest.DialogParent.NULL_DIALOG);
+        test.doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDNonModal4Test.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.Dialog;
+
+/*
+ * @test
+ * @bug 8047367 8049339
+ * @summary Check whether the focus transfer between windows occurs correctly when the following happens:
+ *          a frame (F) is shown; a window having F as owner is shown; a non-modal dialog having
+ *          a null frame owner is shown.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @build TestWindow
+ * @run main FocusTransferFWDNonModal4Test
+ */
+
+public class FocusTransferFWDNonModal4Test {
+
+    public static void main(String[] args) throws Exception {
+        FocusTransferFWDTest test = new FocusTransferFWDTest(
+            null, FocusTransferFWDTest.DialogParent.NULL_FRAME);
+        test.doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDTest.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,201 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.*;
+import static jdk.testlibrary.Asserts.*;
+
+
+// FWD: Frame -> Window -> Dialog
+public class FocusTransferFWDTest {
+
+    class CustomFrame extends TestFrame {
+
+        @Override
+        public void doOpenAction() {
+            if (window != null) {
+                window.setVisible(true);
+            }
+        }
+
+        @Override
+        public void doCloseAction() {
+            this.dispose();
+        }
+    }
+
+    class CustomWindow extends TestWindow {
+
+        public CustomWindow(Frame f) {
+            super(f);
+        }
+
+        @Override
+        public void doOpenAction() {
+            if (dialog != null) {
+                dialog.setVisible(true);
+            }
+        }
+
+        @Override
+        public void doCloseAction() {
+            this.dispose();
+        }
+    }
+
+    class CustomDialog extends TestDialog {
+
+        public CustomDialog(Frame f) {
+            super(f);
+        }
+
+        public CustomDialog(Dialog d) {
+            super(d);
+        }
+
+        @Override
+        public void doCloseAction() {
+            this.dispose();
+        }
+    }
+
+    private TestDialog dialog;
+    private TestFrame  frame;
+    private TestWindow window;
+
+    private Frame  parentFrame;
+    private Dialog parentDialog;
+
+    private static final int delay = 1000;
+
+    private final ExtendedRobot robot;
+
+    private final Dialog.ModalityType modalityType;
+
+    public enum DialogParent {NULL_DIALOG, NULL_FRAME, HIDDEN_DIALOG, HIDDEN_FRAME};
+    private DialogParent dialogParent;
+
+    FocusTransferFWDTest(Dialog.ModalityType modType,
+                         DialogParent        dlgParent) throws Exception {
+
+        modalityType = modType;
+        dialogParent = dlgParent;
+
+        robot = new ExtendedRobot();
+        EventQueue.invokeLater(this::createGUI);
+    }
+
+    private void createGUI() {
+
+        frame = new CustomFrame();
+        frame.setLocation(50, 50);
+
+        switch (dialogParent) {
+            case NULL_DIALOG:
+                dialog = new CustomDialog((Dialog) null);
+                break;
+            case NULL_FRAME:
+                dialog = new CustomDialog((Frame) null);
+                break;
+            case HIDDEN_DIALOG:
+                parentDialog = new Dialog((Frame) null);
+                dialog = new CustomDialog(parentDialog);
+                break;
+            case HIDDEN_FRAME:
+                parentFrame = new Frame();
+                dialog = new CustomDialog(parentFrame);
+                break;
+        }
+
+        assertTrue(dialog != null, "error: null dialog");
+
+        if (modalityType != null) {
+            dialog.setModalityType(modalityType);
+        }
+
+        dialog.setLocation(250, 50);
+        window = new CustomWindow(frame);
+        window.setLocation(450, 50);
+        frame.setVisible(true);
+    }
+
+    private void closeAll() {
+        if (dialog != null) { dialog.dispose(); }
+        if ( frame != null) {  frame.dispose(); }
+        if (window != null) { window.dispose(); }
+
+        if (parentDialog != null) { parentDialog.dispose(); }
+        if (parentFrame  != null) {  parentFrame.dispose(); }
+    }
+
+    public void doTest() throws Exception {
+
+        robot.waitForIdle(delay);
+
+        try {
+
+            frame.checkCloseButtonFocusGained(true);
+
+            frame.clickOpenButton(robot);
+            robot.waitForIdle(delay);
+
+            window.checkCloseButtonFocusGained(true);
+            frame.checkOpenButtonFocusLost(true);
+
+            window.clickOpenButton(robot);
+            robot.waitForIdle(delay);
+
+            dialog.checkCloseButtonFocusGained(true);
+            window.checkOpenButtonFocusLost(true);
+
+            window.openGained.reset();
+
+            dialog.clickCloseButton(robot);
+            robot.waitForIdle(delay);
+
+            window.checkOpenButtonFocusGained(true);
+
+            frame.openGained.reset();
+
+            window.clickCloseButton(robot);
+            robot.waitForIdle(delay);
+
+            frame.checkOpenButtonFocusGained(true);
+
+            frame.clickCloseButton(robot);
+            robot.waitForIdle(delay);
+
+        } catch (Exception e) {
+
+            // make screenshot before exit
+            Rectangle rect = new Rectangle(0, 0, 650, 250);
+            java.awt.image.BufferedImage img = robot.createScreenCapture(rect);
+            javax.imageio.ImageIO.write(img, "jpg", new java.io.File("NOK.jpg"));
+
+            throw e;
+        }
+
+        robot.waitForIdle(delay);
+        EventQueue.invokeAndWait(this::closeAll);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFAppModal1Test.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.Dialog;
+
+/*
+ * @test
+ * @bug 8047367
+ * @summary Check whether the focus transfer between windows occurs correctly when
+ *          the following happens: a window having a hidden frame owner is shown;
+ *          an application modal dialog having a frame (F) owner is shown; F is shown.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @build TestWindow
+ * @run main FocusTransferWDFAppModal1Test
+ */
+
+public class FocusTransferWDFAppModal1Test {
+
+    public static void main(String[] args) throws Exception {
+        FocusTransferWDFTest test = new FocusTransferWDFTest(
+                Dialog.ModalityType.APPLICATION_MODAL,
+                FocusTransferWDFTest.DialogParent.FRAME,
+                FocusTransferWDFTest.WindowParent.NEW_FRAME);
+        test.doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFAppModal2Test.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.Dialog;
+
+/*
+ * @test
+ * @bug 8047367 8048263
+ * @summary Check whether the focus transfer between windows occurs correctly when
+ *          the following happens: a window having a hidden frame owner is shown;
+ *          an application modal dialog having a null dialog owner is shown;
+ *          a frame is shown.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @build TestWindow
+ * @run main FocusTransferWDFAppModal2Test
+ */
+
+public class FocusTransferWDFAppModal2Test {
+
+    public static void main(String[] args) throws Exception {
+        FocusTransferWDFTest test = new FocusTransferWDFTest(
+                Dialog.ModalityType.APPLICATION_MODAL,
+                FocusTransferWDFTest.DialogParent.NULL_DIALOG,
+                FocusTransferWDFTest.WindowParent.NEW_FRAME);
+        test.doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFAppModal3Test.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.Dialog;
+
+/*
+ * @test
+ * @bug 8047367
+ * @summary Check whether the focus transfer between windows occurs correctly when
+ *          the following happens: a window having a frame (F) owner is shown;
+ *          an application modal dialog having F owner is shown; F is shown.
+ *
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @build TestWindow
+ * @run main FocusTransferWDFAppModal3Test
+ */
+
+public class FocusTransferWDFAppModal3Test {
+
+    public static void main(String[] args) throws Exception {
+        FocusTransferWDFTest test = new FocusTransferWDFTest(
+                Dialog.ModalityType.APPLICATION_MODAL,
+                FocusTransferWDFTest.DialogParent.FRAME,
+                FocusTransferWDFTest.WindowParent.FRAME);
+        test.doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFDocModal1Test.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.Dialog;
+
+/*
+ * @test
+ * @bug 8047367
+ * @summary Check whether the focus transfer between windows occurs correctly when
+ *          the following happens: a window having a hidden frame owner is shown;
+ *          a document modal dialog with a frame (F) owner is shown; F is shown.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @build TestWindow
+ * @run main FocusTransferWDFDocModal1Test
+ */
+
+public class FocusTransferWDFDocModal1Test {
+
+    public static void main(String[] args) throws Exception {
+        FocusTransferWDFTest test = new FocusTransferWDFTest(
+                Dialog.ModalityType.DOCUMENT_MODAL,
+                FocusTransferWDFTest.DialogParent.FRAME,
+                FocusTransferWDFTest.WindowParent.NEW_FRAME);
+        test.doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFDocModal2Test.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.Dialog;
+
+/*
+ * @test
+ * @bug 8047367
+ * @summary Check whether the focus transfer between windows occurs correctly when
+ *          the following happens: a window having a hidden frame owner is shown;
+ *          a document modal dialog having a null dialog owner is shown;
+ *          a frame is shown.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @build TestWindow
+ * @run main FocusTransferWDFDocModal2Test
+ */
+
+public class FocusTransferWDFDocModal2Test {
+
+    public static void main(String[] args) throws Exception {
+        FocusTransferWDFTest test = new FocusTransferWDFTest(
+                Dialog.ModalityType.DOCUMENT_MODAL,
+                FocusTransferWDFTest.DialogParent.NULL_DIALOG,
+                FocusTransferWDFTest.WindowParent.NEW_FRAME);
+        test.doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFDocModal3Test.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.Dialog;
+
+/*
+ * @test
+ * @bug 8047367
+ * @summary Check whether the focus transfer between windows occurs correctly when
+ *          the following happens: a window having a frame (F) owner is shown;
+ *          a document modal dialog having F owner is shown; F is shown.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @build TestWindow
+ * @run main FocusTransferWDFDocModal3Test
+ */
+
+public class FocusTransferWDFDocModal3Test {
+
+    public static void main(String[] args) throws Exception {
+        FocusTransferWDFTest test = new FocusTransferWDFTest(
+                Dialog.ModalityType.DOCUMENT_MODAL,
+                FocusTransferWDFTest.DialogParent.FRAME,
+                FocusTransferWDFTest.WindowParent.FRAME);
+        test.doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFModeless1Test.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.Dialog;
+
+/*
+ * @test
+ * @bug 8047367
+ * @summary Check whether the focus transfer between windows occurs correctly when
+ *          the following happens: a window having a hidden frame owner is shown;
+ *          a modeless dialog having a frame (F) owner is shown; F is shown.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @build TestWindow
+ * @run main FocusTransferWDFModeless1Test
+ */
+
+public class FocusTransferWDFModeless1Test {
+
+    public static void main(String[] args) throws Exception {
+        FocusTransferWDFTest test = new FocusTransferWDFTest(
+                Dialog.ModalityType.MODELESS,
+                FocusTransferWDFTest.DialogParent.FRAME,
+                FocusTransferWDFTest.WindowParent.NEW_FRAME);
+        test.doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFModeless2Test.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.Dialog;
+
+/*
+ * @test
+ * @bug 8047367
+ * @summary Check whether the focus transfer between windows occurs correctly when
+ *          the following happens: a window having a hidden frame owner is shown;
+ *          a modeless dialog having a null dialog owner is shown;
+ *          a frame is shown.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @build TestWindow
+ * @run main FocusTransferWDFModeless2Test
+ */
+
+public class FocusTransferWDFModeless2Test {
+
+    public static void main(String[] args) throws Exception {
+        FocusTransferWDFTest test = new FocusTransferWDFTest(
+                Dialog.ModalityType.MODELESS,
+                FocusTransferWDFTest.DialogParent.FRAME,
+                FocusTransferWDFTest.WindowParent.NEW_FRAME);
+        test.doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFModeless3Test.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.Dialog;
+
+/*
+ * @test
+ * @bug 8047367
+ * @summary Check whether the focus transfer between windows occurs correctly when
+ *          the following happens: a window having a frame (F) owner is shown;
+ *          a modeless dialog having F owner is shown; F is shown.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @build TestWindow
+ * @run main FocusTransferWDFModeless3Test
+ */
+
+public class FocusTransferWDFModeless3Test {
+
+    public static void main(String[] args) throws Exception {
+        FocusTransferWDFTest test = new FocusTransferWDFTest(
+                Dialog.ModalityType.MODELESS,
+                FocusTransferWDFTest.DialogParent.FRAME,
+                FocusTransferWDFTest.WindowParent.FRAME);
+        test.doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFNonModal1Test.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.Dialog;
+
+/*
+ * @test
+ * @bug 8047367
+ * @summary Check whether the focus transfer between windows occurs correctly when
+ *          the following happens: a window having a hidden frame owner is shown;
+ *          a non-modal dialog having a frame (F) owner is shown; F is shown.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @build TestWindow
+ * @run main FocusTransferWDFNonModal1Test
+ */
+
+public class FocusTransferWDFNonModal1Test {
+
+    public static void main(String[] args) throws Exception {
+        FocusTransferWDFTest test = new FocusTransferWDFTest(
+                null,
+                FocusTransferWDFTest.DialogParent.FRAME,
+                FocusTransferWDFTest.WindowParent.NEW_FRAME);
+        test.doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFNonModal2Test.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.Dialog;
+
+/*
+ * @test
+ * @bug 8047367
+ * @summary Check whether the focus transfer between windows occurs correctly when
+ *          the following happens: a window having a hidden frame owner is shown;
+ *          a non-modal dialog having a null dialog owner is shown;
+ *          a frame is shown.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @build TestWindow
+ * @run main FocusTransferWDFNonModal2Test
+ */
+
+public class FocusTransferWDFNonModal2Test {
+
+    public static void main(String[] args) throws Exception {
+        FocusTransferWDFTest test = new FocusTransferWDFTest(
+                null,
+                FocusTransferWDFTest.DialogParent.NULL_DIALOG,
+                FocusTransferWDFTest.WindowParent.NEW_FRAME);
+        test.doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFNonModal3Test.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.Dialog;
+
+/*
+ * @test
+ * @bug 8047367
+ * @summary Check whether the focus transfer between windows occurs correctly when
+ *          the following happens: a window having a frame (F) owner is shown;
+ *          a non-modal dialog having F owner is shown; F is shown.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @build TestWindow
+ * @run main FocusTransferWDFNonModal3Test
+ */
+
+public class FocusTransferWDFNonModal3Test {
+
+    public static void main(String[] args) throws Exception {
+        FocusTransferWDFTest test = new FocusTransferWDFTest(
+                null,
+                FocusTransferWDFTest.DialogParent.FRAME,
+                FocusTransferWDFTest.WindowParent.FRAME);
+        test.doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFTest.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,272 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.*;
+import static jdk.testlibrary.Asserts.*;
+
+// WDF: Window -> Dialog -> Frame
+public class FocusTransferWDFTest {
+
+    class CustomDialog extends TestDialog {
+
+        public CustomDialog(Frame f) {
+            super(f);
+        }
+
+        public CustomDialog(Dialog d) {
+            super(d);
+        }
+
+        @Override
+        public void doOpenAction() {
+            if (frame != null) {
+                frame.setVisible(true);
+            }
+        }
+
+        @Override
+        public void doCloseAction() {
+            this.dispose();
+        }
+    }
+
+    class CustomFrame extends TestFrame {
+
+        @Override
+        public void doCloseAction() {
+            this.dispose();
+        }
+    }
+
+    class CustomWindow extends TestWindow {
+
+        public CustomWindow(Frame f) {
+            super(f);
+        }
+
+        @Override
+        public void doOpenAction() {
+            if (dialog != null) {
+                dialog.setVisible(true);
+            }
+        }
+    }
+
+
+    private TestDialog dialog;
+    private TestFrame  frame;
+    private TestWindow window;
+
+    private Frame  parentFrame;
+
+    private static final int delay = 1000;
+
+    private final ExtendedRobot robot;
+
+    private Dialog.ModalityType modalityType;
+
+    public enum DialogParent {FRAME, NULL_DIALOG};
+    private DialogParent dialogParent;
+
+    public enum WindowParent {FRAME, NEW_FRAME};
+    private WindowParent windowParent;
+
+
+    FocusTransferWDFTest(Dialog.ModalityType modType,
+                         DialogParent        dlgParent,
+                         WindowParent        winParent) throws Exception {
+
+        modalityType = modType;
+        dialogParent = dlgParent;
+        windowParent = winParent;
+
+        robot = new ExtendedRobot();
+        EventQueue.invokeLater( this::createGUI );
+    }
+
+    private void createGUI() {
+
+        frame = new CustomFrame();
+        frame.setLocation(50, 50);
+
+        switch (dialogParent) {
+            case FRAME:
+                dialog = new CustomDialog(frame);
+                break;
+            case NULL_DIALOG:
+                dialog = new CustomDialog((Dialog) null);
+                break;
+        }
+        assertTrue(dialog != null, "error: null dialog");
+
+        if (modalityType == null) {
+            modalityType = Dialog.ModalityType.MODELESS;
+        } else {
+            dialog.setModalityType(modalityType);
+        }
+
+        dialog.setLocation(250, 50);
+
+        switch (windowParent) {
+            case FRAME:
+                window = new CustomWindow(frame);
+                break;
+            case NEW_FRAME:
+                parentFrame = new Frame();
+                window = new CustomWindow(parentFrame);
+                break;
+        }
+        assertTrue(window != null, "error: null window");
+
+        window.setLocation(450, 50);
+        window.setVisible(true);
+    }
+
+    private void closeAll() {
+        if (dialog != null) { dialog.dispose(); }
+        if ( frame != null) {  frame.dispose(); }
+        if (window != null) { window.dispose(); }
+
+        if (parentFrame  != null) {  parentFrame.dispose(); }
+    }
+
+    private void ModalTest() throws Exception {
+        frame.checkCloseButtonFocusGained(false, 10);
+        dialog.checkOpenButtonFocusLost(false, 10);
+
+        dialog.clickCloseButton(robot);
+        robot.waitForIdle(delay);
+
+        frame.checkCloseButtonFocusGained(true);
+
+        window.openGained.reset();
+
+        frame.clickCloseButton(robot);
+        robot.waitForIdle(delay);
+    }
+
+    public void doTest() throws Exception {
+
+        try {
+
+            robot.waitForIdle(delay);
+
+            window.checkCloseButtonFocusGained(false, 10);
+
+            window.clickOpenButton(robot);
+            robot.waitForIdle(delay);
+
+            dialog.checkCloseButtonFocusGained(true);
+            window.checkOpenButtonFocusLost(false, 10);
+
+            dialog.clickOpenButton(robot);
+            robot.waitForIdle(delay);
+
+            switch (modalityType) {
+                case APPLICATION_MODAL:
+                    ModalTest();
+                    if (windowParent == WindowParent.FRAME) {
+                        assertFalse(window.isVisible(),
+                            "window shouldn't be visible");
+                    } else { // WindowParent.NEW_FRAME
+                        window.checkOpenButtonFocusGained(false, 10);
+                    }
+
+                    break;
+
+                case DOCUMENT_MODAL:
+                    if (dialogParent == DialogParent.FRAME) {
+                        ModalTest();
+                        if (windowParent == WindowParent.FRAME) { // 10
+                            assertFalse(window.isVisible(),
+                                "window shouldn't be visible");
+                        } else { // WindowParent.NEW_FRAME
+                            window.checkOpenButtonFocusGained(false, 10);
+                        }
+                    } else { // DialogParent.NULL_DIALOG
+                        frame.checkCloseButtonFocusGained(true);
+                        dialog.checkOpenButtonFocusLost(true);
+
+                        dialog.openGained.reset();
+
+                        frame.clickCloseButton(robot);
+                        robot.waitForIdle(delay);
+
+                        dialog.checkOpenButtonFocusGained(true);
+
+                        window.openGained.reset();
+
+                        dialog.clickCloseButton(robot);
+                        robot.waitForIdle(delay);
+
+                        window.checkOpenButtonFocusGained(false, 10);
+                    }
+                    break;
+
+                case MODELESS:
+
+                    frame.checkCloseButtonFocusGained(true);
+                    dialog.checkOpenButtonFocusLost(true);
+
+                    dialog.openGained.reset();
+
+                    frame.clickCloseButton(robot);
+                    robot.waitForIdle(delay);
+
+                    if (dialogParent == DialogParent.NULL_DIALOG) {
+                        dialog.checkOpenButtonFocusGained(true);
+
+                        window.openGained.reset();
+
+                        dialog.clickCloseButton(robot);
+                        robot.waitForIdle(delay);
+
+                        window.checkOpenButtonFocusGained(false, 10);
+                    } else {
+                        assertFalse(dialog.isVisible(),
+                            "dialog shouldn't be visible");
+
+                        if (windowParent == WindowParent.FRAME) {
+                            assertFalse(window.isVisible(),
+                                "window shouldn't be visible");
+                        }
+                    }
+
+                    break;
+            }
+
+        } catch (Exception e) {
+
+            // make screenshot before exit
+            Rectangle rect = new Rectangle(0, 0, 650, 250);
+            java.awt.image.BufferedImage img = robot.createScreenCapture(rect);
+            javax.imageio.ImageIO.write(img, "jpg", new java.io.File("NOK.jpg"));
+
+            throw e;
+        }
+
+        robot.waitForIdle(delay);
+        EventQueue.invokeAndWait(this::closeAll);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/ModalitySettingsTest/ModalitySettingsTest.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,139 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.*;
+import static jdk.testlibrary.Asserts.*;
+
+/*
+ * @test
+ * @bug 8047367
+ * @summary Check modality settings for Window and Dialog.
+ *
+ * @library ../../../../lib/testlibrary/
+ * @run main ModalitySettingsTest
+ */
+
+
+
+public class ModalitySettingsTest {
+
+    private void doTest() throws Exception {
+
+        Window w = new Window(new Frame());
+
+        boolean unexpectedExc = false;
+
+        try {
+            Dialog d = new Dialog(w);
+        } catch (IllegalArgumentException iae) {
+        } catch (Exception e) {
+            unexpectedExc = true;
+        }
+
+        assertFalse(unexpectedExc, "unexpected exception occured when a " +
+            "Window instance was passed to Dialog constructor");
+
+        Dialog d = new Dialog((Frame) null);
+        assertTrue(d.getModalityType() == Dialog.ModalityType.MODELESS,
+            "the default modality type returned by Dialog " +
+            "differs from Dialog.ModalityType.MODELESS");
+
+        Frame f = new Frame();
+        assertTrue(f.getModalExclusionType() == Dialog.ModalExclusionType.NO_EXCLUDE,
+            "the default modality exclusion type returned by Frame" +
+            "differs from Dialog.ModalExclusionType.NO_EXCLUDE");
+
+        w = new Window((Frame) null);
+        assertTrue(w.getModalExclusionType() == Dialog.ModalExclusionType.NO_EXCLUDE,
+            "the default modality exclusion type returned by Window " +
+            "differs from Dialog.ModalExclusionType.NO_EXCLUDE");
+
+        d = new Dialog((Frame) null);
+        assertTrue(d.getModalExclusionType() == Dialog.ModalExclusionType.NO_EXCLUDE,
+            "the default modality exclusion type returned by Dialog " +
+            "differs from Dialog.ModalExclusionType.NO_EXCLUDE");
+
+        d.setModalityType(Dialog.ModalityType.TOOLKIT_MODAL);
+        assertTrue(d.getModalityType() == Dialog.ModalityType.TOOLKIT_MODAL,
+            "the modality type returned by Dialog " +
+            "differs from Dialog.ModalityType.TOOLKIT_MODAL " +
+            "after setting the modality type to that value");
+
+        d.setModal(false);
+        assertTrue(d.getModalityType() == Dialog.ModalityType.MODELESS,
+            "the modality type returned by Dialog differs from " +
+            "Dialog.ModalityType.MODELESS after calling setModal(false)");
+
+        d.setModal(true);
+        assertTrue(d.getModalityType() == Dialog.ModalityType.APPLICATION_MODAL,
+            "the modality type returned by Dialog differs from "
+            + "Dialog.ModalityType.APPLICATION_MODAL after calling setModal(true)");
+
+        w.setModalExclusionType(Dialog.ModalExclusionType.APPLICATION_EXCLUDE);
+        assertTrue(w.getModalExclusionType() ==
+                Dialog.ModalExclusionType.APPLICATION_EXCLUDE,
+            "getModalExclusionType method for Window did not return " +
+            "Dialog.ModalExclusionType.APPLICATION_EXCLUDE after " +
+            "setting it to that value");
+
+        d = new Dialog((Frame) null);
+        d.setModalityType(Dialog.ModalityType.TOOLKIT_MODAL);
+        assertTrue(d.isModal(), "method isModal for Dialog " +
+            "returned false when the Dialog is toolkit modal");
+
+        d.setModalityType(Dialog.ModalityType.MODELESS);
+        assertFalse(d.isModal(), "method isModal for Dialog " +
+            "returned true when the Dialog is MODELESS");
+
+        d = new Dialog((Frame) null, (Dialog.ModalityType) null);
+        assertTrue(d.getModalityType() == Dialog.ModalityType.MODELESS,
+            "The modality type returned for a Dialog constructed " +
+            "with null modality type differs from MODELESS");
+
+        d = new Dialog((Frame) null);
+        d.setModalityType(null);
+        assertTrue(d.getModalityType() == Dialog.ModalityType.MODELESS,
+            "the modality type returned for a Dialog set with null " +
+            "modality type differs from MODELESS");
+
+        d.setModalExclusionType(null);
+        assertTrue(d.getModalExclusionType() == Dialog.ModalExclusionType.NO_EXCLUDE,
+            "The exlcusion type returned for a Dialog set with null " +
+            "exclusion type differs from NO_EXCLUDE");
+
+        try {
+            Dialog.ModalityType.valueOf("invalid");
+        } catch (IllegalArgumentException iae) {
+        } catch (Exception e) {
+            unexpectedExc = true;
+        }
+
+        assertFalse(unexpectedExc, "unexpected exception occured when an " +
+            "invalid value was passed to ModalityType.valueOf method");
+    }
+
+    public static void main(String[] args) throws Exception {
+        ModalitySettingsTest test = new ModalitySettingsTest();
+        test.doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/NullModalityDialogTest/NullModalityDialogTest.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,161 @@
+/*
+ * Copyright (c) 2007, 2014, 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.awt.*;
+import java.awt.event.KeyEvent;
+
+import static jdk.testlibrary.Asserts.*;
+
+
+/*
+ * @test
+ * @bug 8047367
+ * @summary Check whether a Dialog set with null modality type
+ *          behaves like a modeless dialog
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @build TestWindow
+ * @run main NullModalityDialogTest
+ */
+
+
+public class NullModalityDialogTest {
+
+    class CustomDialog extends TestDialog {
+        public CustomDialog(Frame f) {
+            super(f);
+        }
+        @Override
+        public void doOpenAction() {
+            if (frame != null) {
+                frame.setVisible(true);
+            }
+            if (window != null) {
+                window.setVisible(true);
+            }
+        }
+    }
+
+    class CustomFrame extends TestFrame {
+        @Override
+        public void doOpenAction() {
+            if (dialog != null) {
+                dialog.setVisible(true);
+            }
+        }
+    }
+
+    private TestFrame  parent;
+    private TestDialog dialog;
+    private TestFrame  frame;
+    private TestWindow window;
+
+    private static final int delay = 1000;
+
+    private final ExtendedRobot robot;
+
+    NullModalityDialogTest() throws Exception {
+
+        robot = new ExtendedRobot();
+        EventQueue.invokeLater(this::createGUI);
+    }
+
+    private void createGUI() {
+
+        parent = new CustomFrame();
+        parent.setTitle("Parent");
+        parent.setLocation(50, 50);
+
+        dialog = new CustomDialog(parent);
+        dialog.setTitle("Dialog");
+        dialog.setModalityType((Dialog.ModalityType) null);
+        dialog.setLocation(250, 50);
+
+        frame = new TestFrame();
+        frame.setTitle("Frame");
+        frame.setLocation(50, 250);
+
+        window = new TestWindow(frame);
+        window.setLocation(250, 250);
+
+        parent.setVisible(true);
+    }
+
+    private void closeAll() {
+        if (parent != null) { parent.dispose(); }
+        if (dialog != null) { dialog.dispose(); }
+        if (frame  != null) {  frame.dispose(); }
+        if (window != null) { window.dispose(); }
+    }
+
+    public void doTest() throws Exception {
+
+        robot.waitForIdle(delay);
+
+        parent.clickOpenButton(robot);
+        robot.waitForIdle(delay);
+
+        dialog.activated.waitForFlagTriggered();
+        assertTrue(dialog.activated.flag(), "Dialog did not trigger " +
+                "Window Activated event when it became visible");
+
+        dialog.closeGained.waitForFlagTriggered();
+        assertTrue(dialog.closeGained.flag(), "the 1st button did not gain focus " +
+            "when the Dialog became visible");
+
+        assertTrue(dialog.closeButton.hasFocus(), "the 1st button in the Dialog " +
+            "gained focus but lost it afterwards");
+
+        dialog.openGained.reset();
+
+        robot.type(KeyEvent.VK_TAB);
+
+        dialog.openGained.waitForFlagTriggered();
+        assertTrue(dialog.openGained.flag(),
+            "Tab navigation did not happen properly on Dialog. Open button " +
+            "did not gain focus on tab press when parent frame is visible");
+
+        dialog.clickOpenButton(robot);
+        robot.waitForIdle(delay);
+
+        frame.activated.waitForFlagTriggered();
+        assertTrue(frame.activated.flag(), "Frame did not trigger activated when " +
+            "made visible. Dialog and its parent frame are visible");
+
+        frame.checkUnblockedFrame(robot, "Frame is the parent of a visible Dialog.");
+        window.checkUnblockedWindow(robot, "Frame and its child Dialog are visible.");
+
+        robot.waitForIdle(delay);
+
+        EventQueue.invokeAndWait(this::closeAll);
+    }
+
+    public static void main(String[] args) throws Exception {
+        NullModalityDialogTest test = new NullModalityDialogTest();
+        test.doTest();
+    }
+}
--- a/jdk/test/java/awt/Modal/helpers/TestDialog.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/test/java/awt/Modal/helpers/TestDialog.java	Wed Jul 05 19:53:51 2017 +0200
@@ -332,35 +332,47 @@
             "button did not gain focus. " + message);
     }
 
-    public void checkCloseButtonFocusGained() {
-        checkCloseButtonFocusGained(Flag.ATTEMPTS);
+    public void checkCloseButtonFocusGained(boolean refState) {
+        checkCloseButtonFocusGained(refState, Flag.ATTEMPTS);
     }
 
-    public void checkCloseButtonFocusGained(int attempts) {
+    public void checkCloseButtonFocusGained(boolean refState, int attempts) {
         try {
             closeGained.waitForFlagTriggered(attempts);
         } catch (InterruptedException e) {}
-        assertTrue(closeGained.flag(),
-            "dialog Close button did not gain focus");
+
+        String msg = "dialog Close button ";
+        msg += (refState ? "did not gain focus" :
+                "gained focus when it should not");
+
+        assertTrue(closeGained.flag() == refState, msg);
     }
 
-    public void checkOpenButtonFocusGained() {
+    public void checkOpenButtonFocusGained(boolean refState) {
         try {
             openGained.waitForFlagTriggered();
         } catch (InterruptedException e) {}
-        assertTrue(openGained.flag(),
-            "dialog Open button did not gain focus");
+
+        String msg = "dialog Open button ";
+        msg += (refState ? "did not gain focus" :
+                "gained focus when it should not");
+
+        assertTrue(openGained.flag() == refState, msg);
     }
 
-    public void checkOpenButtonFocusLost() {
-        checkOpenButtonFocusLost(Flag.ATTEMPTS);
+    public void checkOpenButtonFocusLost(boolean refState) {
+        checkOpenButtonFocusLost(refState, Flag.ATTEMPTS);
     }
 
-    public void checkOpenButtonFocusLost(int attempts) {
+    public void checkOpenButtonFocusLost(boolean refState, int attempts) {
         try {
             openLost.waitForFlagTriggered(attempts);
         } catch (InterruptedException e) {}
-        assertTrue(openLost.flag(),
-            "dialog Open button did not lose focus");
+
+        String msg = "dialog Open button ";
+        msg += (refState ? "did not lose focus" :
+                "lost focus when it should not");
+
+        assertTrue(openLost.flag() == refState, msg);
     }
 }
--- a/jdk/test/java/awt/Modal/helpers/TestFrame.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/test/java/awt/Modal/helpers/TestFrame.java	Wed Jul 05 19:53:51 2017 +0200
@@ -292,13 +292,13 @@
         robot.waitForIdle(delay);
 
         assertFalse(dummyClicked.flag(),
-            "DummyButton on blocked Window triggered action when clicked. " + message);
+            "DummyButton on blocked Frame triggered action when clicked. " + message);
 
         assertFalse(dummyGained.flag(),
-            "DummyButton on blocked Window gained focus when clicked. " + message);
+            "DummyButton on blocked Frame gained focus when clicked. " + message);
 
         assertFalse(focusGained.flag(),
-            "A blocked Dialog gained focus when component clicked. " + message);
+            "A blocked Frame gained focus when component clicked. " + message);
     }
 
     public void checkUnblockedFrame(ExtendedRobot robot,
@@ -324,46 +324,50 @@
             "button did not gain focus on tab press. " + message);
     }
 
-    public void checkCloseButtonFocusGained() {
-        checkCloseButtonFocusGained(Flag.ATTEMPTS);
+    public void checkCloseButtonFocusGained(boolean refState) {
+        checkCloseButtonFocusGained(refState, Flag.ATTEMPTS);
     }
 
-    public void checkCloseButtonFocusGained(int attempts) {
-
+    public void checkCloseButtonFocusGained(boolean refState, int attempts) {
         try {
             closeGained.waitForFlagTriggered(attempts);
         } catch (InterruptedException e) {}
 
-        if (closeGained.flag()) {
-            Component focusOwner =
-                KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner();
-            assertTrue(closeButton.equals(focusOwner),
-                "close button gained focus, but it is not the current focus owner");
-        } else {
-            assertTrue(false, "frame Close button did not gain focus");
-        }
+        String msg = "frame Close button ";
+        msg += (refState ? "did not gain focus" :
+                "gained focus when it should not");
+
+        assertTrue(closeGained.flag() == refState, msg);
     }
 
-    public void checkOpenButtonFocusGained() {
+    public void checkOpenButtonFocusGained(boolean refState) {
+        checkOpenButtonFocusGained(refState, Flag.ATTEMPTS);
+    }
+
+    public void checkOpenButtonFocusGained(boolean refState, int attempts) {
         try {
-            openGained.waitForFlagTriggered();
+            openGained.waitForFlagTriggered(attempts);
         } catch (InterruptedException e) {}
 
-        if (openGained.flag()) {
-            Component focusOwner =
-                KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner();
-            assertTrue(openButton.equals(focusOwner),
-                "open button gained focus, but it is not the current focus owner");
-        } else {
-            assertTrue(false, "frame Open button did not gain focus");
-        }
+        String msg = "frame Open button ";
+        msg += (refState ? "did not gain focus" :
+                "gained focus when it should not");
+
+        assertTrue(openGained.flag() == refState, msg);
+    }
+
+    public void checkOpenButtonFocusLost(boolean refState) {
+        checkOpenButtonFocusLost(refState, Flag.ATTEMPTS);
     }
 
-    public void checkOpenButtonFocusLost() {
+    public void checkOpenButtonFocusLost(boolean refState, int attempts) {
         try {
-            openLost.waitForFlagTriggered();
+            openLost.waitForFlagTriggered(attempts);
         } catch (InterruptedException e) {}
 
-        assertTrue(openLost.flag(), "frame Open button did not lose focus");
+        String msg = "frame Open button ";
+        msg += (refState ? "did not lose focus" :
+                "lost focus when it should not");
+        assertTrue(openLost.flag()== refState, msg);
     }
 }
--- a/jdk/test/java/awt/Modal/helpers/TestWindow.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/test/java/awt/Modal/helpers/TestWindow.java	Wed Jul 05 19:53:51 2017 +0200
@@ -295,39 +295,51 @@
             "button did not gain focus on tab press. " + message);
     }
 
-    public void checkCloseButtonFocusGained() {
-        checkCloseButtonFocusGained(Flag.ATTEMPTS);
+    public void checkCloseButtonFocusGained(boolean refState) {
+        checkCloseButtonFocusGained(refState, Flag.ATTEMPTS);
     }
 
-    public void checkCloseButtonFocusGained(int attempts) {
+    public void checkCloseButtonFocusGained(boolean refState, int attempts) {
         try {
             closeGained.waitForFlagTriggered(attempts);
         } catch (InterruptedException e) {}
-        assertTrue(closeGained.flag(),
-            "window Close button did not gain focus");
+
+        String msg = "window Close button ";
+        msg += (refState ? "did not gain focus" :
+                "gained focus when it should not");
+
+        assertTrue(closeGained.flag() == refState, msg);
     }
 
-    public void checkOpenButtonFocusGained() {
-        checkOpenButtonFocusGained(Flag.ATTEMPTS);
+
+    public void checkOpenButtonFocusGained(boolean refState) {
+        checkOpenButtonFocusGained(refState, Flag.ATTEMPTS);
     }
 
-    public void checkOpenButtonFocusGained(int attempts) {
+    public void checkOpenButtonFocusGained(boolean refState, int attempts) {
         try {
             openGained.waitForFlagTriggered(attempts);
         } catch (InterruptedException e) {}
-        assertTrue(openGained.flag(),
-            "window Open button did not gain focus");
+
+        String msg = "window Open button ";
+        msg += (refState ? "did not gain focus" :
+                "gained focus when it should not");
+
+        assertTrue(openGained.flag() == refState, msg);
     }
 
-    public void checkOpenButtonFocusLost() {
-        checkOpenButtonFocusLost(Flag.ATTEMPTS);
+    public void checkOpenButtonFocusLost(boolean refState) {
+        checkOpenButtonFocusLost(refState, Flag.ATTEMPTS);
     }
 
-    public void checkOpenButtonFocusLost(int attempts) {
+    public void checkOpenButtonFocusLost(boolean refState, int attempts) {
         try {
             openLost.waitForFlagTriggered(attempts);
         } catch (InterruptedException e) {}
-        assertTrue(openLost.flag(),
-            "window Open button did not lose focus");
+
+        String msg = "window Open button ";
+        msg += (refState ? "did not lose focus" :
+                "lost focus when it should not");
+        assertTrue(openLost.flag()== refState, msg);
     }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Toolkit/DesktopProperties/rfe4758438.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,238 @@
+/*
+ * Copyright (c) 2004, 2014, 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.awt.*;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.io.InputStream;
+
+/*
+ * @test
+ * @bug 4758438
+ * @summary Testcase to check the implementation of RFE 4758438
+ *          The RFE suggests that the GNOME desktop properties
+ *          should be made accessible through the
+ *          Toolkit.getDesktopProperty() API.
+ * @author Girish R (girish.ramachandran@sun.com)
+ * @author Dmitriy Ermashov (dmitriy.ermashov@oracle.com)
+ * @run shell rfe4758438.sh
+ */
+
+public class rfe4758438 implements PropertyChangeListener {
+
+    enum PROPS {
+        drag_threshold(
+                "org.gnome.settings-daemon.peripherals.mouse drag-threshold",
+                "/desktop/gnome/peripherals/mouse/drag_threshold",
+                "gnome.Net/DndDragThreshold",
+                "int",
+                new String[]{"5", "6"}),
+        double_click(
+                "org.gnome.settings-daemon.peripherals.mouse double-click",
+                "/desktop/gnome/peripherals/mouse/double_click",
+                "gnome.Net/DoubleClickTime",
+                "int",
+                new String[]{"200","300"}),
+        cursor_blink(
+                "org.gnome.desktop.interface cursor-blink",
+                "/desktop/gnome/interface/cursor_blink",
+                "gnome.Net/CursorBlink",
+                "bool",
+                new String[]{"true","false"}),
+        cursor_blink_time(
+                "org.gnome.desktop.interface cursor-blink-time",
+                "/desktop/gnome/interface/cursor_blink_time",
+                "gnome.Net/CursorBlinkTime",
+                "int",
+                new String[]{"1000","1500"}),
+        gtk_theme(
+                "org.gnome.desktop.interface gtk-theme",
+                "/desktop/gnome/interface/gtk_theme",
+                "gnome.Net/ThemeName",
+                "string",
+                new String[]{"Crux","Simple"});
+
+        public final String gsettings;
+        public final String gconftool;
+        public final String java;
+        public final String type;
+        public final String[] values;
+
+        PROPS(String gsettings, String gconftool, String java, String type, String[] values){
+            this.gsettings = gsettings;
+            this.gconftool = gconftool;
+            this.java = java;
+            this.type = type;
+            this.values = values;
+        }
+    }
+
+    static boolean useGsettings;
+    static String tool;
+    Toolkit toolkit = Toolkit.getDefaultToolkit();
+    String changedProperty;
+    Object changedValue;
+    Object lock = new Object();
+
+    /**
+     * Implementation of PropertyChangeListener method
+     */
+    public void propertyChange(PropertyChangeEvent event) {
+        changedProperty = event.getPropertyName();
+        changedValue = toolkit.getDesktopProperty(changedProperty);
+        System.out.println("Property "+changedProperty+" changed. Changed value: "+changedValue);
+        synchronized(lock) {
+            try {
+                lock.notifyAll();
+            } catch (Exception e) {
+            }
+        }
+    }
+
+    public static void main(String[] args) throws Exception {
+        useGsettings = System.getProperty("useGsettings").equals("true");
+        tool = System.getProperty("tool");
+
+        String osName = System.getProperty("os.name");
+        if (!"Linux".equals(osName) && !"SunOS".equals(osName))
+            System.out.println("This test need not be run on this platform");
+        else
+            new rfe4758438().doTest();
+    }
+
+    void doTest() throws Exception {
+        for (PROPS p : PROPS.values())
+            toolkit.addPropertyChangeListener(p.java, this);
+
+        for (PROPS p : PROPS.values()) {
+            Thread.sleep(1000);
+            doTest(p);
+        }
+        System.out.println("Test passed");
+    }
+
+    /**
+     * Do the test for each property. Find the current value
+     * of the property, set the property to a value not equal
+     * to the current value, check if the propertyChange event
+     * is triggered. Reset the property to the actual value.
+     */
+    void doTest(PROPS property) throws Exception {
+        //Choose the test value which is not same as the current value
+        Object obj = toolkit.getDesktopProperty(property.java);
+        if (obj == null)
+            throw new RuntimeException("No such property available: " + property.java);
+
+        //For boolean type values, getDesktopProperty method returns Integer objects
+        if (property.type.equals("bool")) {
+            if (obj.equals(new Integer(1))) {
+                obj = new String("true");
+            } else {
+                obj = new String("false");
+            }
+        }
+        Object value = property.values[0];
+        if (obj.toString().equals(value)) {
+            value = property.values[1];
+        }
+
+        //Create the command to execute
+        StringBuffer sb = new StringBuffer(tool);
+        if (useGsettings) {
+            sb.append(" set ");
+            sb.append(property.gsettings);
+            sb.append(" ");
+        } else {
+            sb.append(" --set --type=");
+            sb.append(property.type);
+            sb.append(" ");
+            sb.append(property.gconftool);
+            sb.append(" ");
+        }
+        String tempCommand = sb.toString();
+        sb.append(value.toString());
+
+        //Initialize the variables and execute the command
+        changedProperty = "";
+        changedValue = null;
+        if (executeCommand(sb.toString()) != 0)
+            throw new RuntimeException("Could not execute the command");
+
+        synchronized(lock) {
+            try {
+                lock.wait(5000);
+            } catch (Exception e) {
+            }
+        }
+        if (property.type.equals("bool")) {
+            if (changedValue.equals(new Integer(1))) {
+                changedValue = new String("true");
+            } else {
+                changedValue = new String("false");
+            }
+        }
+
+        //Check if the event got triggered
+        if (!changedProperty.equals(property.java)) {
+            //Reset the property
+            executeCommand(tempCommand + obj.toString());
+            throw new RuntimeException("PropertyChangedEvent did not occur for " + property.java);
+        } else if (!changedValue.toString().equals(value.toString())) {
+            //Reset the property
+            executeCommand(tempCommand + obj.toString());
+            throw new RuntimeException("New value of the property is different from " +
+                                       "the value supplied");
+        }
+
+        //Reset the property
+        executeCommand(tempCommand + obj.toString());
+    }
+
+    /**
+     * Uses the gconftool-2 command to change the value of the property.
+     * Gets the output of the command and prints the output
+     */
+    int executeCommand(String command) throws Exception {
+        System.out.println("Executing " + command);
+        Process process = Runtime.getRuntime().exec(command);
+
+        InputStream is = process.getInputStream();
+        InputStream es = process.getErrorStream();
+        StringBuilder stdout = new StringBuilder();
+        StringBuilder stderr = new StringBuilder();
+
+        process.waitFor();
+
+        while (is.available() > 0)
+            stdout.append((char) is.read());
+
+        while (es.available() > 0)
+            stderr.append((char) es.read());
+
+        if (stdout.length() > 0)
+            System.out.println(stdout.toString());
+        if (stderr.length() > 0)
+            System.err.println(stderr.toString());
+        return process.exitValue();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Toolkit/DesktopProperties/rfe4758438.sh	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,83 @@
+# Copyright (c) 2014, 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.
+
+if [ -z "${TESTJAVA}" ]; then
+  echo "TESTJAVA undefined: can't continue."
+  exit 1
+fi
+
+OS=`uname`
+
+case "$OS" in
+    Linux* )
+        GNOMESID=`pgrep gnome-session`
+        DBUS_SESSION_BUS_ADDRESS=`grep -z DBUS_SESSION_BUS_ADDRESS /proc/$GNOMESID/environ | cut -d= -f2-`
+        export DBUS_SESSION_BUS_ADDRESS
+        DISPLAY=`grep -z DISPLAY /proc/$GNOMESID/environ | cut -d= -f2-`
+        export DISPLAY
+        ;;
+    Sun* )
+        GNOMESID=`pgrep gnome-session`
+        DBUS_SESSION_BUS_ADDRESS=`pargs -e $GNOMESID | grep DBUS_SESSION_BUS_ADDRESS | cut -d= -f2-`
+        export DBUS_SESSION_BUS_ADDRESS
+        DISPLAY=`pargs -e $GNOMESID | grep DISPLAY | cut -d= -f2-`
+        export DISPLAY
+        ;;
+    * )
+        echo "This Feature is not to be tested on $OS"
+        exit 0
+        ;;
+esac
+
+if [ ${GNOME_DESKTOP_SESSION_ID:-nonset} = "nonset" ];
+then
+    if [ ${GNOME_SESSION_NAME:-nonset} = "nonset" ];
+    then
+        echo "This test should run under Gnome"
+        exit 0
+    fi
+fi
+
+SCHEMAS=`gsettings list-schemas | wc -l`
+
+if [ $SCHEMAS -eq 0 ];
+then
+    TOOL=`which gconftool-2`
+    USE_GSETTINGS="false"
+else
+    TOOL=`which gsettings`
+    USE_GSETTINGS="true"
+fi
+
+cd ${TESTSRC}
+echo $PWD
+echo "${TESTJAVA}/bin/javac -d ${TESTCLASSES} rfe4758438.java"
+${TESTJAVA}/bin/javac -d ${TESTCLASSES} rfe4758438.java
+
+cd ${TESTCLASSES}
+${TESTJAVA}/bin/java -DuseGsettings=${USE_GSETTINGS} -Dtool=${TOOL} ${TESTVMOPTS} rfe4758438
+
+if [ $? -ne 0 ]
+then
+    echo "Test failed. See the error stream output"
+    exit 1
+fi
+exit 0
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/event/KeyEvent/ExtendedModifiersTest/ExtendedModifiersTest.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,271 @@
+/*
+ * Copyright (c) 2001, 2014, 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 8043126
+ * @summary Check whether
+ *          1. correct extended modifiers are returned
+ *             by KeyEvent.getModifiersEx()
+ *          2. InputEvent.getModifiersExText() returns
+ *             correct extended modifier keys description
+ *
+ * @library ../../../../../lib/testlibrary/  ../../helpers/lwcomponents/
+ * @build LWComponent
+ * @build LWButton
+ * @build LWList
+ * @build ExtendedRobot
+ * @run main/timeout=600 ExtendedModifiersTest
+ */
+
+
+import java.awt.*;
+import java.awt.event.InputEvent;
+import java.awt.event.KeyEvent;
+import java.awt.event.KeyListener;
+import java.util.ArrayList;
+
+import static jdk.testlibrary.Asserts.*;
+import test.java.awt.event.helpers.lwcomponents.LWButton;
+import test.java.awt.event.helpers.lwcomponents.LWList;
+
+
+public class ExtendedModifiersTest implements KeyListener {
+
+    Frame frame;
+
+    Button    button;
+    LWButton  buttonLW;
+    TextField textField;
+    TextArea  textArea;
+    List      list;
+    LWList    listLW;
+
+    private final ExtendedRobot robot;
+    private final static int robotDelay = 1000;
+    private final static int  waitDelay = 5000;
+    private final static int   keyDelay =  500;
+
+    private final Object lock;
+
+    private boolean keyPressedFlag = false;
+
+    private int modifiersEx = 0;
+    private String exText = "";
+
+
+    @Override
+    public void keyTyped(KeyEvent e) {}
+
+    @Override
+    public void keyPressed(KeyEvent e) {
+
+        if (e.getKeyCode() == KeyEvent.VK_ESCAPE) {
+            return;
+        }
+
+        modifiersEx = e.getModifiersEx();
+        exText = InputEvent.getModifiersExText(modifiersEx);
+        keyPressedFlag = true;
+
+        synchronized (lock) { lock.notifyAll(); }
+    }
+
+    @Override
+    public void keyReleased(KeyEvent e) {}
+
+
+    public void createGUI() {
+
+        frame = new Frame();
+        frame.setTitle("ExtendedModifiersTest");
+        frame.setLayout(new GridLayout(1, 6));
+
+        button = new Button();
+        button.addKeyListener(this);
+        frame.add(button);
+
+        buttonLW = new LWButton();
+        buttonLW.addKeyListener(this);
+        frame.add(buttonLW);
+
+        textField = new TextField(5);
+        textField.addKeyListener(this);
+        frame.add(textField);
+
+        textArea = new TextArea(5, 5);
+        textArea.addKeyListener(this);
+        frame.add(textArea);
+
+        list = new List();
+        for (int i = 1; i <= 5; ++i) { list.add("item " + i); }
+        list.addKeyListener(this);
+        frame.add(list);
+
+        listLW = new LWList();
+        for (int i = 1; i <= 5; ++i) { listLW.add("item " + i); }
+        listLW.addKeyListener(this);
+        frame.add(listLW);
+
+        frame.setBackground(Color.gray);
+        frame.setSize(500, 100);
+        frame.setVisible(true);
+        frame.toFront();
+    }
+
+    public ExtendedModifiersTest() throws Exception {
+        lock = new Object();
+        robot = new ExtendedRobot();
+        EventQueue.invokeAndWait( this::createGUI );
+    }
+
+
+    private void runScenario(int keys[], int refMask) {
+
+        if (keys.length < 1) { return; }
+
+        for (int k = 0; k < keys.length; ++k) {
+
+            keyPressedFlag = false;
+            robot.keyPress(keys[k]);
+            robot.delay(keyDelay);
+
+            if (!keyPressedFlag) {
+                synchronized (lock) {
+                    try {
+                        lock.wait(waitDelay);
+                    } catch (InterruptedException ex) {}
+                }
+            }
+
+            if (!keyPressedFlag) {
+                robot.keyRelease(keys[k]);
+                robot.delay(keyDelay);
+                assertTrue(false, "key press event was not received");
+            }
+        }
+
+        int modEx = modifiersEx & refMask;
+
+        for (int k = keys.length - 1; k >=0; --k) {
+            robot.keyRelease(keys[k]);
+            robot.delay(keyDelay);
+        }
+
+
+        assertEQ(modifiersEx, modEx, "invalid extended modifiers");
+
+        for (int k = 0; k < keys.length; ++k) {
+            String keyText = KeyEvent.getKeyText(keys[k]).toLowerCase();
+            assertTrue(exText.toLowerCase().contains(keyText), "invalid extended modifier keys description");
+        }
+
+        System.out.println(exText + " : passed");
+
+        robot.type(KeyEvent.VK_ESCAPE);
+
+        robot.delay(robotDelay);
+    }
+
+    private void doTest() throws Exception {
+
+        ArrayList<Component> components = new ArrayList();
+        components.add(button);
+        components.add(buttonLW);
+        components.add(textField);
+        components.add(textArea);
+        components.add(list);
+        components.add(listLW);
+
+        String OS = System.getProperty("os.name").toLowerCase();
+        System.out.println(OS);
+
+        for (Component c: components) {
+
+            String className = c.getClass().getName();
+            System.out.println("component class : " + className);
+
+            Point origin = c.getLocationOnScreen();
+            int xc = origin.x + c.getWidth() / 2;
+            int yc = origin.y + c.getHeight() / 2;
+            Point center = new Point(xc, yc);
+
+            robot.delay(robotDelay);
+            robot.glide(origin, center);
+            robot.click();
+            robot.delay(robotDelay);
+
+            // 1. shift + control
+            runScenario(new int[]{KeyEvent.VK_SHIFT, KeyEvent.VK_CONTROL},
+                    InputEvent.SHIFT_DOWN_MASK | InputEvent.CTRL_DOWN_MASK);
+
+            // 2. alt + shift + control
+            runScenario(new int[]{KeyEvent.VK_ALT, KeyEvent.VK_SHIFT, KeyEvent.VK_CONTROL},
+                    InputEvent.ALT_DOWN_MASK | InputEvent.SHIFT_DOWN_MASK | InputEvent.CTRL_DOWN_MASK);
+
+            // 3. shift
+            runScenario(new int[]{KeyEvent.VK_SHIFT},
+                    InputEvent.SHIFT_DOWN_MASK);
+
+            // 4. alt + control
+            runScenario(new int[]{KeyEvent.VK_ALT, KeyEvent.VK_CONTROL},
+                    InputEvent.ALT_DOWN_MASK | InputEvent.CTRL_DOWN_MASK);
+
+            // 5. shift + alt
+            runScenario(new int[]{KeyEvent.VK_SHIFT, KeyEvent.VK_ALT},
+                    InputEvent.SHIFT_DOWN_MASK | InputEvent.ALT_DOWN_MASK);
+
+
+            if (OS.contains("os x") || OS.contains("sunos")) {
+                // 6. meta
+                runScenario(new int[]{KeyEvent.VK_META}, InputEvent.META_DOWN_MASK);
+
+                // 7. shift + ctrl + alt + meta
+                runScenario(new int[]{KeyEvent.VK_SHIFT, KeyEvent.VK_CONTROL, KeyEvent.VK_ALT, KeyEvent.VK_META},
+                    InputEvent.SHIFT_DOWN_MASK | InputEvent.CTRL_DOWN_MASK | InputEvent.ALT_DOWN_MASK | InputEvent.META_DOWN_MASK);
+
+                // 8. meta + shift + ctrl
+                runScenario(new int[]{KeyEvent.VK_META, KeyEvent.VK_SHIFT, KeyEvent.VK_CONTROL},
+                    InputEvent.META_DOWN_MASK | InputEvent.SHIFT_DOWN_MASK | InputEvent.CTRL_DOWN_MASK);
+
+                // 9. meta + shift + alt
+                runScenario(new int[]{KeyEvent.VK_META, KeyEvent.VK_SHIFT, KeyEvent.VK_ALT},
+                    InputEvent.META_DOWN_MASK | InputEvent.SHIFT_DOWN_MASK | InputEvent.ALT_DOWN_MASK);
+
+                // 10. meta + ctrl + alt
+                runScenario(new int[]{KeyEvent.VK_META, KeyEvent.VK_CONTROL, KeyEvent.VK_ALT},
+                    InputEvent.META_DOWN_MASK | InputEvent.CTRL_DOWN_MASK | InputEvent.ALT_DOWN_MASK);
+            }
+        }
+
+        robot.waitForIdle();
+        frame.dispose();
+    }
+
+    public static void main(String[] args) throws Exception {
+        ExtendedModifiersTest test = new ExtendedModifiersTest();
+        test.doTest();
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/event/KeyEvent/KeyMaskTest/KeyMaskTest.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,219 @@
+/*
+ * Copyright (c) 2001, 2014, 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 8043126
+ * @summary Check whether KeyEvent.getModifiers() returns correct modifiers
+ *          when Ctrl, Alt or Shift keys are pressed.
+ *
+ * @library ../../../../../lib/testlibrary/  ../../helpers/lwcomponents/
+ * @build LWComponent
+ * @build LWButton
+ * @build LWList
+ * @build ExtendedRobot
+ * @run main/timeout=600 KeyMaskTest
+ */
+
+
+import java.awt.*;
+import java.awt.event.InputEvent;
+
+import java.awt.event.KeyAdapter;
+import java.awt.event.KeyEvent;
+
+import java.util.ArrayList;
+
+import static jdk.testlibrary.Asserts.*;
+
+import test.java.awt.event.helpers.lwcomponents.LWButton;
+import test.java.awt.event.helpers.lwcomponents.LWList;
+
+
+
+public class KeyMaskTest extends KeyAdapter {
+
+    Frame frame;
+
+    Button    button;
+    LWButton  buttonLW;
+    TextField textField;
+    TextArea  textArea;
+    List      list;
+    LWList    listLW;
+
+    int buttonPressedNumber;
+    int buttonReleasedNumber;
+
+    ExtendedRobot robot;
+
+    private final static int robotDelay = 1500;
+    private final static int waitDelay  = 3500;
+
+    final Object lock;
+
+    private boolean keyPressReceived = false;
+    private int keyCode = -1;
+
+    KeyMaskTest() throws Exception {
+        lock = new Object();
+        robot = new ExtendedRobot();
+        EventQueue.invokeAndWait( this::createGUI );
+    }
+
+    public void createGUI() {
+
+        frame = new Frame();
+        frame.setTitle("KeyMaskTest");
+        frame.setLayout(new GridLayout(1, 6));
+
+        button = new Button();
+        button.addKeyListener(this);
+        frame.add(button);
+
+        buttonLW = new LWButton();
+        buttonLW.addKeyListener(this);
+        frame.add(buttonLW);
+
+        textField = new TextField(5);
+        textField.addKeyListener(this);
+        frame.add(textField);
+
+        textArea = new TextArea(5, 5);
+        textArea.addKeyListener(this);
+        frame.add(textArea);
+
+        list = new List();
+        for (int i = 1; i <= 5; ++i) { list.add("item " + i); }
+        list.addKeyListener(this);
+        frame.add(list);
+
+        listLW = new LWList();
+        for (int i = 1; i <= 5; ++i) { listLW.add("item " + i); }
+        listLW.addKeyListener(this);
+        frame.add(listLW);
+
+
+        frame.setBackground(Color.gray);
+        frame.setSize(500, 100);
+        frame.setVisible(true);
+        frame.toFront();
+    }
+
+    @Override
+    public void keyPressed(KeyEvent e) {
+
+        keyPressReceived = true;
+
+        int code = e.getKeyCode();
+
+        assertEQ(code, keyCode, "wrong key code");
+
+        int mask = 0;
+
+        if (code == KeyEvent.VK_SHIFT) {
+            mask = InputEvent.SHIFT_MASK;
+        } else if (code == KeyEvent.VK_CONTROL) {
+            mask = InputEvent.CTRL_MASK;
+        } else if (code == KeyEvent.VK_ALT) {
+            mask = InputEvent.ALT_MASK;
+        } else if (code == KeyEvent.VK_META) {
+            mask = InputEvent.META_MASK;
+        }
+
+        int mod = e.getModifiers() & mask;
+        assertEQ(mod, mask, "invalid key mask");
+
+        synchronized (lock) { lock.notifyAll(); }
+    }
+
+
+    void doTest() throws Exception {
+
+        ArrayList<Component> components = new ArrayList();
+        components.add(button);
+        components.add(buttonLW);
+        components.add(textField);
+        components.add(textArea);
+        components.add(list);
+        components.add(listLW);
+
+        int keys[];
+        String OS = System.getProperty("os.name").toLowerCase();
+        System.out.println(OS);
+        if (OS.contains("os x") || OS.contains("sunos")) {
+            keys = new int[] {KeyEvent.VK_SHIFT, KeyEvent.VK_CONTROL, KeyEvent.VK_ALT, KeyEvent.VK_META};
+        } else {
+            keys = new int[] {KeyEvent.VK_SHIFT, KeyEvent.VK_CONTROL, KeyEvent.VK_ALT};
+        }
+
+        for (Component c: components) {
+
+            System.out.print(c.getClass().getName() + ": ");
+
+            Point origin = c.getLocationOnScreen();
+            int xc = origin.x + c.getWidth() / 2;
+            int yc = origin.y + c.getHeight() / 2;
+            Point center = new Point(xc, yc);
+
+            robot.delay(robotDelay);
+            robot.glide(origin, center);
+            robot.click();
+            robot.delay(robotDelay);
+
+            for (int k = 0; k < keys.length; ++k) {
+
+                keyPressReceived = false;
+
+                keyCode = keys[k];
+
+                robot.type(keyCode);
+
+                robot.delay(robotDelay);
+
+                if (!keyPressReceived) {
+                    synchronized (lock) {
+                        try {
+                            lock.wait(waitDelay);
+                        } catch (InterruptedException e) {}
+                    }
+                }
+
+                assertTrue(keyPressReceived, "key press event was not received");
+            }
+
+            System.out.println("passed");
+        }
+
+        robot.waitForIdle();
+        frame.dispose();
+    }
+
+
+    public static void main(String[] args) throws Exception {
+
+        KeyMaskTest test = new KeyMaskTest();
+        test.doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/event/MouseEvent/MouseButtonsAndKeyMasksTest/MouseButtonsAndKeyMasksTest.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,302 @@
+/*
+ * Copyright (c) 2001, 2014, 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.awt.*;
+
+import java.awt.event.InputEvent;
+import java.awt.event.KeyEvent;
+import java.awt.event.KeyListener;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseListener;
+import java.util.ArrayList;
+
+import static jdk.testlibrary.Asserts.*;
+
+
+import test.java.awt.event.helpers.lwcomponents.LWButton;
+import test.java.awt.event.helpers.lwcomponents.LWList;
+
+
+/*
+ * @test
+ * @bug 8043126
+ * @summary Check whether MouseEvent.getModifiers(), MouseEvent.getModifiersEx()
+ *          and KeyEvent.getModifiers() return correct modifiers when pressing
+ *          keys Ctrl, Alt, Shift, Meta and mouse buttons sequentially
+ *
+ * @library ../../../../../lib/testlibrary/  ../../helpers/lwcomponents/
+ * @build LWComponent
+ * @build LWButton
+ * @build LWList
+ * @build ExtendedRobot
+ * @run main/timeout=600 MouseButtonsAndKeyMasksTest
+ */
+
+public class MouseButtonsAndKeyMasksTest implements MouseListener, KeyListener {
+
+    Frame frame;
+
+    Button    button;
+    LWButton  buttonLW;
+    TextField textField;
+    TextArea  textArea;
+    List      list;
+    LWList    listLW;
+
+    ExtendedRobot robot;
+
+    private final static int robotDelay = 1500;
+    private final static int   keyDelay =  500;
+    private final static int  waitDelay = 5000;
+
+    int modMouse = 0, modMouseEx = 0, modKey = 0, modAction = 0;
+
+    boolean mousePressFired = false;
+    boolean keyPressFired = false;
+
+    final Object lock;
+
+    MouseButtonsAndKeyMasksTest() throws Exception {
+        lock = new Object();
+        robot = new ExtendedRobot();
+        EventQueue.invokeAndWait( this::createGUI );
+    }
+
+    public void createGUI() {
+
+        frame = new Frame();
+        frame.setTitle("MouseButtonsAndKeysTest");
+        frame.setLayout(new GridLayout(1, 6));
+
+        button = new Button();
+        button.addKeyListener(this);
+        button.addMouseListener(this);
+        frame.add(button);
+
+        buttonLW = new LWButton();
+        buttonLW.addKeyListener(this);
+        buttonLW.addMouseListener(this);
+        frame.add(buttonLW);
+
+        textField = new TextField(5);
+        textField.addKeyListener(this);
+        textField.addMouseListener(this);
+        frame.add(textField);
+
+        textArea = new TextArea(5, 5);
+        textArea.addKeyListener(this);
+        textArea.addMouseListener(this);
+        frame.add(textArea);
+
+        list = new List();
+        for (int i = 1; i <= 5; ++i) { list.add("item " + i); }
+        list.addKeyListener(this);
+        list.addMouseListener(this);
+        frame.add(list);
+
+        listLW = new LWList();
+        for (int i = 1; i <= 5; ++i) { listLW.add("item " + i); }
+        listLW.addKeyListener(this);
+        listLW.addMouseListener(this);
+        frame.add(listLW);
+
+
+        frame.setBackground(Color.gray);
+        frame.setSize(500, 80);
+        frame.setVisible(true);
+        frame.toFront();
+    }
+
+
+    @Override
+    public void mouseClicked(MouseEvent e) {}
+
+    @Override
+    public void mousePressed(MouseEvent e) {
+
+        modMouse = e.getModifiers();
+        modMouseEx = e.getModifiersEx();
+        mousePressFired = true;
+        synchronized (lock) { lock.notifyAll(); }
+    }
+
+    @Override
+    public void mouseReleased(MouseEvent e) {}
+    @Override
+    public void mouseEntered(MouseEvent e) {}
+    @Override
+    public void mouseExited(MouseEvent e) {}
+
+
+    @Override
+    public void keyTyped(KeyEvent e) {}
+
+    @Override
+    public void keyPressed(KeyEvent e) {
+
+        if (e.getKeyCode() == KeyEvent.VK_ESCAPE) { return; }
+
+        keyPressFired = true;
+        modKey = e.getModifiers();
+
+        synchronized (lock) { lock.notifyAll(); }
+    }
+
+    @Override
+    public void keyReleased(KeyEvent e) {}
+
+    void doTest() throws Exception {
+
+        int buttons[] = new int[]{
+            InputEvent.BUTTON1_MASK, InputEvent.BUTTON2_MASK, InputEvent.BUTTON3_MASK};
+
+        int buttonsEx[] = new int[]{
+            InputEvent.BUTTON1_DOWN_MASK, InputEvent.BUTTON2_DOWN_MASK, InputEvent.BUTTON3_DOWN_MASK};
+
+        String OS = System.getProperty("os.name").toLowerCase();
+        System.out.println(OS);
+
+        int keyMods[], keyModsEx[], keys[];
+
+
+        if (OS.contains("linux")) {
+            keyMods = new int[]{InputEvent.SHIFT_MASK, InputEvent.CTRL_MASK};
+            keyModsEx = new int[]{InputEvent.SHIFT_DOWN_MASK, InputEvent.CTRL_DOWN_MASK};
+            keys = new int[]{KeyEvent.VK_SHIFT, KeyEvent.VK_CONTROL};
+        } else if (OS.contains("os x")) {
+            keyMods = new int[]{
+                InputEvent.SHIFT_MASK, InputEvent.CTRL_MASK, InputEvent.ALT_MASK, InputEvent.META_MASK};
+            keyModsEx = new int[]{
+                InputEvent.SHIFT_DOWN_MASK, InputEvent.CTRL_DOWN_MASK, InputEvent.ALT_DOWN_MASK, InputEvent.META_DOWN_MASK};
+            keys = new int[]{KeyEvent.VK_SHIFT, KeyEvent.VK_CONTROL, KeyEvent.VK_ALT, KeyEvent.VK_META};
+        } else if (OS.contains("sunos")) {
+            keyMods   = new int[]{InputEvent.SHIFT_MASK, InputEvent.META_MASK};
+            keyModsEx = new int[]{InputEvent.SHIFT_DOWN_MASK, InputEvent.META_DOWN_MASK};
+            keys = new int[]{KeyEvent.VK_SHIFT, KeyEvent.VK_META};
+        } else {
+            keyMods = new int[]{
+                InputEvent.SHIFT_MASK, InputEvent.CTRL_MASK, InputEvent.ALT_MASK};
+            keyModsEx = new int[]{
+                InputEvent.SHIFT_DOWN_MASK, InputEvent.CTRL_DOWN_MASK, InputEvent.ALT_DOWN_MASK};
+            keys = new int[]{KeyEvent.VK_SHIFT, KeyEvent.VK_CONTROL, KeyEvent.VK_ALT};
+        }
+
+
+        ArrayList<Component> components = new ArrayList();
+        components.add(button);
+        components.add(buttonLW);
+        components.add(textField);
+        components.add(textArea);
+        components.add(list);
+        components.add(listLW);
+
+        for (Component c: components) {
+
+            System.out.println(c.getClass().getName() + ":");
+
+            Point origin = c.getLocationOnScreen();
+            int xc = origin.x + c.getWidth() / 2;
+            int yc = origin.y + c.getHeight() / 2;
+            Point center = new Point(xc, yc);
+
+            robot.delay(robotDelay);
+            robot.glide(origin, center);
+            robot.click();
+            robot.delay(robotDelay);
+
+            for (int b = 0; b < buttons.length; ++b) {
+
+                int btn = buttons[b];
+
+                for (int k = 0; k < keys.length; ++k) {
+
+                    int key = keys[k];
+
+                    System.out.print(KeyEvent.getKeyText(key) + " + button " + (b + 1));
+
+                    robot.delay(robotDelay);
+
+                    robot.keyPress(key);
+                    robot.delay(keyDelay);
+
+                    if (!keyPressFired) {
+                        synchronized (lock) {
+                            try {
+                                lock.wait(waitDelay);
+                            } catch (InterruptedException ex) {}
+                        }
+                    }
+
+                    if (!keyPressFired) {
+                        robot.keyRelease(key);
+                        assertTrue(false, "key press event was not received");
+                    }
+
+                    robot.mousePress(btn);
+                    robot.delay(robotDelay);
+
+                    if (!mousePressFired) {
+                        synchronized (lock) {
+                            try {
+                                lock.wait(waitDelay);
+                            } catch (InterruptedException ex) {}
+                        }
+                    }
+
+                    assertTrue(mousePressFired, "mouse press event was not received");
+
+                    robot.mouseRelease(btn);
+                    robot.delay(robotDelay);
+
+                    // do checks
+                    assertEQ(modMouse & btn, btn, "invalid mouse button mask");
+                    assertEQ(modKey & keyMods[k], keyMods[k], "invalid key mask");
+                    assertEQ(buttonsEx[b] | keyModsEx[k], modMouseEx, "invalid extended modifiers");
+
+                    mousePressFired  = false;
+                    keyPressFired    = false;
+
+                    robot.keyRelease(key);
+                    robot.delay(keyDelay);
+
+                    robot.type(KeyEvent.VK_ESCAPE);
+
+                    robot.delay(robotDelay);
+
+                    System.out.println(" - passed");
+                }
+            }
+        }
+
+        robot.waitForIdle();
+        frame.dispose();
+    }
+
+
+    public static void main(String[] args) throws Exception {
+
+        MouseButtonsAndKeyMasksTest test = new MouseButtonsAndKeyMasksTest();
+        test.doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/event/MouseEvent/MouseButtonsTest/MouseButtonsTest.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,254 @@
+/*
+ * Copyright (c) 2001, 2014, 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.awt.*;
+
+import java.awt.event.InputEvent;
+import java.awt.event.KeyEvent;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseListener;
+
+import test.java.awt.event.helpers.lwcomponents.LWButton;
+import test.java.awt.event.helpers.lwcomponents.LWList;
+
+import java.util.ArrayList;
+
+import static jdk.testlibrary.Asserts.*;
+
+/*
+ * @test
+ * @bug 8043126
+ * @summary Check whether getButton() returns correct mouse button
+ *          number when the mouse buttons are pressed and getModifiers()
+ *          returns correct modifiers
+ *
+ * @library ../../../../../lib/testlibrary/  ../../helpers/lwcomponents/
+ * @build LWComponent
+ * @build LWButton
+ * @build LWList
+ * @build ExtendedRobot
+ * @run main/timeout=600 MouseButtonsTest
+ */
+
+public class MouseButtonsTest implements MouseListener {
+
+    private Frame frame;
+
+    private Button    button;
+    private LWButton  buttonLW;
+    private TextField textField;
+    private TextArea  textArea;
+    private List      list;
+    private LWList    listLW;
+
+    private int buttonPressedNumber = 0;
+    private int buttonReleasedNumber = 0;
+    private int modifiers = 0;
+
+
+    private final ExtendedRobot robot;
+
+    private final static int robotDelay = 1000;
+    private final static int waitDelay  = 3500;
+
+    private boolean released = false;
+    private boolean pressed = false;
+    private final Object lock;
+
+
+    MouseButtonsTest() throws Exception {
+        lock = new Object();
+        robot = new ExtendedRobot();
+        EventQueue.invokeAndWait( this::createGUI );
+    }
+
+    public void createGUI() {
+
+        frame = new Frame();
+        frame.setTitle("MouseButtonsTest");
+        frame.setLayout(new GridLayout(1, 6));
+
+        button = new Button();
+        button.addMouseListener(this);
+        frame.add(button);
+
+        buttonLW = new LWButton();
+        buttonLW.addMouseListener(this);
+        frame.add(buttonLW);
+
+        textField = new TextField(5);
+        textField.addMouseListener(this);
+        frame.add(textField);
+
+        textArea = new TextArea(5, 5);
+        textArea.addMouseListener(this);
+        frame.add(textArea);
+
+        list = new List();
+        for (int i = 1; i <= 5; ++i) { list.add("item " + i); }
+        list.addMouseListener(this);
+        frame.add(list);
+
+        listLW = new LWList();
+        for (int i = 1; i <= 5; ++i) { listLW.add("item " + i); }
+        listLW.addMouseListener(this);
+        frame.add(listLW);
+
+
+        frame.setBackground(Color.gray);
+        frame.setSize(500, 100);
+        frame.setVisible(true);
+        frame.toFront();
+    }
+
+
+    @Override
+    public void mouseClicked(MouseEvent e) {}
+
+    @Override
+    public void mousePressed(MouseEvent e) {
+
+        assertFalse(e.getButton() == MouseEvent.NOBUTTON, "invalid button");
+
+        buttonPressedNumber = e.getButton();
+        modifiers = e.getModifiers();
+
+        pressed = true;
+
+        synchronized (lock) {
+            try {
+                lock.notifyAll();
+            } catch (Exception ex) {}
+        }
+    }
+
+    @Override
+    public void mouseReleased(MouseEvent e) {
+
+        assertFalse(e.getButton() == MouseEvent.NOBUTTON, "invalid button");
+
+        buttonReleasedNumber = e.getButton();
+        modifiers = e.getModifiers();
+
+        released = true;
+
+        synchronized (lock) {
+            try {
+                lock.notifyAll();
+            } catch (Exception ex) {}
+        }
+    }
+
+    @Override
+    public void mouseEntered(MouseEvent e) {}
+
+    @Override
+    public void mouseExited(MouseEvent e) {}
+
+
+    void doTest() throws Exception {
+
+        int masks[] = new int[]{
+            InputEvent.BUTTON1_MASK, InputEvent.BUTTON2_MASK, InputEvent.BUTTON3_MASK};
+
+        int buttons[] = new int[]{
+            MouseEvent.BUTTON1, MouseEvent.BUTTON2, MouseEvent.BUTTON3};
+
+        ArrayList<Component> components = new ArrayList();
+        components.add(button);
+        components.add(buttonLW);
+        components.add(textField);
+        components.add(textArea);
+        components.add(list);
+        components.add(listLW);
+
+        for (Component c: components) {
+
+            System.out.println(c.getClass().getName() + ":");
+
+            Point origin = c.getLocationOnScreen();
+            int xc = origin.x + c.getWidth() / 2;
+            int yc = origin.y + c.getHeight() / 2;
+            Point center = new Point(xc, yc);
+
+            robot.delay(robotDelay);
+            robot.glide(origin, center);
+            robot.click();
+            robot.delay(robotDelay);
+
+            for (int i = 0; i < masks.length; ++i) {
+
+                pressed  = false;
+                released = false;
+
+                int mask = masks[i];
+                robot.mousePress(mask);
+                robot.delay(robotDelay);
+
+                if (!pressed) {
+                    synchronized (lock) {
+                        try {
+                            lock.wait(waitDelay);
+                        } catch (InterruptedException ex) {}
+                    }
+                }
+
+                assertTrue(pressed, "mouse press event was not received");
+                assertEQ((modifiers & mask), mask, "invalid mask modifiers");
+
+                robot.mouseRelease(mask);
+                robot.delay(robotDelay);
+
+                if (!released) {
+                    synchronized (lock) {
+                        try {
+                            lock.wait(waitDelay);
+                        } catch (InterruptedException ex) {}
+                    }
+                }
+
+                assertTrue(released, "mouse release event was not received");
+                assertEQ((modifiers & mask), mask, "invalid mask modifiers");
+
+                assertEquals(buttonPressedNumber,  buttons[i]);
+                assertEquals(buttonReleasedNumber, buttons[i]);
+
+                robot.type(KeyEvent.VK_ESCAPE);
+                robot.delay(robotDelay);
+
+                System.out.println("button " + buttons[i] + " - passed");
+            }
+        }
+
+        robot.waitForIdle();
+        frame.dispose();
+    }
+
+
+    public static void main(String[] args) throws Exception {
+
+        MouseButtonsTest test = new MouseButtonsTest();
+        test.doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/event/MouseEvent/MultipleMouseButtonsTest/MultipleMouseButtonsTest.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,237 @@
+/*
+ * Copyright (c) 2001, 2014, 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.awt.*;
+import java.awt.event.*;
+import java.util.ArrayList;
+
+import test.java.awt.event.helpers.lwcomponents.LWButton;
+import test.java.awt.event.helpers.lwcomponents.LWList;
+
+import static jdk.testlibrary.Asserts.*;
+
+/*
+ * @test
+ * @bug 8043126
+ * @summary Check whether correct modifiers set when multiple mouse buttons were pressed;
+ *          check number of received events.
+ *
+ * @library ../../../../../lib/testlibrary/  ../../helpers/lwcomponents/
+ * @build LWComponent
+ * @build LWButton
+ * @build LWList
+ * @build ExtendedRobot
+ * @run main/timeout=600 MultipleMouseButtonsTest
+ */
+
+
+public class MultipleMouseButtonsTest implements MouseListener {
+
+    private final static int robotDelay = 1000;
+
+    private final ExtendedRobot robot;
+    private final Object lock = new Object();
+
+    private Frame frame;
+
+    private Button    button;
+    private LWButton  buttonLW;
+    private TextField textField;
+    private TextArea  textArea;
+    private List      list;
+    private LWList    listLW;
+
+    private int eventCount;
+    private int testCount;
+    private boolean pressed = false;
+    private int modifiers = 0;
+    private int modifiersEx = 0;
+
+    private boolean countEvents = false;
+
+
+    public void createGUI() {
+
+        frame = new Frame("MultipleMouseButtonTest");
+        frame.setLayout(new GridLayout(1, 6));
+
+        button = new Button();
+        button.addMouseListener(this);
+        frame.add(button);
+
+        buttonLW = new LWButton();
+        buttonLW.addMouseListener(this);
+        frame.add(buttonLW);
+
+        textField = new TextField(5);
+        textField.addMouseListener(this);
+        frame.add(textField);
+
+        textArea = new TextArea(5, 5);
+        textArea.addMouseListener(this);
+        frame.add(textArea);
+
+        list = new List();
+        for (int i = 1; i <= 5; ++i) { list.add("item " + i); }
+        list.addMouseListener(this);
+        frame.add(list);
+
+        listLW = new LWList();
+        for (int i = 1; i <= 5; ++i) { listLW.add("item " + i); }
+        listLW.addMouseListener(this);
+        frame.add(listLW);
+
+        frame.setBackground(Color.gray);
+        frame.setSize(500, 100);
+        frame.setVisible(true);
+        frame.toFront();
+    }
+
+    @Override
+    public void mouseClicked(MouseEvent e) {}
+    @Override
+    public void mouseEntered(MouseEvent e) {}
+    @Override
+    public void mouseExited (MouseEvent e) {}
+
+    @Override
+    public void mousePressed(MouseEvent e) {
+
+        if (!countEvents) { return; }
+
+        ++eventCount;
+
+        pressed = true;
+        modifiers = e.getModifiers();
+        modifiersEx = e.getModifiersEx();
+
+        synchronized (lock) { lock.notifyAll(); }
+    }
+
+    @Override
+    public void mouseReleased(MouseEvent e) {
+
+        if (countEvents) {
+            ++eventCount;
+        }
+    }
+
+    MultipleMouseButtonsTest() throws Exception {
+        this.robot = new ExtendedRobot();
+        EventQueue.invokeAndWait( this::createGUI );
+    }
+
+    void doTest() throws Exception {
+
+        int masks[] = new int[]{InputEvent.BUTTON1_MASK, InputEvent.BUTTON2_MASK, InputEvent.BUTTON3_MASK};
+        int masksEx[] = new int[]{InputEvent.BUTTON1_DOWN_MASK, InputEvent.BUTTON2_DOWN_MASK, InputEvent.BUTTON3_DOWN_MASK};
+
+        robot.waitForIdle();
+
+        ArrayList<Component> components = new ArrayList();
+        components.add(button);
+        components.add(buttonLW);
+        components.add(textField);
+        components.add(textArea);
+        components.add(list);
+        components.add(listLW);
+
+        for (Component c: components) {
+
+            System.out.println(c.getClass().getName() + ": ");
+
+            Point origin = c.getLocationOnScreen();
+
+            int xc = origin.x + c.getWidth() / 2;
+            int yc = origin.y + c.getHeight() / 2;
+            Point center = new Point(xc, yc);
+
+            robot.delay(robotDelay);
+            robot.mouseMove(origin);
+            robot.delay(robotDelay);
+            robot.glide(origin, center);
+            robot.delay(robotDelay);
+            robot.click();
+            robot.delay(robotDelay);
+
+            testCount = 0;
+            eventCount = 0;
+
+            for (int i = 0; i < masks.length; ++i) {
+
+                for (int k = 0; k < masks.length; ++k) {
+                    if (k == i) { continue; }
+
+                    countEvents = false;
+                    robot.mousePress(masks[i]);
+                    robot.delay(robotDelay);
+
+                    countEvents = true;
+
+                    pressed = false;
+
+                    robot.mousePress(masks[k]);
+                    robot.delay(robotDelay);
+                    ++testCount;
+
+                    if (!pressed) {
+                        synchronized (lock) {
+                            try {
+                                lock.wait(3 * robotDelay);
+                            } catch (InterruptedException ex) {}
+                        }
+                    }
+
+                    assertTrue(pressed, "mouse press event was not received");
+
+                    assertEQ(modifiers & masks[k], masks[k], "invalid modifiers");
+                    assertEQ(modifiersEx & masksEx[i], masksEx[i], "invalid extended modifiers");
+
+                    robot.mouseRelease(masks[k]);
+                    robot.delay(robotDelay);
+                    ++testCount;
+
+                    countEvents = false;
+
+                    robot.mouseRelease(masks[i]);
+                    robot.delay(robotDelay);
+
+                    robot.type(KeyEvent.VK_ESCAPE);
+                    robot.delay(robotDelay);
+                } //k
+            } //i
+
+            assertEquals(testCount, eventCount, "different amount of sent and received events");
+            System.out.println("passed");
+        } //component
+
+        robot.waitForIdle();
+        frame.dispose();
+    }
+
+    public static void main(String[] args) throws Exception {
+
+        MultipleMouseButtonsTest test = new MultipleMouseButtonsTest();
+        test.doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/event/helpers/lwcomponents/LWButton.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,418 @@
+/*
+ * Copyright (c) 2001, 2014, 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 test.java.awt.event.helpers.lwcomponents;
+
+import java.awt.*;
+import java.awt.event.*;
+
+/**
+ * Lightweight <i>Button</i> component with some nice features. This
+ * component provides the capabilities of Buttons, namely that you it
+ * displays a label string and, when clicked, causes the
+ * ActionListener method to be called.<p>
+ *
+ * The look of the button is a little unusual. There are three
+ * rectangles drawn at the border that indicate various states
+ * of the button.  These are (listed from outside in)<p>
+ * <ol>
+ * <li><b>Focus</b>: Indicates that the LWButton has the focus.
+ * <li><b>Mouse Over</b>: Indicates that the mouse is over the component.
+ * <li><b>Mouse Pressed</b>: Indicates that the mouse has been pressed.
+ * </ol>
+ *
+ * In addition, when the button has been activated (mouse clicked or
+ * via keyboard activation) the button flashes briefly.
+ */
+
+public class LWButton extends LWComponent {
+
+  /*
+   * The button's Label.
+   * If Label is not specified it will default to "".
+   * @serial
+   * @see getLabel()
+   * @see setLabel()
+   */
+  private String label;
+  private boolean isInClick = false;
+
+  private static final String base = "LWButton";
+  private static int nameCounter = 0;
+
+  private transient ActionListener actionListener;
+
+  /*
+   * The action to be performaed once a button has been
+   * pressed.
+   * actionCommand can be null.
+   * @serial
+   * @see getActionCommand()
+   * @see setActionCommand()
+   */
+  String actionCommand;
+
+  Color colMousePressed;
+
+  public LWButton() { this(""); }
+
+  public LWButton(String label) {
+    this(label, Color.red, Color.green, Color.white);
+  }
+
+  /**
+   * Initialize the LWButton, fully specifying all parameters.
+   * @param label The string to display.
+   * @param fgnd  The color to draw the label in.
+   * @param bkgnd The color of the button itself.
+   * @param mousePressed The Color of the MousePressed rectangle.
+   */
+  public LWButton(String label, Color fgnd, Color bkgnd, Color mousePressed) {
+    super();
+    this.label = label;
+    setBackground(fgnd);
+    setForeground(bkgnd);
+    colMousePressed = mousePressed;
+    setName(makeComponentName());
+
+    enableEvents(  AWTEvent.MOUSE_EVENT_MASK
+         | AWTEvent.KEY_EVENT_MASK
+         | AWTEvent.ACTION_EVENT_MASK);
+    setEnabled(true);
+  }
+
+  /**
+   * Make the component flash briefly.
+   */
+  public void flash() {
+    isInClick = true;
+    repaint();
+
+    class unClicker implements Runnable {
+      @Override
+      public void run() {
+        try { Thread.sleep(100); } catch (InterruptedException ee) {}
+        isInClick = false;
+        repaint();
+      }
+    }
+    try {
+      unClicker uc = new unClicker();
+      new Thread(uc).start();
+    } catch (Exception e) {
+      // In case we're in an applet and the security has not been
+      // turned off (in which case we can't start a new thread)
+      // we can catch that and set the flag back to how it should be.
+      isInClick = false;
+      repaint();
+    }
+  }
+
+  /**
+   * Set the MousePressed color (the color shown in the MousePressed rectangle
+   * when the mouse is over the component).
+   * @param c The color of the MousePressed rectangle.
+   */
+  public void setMousePressedColor(Color c) { colMousePressed = c; }
+
+  /**
+   * Get the MousePressed color.
+   * @return The color of the MousePressed rectangle.
+   */
+  public Color getMousePressedColor() { return colMousePressed; }
+
+  /**
+   * Used to dispatch out the ActionEvent for a corresponding InputEvent.
+   * @param e The InputEvent that is causing the ActionEvent dispatch.
+   */
+  private void sendActionEvent(InputEvent e) {
+
+    int modifiers = e.getModifiers();
+    int aModifiers = 0;
+
+    if ((modifiers & MouseEvent.SHIFT_MASK) != 0) {
+      aModifiers |= ActionEvent.SHIFT_MASK;
+    }
+    if ((modifiers & MouseEvent.CTRL_MASK) != 0) {
+      aModifiers |= ActionEvent.CTRL_MASK;
+    }
+    if ((modifiers & MouseEvent.META_MASK) != 0) {
+      aModifiers |= ActionEvent.META_MASK;
+    }
+    if ((modifiers & MouseEvent.ALT_MASK) != 0) {
+      aModifiers |= ActionEvent.ALT_MASK;
+    }
+
+    ActionEvent ae = new ActionEvent(this,
+                     ActionEvent.ACTION_PERFORMED,
+                     actionCommand,
+                     aModifiers);
+    // XXX: What's the right way to send out the ActionEvent?
+    //   My assumption was to put it into the system event queue
+    //   and the it will be dispatched back into <i>processEvent</i>
+    //   for us.  However this doesn't happen...?
+    if (actionListener != null) {
+      actionListener.actionPerformed(ae);
+    }
+    //Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(ae);
+  }
+
+  /**
+   * Set whether the component is enabled ({@code true}) or not.
+   * @param enabled If {@code true}, the component is to be enabled.
+   */
+  @Override
+  public void setEnabled(boolean enabled) {
+    super.setEnabled(enabled);
+
+    if (enabled) {
+      enableEvents(AWTEvent.MOUSE_EVENT_MASK | AWTEvent.MOUSE_MOTION_EVENT_MASK);
+    } else {
+      disableEvents(AWTEvent.MOUSE_EVENT_MASK | AWTEvent.MOUSE_MOTION_EVENT_MASK);
+    }
+    repaint(1);
+  }
+
+  /**
+   * Indicates that LWButton component can receive focus.
+   * @return  {@code true} if the LWButton component can receive focus
+   */
+  @Override
+  public boolean isFocusTraversable() { return true; }
+
+  /**
+   * Construct a name for this component. Called by getName() when the
+   * name is null.
+   */
+  String makeComponentName() {
+    synchronized (getClass()) {
+      return base + nameCounter++;
+    }
+  }
+
+  /**
+   * Handle painting the enabled version of the component.
+   *
+   * ASSUMES: g.color may be changed
+   */
+  @Override
+  public void paint(Graphics g) {
+
+    super.paint(g);
+    restrictGraphicsToClientArea(g);
+
+    Dimension dim = getClientSize();
+
+    int s = Math.min(dim.width - 1, dim.height - 1);
+
+    if (isInClick) {
+      g.setColor(Color.white);
+    } else {
+      g.setColor(getBackground());
+    }
+
+    // In jdk 1.2 (pre-release) there was a bug using clearRect
+    // to paint the background of a lightweight.
+    //g.clearRect(loc.x, loc.y, dim.width, dim.height);
+    g.fillRect(0, 0, dim.width, dim.height);
+
+    if (mouseB1Pressed) {
+      g.setColor(colMousePressed);
+      //LWComponent.traceMsg("paint mousePressed " + this.toString());
+      g.drawRect(1, 1, dim.width - 3, dim.height - 3);
+    }
+
+    Font f = getFont();
+    if (f != null) {
+      FontMetrics fm = getFontMetrics(f);
+      g.setColor(getForeground());
+      g.drawString(label,
+                   s/2 - fm.stringWidth(label)/2,
+                   s/2 + fm.getMaxDescent());
+    }
+
+    unrestrictGraphicsFromClientArea(g);
+  }
+
+  @Override
+  public Dimension getPreferredSize() {
+    Font f = getFont();
+    if (f != null) {
+      FontMetrics fm = getFontMetrics(f);
+      int max = Math.max(fm.stringWidth(label) + 40, fm.getHeight() + 40);
+      return new Dimension(max, max);
+    } else {
+      return new Dimension(100, 100);
+    }
+  }
+
+  @Override
+  public Dimension getMinimumSize() {
+    return getPreferredSize();
+  }
+
+  /**
+   * Get the text displayed in the LWButton.
+   * @return  the text displayed in the LWButton
+   */
+  public String getText() { return label; }
+
+  /**
+   * Set the text displayed in the LWButton.
+   * @param s The text to be displayed.
+   */
+  public void setText(String s) {
+    Font f = getFont();
+    int oWidth = 0;
+    int oHeight = 0;
+    int nWidth = 0;
+    int nHeight = 0;
+    int invalidated = 0;
+    FontMetrics fm = null;
+
+    if (f != null) {
+      fm = getFontMetrics(f);
+      oWidth = fm.stringWidth(label);
+      oHeight = fm.getHeight();
+    }
+
+    this.label = s;
+
+    if (f != null) {
+      nWidth = fm.stringWidth(label);
+      nHeight = fm.getHeight();
+
+      if ((nWidth > oWidth) || (nHeight > oHeight)) {
+        invalidate();
+        invalidated = 1;
+      }
+    }
+
+    if (invalidated == 0) {
+      repaint();
+    }
+  }
+
+  /**
+   * Set the command name for the action event fired
+   * by this button. By default this action command is
+   * set to match the label of the button.
+   * @param     command  A string used to set the button's
+   *                     action command.
+   *            If the string is <code>null</code> then the action command
+   *            is set to match the label of the button.
+   * @see       java.awt.event.ActionEvent
+   * @since     JDK1.1
+   */
+  public void setActionCommand(String command) {
+    actionCommand = command;
+  }
+
+  /**
+   * Returns the command name of the action event fired by this button.
+   * If the command name is {@code null} (default) then this method
+   * returns the label of the button.
+   *
+   * @return the command name of the action event fired by this button
+   *         or the label of the button (in case of {@code null})
+   */
+  public String getActionCommand() {
+    return (actionCommand == null? label : actionCommand);
+  }
+
+  /**
+   * Add the specified action listener to receive action events from
+   * this button. Action events occur when a user presses or releases
+   * the mouse over this button.
+   * @param         l the action listener.
+   * @see           java.awt.event.ActionListener
+   * @see           #removeActionListener
+   * @since         JDK1.1
+   */
+  public synchronized void addActionListener(ActionListener l) {
+    actionListener = AWTEventMulticaster.add(actionListener, l);
+    enableEvents(AWTEvent.MOUSE_EVENT_MASK);
+  }
+
+  /**
+   * Remove the specified action listener so that it no longer
+   * receives action events from this button. Action events occur
+   * when a user presses or releases the mouse over this button.
+   * @param         l     the action listener.
+   * @see           java.awt.event.ActionListener
+   * @see           #addActionListener
+   * @since         JDK1.1
+   */
+  public synchronized void removeActionListener(ActionListener l) {
+    actionListener = AWTEventMulticaster.remove(actionListener, l);
+  }
+
+  @Override
+  protected void processKeyEvent(KeyEvent e) {
+    super.processKeyEvent(e);
+    if (!isEnabled()) { return; }
+    switch(e.getID()) {
+    case KeyEvent.KEY_TYPED:
+      switch (e.getKeyCode()) {
+        case KeyEvent.VK_ENTER:
+        case KeyEvent.VK_SPACE:
+          flash();
+          sendActionEvent(e);
+          break;
+      }
+      break;
+    }
+  }
+
+  @Override
+  protected void processMouseEvent(MouseEvent e) {
+    super.processMouseEvent(e);
+    if (!isEnabled()) { return; }
+    switch(e.getID()) {
+    case MouseEvent.MOUSE_PRESSED:
+      requestFocus();
+      repaint();
+      break;
+    case MouseEvent.MOUSE_RELEASED:
+      repaint();
+      break;
+    case MouseEvent.MOUSE_CLICKED:
+      if ((e.getModifiers() & MouseEvent.BUTTON1_MASK) != 0) {
+        flash();
+        sendActionEvent(e);
+      }
+      break;
+    }
+  }
+
+  /**
+   * Returns the parameter string representing the state of this
+   * button. This string is useful for debugging.
+   * @return     the parameter string of this button.
+   */
+  @Override
+  protected String paramString() {
+    return super.paramString() + ", label = " + label;
+  }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/event/helpers/lwcomponents/LWComponent.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,464 @@
+/*
+ * Copyright (c) 2001, 2014, 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 test.java.awt.event.helpers.lwcomponents;
+
+import java.io.*;
+import java.awt.*;
+import java.awt.event.*;
+
+/**
+ * This is experimental - The idea is to subclass all the LW components
+ * from LWComponent to provide for some common capabilities.  The main
+ * capability to be provided is the status rectangles as done for LWButton.
+ * In particular the Focus and MouseOver rectangles are generically
+ * useful, while other rectangles might be useful to other components.<p>
+ *
+ * To implement that, here is the idea ... borrowed from Win32 ... Each
+ * of the LW components has both a client and non-client region.  We
+ * call paintNC to paint the non-client region (Focus and MouseOver
+ * rectangles), and the subclass might be permitted to implement paintNC
+ * but for now they aren't.<p>
+ *
+ * Then the paint{Enabled,Disabled} methods are called as appropriate.
+ * Note that paintDisabled is implemented in LWComponent to call paintEnabled
+ * then stipple over the top of it.<p>
+ *
+ * So it is paintEnabled that the component should implement.  This method
+ * needs to know the dimensions of the client area (getClientRegion?) and
+ * the Graphics needs to have it's clip region set appropriately.<p>
+ *
+ * <b>KVETCHING</b>: <i>Kvetch</i> is a Yiddish word which means, basically,
+ * to complain very precisely.  The LWComponent family tracks various pieces
+ * of information over time that are used to check closely for correct behavior
+ * in some circumstances.  The method <i>kvetch</i> is where this code lives
+ * and is intended to check a broad range of conditions.<p>
+ *
+ * To turn off specific kvetch's, one simply specifies a System property
+ * as in this table:<p>
+ *
+ * <table border="1">
+ * <tr><th>Property name</th><th>Value</th><th>Discussion</th></tr>
+ * <tr>
+ *    <th>javasoft.awtsqe.lw.IGNORE_FOCUS_KVETCH</th>
+ *    <th>true or false</th>
+ *    <td>Specify whether the <i>hasFocus</i> kvetch is checked.</td>
+ * </tr>
+ * </table><p>
+ *
+ * <b>XXX To implement</b> - specifying colors.  NCBackground,
+ * FocusRectColor, MouseOverColor are the threee colors.  paintNC
+ * fills the NC region with NCBackground, and then pains the two
+ * colors as appropriate.  There needs to be methods to get/specify
+ * these colors.<p>
+ *
+ * <b>XXX To implement</b> - Specifying the component name and toString().
+ * The subclass should only give the base class name, and a method
+ * in LWComponent should construct a name from that.  For toString()
+ * there needs to be a small amount of infrastructure built.<p>
+ */
+
+public abstract class LWComponent extends Component {
+
+  protected static Color ncBackgroundColor;
+  protected static Color focusColor;
+  protected static Color focusWrongColor;
+  protected static Color mouseOverColor;
+
+  static {
+    ncBackgroundColor = Color.white;
+    focusColor        = Color.black;
+    focusWrongColor   = Color.magenta;
+    mouseOverColor    = Color.blue;
+  }
+
+  /**
+   * Flag indicating whether our records indicate that the component
+   * should have focus.
+   */
+  protected boolean _shouldHaveFocus = false;
+  protected boolean _shouldBeShowing = false;
+
+  protected boolean mouseB1Pressed = false;
+  protected boolean mouseB2Pressed = false;
+  protected boolean mouseB3Pressed = false;
+  protected boolean mouseInside    = false;
+
+  protected static boolean tracingOn = false;
+  protected static PrintStream traceOutput = null;
+
+  // Uncommenting these lines turns on tracing for the package.
+  //  static {
+  //    tracingOn = true;
+  //    traceOutput = System.err;
+  //  }
+
+  public LWComponent() {
+    enableEvents(AWTEvent.MOUSE_EVENT_MASK
+         /*| AWTEvent.MOUSE_MOTION_EVENT_MASK*/
+           | AWTEvent.FOCUS_EVENT_MASK
+           | AWTEvent.COMPONENT_EVENT_MASK);
+  }
+
+  /**
+   * Print out an error message.
+   * @param msg  the message
+   */
+  public static void errorMsg(String msg) {
+    System.err.println("ERROR: " + msg);
+  }
+
+  /**
+   * Print out a tracing message
+   * @param msg  the message
+   */
+  public static void traceMsg(String msg) {
+    if (LWComponent.tracingOn) {
+      LWComponent.traceOutput.println(msg);
+    }
+  }
+
+  /////////////////////////////////////////////
+  /////// FLAGS FOR IGNORING KVETCH's /////////
+  /////////////////////////////////////////////
+
+  static boolean bIgnFocus = false;
+
+  static {
+    // Initialize the kvetch ignoring flags here.
+    String ignFocus = System.getProperty("javasoft.awtsqe.lw.IGNORE_FOCUS_KVETCH",
+                                         "false");
+    bIgnFocus = ignFocus.trim().toLowerCase().equals("true");
+  }
+
+  /**
+   * Check the <i>shoulds</i> and return a string indicating which
+   * do not match the components actual state.
+   *
+   * @return  the string indicating which do not match the components actual state
+   */
+  public String kvetch() {
+    String ret = this.toString();
+    boolean errors = false;
+
+    if (!bIgnFocus) {
+      if (hasFocus()) {
+        if (!shouldHaveFocus()) {
+          ret += "\nERROR: hasFocus indicates we have Focus, when we shouldn't.";
+          errors = true;
+        }
+      } else {
+        if (shouldHaveFocus()) {
+          ret += "\nERROR: (see bug#4233658) hasFocus does not indicate we have Focus, when we should.";
+          errors = true;
+        }
+      }
+    }
+
+    if (errors) {
+      return ret;
+    } else {
+      return null;
+    }
+  }
+
+  /**
+   * Check the <i>shoulds</i> and return a string indicating which
+   * do not match the components actual state.  Prints the output
+   * to the given PrintStream.
+   * @param out The PrintStream to print to.
+   */
+  public void kvetch(PrintStream out) {
+    if (out != null) {
+      String s = kvetch();
+      if (s != null) {
+        LWComponent.errorMsg(s);
+      }
+    }
+  }
+
+  /**
+   * Turn on tracing for the LWComponent family.
+   * @param out  the output stream
+   */
+  public static void startTracing(PrintStream out) {
+    tracingOn = true;
+    traceOutput = out;
+  }
+
+  /**
+   * Turn off tracing for the LWComponent family.
+   */
+  public static void stopTracing() { tracingOn = false; traceOutput = null; }
+
+  /**
+   * Indicate whether it is believed the component should have focus.
+   * @return {@code true} if the component should have focus
+   */
+  public boolean shouldHaveFocus() { return _shouldHaveFocus; }
+
+  /**
+   * Indicate whether it is believed the component should be showing.
+   * @return  {@code true} if the component should be showing
+   */
+  public boolean shouldBeShowing() { return _shouldBeShowing; }
+
+  @Override
+  protected void processFocusEvent(FocusEvent e) {
+    super.processFocusEvent(e);
+    LWComponent.traceMsg("processFocusEvent " + e.toString());
+    switch (e.getID()) {
+    case FocusEvent.FOCUS_GAINED:
+      _shouldHaveFocus = true;
+      repaint();
+      break;
+    case FocusEvent.FOCUS_LOST:
+      _shouldHaveFocus = false;
+      repaint();
+      break;
+    }
+  }
+
+  @Override
+  protected void processComponentEvent(ComponentEvent e) {
+    super.processComponentEvent(e);
+    LWComponent.traceMsg("processComponentEvent " + e.toString());
+    switch (e.getID()) {
+      case ComponentEvent.COMPONENT_MOVED:   break;
+      case ComponentEvent.COMPONENT_RESIZED: break;
+      case ComponentEvent.COMPONENT_SHOWN:   _shouldBeShowing = true;  break;
+      case ComponentEvent.COMPONENT_HIDDEN:  _shouldBeShowing = false; break;
+    }
+  }
+
+  @Override
+  protected void processMouseEvent(MouseEvent e) {
+    int mod = e.getModifiers();
+    super.processMouseEvent(e);
+    LWComponent.traceMsg("processMouseEvent " + e.toString());
+    switch (e.getID()) {
+    case MouseEvent.MOUSE_PRESSED:
+      if ((mod & MouseEvent.BUTTON1_MASK) != 0) {
+        if (mouseB1Pressed) {
+          errorMsg("ERROR: MOUSE_PRESSED for B1 when already pressed, on "
+              + this.toString());
+        }
+        mouseB1Pressed = true;
+        break;
+      }
+      if ((mod & MouseEvent.BUTTON2_MASK) != 0) {
+        if (mouseB2Pressed) {
+          errorMsg("ERROR: MOUSE_PRESSED for B2 when already pressed, on "
+              + this.toString());
+        }
+        mouseB2Pressed = true;
+        break;
+      }
+      if ((mod & MouseEvent.BUTTON3_MASK) != 0) {
+        if (mouseB3Pressed) {
+          errorMsg("ERROR: MOUSE_PRESSED for B3 when already pressed, on "
+              + this.toString());
+        }
+        mouseB3Pressed = true;
+        break;
+      }
+      repaint();
+      break;
+    case MouseEvent.MOUSE_RELEASED:
+      if ((mod & MouseEvent.BUTTON1_MASK) != 0) {
+        if (!mouseB1Pressed) {
+          errorMsg("ERROR: MOUSE_RELEASED for B1 when not pressed, on "
+              + this.toString());
+        }
+        mouseB1Pressed = false;
+        break;
+      }
+      if ((mod & MouseEvent.BUTTON2_MASK) != 0) {
+        if (!mouseB2Pressed) {
+          errorMsg("ERROR: MOUSE_RELEASED for B2 when not pressed, on "
+              + this.toString());
+        }
+        mouseB2Pressed = false;
+        break;
+      }
+      if ((mod & MouseEvent.BUTTON3_MASK) != 0) {
+        if (!mouseB3Pressed) {
+          errorMsg("ERROR: MOUSE_RELEASED for B3 when not pressed, on "
+              + this.toString());
+        }
+        mouseB3Pressed = false;
+        break;
+      }
+      repaint();
+      break;
+    case MouseEvent.MOUSE_CLICKED:
+      break;
+    case MouseEvent.MOUSE_ENTERED:
+      if (mouseInside) {
+        errorMsg("ERROR: MOUSE_ENTERED when mouse already inside component, on "
+            + this.toString());
+      }
+      mouseInside = true;
+      repaint();
+      break;
+    case MouseEvent.MOUSE_EXITED:
+      if (!mouseInside) {
+        errorMsg("ERROR: MOUSE_EXITED when mouse not inside component, on "
+            + this.toString());
+      }
+      mouseInside = false;
+      repaint();
+      break;
+    case MouseEvent.MOUSE_MOVED:
+      break;
+    case MouseEvent.MOUSE_DRAGGED:
+      break;
+    }
+  }
+
+  public Point getClientLocation() {
+    return new Point(5, 5);
+  }
+
+  public Dimension getClientSize() {
+    Dimension dim = getSize();
+    dim.width -= 10;
+    dim.height -= 10;
+    return dim;
+  }
+
+  public Rectangle getClientBounds() {
+    Dimension dim = getClientSize();
+    return new Rectangle(5, 5, dim.width, dim.height);
+  }
+
+  public int getClientX() { return 5; }
+  public int getClientY() { return 5; }
+
+  /**
+   * Set the color used for painting the non-client area of the component.
+   * The default for this is Color.white.
+   *
+   * @param c The new color to use.
+   */
+  public void setNonClientColor(Color c) {
+    LWComponent.ncBackgroundColor = c;
+  }
+
+  /**
+   * Handle painting for the component.
+   */
+  @Override
+  public void paint(Graphics g) {
+    Dimension dim = getSize();
+
+    kvetch(System.err);
+
+    Color saveColor = g.getColor();
+    super.paint(g);
+
+    // ------------------- Paint the background -----------------
+
+    // In jdk 1.2 (pre-release) there was a bug using clearRect
+    // to paint the background of a lightweight.
+    //g.clearRect(0, 0, dim.width, dim.height);
+    g.setColor(getBackground());
+    g.fillRect(0, 0, dim.width, dim.height);
+
+    // ------------------- Paint the non-client area ------------
+
+    g.setColor(ncBackgroundColor);
+    //         x              y                width      height
+    g.fillRect(0,             0,               dim.width, 5);
+    g.fillRect(0,             5,               5,         dim.height - 10);
+    g.fillRect(dim.width - 5, 5,               5,         dim.height - 10);
+    g.fillRect(0,             dim.height - 5,  dim.width, 5);
+
+    if (shouldHaveFocus() || hasFocus()) {
+      g.setColor(shouldHaveFocus() && hasFocus()
+         ? focusColor
+         : focusWrongColor);
+      g.drawRect(1, 1, dim.width - 3, dim.height - 3);
+    }
+
+    if (mouseInside) {
+      g.setColor(mouseOverColor);
+      g.drawRect(3, 3, dim.width - 7, dim.height - 7);
+    }
+
+    // ------------------- Paint disabledness, if true -----------
+
+    if (!isEnabled()) {
+      g.setColor(getBackground());
+      Dimension size = getSize();
+      int borderThickness = 0;
+      int startX = borderThickness;
+      int startY = borderThickness;
+      int endX = startX + size.width  - 2 * borderThickness - 2;
+      int endY = startY + size.height - 2 * borderThickness - 2;
+      int x, y;
+      for (y = startY; y <= endY; y += 1) {
+        for (x = startX + (y % 2); x <= endX; x += 2) {
+          g.fillRect(x, y, 1, 1);
+        } // x
+      } // y
+    }
+
+    g.setColor(saveColor);
+  }
+
+  /**
+   * Restricts the Graphics to be within the "client area" of the
+   * component.  Recall that the LWComponent series of components has
+   * a "non-client area" of 5 pixels wide in which it draws two
+   * status rectangles showing mouse-over and has-focus status. <p>
+   *
+   * Child classes of LWComponent are to call {@code restrictGraphicsToClientArea}
+   * at the beginning of their {@code paint} method, and then call
+   * {@code unrestrictGraphicsFromClientArea} afterwards.<p>
+   *
+   * In order to make those paint methods as convenient as possible, these
+   * two methods make it appear as if the Graphics available to the
+   * component is slightly smaller than it really is, by the amount
+   * used in the non-client area (5 pixel wide border).<p>
+   *
+   * @param g The Graphics to restrict.
+   */
+  public void restrictGraphicsToClientArea(Graphics g) {
+    Dimension dim = getSize();
+    g.translate(5, 5);
+    g.setClip(0, 0, dim.width - 10, dim.height - 10);
+  }
+
+  /**
+   * Undo the restriction done in restrictGraphicsToClientArea.
+   *
+   * @param g The Graphics to unrestrict.
+   */
+  public void unrestrictGraphicsFromClientArea(Graphics g) {
+    g.translate(-5, -5);
+    Dimension dim = getSize();
+    g.setClip(0, 0, dim.width, dim.height);
+  }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/event/helpers/lwcomponents/LWList.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,726 @@
+/*
+ * Copyright (c) 1999, 2014, 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 test.java.awt.event.helpers.lwcomponents;
+
+import java.awt.*;
+import java.awt.event.*;
+import java.util.Vector;
+import java.util.Enumeration;
+
+/**
+ * Remarks : Source for LightWeight component - List.
+ *
+ * Scroll bar support is not available for this component, so if the
+ * items exceeds visibility those items will be truncated. Also, here
+ * double buffering is not used so there will be little bit flickering
+ * while it repaints. Item listener support is not enabled in this
+ * component. Listeners handled were Mouse, Key and Focus.
+ *
+ * @author R.Govindarajan (govind@siptech.co.in), G.N.V.Sekhar (sekharv@siptech.co.in)
+ */
+
+public class LWList extends LWComponent implements ItemSelectable {
+
+  // Constants used for component size
+  private final int MIN_WIDTH   = 100;
+  private final int MIN_HEIGHT  = 100;
+  private final int PREF_WIDTH  = 100;
+  private final int PREF_HEIGHT = 100;
+
+  // Constants used for setting color for component
+  private final Color BACK_COLOR          = Color.white;
+  private final Color FRONT_COLOR         = Color.black;
+  private final Color BORDER_COLOR        = Color.darkGray;
+  private final Color FOCUS_COLOR         = Color.blue;
+  private final Color FOCUS_FORECOLOR     = Color.white;
+  private final Color FOCUS_ENABLED_COLOR = Color.red;
+  private final int BORDER_WIDTH = 2;
+
+  private Vector stringList;  // List of items
+  private Vector selList;     // List of selected items
+  private int rows;           // Visible rows
+  private int focusIndex, prevfocusIndex;
+  private Dimension minSize;
+  private Dimension prefSize;
+  private boolean pressed, eventOccurred, focusEnabled;
+  private boolean multipleMode;
+
+  // Listeners handled for this component
+  private ActionListener actionListener;
+  private KeyListener    keyListener;
+  private FocusListener  focusListener;
+  private ItemListener   itemListener;
+
+  private static int nameCounter = 0;
+
+  /**
+   * Creates a new list.
+   */
+  public LWList() {
+    this(0);
+  }
+
+  /**
+   * Creates a new list with the specified number of rows;
+   * multiple selection mode is disabled.
+   *
+   * @param i  the number of rows
+   */
+  public LWList(int i) {
+    this(i, false);
+  }
+
+  /**
+   * Creates a new list with the specified number of rows and multiple selection mode.
+   *
+   * @param rows  the number of rows
+   * @param flag  determines whether the list allows multiple selections
+   */
+  public LWList(int rows, boolean flag) {
+    multipleMode        = flag;
+    this.rows           = rows;
+    minSize             = new Dimension(MIN_WIDTH, MIN_HEIGHT);
+    prefSize            = new Dimension(PREF_WIDTH, PREF_HEIGHT);
+    stringList          = new Vector();
+    selList             = new Vector();
+    selList.addElement(0);
+    focusIndex          = -1;
+    prevfocusIndex      = focusIndex;
+    enableEvents(AWTEvent.MOUSE_EVENT_MASK);
+    enableEvents(AWTEvent.KEY_EVENT_MASK);
+    enableEvents(AWTEvent.FOCUS_EVENT_MASK);
+    enableEvents(AWTEvent.ITEM_EVENT_MASK);
+    setName(makeComponentName()); // set the name to the component
+  }
+
+  String makeComponentName() {
+    String s = "LWList" + nameCounter++;
+    return s;
+  }
+
+  /**
+   * Set whether the component is enabled or not.
+   * @param enabled  if {@code true}, the component is to be enabled
+   */
+  @Override
+  public void setEnabled(boolean enabled) {
+    super.setEnabled(enabled);
+
+    if (enabled) {
+      enableEvents(AWTEvent.MOUSE_EVENT_MASK | AWTEvent.MOUSE_MOTION_EVENT_MASK);
+    } else {
+      disableEvents(AWTEvent.MOUSE_EVENT_MASK | AWTEvent.MOUSE_MOTION_EVENT_MASK);
+    }
+    repaint(1);
+  }
+
+  /**
+   * Set the selection mode.
+   *
+   * @param flag  determines whether the list allows multiple selections
+   */
+  public void setSelectionMode(boolean flag) {
+    multipleMode = flag;
+  }
+
+  /**
+   * Check if the list allows multiple selections.
+   *
+   * @return  {@code true} if the list allows multiple selections
+   */
+  public boolean isMultipleMode() {
+    return multipleMode;
+  }
+
+  /**
+   * Add the specified item.
+   *
+   * @param listItem  the item
+   */
+  public void add(String listItem) {
+    stringList.addElement(listItem);
+    invalidate();
+    repaint();
+  }
+
+  /**
+   * Get minimum dimension for the list.
+   *
+   * @return  the minimum dimensions for displaying
+   */
+  @Override
+  public Dimension getMinimumSize() {
+    return minSize;
+  }
+
+  /**
+   * Get the preferred size of the list.
+   *
+   * @return  the preferred dimensions for displaying
+   */
+  @Override
+  public Dimension getPreferredSize() {
+    return prefSize;
+  }
+
+  /**
+   * Get the background color for the component.
+   *
+   * @return  the background color for the component
+   */
+  @Override
+  public Color getBackground() {
+    return BACK_COLOR;
+  }
+
+  /**
+   * Get the foreground color for the component.
+   *
+   * @return  the foreground color for the component
+   */
+  @Override
+  public Color getForeground() {
+    return FRONT_COLOR;
+  }
+
+  /**
+   * Get the border color for the component.
+   *
+   * @return  the border color for the component
+   */
+  public Color getBorder() {
+    return BORDER_COLOR;
+  }
+
+  /**
+   * Get background color for the selected item.
+   *
+   * @return  the color for the selected item
+   */
+  public Color getFocusColor() {
+    return FOCUS_COLOR;
+  }
+
+  /**
+   * Get foreground color for the selected item.
+   *
+   * @return  the foreground color for the selected item
+   */
+  public Color getFocusForeColor() {
+    return FOCUS_FORECOLOR;
+  }
+
+  /**
+   * Get a "focus enabled" color - a small rectangle around the item
+   * should be drawn when the component got the focus.
+   *
+   * @return  the "focus enabled" color
+   */
+  public Color getFocusEnabledColor() {
+    return FOCUS_ENABLED_COLOR;
+  }
+
+  /**
+   * Get border width.
+   *
+   * @return  the border width
+   */
+  public int getBorderWidth() {
+    return BORDER_WIDTH;
+  }
+
+  /**
+   * Get the list item count.
+   *
+   * @return  the count of items
+   */
+  public int getItemCount() {
+    return stringList.size();
+  }
+
+  /**
+   * Get the specified item from the list.
+   *
+   * @param index  the index
+   * @return  the item string
+   */
+  public String getItem(int index) {
+    return (String)stringList.elementAt(index);
+  }
+
+  /**
+   * Get array of items from the list.
+   *
+   * @return  the array of item strings
+   */
+  public String[] getItems() {
+    String str[] = new String[getItemCount()];
+    int count = 0;
+    for (Enumeration e = stringList.elements(); e.hasMoreElements(); ) {
+      str[count++] = (String)e.nextElement();
+    }
+    return str;
+  }
+
+  /**
+   * Check whether the component can be a focus owner (explicitly enabled here).
+   *
+   * @return {@code true} if the component is focusable
+   */
+  @Override
+  public boolean isFocusTraversable() {
+    return true;
+  }
+
+  /**
+   * Check whether mouse click point lies within the list of items.
+   *
+   * @param pt  the click point
+   * @return  {@code true} if the click point lies within the list of items
+   */
+  @Override
+  public boolean contains(Point pt) {
+    Rectangle rect = new Rectangle();
+    Dimension d = getSize();
+    rect.x = getBorderWidth();
+    rect.y = getBorderWidth();
+    rect.width  = d.width  - (getBorderWidth() * 2);
+    rect.height = d.height - (getBorderWidth() * 2);
+    return rect.contains(pt);
+  }
+
+  /**
+   * Given a click point the item that has to be selected is found from the list
+   * and focusIndex variable is set accordingly.
+   *
+   * @param pt  the click point
+   */
+  private void findSelectedIndex(Point pt) {
+    Font f = getFont();
+    FontMetrics fm = getFontMetrics(f);
+    focusIndex = pt.y / fm.getHeight() - 1;
+    if (multipleMode) {
+      Integer fi = focusIndex;
+      if (selList.contains(fi)) {
+        int i = selList.indexOf(fi);
+        selList.removeElementAt(i);
+      } else {
+        selList.addElement(fi);
+      }
+    }
+  }
+
+  /**
+   * Set index of the selected item.
+   *
+   * @param index  the index
+   */
+  public void setSelectedIndex(int index) {
+    prevfocusIndex = focusIndex;
+    focusIndex = index;
+  }
+
+  /**
+   * Get the selected item index.
+   *
+   * @return  the selected item index.
+   */
+  public int getSelectedIndex() {
+    return focusIndex;
+  }
+
+  /**
+   * Get an array of the selected Objects.
+   *
+   * @return  array of the Objects
+   */
+  @Override
+  public Object[] getSelectedObjects() {
+    int ai[] = getSelectedIndexes();
+    Object aobj[] = new Object[selList.size()];
+    for (int i = 0; i < selList.size(); i++) {
+      aobj[i] = stringList.elementAt(ai[i]);
+    }
+    return aobj;
+  }
+
+  /**
+   * Get an array of the selected item indices.
+   *
+   * @return  the array of the indices
+   */
+  public int[] getSelectedIndexes() {
+    int ai[] = new int[selList.size()];
+    for (int i = 0; i < selList.size(); i++) {
+      ai[i] = ((Integer)selList.elementAt(i));
+    }
+    return ai;
+  }
+
+  /**
+   * Add the specified item listener to receive item events from the list.
+   *
+   * @param itemlistener  the item listener
+   */
+  @Override
+  public synchronized void addItemListener(ItemListener itemlistener) {
+    itemListener = AWTEventMulticaster.add(itemListener, itemlistener);
+    enableEvents(AWTEvent.ITEM_EVENT_MASK);
+  }
+
+  /**
+   * Remove the specified item listener so
+   * that it no longer receives item events from this list.
+   *
+   * @param itemlistener  the item listener
+   */
+  @Override
+  public synchronized void removeItemListener(ItemListener itemlistener) {
+    itemListener = AWTEventMulticaster.remove(itemListener, itemlistener);
+  }
+
+  /**
+   * Add the specified action listener to receive action events from this list.
+   *
+   * @param listener  the action listener
+   */
+  public synchronized void addActionListener(ActionListener listener) {
+    actionListener = AWTEventMulticaster.add(actionListener, listener);
+    enableEvents(AWTEvent.MOUSE_EVENT_MASK);
+  }
+
+  /**
+   * Remove the specified action listener so
+   * that it no longer receives action events from this list.
+   *
+   * @param listener  the action listener
+   */
+  public synchronized void removeActionListener(ActionListener listener) {
+    actionListener = AWTEventMulticaster.remove(actionListener, listener);
+  }
+
+  /**
+   * Add the specified key listener to receive key events from this component.
+   *
+   * @param listener  the key listener
+   */
+  @Override
+  public synchronized void addKeyListener(KeyListener listener) {
+    keyListener = AWTEventMulticaster.add(keyListener, listener);
+    enableEvents(AWTEvent.KEY_EVENT_MASK);
+  }
+
+  /**
+   * Remove the specified key listener so
+   * that it no longer receives key events from this component.
+   *
+   * @param listener  the key listener
+   */
+  @Override
+  public synchronized void removeKeyListener(KeyListener listener) {
+    keyListener = AWTEventMulticaster.remove(keyListener, listener);
+  }
+
+  /**
+   * Add the specified focus listener to receive focus events
+   * from this component when it gains input focus.
+   *
+   * @param listener  the focus listener
+   */
+  @Override
+  public synchronized void addFocusListener(FocusListener listener) {
+    focusListener = AWTEventMulticaster.add(focusListener, listener);
+    enableEvents(AWTEvent.FOCUS_EVENT_MASK);
+  }
+
+  /**
+   * Remove the specified focus listener so
+   * that it no longer receives focus events from this component.
+   *
+   * @param listener  the focus listener
+   */
+  @Override
+  public synchronized void removeFocusListener(FocusListener listener) {
+    focusListener = AWTEventMulticaster.remove(focusListener, listener);
+  }
+
+  @Override
+  protected void processEvent(AWTEvent awtevent) {
+
+    if (awtevent instanceof FocusEvent) {
+      processFocusEvent((FocusEvent)awtevent);
+    } else if (awtevent instanceof ItemEvent) {
+      processItemEvent((ItemEvent)awtevent);
+    } else if (awtevent instanceof KeyEvent) {
+      processKeyEvent((KeyEvent)awtevent);
+    } else if (awtevent instanceof MouseEvent) {
+      switch (awtevent.getID()) {
+      case MouseEvent.MOUSE_CLICKED:
+      case MouseEvent.MOUSE_PRESSED:
+      case MouseEvent.MOUSE_RELEASED:
+      case MouseEvent.MOUSE_ENTERED:
+      case MouseEvent.MOUSE_EXITED:
+    processMouseEvent((MouseEvent)awtevent);
+    break;
+
+      case MouseEvent.MOUSE_MOVED:
+      case MouseEvent.MOUSE_DRAGGED:
+    super.processEvent((MouseEvent)awtevent);
+    break;
+      }
+    } else {
+      if (awtevent instanceof ComponentEvent)
+    super.processComponentEvent((ComponentEvent)awtevent);
+      else
+    super.processEvent(awtevent);
+    }
+  }
+
+  protected void processItemEvent(ItemEvent itemevent) {
+    if (itemListener != null) {
+      itemListener.itemStateChanged(itemevent);
+    }
+  }
+
+  @Override
+  protected void processFocusEvent(FocusEvent e) {
+    switch (e.getID()) {
+    case FocusEvent.FOCUS_GAINED:
+      if (focusListener != null) { focusListener.focusGained(e); }
+      if (getSelectedIndex() == -1) { setSelectedIndex(0); }
+      focusEnabled = true;
+      repaint();
+      break;
+    case FocusEvent.FOCUS_LOST:
+      if (focusListener != null) {
+        focusListener.focusLost(e);
+      }
+      focusEnabled = false;
+      repaint();
+      break;
+    }
+    super.processFocusEvent(e);
+  }
+
+  @Override
+  protected void processKeyEvent(KeyEvent e) {
+    rows = getItemCount();
+
+    switch (e.getID()) {
+
+    case KeyEvent.KEY_TYPED:
+      if (keyListener != null) {
+        keyListener.keyTyped(e);
+      }
+      break;
+
+    case KeyEvent.KEY_PRESSED:
+      if (keyListener != null) {
+        keyListener.keyPressed(e);
+      }
+      if (e.getKeyCode() == KeyEvent.VK_DOWN) {
+        prevfocusIndex = focusIndex;
+        int index = getSelectedIndex() + 1;
+        if (index > rows) { break; }
+        setSelectedIndex(index);
+        processItemEvent(new ItemEvent(this, 0, index, 0));
+        eventOccurred = true;
+        repaint();
+      } else if (e.getKeyCode() == KeyEvent.VK_UP) {
+        int index = getSelectedIndex()-1;
+        if (index >= 0) {
+          setSelectedIndex(index);
+          if (e.getID() != 400) {
+            processItemEvent(new ItemEvent(this, 0, index, 0));
+          }
+          eventOccurred = true;
+          repaint();
+        }
+      }
+      break;
+
+    case KeyEvent.KEY_RELEASED:
+      if (keyListener != null) {
+        keyListener.keyReleased(e);
+      }
+      if (e.getKeyCode() == KeyEvent.VK_ENTER) {
+        eventOccurred = true;
+
+        // ActionEvent is fired here
+        if (actionListener != null) {
+          actionListener.actionPerformed( new ActionEvent(
+              this, ActionEvent.ACTION_PERFORMED, null));
+        }
+        repaint();
+      }
+      break;
+    } // switch
+    super.processKeyEvent(e);
+  }
+
+  @Override
+  protected void processMouseEvent(MouseEvent e) {
+    switch (e.getID()) {
+    case MouseEvent.MOUSE_PRESSED:
+      pressed = true;
+      if (contains(e.getPoint())) {
+        findSelectedIndex(e.getPoint());
+        processItemEvent(new ItemEvent(this, 0, focusIndex, 0));
+        eventOccurred = true;
+      }
+      repaint();
+      break;
+
+    case MouseEvent.MOUSE_RELEASED:
+      if (pressed) { requestFocus(); }
+
+      if (contains(e.getPoint())) {
+        findSelectedIndex(e.getPoint());
+        eventOccurred = true;
+      }
+      // ActionEvent is fired here
+      if (actionListener != null) {
+        actionListener.actionPerformed(new ActionEvent(
+            this, ActionEvent.ACTION_PERFORMED, null));
+      }
+
+      if (pressed) {
+        pressed = false;
+        repaint();
+      }
+      break;
+    }
+    super.processMouseEvent(e);
+  }
+
+  @Override
+  /**
+   * Paint the list.
+   *
+   * @param g  the graphics context to be used for testing
+   */
+  public void paint(Graphics g) {
+    super.paint(g);
+    restrictGraphicsToClientArea(g);
+
+    Point     loc = getClientLocation();
+    Dimension dim = getClientSize();
+    Color prevColor = g.getColor();
+
+    // List border is drawn here
+    g.setColor(getBackground());
+    g.fillRect(0, 0, dim.width - 2, dim.height - 2);
+    g.setColor(getBorder());
+    g.drawRect(0, 0, dim.width - 2, dim.height - 2);
+
+    if (getItemCount() > 0) {
+      Font f = getFont();
+      if (f != null) {
+        String str[] = getItems();
+        FontMetrics fm = getFontMetrics(f);
+        int drawRow = loc.x + getBorderWidth() + fm.getAscent();
+        int drawCol = loc.y + getBorderWidth();
+        int rectRow = loc.y + getBorderWidth();
+        int i = 0;
+
+        // Draw items (if the items exceeds visibility those items will be truncated
+        // as scrollbar support is not enabled
+
+        for (;
+             i < str.length && drawRow < (dim.height - getBorderWidth());
+             i++) {
+               if (fm.stringWidth(str[i]) < (dim.width - (getBorderWidth() * 2))) {
+                 drawItem(g, i, drawCol, drawRow, rectRow, fm);
+                 drawRow += fm.getHeight();
+                 rectRow += fm.getHeight();
+               } else {
+                 LWComponent.errorMsg("string width exceeds list width");
+                 LWComponent.errorMsg("Horizontal scrollbar support is not available");
+               }
+            } // for
+
+        if ( (drawRow > (dim.height - getBorderWidth())) && (str.length > i) ) {
+          //LWComponent.errorMsg("no of strings exceeds list height");
+          //LWComponent.errorMsg("Vertical scrollbar support is not available");
+        }
+      } else { LWComponent.errorMsg("Font not available.."); }
+    }
+
+    eventOccurred = false;
+    g.setColor(prevColor);
+    unrestrictGraphicsFromClientArea(g);
+  }
+
+  // Draw String items
+  private void drawItem(Graphics g, int listIndex, int drawCol,
+      int drawRow, int rectRow, FontMetrics fm) {
+    Point     loc = getClientLocation();
+    Dimension dim = getClientSize();
+    String    str = getItem(listIndex);
+    if (multipleMode) {
+      for (int i1 = 0; i1 < selList.size(); i1++) {
+        if (listIndex == ((Integer)selList.elementAt(i1))) {
+          g.setColor(getFocusColor());
+          g.fillRect(loc.x + getBorderWidth(),
+                     rectRow,
+                     dim.width - getBorderWidth() * 2,
+                     fm.getHeight());
+          g.setColor(getFocusEnabledColor());
+          g.drawRect(loc.x + getBorderWidth(),
+                     rectRow,
+                     dim.width - getBorderWidth() * 2,
+                     fm.getHeight());
+        }
+      } // for
+    } else {
+      if (listIndex == getSelectedIndex() && !multipleMode) {
+        g.setColor(getFocusColor());
+        g.fillRect(loc.x + getBorderWidth(),
+                   rectRow,
+                   dim.width - getBorderWidth() * 2,
+                   fm.getHeight());
+        g.setColor(getFocusForeColor());
+      }
+      if ((listIndex == prevfocusIndex) && (prevfocusIndex != getSelectedIndex()) && !multipleMode) {
+        g.setColor(getBackground());
+        g.fillRect(loc.x + getBorderWidth(),
+                   rectRow,
+                   dim.width - getBorderWidth() * 2,
+                   fm.getHeight());
+        prevfocusIndex = getSelectedIndex();
+      }
+      if (focusEnabled && listIndex == getSelectedIndex() && !multipleMode) {
+        g.setColor(getFocusEnabledColor());
+        g.drawRect(loc.x + getBorderWidth(),
+                   rectRow,
+                   dim.width - getBorderWidth() * 2,
+                   fm.getHeight());
+      }
+    }
+    g.setColor(getForeground());
+    g.drawString(str,drawCol,drawRow);
+  }
+
+}
+
--- a/jdk/test/java/lang/ProcessBuilder/Basic.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/test/java/lang/ProcessBuilder/Basic.java	Wed Jul 05 19:53:51 2017 +0200
@@ -2269,9 +2269,9 @@
                 fail("Test failed: Process exited prematurely");
             }
             long end = System.nanoTime();
-            // give waitFor(timeout) a wide berth (100ms)
+            // give waitFor(timeout) a wide berth (200ms)
             // Old AIX machines my need a little longer.
-            if ((end - start) > 100000000L * (AIX.is() ? 4 : 1))
+            if ((end - start) > 200000000L * (AIX.is() ? 2 : 1))
                 fail("Test failed: waitFor took too long (" + (end - start) + "ns)");
 
             p.destroy();
--- a/jdk/test/java/lang/reflect/Modifier/toStringTest.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/test/java/lang/reflect/Modifier/toStringTest.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2014, 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
@@ -23,11 +23,11 @@
 
 /**
  * @test
- * @bug 4394937
+ * @bug 4394937 8051382
  * @summary tests the toString method of reflect.Modifier
  */
 
-import java.lang.reflect.*;
+import java.lang.reflect.Modifier;
 
 public class toStringTest {
 
--- a/jdk/test/java/util/Collections/CheckedListReplaceAll.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/test/java/util/Collections/CheckedListReplaceAll.java	Wed Jul 05 19:53:51 2017 +0200
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug     8047795
+ * @bug     8047795 8053938
  * @summary Ensure that replaceAll operator cannot add bad elements
  * @author  Mike Duigou
  */
@@ -46,5 +46,16 @@
             thwarted.printStackTrace(System.out);
             System.out.println("Curses! Foiled again!");
         }
+
+        unwrapped = Arrays.asList(new Object[]{});  // Empty list
+        wrapped = Collections.checkedList(unwrapped, Integer.class);
+        try {
+            wrapped.replaceAll((UnaryOperator)null);
+            System.out.printf("Bwahaha! I have defeated you! %s\n", wrapped);
+            throw new RuntimeException("NPE not thrown when passed a null operator");
+        } catch (NullPointerException thwarted) {
+            thwarted.printStackTrace(System.out);
+            System.out.println("Curses! Foiled again!");
+        }
     }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/util/Collections/SyncSubMutexes.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,270 @@
+/*
+ * Copyright (c) 2014, 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 8048209
+ * @summary Check that Collections.synchronizedNavigableSet().tailSet() is using
+ * the same lock object as it's source.
+ * @run testng SyncSubMutexes
+ */
+import java.lang.reflect.Field;
+import java.util.*;
+import java.util.Set;
+import java.util.Arrays;
+
+import org.testng.annotations.Test;
+import org.testng.annotations.DataProvider;
+import static org.testng.Assert.assertSame;
+
+public class SyncSubMutexes {
+
+    @Test(dataProvider = "Collections")
+    public void testCollections(Collection<String> instance) {
+        // nothing to test, no subset methods
+    }
+
+    @Test(dataProvider = "Lists")
+    public void testLists(List<String> instance) {
+         assertSame(getSyncCollectionMutex(instance.subList(0, 1)), getSyncCollectionMutex(instance));
+    }
+
+    @Test(dataProvider = "Sets")
+    public void testSets(Set<String> instance) {
+        // nothing to test, no subset methods
+
+    }
+
+    @Test(dataProvider = "SortedSets")
+    public void testSortedSets(SortedSet<String> instance) {
+         assertSame(getSyncCollectionMutex(instance.headSet("Echo")), getSyncCollectionMutex(instance));
+         assertSame(getSyncCollectionMutex(instance.tailSet("Charlie")), getSyncCollectionMutex(instance));
+         assertSame(getSyncCollectionMutex(instance.subSet("Charlie", "Echo")), getSyncCollectionMutex(instance));
+
+    }
+
+    @Test(dataProvider = "NavigableSets")
+    public void testNavigableSets(NavigableSet<String> instance) {
+         assertSame(getSyncCollectionMutex(instance.descendingSet()), getSyncCollectionMutex(instance));
+         assertSame(getSyncCollectionMutex(instance.headSet("Echo")), getSyncCollectionMutex(instance));
+         assertSame(getSyncCollectionMutex(instance.headSet("Echo", true)), getSyncCollectionMutex(instance));
+         assertSame(getSyncCollectionMutex(instance.tailSet("Charlie")), getSyncCollectionMutex(instance));
+         assertSame(getSyncCollectionMutex(instance.tailSet("Charlie", true)), getSyncCollectionMutex(instance));
+         assertSame(getSyncCollectionMutex(instance.subSet("Charlie", "Echo")), getSyncCollectionMutex(instance));
+         assertSame(getSyncCollectionMutex(instance.subSet("Charlie", true, "Echo", true)), getSyncCollectionMutex(instance));
+    }
+
+    @Test(dataProvider = "Maps")
+    public void testMaps(Map<String, String> instance) {
+         assertSame(getSyncCollectionMutex(instance.entrySet()), getSyncMapMutex(instance));
+         assertSame(getSyncCollectionMutex(instance.keySet()), getSyncMapMutex(instance));
+         assertSame(getSyncCollectionMutex(instance.values()), getSyncMapMutex(instance));
+    }
+
+    @Test(dataProvider = "SortedMaps")
+    public void testSortedMaps(SortedMap<String, String> instance) {
+         assertSame(getSyncCollectionMutex(instance.entrySet()), getSyncMapMutex(instance));
+         assertSame(getSyncCollectionMutex(instance.keySet()), getSyncMapMutex(instance));
+         assertSame(getSyncCollectionMutex(instance.values()), getSyncMapMutex(instance));
+         assertSame(getSyncMapMutex(instance.headMap("Echo")), getSyncMapMutex(instance));
+         assertSame(getSyncMapMutex(instance.tailMap("Charlie")), getSyncMapMutex(instance));
+         assertSame(getSyncMapMutex(instance.subMap("Charlie", "Echo")), getSyncMapMutex(instance));
+    }
+
+    @Test(dataProvider = "NavigableMaps")
+    public void testNavigableMaps(NavigableMap<String, String> instance) {
+         assertSame(getSyncMapMutex(instance.descendingMap()), getSyncMapMutex(instance));
+         assertSame(getSyncCollectionMutex(instance.entrySet()), getSyncMapMutex(instance));
+         assertSame(getSyncCollectionMutex(instance.keySet()), getSyncMapMutex(instance));
+         assertSame(getSyncCollectionMutex(instance.descendingKeySet()), getSyncMapMutex(instance));
+         assertSame(getSyncCollectionMutex(instance.values()), getSyncMapMutex(instance));
+         assertSame(getSyncMapMutex(instance.headMap("Echo")), getSyncMapMutex(instance));
+         assertSame(getSyncMapMutex(instance.headMap("Echo", true)), getSyncMapMutex(instance));
+         assertSame(getSyncMapMutex(instance.tailMap("Charlie")), getSyncMapMutex(instance));
+         assertSame(getSyncMapMutex(instance.tailMap("Charlie", true)), getSyncMapMutex(instance));
+         assertSame(getSyncMapMutex(instance.subMap("Charlie", true, "Echo", true)), getSyncMapMutex(instance));
+         assertSame(getSyncMapMutex(instance.subMap("Charlie", true, "Echo", true)), getSyncMapMutex(instance));
+    }
+
+    @DataProvider(name = "Collections", parallel = true)
+    public static Iterator<Object[]> collectionProvider() {
+        return makeCollections().iterator();
+    }
+
+    @DataProvider(name = "Lists", parallel = true)
+    public static Iterator<Object[]> listProvider() {
+        return makeLists().iterator();
+    }
+
+    @DataProvider(name = "Sets", parallel = true)
+    public static Iterator<Object[]> setProvider() {
+        return makeSets().iterator();
+    }
+
+    @DataProvider(name = "SortedSets", parallel = true)
+    public static Iterator<Object[]> sortedsetProvider() {
+        return makeSortedSets().iterator();
+    }
+
+    @DataProvider(name = "NavigableSets", parallel = true)
+    public static Iterator<Object[]> navigablesetProvider() {
+        return makeNavigableSets().iterator();
+    }
+
+    @DataProvider(name = "Maps", parallel = true)
+    public static Iterator<Object[]> mapProvider() {
+        return makeMaps().iterator();
+    }
+
+    @DataProvider(name = "SortedMaps", parallel = true)
+    public static Iterator<Object[]> sortedmapProvider() {
+        return makeSortedMaps().iterator();
+    }
+
+    @DataProvider(name = "NavigableMaps", parallel = true)
+    public static Iterator<Object[]> navigablemapProvider() {
+        return makeNavigableMaps().iterator();
+    }
+
+    private static final Collection<String> BASE_COLLECTION = Collections.unmodifiableCollection(
+            Arrays.asList("Alpha", "Bravo", "Charlie", "Delta", "Echo", "Foxtrot", "Golf")
+    );
+    private static final Map<String, String> BASE_MAP;
+
+    static {
+        Map<String, String> map = new HashMap<>();
+        for(String each : BASE_COLLECTION) {
+            map.put(each, "*" + each + "*");
+        }
+        BASE_MAP = Collections.unmodifiableMap(map);
+    }
+
+    public static Collection<Object[]> makeCollections() {
+        Collection<Object[]> instances = new ArrayList<>();
+        instances.add(new Object[] {Collections.synchronizedCollection(new ArrayList<>(BASE_COLLECTION))});
+        instances.addAll(makeLists());
+
+        return instances;
+    }
+
+    public static Collection<Object[]> makeLists() {
+        Collection<Object[]> instances = new ArrayList<>();
+        instances.add(new Object[] {Collections.synchronizedList(new ArrayList<>(BASE_COLLECTION))});
+        instances.add(new Object[] {Collections.synchronizedList(new ArrayList<>(BASE_COLLECTION)).subList(1, 2)});
+
+        return instances;
+    }
+
+     public static Collection<Object[]> makeSets() {
+        Collection<Object[]> instances = new ArrayList<>();
+
+        instances.add(new Object[] {Collections.synchronizedSet(new TreeSet<>(BASE_COLLECTION))});
+        instances.addAll(makeSortedSets());
+        return instances;
+     }
+
+    public static Collection<Object[]> makeSortedSets() {
+        Collection<Object[]> instances = new ArrayList<>();
+        instances.add(new Object[] {Collections.synchronizedSortedSet(new TreeSet<>(BASE_COLLECTION))});
+        instances.add(new Object[] {Collections.synchronizedSortedSet(new TreeSet<>(BASE_COLLECTION)).headSet("Foxtrot")});
+        instances.add(new Object[] {Collections.synchronizedSortedSet(new TreeSet<>(BASE_COLLECTION)).tailSet("Bravo")});
+        instances.add(new Object[] {Collections.synchronizedSortedSet(new TreeSet<>(BASE_COLLECTION)).subSet("Bravo", "Foxtrot")});
+        instances.addAll(makeNavigableSets());
+
+        return instances;
+     }
+
+    public static Collection<Object[]> makeNavigableSets() {
+        Collection<Object[]> instances = new ArrayList<>();
+
+        instances.add(new Object[] {Collections.synchronizedNavigableSet(new TreeSet<>(BASE_COLLECTION))});
+        instances.add(new Object[] {Collections.synchronizedNavigableSet(new TreeSet<>(BASE_COLLECTION)).descendingSet().descendingSet()});
+        instances.add(new Object[] {Collections.synchronizedNavigableSet(new TreeSet<>(BASE_COLLECTION)).headSet("Foxtrot")});
+        instances.add(new Object[] {Collections.synchronizedNavigableSet(new TreeSet<>(BASE_COLLECTION)).headSet("Foxtrot", true)});
+        instances.add(new Object[] {Collections.synchronizedNavigableSet(new TreeSet<>(BASE_COLLECTION)).tailSet("Bravo")});
+        instances.add(new Object[] {Collections.synchronizedNavigableSet(new TreeSet<>(BASE_COLLECTION)).tailSet("Bravo", true)});
+        instances.add(new Object[] {Collections.synchronizedNavigableSet(new TreeSet<>(BASE_COLLECTION)).subSet("Bravo", "Foxtrot")});
+        instances.add(new Object[] {Collections.synchronizedNavigableSet(new TreeSet<>(BASE_COLLECTION)).subSet("Bravo", true, "Foxtrot", true)});
+
+        return instances;
+    }
+
+    public static Collection<Object[]> makeMaps() {
+        Collection<Object[]> instances = new ArrayList<>();
+
+        instances.add(new Object[] {Collections.synchronizedMap(new HashMap<>(BASE_MAP))});
+        instances.addAll(makeSortedMaps());
+
+        return instances;
+    }
+
+    public static Collection<Object[]> makeSortedMaps() {
+        Collection<Object[]> instances = new ArrayList<>();
+
+        instances.add(new Object[] {Collections.synchronizedSortedMap(new TreeMap<>(BASE_MAP))});
+        instances.add(new Object[] {Collections.synchronizedSortedMap(new TreeMap<>(BASE_MAP)).headMap("Foxtrot")});
+        instances.add(new Object[] {Collections.synchronizedSortedMap(new TreeMap<>(BASE_MAP)).tailMap("Bravo")});
+        instances.add(new Object[] {Collections.synchronizedSortedMap(new TreeMap<>(BASE_MAP)).subMap("Bravo", "Foxtrot")});
+        instances.addAll(makeNavigableMaps());
+
+        return instances;
+    }
+
+    public static Collection<Object[]> makeNavigableMaps() {
+        Collection<Object[]> instances = new ArrayList<>();
+
+        instances.add(new Object[] {Collections.synchronizedNavigableMap(new TreeMap<>(BASE_MAP))});
+        instances.add(new Object[] {Collections.synchronizedNavigableMap(new TreeMap<>(BASE_MAP).descendingMap().descendingMap())});
+        instances.add(new Object[] {Collections.synchronizedNavigableMap(new TreeMap<>(BASE_MAP)).headMap("Foxtrot")});
+        instances.add(new Object[] {Collections.synchronizedNavigableMap(new TreeMap<>(BASE_MAP)).headMap("Foxtrot", true)});
+        instances.add(new Object[] {Collections.synchronizedNavigableMap(new TreeMap<>(BASE_MAP)).tailMap("Bravo")});
+        instances.add(new Object[] {Collections.synchronizedNavigableMap(new TreeMap<>(BASE_MAP)).tailMap("Bravo", true)});
+        instances.add(new Object[] {Collections.synchronizedNavigableMap(new TreeMap<>(BASE_MAP)).subMap("Bravo", "Foxtrot")});
+        instances.add(new Object[] {Collections.synchronizedNavigableMap(new TreeMap<>(BASE_MAP)).subMap("Bravo", true, "Foxtrot", true)});
+
+        return instances;
+    }
+
+    private static Object getSyncCollectionMutex(Collection<?> from) {
+        try {
+            Class<?> synchronizedCollectionClazz = Class.forName("java.util.Collections$SynchronizedCollection");
+            Field f = synchronizedCollectionClazz.getDeclaredField("mutex");
+            f.setAccessible(true);
+            return f.get(from);
+        } catch ( ClassNotFoundException | NoSuchFieldException | IllegalAccessException e) {
+            throw new RuntimeException("Unable to get mutex field.", e);
+        }
+    }
+
+    private static Object getSyncMapMutex(Map<?,?> from) {
+        try {
+            Class<?> synchronizedMapClazz = Class.forName("java.util.Collections$SynchronizedMap");
+            Field f = synchronizedMapClazz.getDeclaredField("mutex");
+            f.setAccessible(true);
+            return f.get(from);
+        } catch ( ClassNotFoundException | NoSuchFieldException | IllegalAccessException e) {
+            throw new RuntimeException("Unable to get mutex field.", e);
+        }
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/imageio/plugins/png/PngDitDepthTest.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2014, 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 4991647
+* @summary PNGMetadata.getAsTree() sets bitDepth to invalid value
+* @run main PngDitDepthTest
+*/
+
+import org.w3c.dom.Node;
+
+import javax.imageio.ImageIO;
+import javax.imageio.ImageTypeSpecifier;
+import javax.imageio.ImageWriter;
+import javax.imageio.metadata.IIOInvalidTreeException;
+import javax.imageio.metadata.IIOMetadata;
+import java.awt.image.ColorModel;
+import java.awt.image.SampleModel;
+import java.util.Iterator;
+
+public class PngDitDepthTest {
+
+    public static void main(String[] args) throws IIOInvalidTreeException {
+
+        // getting the writer for the png format
+        Iterator iter = ImageIO.getImageWritersByFormatName("png");
+        ImageWriter writer = (ImageWriter) iter.next();
+
+        // creating a color model
+        ColorModel colorModel = ColorModel.getRGBdefault();
+
+        // creating a sample model
+        SampleModel sampleModel = colorModel.createCompatibleSampleModel(640, 480);
+
+        // creating a default metadata object
+        IIOMetadata metaData = writer.getDefaultImageMetadata(new ImageTypeSpecifier(colorModel, sampleModel), null);
+        String formatName = metaData.getNativeMetadataFormatName();
+
+        // first call
+        Node metaDataNode = metaData.getAsTree(formatName);
+        try {
+            metaData.setFromTree(formatName, metaDataNode);
+        } catch (Exception ex) {
+            ex.printStackTrace();
+        }
+
+        // second call (bitdepht is already set to an invalid value)
+        metaDataNode = metaData.getAsTree(formatName);
+
+        metaData.setFromTree(formatName, metaDataNode);
+
+    }
+}
--- a/jdk/test/javax/management/monitor/StartStopTest.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/test/javax/management/monitor/StartStopTest.java	Wed Jul 05 19:53:51 2017 +0200
@@ -213,6 +213,6 @@
     }
 
     private static void doSleep(long ms) throws Exception {
-        Thread.sleep(Math.round(ms * Utils.TIMEOUT_FACTOR));
+        Thread.sleep(Utils.adjustTimeout(ms));
     }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/naming/InitialContext/AppletIsNotUsed.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2014, 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 javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import javax.naming.NoInitialContextException;
+import java.util.Hashtable;
+
+/*
+ * @test
+ * @bug 8051422
+ * @summary Make sure java.applet.Applet is not used as a source of
+ *          configuration parameters for an InitialContext
+ */
+public class AppletIsNotUsed {
+
+    @SuppressWarnings("deprecation")
+    public static void main(String[] args) throws NamingException {
+
+        testWith(Context.APPLET);
+        testWith("java.naming.applet");
+
+    }
+
+    private static void testWith(String appletProperty) throws NamingException {
+        Hashtable<Object, Object> env = new Hashtable<>();
+        // Deliberately put java.lang.Object rather than java.applet.Applet
+        // if an applet was used we would see a ClassCastException down there
+        env.put(appletProperty, new Object());
+        // It's ok to instantiate InitialContext with no parameters
+        // and be unaware of it right until you try to use it
+        Context ctx = new InitialContext(env);
+        boolean threw = true;
+        try {
+            ctx.lookup("whatever");
+            threw = false;
+        } catch (NoInitialContextException e) {
+            String m = e.getMessage();
+            if (m == null || m.contains("applet"))
+                throw new RuntimeException("The exception message is incorrect", e);
+        } catch (Throwable t) {
+            throw new RuntimeException(
+                    "The test was supposed to catch NoInitialContextException" +
+                            " here, but caught: " + t.getClass().getName(), t);
+        } finally {
+            ctx.close();
+        }
+
+        if (!threw)
+            throw new RuntimeException("The test was supposed to catch NoInitialContextException here");
+    }
+}
--- a/jdk/test/javax/naming/InitialContext/NoApplet.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/test/javax/naming/InitialContext/NoApplet.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, 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,12 +31,11 @@
 import java.util.Hashtable;
 
 public class NoApplet {
+    @SuppressWarnings("deprecation")
     public static void main(String[] args) throws NamingException {
-         Hashtable<Object,Object> env = new Hashtable<>();
-         env.put(Context.APPLET, new Object());
-         try {
-             Context ctxt = new InitialContext(env);
-             throw new RuntimeException("ClassCastException expected");
-         } catch (ClassCastException expected) { }
+        Hashtable<Object,Object> env = new Hashtable<>();
+        env.put(Context.APPLET, new Object());
+        Context ctxt = new InitialContext(env);
+        ctxt.close();
     }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/net/ssl/TLSv12/ProtocolFilter.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,315 @@
+/*
+ * Copyright (c) 2014, 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.
+ */
+
+// SunJSSE does not support dynamic system properties, no way to re-use
+// system properties in samevm/agentvm mode.
+
+/*
+ * @test
+ * @bug 8052406
+ * @summary SSLv2Hello protocol may be filter out unexpectedly
+ * @run main/othervm ProtocolFilter
+ */
+
+import java.io.*;
+import java.net.*;
+import javax.net.ssl.*;
+
+public class ProtocolFilter {
+
+    /*
+     * =============================================================
+     * Set the various variables needed for the tests, then
+     * specify what tests to run on each side.
+     */
+
+    /*
+     * Should we run the client or server in a separate thread?
+     * Both sides can throw exceptions, but do you have a preference
+     * as to which side should be the main thread.
+     */
+    static boolean separateServerThread = false;
+
+    /*
+     * Where do we find the keystores?
+     */
+    static String pathToStores = "../etc";
+    static String keyStoreFile = "keystore";
+    static String trustStoreFile = "truststore";
+    static String passwd = "passphrase";
+
+    /*
+     * Is the server ready to serve?
+     */
+    volatile static boolean serverReady = false;
+
+    /*
+     * Turn on SSL debugging?
+     */
+    static boolean debug = false;
+
+    /*
+     * If the client or server is doing some kind of object creation
+     * that the other side depends on, and that thread prematurely
+     * exits, you may experience a hang.  The test harness will
+     * terminate all hung threads after its timeout has expired,
+     * currently 3 minutes by default, but you might try to be
+     * smart about it....
+     */
+
+    /*
+     * Define the server side of the test.
+     *
+     * If the server prematurely exits, serverReady will be set to true
+     * to avoid infinite hangs.
+     */
+    void doServerSide() throws Exception {
+        SSLServerSocketFactory sslssf =
+            (SSLServerSocketFactory) SSLServerSocketFactory.getDefault();
+        SSLServerSocket sslServerSocket =
+            (SSLServerSocket) sslssf.createServerSocket(serverPort);
+
+        // Only enable cipher suites for TLS v1.2.
+        sslServerSocket.setEnabledCipherSuites(
+            new String[]{"TLS_RSA_WITH_AES_128_CBC_SHA256"});
+
+        serverPort = sslServerSocket.getLocalPort();
+
+        /*
+         * Signal Client, we're ready for his connect.
+         */
+        serverReady = true;
+
+        SSLSocket sslSocket = (SSLSocket) sslServerSocket.accept();
+        InputStream sslIS = sslSocket.getInputStream();
+        OutputStream sslOS = sslSocket.getOutputStream();
+
+        sslIS.read();
+        sslOS.write(85);
+        sslOS.flush();
+
+        sslSocket.close();
+    }
+
+    /*
+     * Define the client side of the test.
+     *
+     * If the server prematurely exits, serverReady will be set to true
+     * to avoid infinite hangs.
+     */
+    void doClientSide() throws Exception {
+
+        /*
+         * Wait for server to get started.
+         */
+        while (!serverReady) {
+            Thread.sleep(50);
+        }
+
+        SSLSocketFactory sslsf =
+            (SSLSocketFactory) SSLSocketFactory.getDefault();
+        SSLSocket sslSocket = (SSLSocket)
+            sslsf.createSocket("localhost", serverPort);
+
+        // Enable all supported protocols, including SSLv2Hello.
+        sslSocket.setEnabledProtocols(sslSocket.getSupportedProtocols());
+
+        InputStream sslIS = sslSocket.getInputStream();
+        OutputStream sslOS = sslSocket.getOutputStream();
+
+        sslOS.write(280);
+        sslOS.flush();
+        sslIS.read();
+
+        sslSocket.close();
+    }
+
+    /*
+     * =============================================================
+     * The remainder is just support stuff
+     */
+
+    // use any free port by default
+    volatile int serverPort = 0;
+
+    volatile Exception serverException = null;
+    volatile Exception clientException = null;
+
+    public static void main(String[] args) throws Exception {
+        String keyFilename =
+            System.getProperty("test.src", ".") + "/" + pathToStores +
+                "/" + keyStoreFile;
+        String trustFilename =
+            System.getProperty("test.src", ".") + "/" + pathToStores +
+                "/" + trustStoreFile;
+
+        System.setProperty("javax.net.ssl.keyStore", keyFilename);
+        System.setProperty("javax.net.ssl.keyStorePassword", passwd);
+        System.setProperty("javax.net.ssl.trustStore", trustFilename);
+        System.setProperty("javax.net.ssl.trustStorePassword", passwd);
+
+        if (debug)
+            System.setProperty("javax.net.debug", "all");
+
+        /*
+         * Start the tests.
+         */
+        new ProtocolFilter();
+    }
+
+    Thread clientThread = null;
+    Thread serverThread = null;
+
+    /*
+     * Primary constructor, used to drive remainder of the test.
+     *
+     * Fork off the other side, then do your work.
+     */
+    ProtocolFilter() throws Exception {
+        Exception startException = null;
+        try {
+            if (separateServerThread) {
+                startServer(true);
+                startClient(false);
+            } else {
+                startClient(true);
+                startServer(false);
+            }
+        } catch (Exception e) {
+            startException = e;
+        }
+
+        /*
+         * Wait for other side to close down.
+         */
+        if (separateServerThread) {
+            if (serverThread != null) {
+                serverThread.join();
+            }
+        } else {
+            if (clientThread != null) {
+                clientThread.join();
+            }
+        }
+
+        /*
+         * When we get here, the test is pretty much over.
+         * Which side threw the error?
+         */
+        Exception local;
+        Exception remote;
+
+        if (separateServerThread) {
+            remote = serverException;
+            local = clientException;
+        } else {
+            remote = clientException;
+            local = serverException;
+        }
+
+        Exception exception = null;
+
+        /*
+         * Check various exception conditions.
+         */
+        if ((local != null) && (remote != null)) {
+            // If both failed, return the curthread's exception.
+            local.initCause(remote);
+            exception = local;
+        } else if (local != null) {
+            exception = local;
+        } else if (remote != null) {
+            exception = remote;
+        } else if (startException != null) {
+            exception = startException;
+        }
+
+        /*
+         * If there was an exception *AND* a startException,
+         * output it.
+         */
+        if (exception != null) {
+            if (exception != startException && startException != null) {
+                exception.addSuppressed(startException);
+            }
+            throw exception;
+        }
+
+        // Fall-through: no exception to throw!
+    }
+
+    void startServer(boolean newThread) throws Exception {
+        if (newThread) {
+            serverThread = new Thread() {
+                public void run() {
+                    try {
+                        doServerSide();
+                    } catch (Exception e) {
+                        /*
+                         * Our server thread just died.
+                         *
+                         * Release the client, if not active already...
+                         */
+                        System.err.println("Server died...");
+                        serverReady = true;
+                        serverException = e;
+                    }
+                }
+            };
+            serverThread.start();
+        } else {
+            try {
+                doServerSide();
+            } catch (Exception e) {
+                serverException = e;
+            } finally {
+                serverReady = true;
+            }
+        }
+    }
+
+    void startClient(boolean newThread) throws Exception {
+        if (newThread) {
+            clientThread = new Thread() {
+                public void run() {
+                    try {
+                        doClientSide();
+                    } catch (Exception e) {
+                        /*
+                         * Our client thread just died.
+                         */
+                        System.err.println("Client died...");
+                        clientException = e;
+                    }
+                }
+            };
+            clientThread.start();
+        } else {
+            try {
+                doClientSide();
+            } catch (Exception e) {
+                clientException = e;
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/print/attribute/PrintResAttr.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2014, 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 8048328
+ * @summary CUPS Printing does not report supported printer resolutions.
+ * @run main PrintResAttr
+ */
+
+/*
+ * Since there is no guarantee you have any printers that support
+ * resolution this test can't verify that resolution is being
+ * reported when supported. But when they are it should test that
+ * the code behaves reasonably.
+ */
+import javax.print.*;
+import javax.print.attribute.*;
+import javax.print.attribute.standard.*;
+
+public class PrintResAttr {
+
+   public static void main(String args[]) throws Exception {
+
+      PrintService[] services =
+            PrintServiceLookup.lookupPrintServices(null,null);
+      for (int i=0; i<services.length; i++) {
+          if (services[i].isAttributeCategorySupported(PrinterResolution.class)) {
+              System.out.println("Testing " + services[i]);
+              PrinterResolution[] res = (PrinterResolution[])
+            services[i].getSupportedAttributeValues(PrinterResolution.class,
+                                                      null,null);
+              System.out.println("# supp res= " + res.length);
+              for (int r=0;r<res.length;r++) System.out.println(res[r]);
+          }
+      }
+   }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/xml/jaxp/common/8032908/TestFunc.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2014, 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 org.w3c.dom.Node;
+
+public class TestFunc {
+
+    public static String test(Node node) {
+        String s = node.getTextContent();
+        return s;
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/xml/jaxp/common/8032908/XSLT.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2014, 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 8032908
+ * @summary Test if Node.getTextContent() function correctly returns children
+ * content
+ * @compile TestFunc.java XSLT.java
+ * @run main/othervm XSLT
+ */
+import java.io.ByteArrayOutputStream;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.stream.StreamSource;
+
+public class XSLT {
+
+    static final String XMLTOTRANSFORM = "/in.xml";
+    static final String XSLTRANSFORMER = "/test.xsl";
+    static final String EXPECTEDRESULT = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>ABCDEFG";
+
+    public static void main(String[] args) throws TransformerException {
+        ByteArrayOutputStream resStream = new ByteArrayOutputStream();
+        TransformerFactory trf = TransformerFactory.newInstance();
+        Transformer tr = trf.newTransformer(new StreamSource(System.getProperty("test.src", ".") + XSLTRANSFORMER));
+        tr.transform(new StreamSource(System.getProperty("test.src", ".") + XMLTOTRANSFORM), new StreamResult(resStream));
+        System.out.println("Transformation completed. Result:" + resStream.toString());
+        if (!resStream.toString().equals(EXPECTEDRESULT)) {
+            throw new RuntimeException("Incorrect transformation result");
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/xml/jaxp/common/8032908/in.xml	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<root><elem><level2_0>ABCD</level2_0><level2_1>EFG</level2_1></elem></root>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/xml/jaxp/common/8032908/test.xsl	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:transform exclude-result-prefixes="cscdt_ufunc" version="1.0"
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    xmlns:cscdt_ufunc="http://xml.apache.org/xalan/java">
+    <xsl:template match="elem">
+        <xsl:value-of select="cscdt_ufunc:TestFunc.test(.)" />
+    </xsl:template>
+</xsl:transform>
--- a/jdk/test/lib/testlibrary/jdk/testlibrary/ProcessThread.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/test/lib/testlibrary/jdk/testlibrary/ProcessThread.java	Wed Jul 05 19:53:51 2017 +0200
@@ -148,9 +148,7 @@
          */
         @Override
         public void xrun() throws Throwable {
-            this.process = ProcessTools.startProcess(
-                name, processBuilder, waitfor, -1, TimeUnit.SECONDS
-            );
+            this.process = ProcessTools.startProcess(name, processBuilder, waitfor);
             // Release when process is started
             latch.countDown();
 
--- a/jdk/test/lib/testlibrary/jdk/testlibrary/ProcessTools.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/test/lib/testlibrary/jdk/testlibrary/ProcessTools.java	Wed Jul 05 19:53:51 2017 +0200
@@ -74,7 +74,7 @@
     public static Process startProcess(String name,
                                        ProcessBuilder processBuilder)
     throws IOException {
-        return startProcess(name, processBuilder, null);
+        return startProcess(name, processBuilder, (Consumer)null);
     }
 
     /**
@@ -124,7 +124,7 @@
      *                      Used to determine the moment the target app is
      *                      properly warmed-up.
      *                      It can be null - in that case the warmup is skipped.
-     * @param timeout The timeout for the warmup waiting
+     * @param timeout The timeout for the warmup waiting; -1 = no wait; 0 = wait forever
      * @param unit The timeout {@linkplain TimeUnit}
      * @return Returns the initialized {@linkplain Process}
      * @throws IOException
@@ -156,15 +156,20 @@
             };
             stdout.addPump(pump);
             stderr.addPump(pump);
+        } else {
+            latch.countDown();
         }
         Future<Void> stdoutTask = stdout.process();
         Future<Void> stderrTask = stderr.process();
 
         try {
             if (timeout > -1) {
-                long realTimeout = Math.round(timeout * Utils.TIMEOUT_FACTOR);
-                if (!latch.await(realTimeout, unit)) {
-                    throw new TimeoutException();
+                if (timeout == 0) {
+                    latch.await();
+                } else {
+                    if (!latch.await(Utils.adjustTimeout(timeout), unit)) {
+                        throw new TimeoutException();
+                    }
                 }
             }
         } catch (TimeoutException | InterruptedException e) {
@@ -181,6 +186,31 @@
     }
 
     /**
+     * <p>Starts a process from its builder.</p>
+     * <span>The default redirects of STDOUT and STDERR are started</span>
+     * <p>
+     * It is possible to wait for the process to get to a warmed-up state
+     * via {@linkplain Predicate} condition on the STDOUT
+     * </p>
+     * @param name The process name
+     * @param processBuilder The process builder
+     * @param linePredicate The {@linkplain Predicate} to use on the STDOUT
+     *                      Used to determine the moment the target app is
+     *                      properly warmed-up.
+     *                      It can be null - in that case the warmup is skipped.
+     * @return Returns the initialized {@linkplain Process}
+     * @throws IOException
+     * @throws InterruptedException
+     * @throws TimeoutException
+     */
+    public static Process startProcess(String name,
+                                       ProcessBuilder processBuilder,
+                                       final Predicate<String> linePredicate)
+    throws IOException, InterruptedException, TimeoutException {
+        return startProcess(name, processBuilder, linePredicate, 0, TimeUnit.SECONDS);
+    }
+
+    /**
      * Pumps stdout and stderr from running the process into a String.
      *
      * @param processBuilder
--- a/jdk/test/lib/testlibrary/jdk/testlibrary/Utils.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/test/lib/testlibrary/jdk/testlibrary/Utils.java	Wed Jul 05 19:53:51 2017 +0200
@@ -280,4 +280,13 @@
         return output;
     }
 
+    /**
+     * Adjusts the provided timeout value for the TIMEOUT_FACTOR
+     * @param tOut the timeout value to be adjusted
+     * @return The timeout value adjusted for the value of "test.timeout.factor"
+     *         system property
+     */
+    public static long adjustTimeout(long tOut) {
+        return Math.round(tOut * Utils.TIMEOUT_FACTOR);
+    }
 }
--- a/jdk/test/sun/awt/image/bug8038000.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/test/sun/awt/image/bug8038000.java	Wed Jul 05 19:53:51 2017 +0200
@@ -23,11 +23,13 @@
 
 /**
  * @test
- * @bug     8038000
+ * @bug     8038000 8047066
  *
  * @summary Verifies that we could create different type of Rasters with height 1
  * and strideline which exceeds raster width.
  * Also checks that a set of RasterOp work correctly with such kind of Rasters.
+ * For 8047066 verifies that ColorConvertOp could process
+ * Raster (ByteBuffer + SinglePixelPackedSampleModel)
  *
  * @run     main bug8038000
  */
--- a/jdk/test/sun/net/ftp/FtpURL.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/test/sun/net/ftp/FtpURL.java	Wed Jul 05 19:53:51 2017 +0200
@@ -483,7 +483,7 @@
 
             // Now let's check the URL handler
 
-            url = new URL("ftp://user2:@localhost:" + port + "/%2Fusr/bin;type=d");
+            url = new URL("ftp://user2@localhost:" + port + "/%2Fusr/bin;type=d");
             con = url.openConnection();
             in = new BufferedReader(new InputStreamReader(con.getInputStream()));
             do {
--- a/jdk/test/sun/security/pkcs11/ec/ReadCertificates.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/test/sun/security/pkcs11/ec/ReadCertificates.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2014, 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
@@ -23,7 +23,7 @@
 
 /**
  * @test
- * @bug 6405536 6414980
+ * @bug 6405536 6414980 8051972
  * @summary Make sure that we can parse certificates using various named curves
  *   and verify their signatures
  * @author Andreas Sterbenz
@@ -153,8 +153,14 @@
                 signer = getRandomCert(certList);
             } while (cert.getIssuerX500Principal().equals(signer.getSubjectX500Principal()));
             try {
-                cert.verify(signer.getPublicKey());
-                throw new Exception("Verified invalid signature");
+                PublicKey signerPublicKey = signer.getPublicKey();
+                cert.verify(signerPublicKey);
+                // Ignore false positives
+                if (cert.getPublicKey().equals(signerPublicKey)) {
+                    System.out.println("OK: self-signed certificate detected");
+                } else {
+                    throw new Exception("Verified invalid signature");
+                }
             } catch (SignatureException e) {
                 System.out.println("OK: " + e);
             } catch (InvalidKeyException e) {
--- a/jdk/test/tools/launcher/TestSpecialArgs.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/jdk/test/tools/launcher/TestSpecialArgs.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2014, 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
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 7124089 7131021
+ * @bug 7124089 7131021 8042469
  * @summary Checks for MacOSX specific flags are accepted or rejected, and
  *          MacOSX platforms specific environment is consistent.
  * @compile -XDignore.symbol.file TestSpecialArgs.java EnvironmentVariables.java
@@ -69,6 +69,137 @@
                 throw new RuntimeException("Error: argument was accepted ????");
             }
         }
+
+        /*
+         * test argument : -XX:NativeMemoryTracking=value
+         * A JVM flag, comsumed by the JVM, but requiring launcher
+         * to set an environmental variable if and only if value is supplied.
+         * Test and order:
+         * 1) execute with valid parameter: -XX:NativeMemoryTracking=MyValue
+         *    a) check for correct env variable name: "NMT_LEVEL_" + pid
+         *    b) check that "MyValue" was found in local env.
+         * 2) execute with invalid parameter: -XX:NativeMemoryTracking=
+         *    !) Won't find "NativeMemoryTracking:"
+         *       Code to create env variable not executed.
+         * 3) execute with invalid parameter: -XX:NativeMemoryTracking
+         *    !) Won't find "NativeMemoryTracking:"
+         *       Code to create env variable not executed.
+         * 4) give and invalid value and check to make sure JVM commented
+         */
+        { // NativeMemoryTracking
+            String launcherPidString = "launcher.pid=";
+            String envVarPidString = "TRACER_MARKER: NativeMemoryTracking: env var is NMT_LEVEL_";
+            String NMT_Option_Value = "off";
+            String myClassName = "helloworld";
+            boolean haveLauncherPid = false;
+
+            // === Run the tests ===
+
+            // ---Test 1a
+            tr = doExec(envMap,javaCmd, "-XX:NativeMemoryTracking=" + NMT_Option_Value,
+                        "-version");
+
+            // get the PID from the env var we set for the JVM
+            String envVarPid = null;
+            for (String line : tr.testOutput) {
+                if (line.contains(envVarPidString)) {
+                    int sindex = envVarPidString.length();
+                    envVarPid = line.substring(sindex);
+                    break;
+                }
+            }
+            // did we find envVarPid?
+            if (envVarPid == null) {
+                System.out.println(tr);
+                throw new RuntimeException("Error: failed to find env Var Pid in tracking info");
+            }
+            // we think we found the pid string.  min test, not "".
+            if (envVarPid.length() < 1) {
+                System.out.println(tr);
+                throw new RuntimeException("Error: env Var Pid in tracking info is empty string");
+            }
+
+            /*
+             * On Linux, Launcher Tracking will print the PID.  Use this info
+             * to validate what we got as the PID in the Launcher itself.
+             * Linux is the only one that prints this, and trying to get it
+             * here for win is awful.  So let the linux test make sure we get
+             * the valid pid, and for non-linux, just make sure pid string is
+             * non-zero.
+             */
+            if (isLinux) {
+                // get what the test says is the launcher pid
+                String launcherPid = null;
+                for (String line : tr.testOutput) {
+                    int index = line.indexOf(launcherPidString);
+                    if (index >= 0) {
+                        int sindex = index + launcherPidString.length();
+                        int tindex = sindex + line.substring(sindex).indexOf("'");
+                        System.out.println("DEBUG INFO: sindex = " + sindex);
+                        System.out.println("DEBUG INFO: searching substring: " + line.substring(sindex));
+                        System.out.println("DEBUG INFO: tindex = " + tindex);
+                        // DEBUG INFO
+                        System.out.println(tr);
+                        launcherPid = line.substring(sindex, tindex);
+                        break;
+                    }
+                }
+                if (launcherPid == null) {
+                    System.out.println(tr);
+                    throw new RuntimeException("Error: failed to find launcher Pid in launcher tracking info");
+                }
+
+                // did we create the env var with the correct pid?
+                if (!launcherPid.equals(envVarPid)) {
+                    System.out.println(tr);
+                    System.out.println("Error: wrong pid in creating env var");
+                    System.out.println("Error Info: launcherPid = " + launcherPid);
+                    System.out.println("Error Info: envVarPid   = " + envVarPid);
+                    throw new RuntimeException("Error: wrong pid in creating env var");
+                }
+            }
+
+
+            // --- Test 1b
+            if (!tr.contains("NativeMemoryTracking: got value " + NMT_Option_Value)) {
+                System.out.println(tr);
+                throw new RuntimeException("Error: Valid param failed to set env variable");
+            }
+
+            // --- Test 2
+            tr = doExec(envMap,javaCmd, "-XX:NativeMemoryTracking=",
+                        "-version");
+            if (tr.contains("NativeMemoryTracking:")) {
+                System.out.println(tr);
+                throw new RuntimeException("Error: invalid param caused env variable to be erroneously created");
+            }
+            if (!tr.contains("Syntax error, expecting -XX:NativeMemoryTracking=")) {
+                System.out.println(tr);
+                throw new RuntimeException("Error: invalid param not checked by JVM");
+            }
+
+            // --- Test 3
+            tr = doExec(envMap,javaCmd, "-XX:NativeMemoryTracking",
+                        "-version");
+            if (tr.contains("NativeMemoryTracking:")) {
+                System.out.println(tr);
+                throw new RuntimeException("Error: invalid param caused env variable to be erroneously created");
+            }
+            if (!tr.contains("Syntax error, expecting -XX:NativeMemoryTracking=")) {
+                System.out.println(tr);
+                throw new RuntimeException("Error: invalid param not checked by JVM");
+            }
+            // --- Test 4
+            tr = doExec(envMap,javaCmd, "-XX:NativeMemoryTracking=BADVALUE",
+                        "-version");
+            if (!tr.contains("expecting -XX:NativeMemoryTracking")) {
+                System.out.println(tr);
+                throw new RuntimeException("Error: invalid param did not get JVM Syntax error message");
+            }
+
+        } // NativeMemoryTracking
+
+
         // MacOSX specific tests ensue......
         if (!isMacOSX)
             return;
--- a/langtools/.hgtags	Wed Jul 05 19:52:35 2017 +0200
+++ b/langtools/.hgtags	Wed Jul 05 19:53:51 2017 +0200
@@ -267,3 +267,4 @@
 aca19c52b24627a6b085cfeb433051a3e420cd81 jdk9-b22
 0402a91cd14b530b6e98452341ff853717948239 jdk9-b23
 980b18627fd3f4936be2d9e2b013abb461cb2ddb jdk9-b24
+d60b572d759449913d02478219ad87e0574a3909 jdk9-b25
--- a/langtools/make/build.properties	Wed Jul 05 19:52:35 2017 +0200
+++ b/langtools/make/build.properties	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2007, 2014, 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
@@ -168,6 +168,8 @@
 sjavac.tests = \
         tools/sjavac
 
+crules.tests = ../make/test/crules
+
 #
 
 # The following files require the latest JDK to be available.
--- a/langtools/make/build.xml	Wed Jul 05 19:52:35 2017 +0200
+++ b/langtools/make/build.xml	Wed Jul 05 19:53:51 2017 +0200
@@ -760,7 +760,8 @@
     **** crules targets.
     -->
 
-    <target name="build-crules" depends="-def-compilecrules,-def-build-jar-with-services">
+    <target name="build-crules"
+            depends="-def-compilecrules,-def-build-jar-with-services,build-bootstrap-javac,-create-import-jdk-stubs">
         <compilecrules/>
         <build-jar-with-services
                     name="crules"
@@ -770,13 +771,19 @@
                     jarmainclass=""
                     jarclasspath="crules.jar"
                     service.type="com.sun.source.util.Plugin"
-                    service.provider="crules.MutableFieldsAnalyzer"/>
+                    service.provider="crules.CodingRulesAnalyzerPlugin"/>
         <build-tool name="crules"/>
     </target>
 
+    <target name="jtreg-crules" depends="build-javac,build-crules,-def-jtreg">
+        <jtreg-tool name="crules"
+                    tests="${crules.tests}"
+                    extra.jvmargs="-Xbootclasspath/a:${build.toolclasses.dir}/crules.jar" />
+    </target>
+
     <target name="check-coding-rules" depends="build-bootstrap-javac,-create-import-jdk-stubs,build-crules">
         <build-classes includes="${javac.includes}"
-            plugin.options="-J-Xbootclasspath/a:${build.toolclasses.dir}/crules.jar -Xplugin:mutable_fields_analyzer" />
+            plugin.options="-J-Xbootclasspath/a:${build.toolclasses.dir}/crules.jar -Xplugin:coding_rules" />
     </target>
 
     <!--
@@ -1150,6 +1157,7 @@
             <attribute name="options" default="${other.jtreg.options}"/>
             <attribute name="keywords" default="-keywords:!ignore"/>
             <attribute name="jpda.jvmargs" default=""/>
+            <attribute name="extra.jvmargs" default=""/>
             <sequential>
                 <property name="coverage.options" value=""/>              <!-- default -->
                 <property name="coverage.classpath" value=""/>            <!-- default -->
@@ -1163,7 +1171,7 @@
                     samevm="@{samevm}" verbose="@{verbose}"
                     failonerror="false" resultproperty="jtreg.@{name}.result"
                     javacoptions="-g"
-                    vmoptions="${coverage.options} -Xbootclasspath/p:${coverage.classpath}${path.separator}${build.classes.dir} @{jpda.jvmargs}">
+                    vmoptions="${coverage.options} -Xbootclasspath/p:${coverage.classpath}${path.separator}${build.classes.dir} @{jpda.jvmargs} @{extra.jvmargs}">
                     <arg line="@{keywords}"/>
                     <arg line="@{options}"/>
                     <arg line="@{tests}"/>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/make/test/crules/CodingRulesAnalyzerPlugin/Test.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,11 @@
+/**@test /nodynamiccopyright/
+ * @compile/fail/ref=Test.out -Xplugin:coding_rules -XDrawDiagnostics Test.java
+ */
+
+import com.sun.tools.javac.util.Assert;
+
+public class Test {
+    public void check(String value) {
+        Assert.check(value.trim().length() > 0, "value=" + value);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/make/test/crules/CodingRulesAnalyzerPlugin/Test.out	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,2 @@
+Test.java:9:21: compiler.err.proc.messager: compiler.misc.crules.should.not.use.string.concatenation
+1 error
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/make/test/crules/MutableFieldsAnalyzer/Test.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,9 @@
+/**@test /nodynamiccopyright/
+ * @compile/fail/ref=Test.out -Xplugin:coding_rules -XDrawDiagnostics Test.java
+ */
+
+package com.sun.tools.javac;
+
+public class Test {
+    public static String mutable;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/make/test/crules/MutableFieldsAnalyzer/Test.out	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,2 @@
+Test.java:8:26: compiler.err.proc.messager: compiler.misc.crules.err.var.must.be.final: public static String mutable
+1 error
--- a/langtools/make/tools/crules/AbstractCodingRulesAnalyzer.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/langtools/make/tools/crules/AbstractCodingRulesAnalyzer.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, 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,64 +27,43 @@
 import java.util.Locale;
 import java.util.ResourceBundle;
 
-import javax.lang.model.element.TypeElement;
-import javax.tools.JavaFileObject;
-
-import com.sun.source.tree.Tree;
 import com.sun.source.util.JavacTask;
-import com.sun.source.util.Plugin;
-import com.sun.source.util.TaskEvent;
-import com.sun.source.util.TaskListener;
-import com.sun.source.util.Trees;
 import com.sun.tools.javac.api.BasicJavacTask;
+import com.sun.tools.javac.code.Symtab;
 import com.sun.tools.javac.tree.JCTree;
 import com.sun.tools.javac.tree.TreeScanner;
 import com.sun.tools.javac.util.Context;
+import com.sun.tools.javac.util.JCDiagnostic;
+import com.sun.tools.javac.util.JCDiagnostic.DiagnosticType;
 import com.sun.tools.javac.util.Log;
+import com.sun.tools.javac.util.Options;
+import com.sun.tools.javac.util.RawDiagnosticFormatter;
 
 import static com.sun.source.util.TaskEvent.Kind;
 
-public abstract class AbstractCodingRulesAnalyzer implements Plugin {
+public abstract class AbstractCodingRulesAnalyzer {
 
-    protected Log log;
-    protected Trees trees;
+    private   final Log log;
+    private   final boolean rawDiagnostics;
+    private   final JCDiagnostic.Factory diags;
+    private   final Options options;
+    protected final Messages messages;
+    protected final Symtab syms;
     protected TreeScanner treeVisitor;
     protected Kind eventKind;
-    protected Messages messages;
 
-    public void init(JavacTask task, String... args) {
+    public AbstractCodingRulesAnalyzer(JavacTask task) {
         BasicJavacTask impl = (BasicJavacTask)task;
         Context context = impl.getContext();
         log = Log.instance(context);
-        trees = Trees.instance(task);
+        options = Options.instance(context);
+        rawDiagnostics = options.isSet("rawDiagnostics");
+        diags = JCDiagnostic.Factory.instance(context);
         messages = new Messages();
-        task.addTaskListener(new PostAnalyzeTaskListener());
+        syms = Symtab.instance(context);
     }
 
-    public class PostAnalyzeTaskListener implements TaskListener {
-
-        @Override
-        public void started(TaskEvent taskEvent) {}
-
-        @Override
-        public void finished(TaskEvent taskEvent) {
-            if (taskEvent.getKind().equals(eventKind)) {
-                TypeElement typeElem = taskEvent.getTypeElement();
-                Tree tree = trees.getTree(typeElem);
-                if (tree != null) {
-                    JavaFileObject prevSource = log.currentSourceFile();
-                    try {
-                        log.useSource(taskEvent.getCompilationUnit().getSourceFile());
-                        treeVisitor.scan((JCTree)tree);
-                    } finally {
-                        log.useSource(prevSource);
-                    }
-                }
-            }
-        }
-    }
-
-    class Messages {
+    protected class Messages {
         ResourceBundle bundle;
 
         Messages() {
@@ -93,7 +72,14 @@
         }
 
         public void error(JCTree tree, String code, Object... args) {
-            String msg = (code == null) ? (String) args[0] : localize(code, args);
+            String msg;
+            if (rawDiagnostics) {
+                RawDiagnosticFormatter f = new RawDiagnosticFormatter(options);
+                msg = f.formatMessage(diags.create(DiagnosticType.FRAGMENT, log.currentSource(),
+                                                   tree.pos(), code, args), null);
+            } else {
+                msg = (code == null) ? (String) args[0] : localize(code, args);
+            }
             log.error(tree, "proc.messager", msg.toString());
         }
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/make/tools/crules/AssertCheckAnalyzer.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2013, 2014, 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 crules;
+
+import com.sun.source.util.JavacTask;
+import com.sun.source.util.TaskEvent.Kind;
+import com.sun.tools.javac.code.Symbol;
+import com.sun.tools.javac.tree.JCTree.JCExpression;
+import com.sun.tools.javac.tree.JCTree.JCMethodInvocation;
+import com.sun.tools.javac.tree.JCTree.Tag;
+import com.sun.tools.javac.tree.TreeInfo;
+import com.sun.tools.javac.tree.TreeScanner;
+import com.sun.tools.javac.util.Assert;
+
+public class AssertCheckAnalyzer extends AbstractCodingRulesAnalyzer {
+
+    public AssertCheckAnalyzer(JavacTask task) {
+        super(task);
+        treeVisitor = new AssertCheckVisitor();
+        eventKind = Kind.ANALYZE;
+    }
+
+    class AssertCheckVisitor extends TreeScanner {
+
+        @Override
+        public void visitApply(JCMethodInvocation tree) {
+            Symbol method = TreeInfo.symbolFor(tree);
+            if (method != null &&
+                method.owner.getQualifiedName().contentEquals(Assert.class.getName()) &&
+                !method.name.contentEquals("error")) {
+                JCExpression lastParam = tree.args.last();
+                if (lastParam != null &&
+                    lastParam.type.tsym == syms.stringType.tsym &&
+                    lastParam.hasTag(Tag.PLUS)) {
+                    messages.error(tree, "crules.should.not.use.string.concatenation");
+                }
+            }
+
+            super.visitApply(tree);
+        }
+
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/make/tools/crules/CodingRulesAnalyzerPlugin.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,107 @@
+/*
+ * Copyright (c) 2013, 2014, 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 crules;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.lang.model.element.TypeElement;
+import javax.tools.JavaFileObject;
+
+import com.sun.source.tree.Tree;
+import com.sun.source.util.JavacTask;
+import com.sun.source.util.Plugin;
+import com.sun.source.util.TaskEvent;
+import com.sun.source.util.TaskEvent.Kind;
+import com.sun.source.util.TaskListener;
+import com.sun.source.util.Trees;
+import com.sun.tools.javac.api.BasicJavacTask;
+import com.sun.tools.javac.tree.JCTree;
+import com.sun.tools.javac.util.Context;
+import com.sun.tools.javac.util.Log;
+
+public class CodingRulesAnalyzerPlugin implements Plugin {
+
+    protected Log log;
+    protected Trees trees;
+
+    public void init(JavacTask task, String... args) {
+        BasicJavacTask impl = (BasicJavacTask)task;
+        Context context = impl.getContext();
+        log = Log.instance(context);
+        trees = Trees.instance(task);
+        task.addTaskListener(new PostAnalyzeTaskListener(
+                new MutableFieldsAnalyzer(task),
+                new AssertCheckAnalyzer(task)
+        ));
+    }
+
+    public class PostAnalyzeTaskListener implements TaskListener {
+        private final Map<Kind, List<AbstractCodingRulesAnalyzer>> analyzers = new HashMap<>();
+
+        public PostAnalyzeTaskListener(AbstractCodingRulesAnalyzer... analyzers) {
+            for (AbstractCodingRulesAnalyzer analyzer : analyzers) {
+                List<AbstractCodingRulesAnalyzer> currentAnalyzers = this.analyzers.get(analyzer.eventKind);
+
+                if (currentAnalyzers == null) {
+                    this.analyzers.put(analyzer.eventKind, currentAnalyzers = new ArrayList<>());
+                }
+
+                currentAnalyzers.add(analyzer);
+            }
+        }
+
+        @Override
+        public void started(TaskEvent taskEvent) {}
+
+        @Override
+        public void finished(TaskEvent taskEvent) {
+            List<AbstractCodingRulesAnalyzer> currentAnalyzers = this.analyzers.get(taskEvent.getKind());
+
+            if (currentAnalyzers != null) {
+                TypeElement typeElem = taskEvent.getTypeElement();
+                Tree tree = trees.getTree(typeElem);
+                if (tree != null) {
+                    JavaFileObject prevSource = log.currentSourceFile();
+                    try {
+                        log.useSource(taskEvent.getCompilationUnit().getSourceFile());
+                        for (AbstractCodingRulesAnalyzer analyzer : currentAnalyzers) {
+                            analyzer.treeVisitor.scan((JCTree)tree);
+                        }
+                    } finally {
+                        log.useSource(prevSource);
+                    }
+                }
+            }
+        }
+    }
+
+    @Override
+    public String getName() {
+        return "coding_rules";
+    }
+
+}
--- a/langtools/make/tools/crules/MutableFieldsAnalyzer.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/langtools/make/tools/crules/MutableFieldsAnalyzer.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, 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,24 +28,25 @@
 import java.util.List;
 import java.util.Map;
 
+import com.sun.source.util.JavacTask;
+import com.sun.source.util.TaskEvent.Kind;
 import com.sun.tools.javac.code.Kinds;
+import com.sun.tools.javac.tree.JCTree.JCVariableDecl;
 import com.sun.tools.javac.tree.TreeScanner;
 
-import static com.sun.source.util.TaskEvent.Kind;
-import static com.sun.tools.javac.code.Flags.*;
-import static com.sun.tools.javac.tree.JCTree.JCVariableDecl;
+import static com.sun.tools.javac.code.Flags.ENUM;
+import static com.sun.tools.javac.code.Flags.FINAL;
+import static com.sun.tools.javac.code.Flags.STATIC;
+import static com.sun.tools.javac.code.Flags.SYNTHETIC;
 
 public class MutableFieldsAnalyzer extends AbstractCodingRulesAnalyzer {
 
-    public MutableFieldsAnalyzer() {
+    public MutableFieldsAnalyzer(JavacTask task) {
+        super(task);
         treeVisitor = new MutableFieldsVisitor();
         eventKind = Kind.ANALYZE;
     }
 
-    public String getName() {
-        return "mutable_fields_analyzer";
-    }
-
     private boolean ignoreField(String className, String field) {
         List<String> currentFieldsToIgnore =
                 classFieldsToIgnoreMap.get(className);
@@ -89,7 +90,7 @@
     private static final String packageToCheck = "com.sun.tools.javac";
 
     private static final Map<String, List<String>> classFieldsToIgnoreMap =
-                new HashMap<String, List<String>>();
+                new HashMap<>();
 
     static {
         classFieldsToIgnoreMap.
--- a/langtools/make/tools/crules/resources/crules.properties	Wed Jul 05 19:52:35 2017 +0200
+++ b/langtools/make/tools/crules/resources/crules.properties	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2013, 2014, 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,3 +26,5 @@
 # 0: symbol
 crules.err.var.must.be.final=\
     Static variable {0} must be final
+crules.should.not.use.string.concatenation=\
+    Should not use string concatenation.
--- a/langtools/src/share/classes/com/sun/tools/javac/code/ClassFinder.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/ClassFinder.java	Wed Jul 05 19:53:51 2017 +0200
@@ -103,6 +103,10 @@
      */
     private final JavaFileManager fileManager;
 
+    /** Dependency tracker
+     */
+    private final Dependencies dependencies;
+
     /** Factory for diagnostics
      */
     JCDiagnostic.Factory diagFactory;
@@ -150,6 +154,7 @@
         names = Names.instance(context);
         syms = Symtab.instance(context);
         fileManager = context.get(JavaFileManager.class);
+        dependencies = Dependencies.instance(context);
         if (fileManager == null)
             throw new AssertionError("FileManager initialization error");
         diagFactory = JCDiagnostic.Factory.instance(context);
@@ -179,18 +184,23 @@
      */
     private void complete(Symbol sym) throws CompletionFailure {
         if (sym.kind == TYP) {
-            ClassSymbol c = (ClassSymbol)sym;
-            c.members_field = new Scope.ErrorScope(c); // make sure it's always defined
-            annotate.enterStart();
             try {
-                completeOwners(c.owner);
-                completeEnclosing(c);
+                ClassSymbol c = (ClassSymbol) sym;
+                dependencies.push(c);
+                c.members_field = new Scope.ErrorScope(c); // make sure it's always defined
+                annotate.enterStart();
+                try {
+                    completeOwners(c.owner);
+                    completeEnclosing(c);
+                } finally {
+                    // The flush needs to happen only after annotations
+                    // are filled in.
+                    annotate.enterDoneWithoutFlush();
+                }
+                fillIn(c);
             } finally {
-                // The flush needs to happen only after annotations
-                // are filled in.
-                annotate.enterDoneWithoutFlush();
+                dependencies.pop();
             }
-            fillIn(c);
         } else if (sym.kind == PCK) {
             PackageSymbol p = (PackageSymbol)sym;
             try {
@@ -257,7 +267,6 @@
                                                         + classfile.toUri());
                     }
                 }
-                return;
             } finally {
                 currentClassFile = previousClassFile;
             }
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Flags.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Flags.java	Wed Jul 05 19:53:51 2017 +0200
@@ -66,7 +66,7 @@
                 flags &= ~flag.value;
             }
         }
-        Assert.check(flags == 0, "Flags parameter contains unknown flags " + flags);
+        Assert.check(flags == 0);
         return flagSet;
     }
 
--- a/langtools/src/share/classes/com/sun/tools/javac/code/TypeAnnotationPosition.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/TypeAnnotationPosition.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -67,22 +67,19 @@
         private TypePathEntry(TypePathEntryKind tag) {
             Assert.check(tag == TypePathEntryKind.ARRAY ||
                     tag == TypePathEntryKind.INNER_TYPE ||
-                    tag == TypePathEntryKind.WILDCARD,
-                    "Invalid TypePathEntryKind: " + tag);
+                    tag == TypePathEntryKind.WILDCARD);
             this.tag = tag;
             this.arg = 0;
         }
 
         public TypePathEntry(TypePathEntryKind tag, int arg) {
-            Assert.check(tag == TypePathEntryKind.TYPE_ARGUMENT,
-                    "Invalid TypePathEntryKind: " + tag);
+            Assert.check(tag == TypePathEntryKind.TYPE_ARGUMENT);
             this.tag = tag;
             this.arg = arg;
         }
 
         public static TypePathEntry fromBinary(int tag, int arg) {
-            Assert.check(arg == 0 || tag == TypePathEntryKind.TYPE_ARGUMENT.tag,
-                    "Invalid TypePathEntry tag/arg: " + tag + "/" + arg);
+            Assert.check(arg == 0 || tag == TypePathEntryKind.TYPE_ARGUMENT.tag);
             switch (tag) {
             case 0:
                 return ARRAY;
@@ -351,7 +348,7 @@
         Iterator<Integer> iter = list.iterator();
         while (iter.hasNext()) {
             Integer fst = iter.next();
-            Assert.check(iter.hasNext(), "Could not decode type path: " + list);
+            Assert.check(iter.hasNext());
             Integer snd = iter.next();
             loc = loc.append(TypePathEntry.fromBinary(fst, snd));
         }
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java	Wed Jul 05 19:53:51 2017 +0200
@@ -49,6 +49,7 @@
 import com.sun.tools.javac.tree.JCTree.*;
 import com.sun.tools.javac.tree.JCTree.JCPolyExpression.*;
 import com.sun.tools.javac.util.*;
+import com.sun.tools.javac.util.Dependencies.AttributionKind;
 import com.sun.tools.javac.util.JCDiagnostic.DiagnosticPosition;
 import com.sun.tools.javac.util.List;
 import static com.sun.tools.javac.code.Flags.*;
@@ -94,6 +95,7 @@
     final Annotate annotate;
     final DeferredLintHandler deferredLintHandler;
     final TypeEnvs typeEnvs;
+    final Dependencies dependencies;
 
     public static Attr instance(Context context) {
         Attr instance = context.get(attrKey);
@@ -123,6 +125,7 @@
         annotate = Annotate.instance(context);
         deferredLintHandler = DeferredLintHandler.instance(context);
         typeEnvs = TypeEnvs.instance(context);
+        dependencies = Dependencies.instance(context);
 
         Options options = Options.instance(context);
 
@@ -254,7 +257,7 @@
      *  @param env    The current environment.
      */
     boolean isAssignableAsBlankFinal(VarSymbol v, Env<AttrContext> env) {
-        Symbol owner = owner(env);
+        Symbol owner = env.info.scope.owner;
            // owner refers to the innermost variable, method or
            // initializer block declaration at this point.
         return
@@ -269,41 +272,6 @@
              ((v.flags() & STATIC) != 0) == Resolve.isStatic(env));
     }
 
-    /**
-     * Return the innermost enclosing owner symbol in a given attribution context
-     */
-    Symbol owner(Env<AttrContext> env) {
-        while (true) {
-            switch (env.tree.getTag()) {
-                case VARDEF:
-                    //a field can be owner
-                    VarSymbol vsym = ((JCVariableDecl)env.tree).sym;
-                    if (vsym.owner.kind == TYP) {
-                        return vsym;
-                    }
-                    break;
-                case METHODDEF:
-                    //method def is always an owner
-                    return ((JCMethodDecl)env.tree).sym;
-                case CLASSDEF:
-                    //class def is always an owner
-                    return ((JCClassDecl)env.tree).sym;
-                case BLOCK:
-                    //static/instance init blocks are owner
-                    Symbol blockSym = env.info.scope.owner;
-                    if ((blockSym.flags() & BLOCK) != 0) {
-                        return blockSym;
-                    }
-                    break;
-                case TOPLEVEL:
-                    //toplevel is always an owner (for pkge decls)
-                    return env.info.scope.owner;
-            }
-            Assert.checkNonNull(env.next);
-            env = env.next;
-        }
-    }
-
     /** Check that variable can be assigned to.
      *  @param pos    The current source code position.
      *  @param v      The assigned varaible
@@ -695,6 +663,7 @@
      */
     void attribTypeVariables(List<JCTypeParameter> typarams, Env<AttrContext> env) {
         for (JCTypeParameter tvar : typarams) {
+            dependencies.push(AttributionKind.TVAR, tvar);
             TypeVar a = (TypeVar)tvar.type;
             a.tsym.flags_field |= UNATTRIBUTED;
             a.bound = Type.noType;
@@ -710,6 +679,7 @@
                 types.setBounds(a, List.of(syms.objectType));
             }
             a.tsym.flags_field &= ~UNATTRIBUTED;
+            dependencies.pop();
         }
         for (JCTypeParameter tvar : typarams) {
             chk.checkNonCyclic(tvar.pos(), (TypeVar)tvar.type);
@@ -3815,7 +3785,7 @@
             // and are subject to definite assignment checking.
             if ((env.info.enclVar == v || v.pos > tree.pos) &&
                 v.owner.kind == TYP &&
-                canOwnInitializer(owner(env)) &&
+                enclosingInitEnv(env) != null &&
                 v.owner == env.info.scope.owner.enclClass() &&
                 ((v.flags() & STATIC) != 0) == Resolve.isStatic(env) &&
                 (!env.tree.hasTag(ASSIGN) ||
@@ -3835,6 +3805,36 @@
         }
 
         /**
+         * Returns the enclosing init environment associated with this env (if any). An init env
+         * can be either a field declaration env or a static/instance initializer env.
+         */
+        Env<AttrContext> enclosingInitEnv(Env<AttrContext> env) {
+            while (true) {
+                switch (env.tree.getTag()) {
+                    case VARDEF:
+                        JCVariableDecl vdecl = (JCVariableDecl)env.tree;
+                        if (vdecl.sym.owner.kind == TYP) {
+                            //field
+                            return env;
+                        }
+                        break;
+                    case BLOCK:
+                        if (env.next.tree.hasTag(CLASSDEF)) {
+                            //instance/static initializer
+                            return env;
+                        }
+                        break;
+                    case METHODDEF:
+                    case CLASSDEF:
+                    case TOPLEVEL:
+                        return null;
+                }
+                Assert.checkNonNull(env.next);
+                env = env.next;
+            }
+        }
+
+        /**
          * Check for illegal references to static members of enum.  In
          * an enum type, constructors and initializers may not
          * reference its static members unless they are constant.
@@ -3887,17 +3887,6 @@
                    v.name != names._class;
         }
 
-        /** Can the given symbol be the owner of code which forms part
-         *  if class initialization? This is the case if the symbol is
-         *  a type or field, or if the symbol is the synthetic method.
-         *  owning a block.
-         */
-        private boolean canOwnInitializer(Symbol sym) {
-            return
-                (sym.kind & (VAR | TYP)) != 0 ||
-                (sym.kind == MTH && (sym.flags() & BLOCK) != 0);
-        }
-
     Warner noteWarner = new Warner();
 
     /**
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Check.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Check.java	Wed Jul 05 19:53:51 2017 +0200
@@ -2765,7 +2765,7 @@
     }
 
     public void validateTypeAnnotation(JCAnnotation a, boolean isTypeParameter) {
-        Assert.checkNonNull(a.type, "annotation tree hasn't been attributed yet: " + a);
+        Assert.checkNonNull(a.type);
         validateAnnotationTree(a);
 
         if (a.hasTag(TYPE_ANNOTATION) &&
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Infer.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Infer.java	Wed Jul 05 19:53:51 2017 +0200
@@ -29,6 +29,7 @@
 import com.sun.tools.javac.tree.JCTree.JCTypeCast;
 import com.sun.tools.javac.tree.TreeInfo;
 import com.sun.tools.javac.util.*;
+import com.sun.tools.javac.util.GraphUtils.DottableNode;
 import com.sun.tools.javac.util.JCDiagnostic.DiagnosticPosition;
 import com.sun.tools.javac.util.List;
 import com.sun.tools.javac.code.*;
@@ -40,9 +41,9 @@
 import com.sun.tools.javac.comp.Infer.GraphSolver.InferenceGraph.Node;
 import com.sun.tools.javac.comp.Resolve.InapplicableMethodException;
 import com.sun.tools.javac.comp.Resolve.VerboseResolutionMode;
-import com.sun.tools.javac.util.GraphUtils.TarjanNode;
 
 import java.util.ArrayList;
+import java.util.Collection;
 import java.util.Collections;
 import java.util.EnumMap;
 import java.util.EnumSet;
@@ -50,6 +51,7 @@
 import java.util.HashSet;
 import java.util.LinkedHashSet;
 import java.util.Map;
+import java.util.Properties;
 import java.util.Set;
 
 import static com.sun.tools.javac.code.TypeTag.*;
@@ -1607,11 +1609,6 @@
         private DependencyKind(String dotSyle) {
             this.dotSyle = dotSyle;
         }
-
-        @Override
-        public String getDotStyle() {
-            return dotSyle;
-        }
     }
 
     /**
@@ -1684,7 +1681,7 @@
              * updates on the structure of the graph this node belongs to (used to
              * keep dependencies in sync).
              */
-            class Node extends GraphUtils.TarjanNode<ListBuffer<Type>> {
+            class Node extends GraphUtils.TarjanNode<ListBuffer<Type>, Node> implements DottableNode<ListBuffer<Type>, Node> {
 
                 /** map listing all dependencies (grouped by kind) */
                 EnumMap<DependencyKind, Set<Node>> deps;
@@ -1699,33 +1696,12 @@
                     return DependencyKind.values();
                 }
 
-                @Override
-                public String getDependencyName(GraphUtils.Node<ListBuffer<Type>> to, GraphUtils.DependencyKind dk) {
-                    if (dk == DependencyKind.STUCK) return "";
-                    else {
-                        StringBuilder buf = new StringBuilder();
-                        String sep = "";
-                        for (Type from : data) {
-                            UndetVar uv = (UndetVar)inferenceContext.asUndetVar(from);
-                            for (Type bound : uv.getBounds(InferenceBound.values())) {
-                                if (bound.containsAny(List.from(to.data))) {
-                                    buf.append(sep);
-                                    buf.append(bound);
-                                    sep = ",";
-                                }
-                            }
-                        }
-                        return buf.toString();
-                    }
-                }
-
-                @Override
                 public Iterable<? extends Node> getAllDependencies() {
                     return getDependencies(DependencyKind.values());
                 }
 
                 @Override
-                public Iterable<? extends TarjanNode<ListBuffer<Type>>> getDependenciesByKind(GraphUtils.DependencyKind dk) {
+                public Collection<? extends Node> getDependenciesByKind(GraphUtils.DependencyKind dk) {
                     return getDependencies((DependencyKind)dk);
                 }
 
@@ -1855,6 +1831,36 @@
                         }
                     }
                 }
+
+                @Override
+                public Properties nodeAttributes() {
+                    Properties p = new Properties();
+                    p.put("label", toString());
+                    return p;
+                }
+
+                @Override
+                public Properties dependencyAttributes(Node sink, GraphUtils.DependencyKind dk) {
+                    Properties p = new Properties();
+                    p.put("style", ((DependencyKind)dk).dotSyle);
+                    if (dk == DependencyKind.STUCK) return p;
+                    else {
+                        StringBuilder buf = new StringBuilder();
+                        String sep = "";
+                        for (Type from : data) {
+                            UndetVar uv = (UndetVar)inferenceContext.asUndetVar(from);
+                            for (Type bound : uv.getBounds(InferenceBound.values())) {
+                                if (bound.containsAny(List.from(sink.data))) {
+                                    buf.append(sep);
+                                    buf.append(bound);
+                                    sep = ",";
+                                }
+                            }
+                        }
+                        p.put("label", buf.toString());
+                    }
+                    return p;
+                }
             }
 
             /** the nodes in the inference graph */
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/MemberEnter.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/MemberEnter.java	Wed Jul 05 19:53:51 2017 +0200
@@ -55,6 +55,7 @@
 import static com.sun.tools.javac.code.TypeTag.TYPEVAR;
 import static com.sun.tools.javac.tree.JCTree.Tag.*;
 
+import com.sun.tools.javac.util.Dependencies.AttributionKind;
 import com.sun.tools.javac.util.JCDiagnostic.DiagnosticFlag;
 import com.sun.tools.javac.util.JCDiagnostic.DiagnosticPosition;
 
@@ -90,6 +91,7 @@
     private final DeferredLintHandler deferredLintHandler;
     private final Lint lint;
     private final TypeEnvs typeEnvs;
+    private final Dependencies dependencies;
 
     public static MemberEnter instance(Context context) {
         MemberEnter instance = context.get(memberEnterKey);
@@ -116,6 +118,7 @@
         deferredLintHandler = DeferredLintHandler.instance(context);
         lint = Lint.instance(context);
         typeEnvs = TypeEnvs.instance(context);
+        dependencies = Dependencies.instance(context);
         allowTypeAnnos = source.allowTypeAnnotations();
     }
 
@@ -555,6 +558,7 @@
 
     // process the non-static imports and the static imports of types.
     public void visitImport(JCImport tree) {
+        dependencies.push(AttributionKind.IMPORT, tree);
         JCFieldAccess imp = (JCFieldAccess)tree.qualid;
         Name name = TreeInfo.name(imp);
 
@@ -581,6 +585,7 @@
                 importNamed(tree.pos(), c, env);
             }
         }
+        dependencies.pop();
     }
 
     public void visitMethodDef(JCMethodDecl tree) {
@@ -952,6 +957,8 @@
         JavaFileObject prev = log.useSource(env.toplevel.sourcefile);
         DiagnosticPosition prevLintPos = deferredLintHandler.setPos(tree.pos());
         try {
+            dependencies.push(c);
+
             // Save class environment for later member enter (2) processing.
             halfcompleted.append(env);
 
@@ -990,16 +997,21 @@
             Type supertype;
 
             if (tree.extending != null) {
-                supertype = attr.attribBase(tree.extending, baseEnv,
-                                            true, false, true);
-                if (sym.isAnonymous()) {
-                    annotate.annotateAnonClassDefLater(tree.extending,
-                                                       tree.mods.annotations,
-                                                       baseEnv, sym, tree.pos(),
-                                                       annotate.extendsCreator);
-                } else {
-                    annotate.annotateTypeLater(tree.extending, baseEnv, sym,
-                                               tree.pos(), annotate.extendsCreator);
+                dependencies.push(AttributionKind.EXTENDS, tree.extending);
+                try {
+                    supertype = attr.attribBase(tree.extending, baseEnv,
+                            true, false, true);
+                    if (sym.isAnonymous()) {
+                        annotate.annotateAnonClassDefLater(tree.extending,
+                                tree.mods.annotations,
+                                baseEnv, sym, tree.pos(),
+                                annotate.extendsCreator);
+                    } else {
+                        annotate.annotateTypeLater(tree.extending, baseEnv, sym,
+                                tree.pos(), annotate.extendsCreator);
+                    }
+                } finally {
+                    dependencies.pop();
                 }
             } else {
                 supertype = ((tree.mods.flags & Flags.ENUM) != 0)
@@ -1018,29 +1030,34 @@
             List<JCExpression> interfaceTrees = tree.implementing;
             int i = 0;
             for (JCExpression iface : interfaceTrees) {
-                Type it = attr.attribBase(iface, baseEnv, false, true, true);
-                if (it.hasTag(CLASS)) {
-                    interfaces.append(it);
-                    if (all_interfaces != null) all_interfaces.append(it);
-                    chk.checkNotRepeated(iface.pos(), types.erasure(it), interfaceSet);
-                } else {
-                    if (all_interfaces == null)
-                        all_interfaces = new ListBuffer<Type>().appendList(interfaces);
-                    all_interfaces.append(modelMissingTypes(it, iface, true));
+                dependencies.push(AttributionKind.IMPLEMENTS, iface);
+                try {
+                    Type it = attr.attribBase(iface, baseEnv, false, true, true);
+                    if (it.hasTag(CLASS)) {
+                        interfaces.append(it);
+                        if (all_interfaces != null) all_interfaces.append(it);
+                        chk.checkNotRepeated(iface.pos(), types.erasure(it), interfaceSet);
+                    } else {
+                        if (all_interfaces == null)
+                            all_interfaces = new ListBuffer<Type>().appendList(interfaces);
+                        all_interfaces.append(modelMissingTypes(it, iface, true));
 
+                    }
+                    if (sym.isAnonymous()) {
+                        // Note: if an anonymous class ever has more than
+                        // one supertype for some reason, this will
+                        // incorrectly attach tree.mods.annotations to ALL
+                        // supertypes, not just the first.
+                        annotate.annotateAnonClassDefLater(iface, tree.mods.annotations,
+                                baseEnv, sym, tree.pos(),
+                                annotate.implementsCreator(i++));
+                    } else {
+                        annotate.annotateTypeLater(iface, baseEnv, sym, tree.pos(),
+                                annotate.implementsCreator(i++));
+                    }
+                } finally {
+                    dependencies.pop();
                 }
-                if (sym.isAnonymous()) {
-                    // Note: if an anonymous class ever has more than
-                    // one supertype for some reason, this will
-                    // incorrectly attach tree.mods.annotations to ALL
-                    // supertypes, not just the first.
-                    annotate.annotateAnonClassDefLater(iface, tree.mods.annotations,
-                                                       baseEnv, sym, tree.pos(),
-                                                       annotate.implementsCreator(i++));
-                } else {
-                    annotate.annotateTypeLater(iface, baseEnv, sym, tree.pos(),
-                                               annotate.implementsCreator(i++));
-            }
             }
 
             if ((c.flags_field & ANNOTATION) != 0) {
@@ -1157,6 +1174,7 @@
         } finally {
             deferredLintHandler.setPos(prevLintPos);
             log.useSource(prev);
+            dependencies.pop();
         }
 
         // Enter all member fields and methods of a set of half completed
--- a/langtools/src/share/classes/com/sun/tools/javac/main/Main.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/langtools/src/share/classes/com/sun/tools/javac/main/Main.java	Wed Jul 05 19:53:51 2017 +0200
@@ -488,6 +488,10 @@
                 }
             }
 
+            if (options.isSet("completionDeps")) {
+                Dependencies.GraphDependencies.preRegister(context);
+            }
+
             comp = JavaCompiler.instance(context);
 
             // FIXME: this code will not be invoked if using JavacTask.parse/analyze/generate
--- a/langtools/src/share/classes/com/sun/tools/javac/util/Assert.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/Assert.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2014, 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,7 +25,6 @@
 
 package com.sun.tools.javac.util;
 
-
 /**
  * Simple facility for unconditional assertions.
  * The methods in this class are described in terms of equivalent assert
@@ -87,7 +86,7 @@
     }
 
     /** Equivalent to
-     *   assert cond : value;
+     *   assert cond : msg;
      */
     public static void check(boolean cond, String msg) {
         if (!cond)
@@ -103,7 +102,7 @@
     }
 
     /** Equivalent to
-     *   assert (o == null) : value;
+     *   assert (o == null) : msg;
      */
     public static void checkNull(Object o, String msg) {
         if (o != null)
@@ -111,7 +110,7 @@
     }
 
     /** Equivalent to
-     *   assert (o != null) : value;
+     *   assert (o != null) : msg;
      */
     public static <T> T checkNonNull(T t, String msg) {
         if (t == null)
--- a/langtools/src/share/classes/com/sun/tools/javac/util/Bits.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/Bits.java	Wed Jul 05 19:53:51 2017 +0200
@@ -183,7 +183,7 @@
      */
     public void incl(int x) {
         Assert.check(currentState != BitsState.UNKNOWN);
-        Assert.check(x >= 0, "Value of x " + x);
+        Assert.check(x >= 0);
         sizeTo((x >>> wordshift) + 1);
         bits[x >>> wordshift] = bits[x >>> wordshift] |
             (1 << (x & wordmask));
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/Dependencies.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,559 @@
+/*
+ * Copyright (c) 2014, 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.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * 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 com.sun.tools.javac.util;
+
+import com.sun.tools.javac.code.Symbol;
+import com.sun.tools.javac.code.Symbol.ClassSymbol;
+import com.sun.tools.javac.code.Symbol.Completer;
+import com.sun.tools.javac.code.Symbol.CompletionFailure;
+import com.sun.tools.javac.main.JavaCompiler;
+import com.sun.tools.javac.tree.JCTree;
+import com.sun.tools.javac.util.GraphUtils.DotVisitor;
+import com.sun.tools.javac.util.GraphUtils.NodeVisitor;
+
+import java.io.Closeable;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.EnumMap;
+import java.util.EnumSet;
+import java.util.HashSet;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+import java.util.Stack;
+
+import javax.tools.JavaFileObject;
+
+/**
+ *  This class is used to track dependencies in the javac symbol completion process.
+ *
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
+ *  This code and its internal interfaces are subject to change or
+ *  deletion without notice.</b>
+ */
+public abstract class Dependencies {
+
+    protected static final Context.Key<Dependencies> dependenciesKey = new Context.Key<>();
+
+    public static Dependencies instance(Context context) {
+        Dependencies instance = context.get(dependenciesKey);
+        if (instance == null) {
+            //use a do-nothing implementation in case no other implementation has been set by preRegister
+            instance = new DummyDependencies(context);
+        }
+        return instance;
+    }
+
+    Dependencies(Context context) {
+        context.put(dependenciesKey, this);
+    }
+
+    /**
+     * This enum models different kinds of attribution actions triggered during
+     * symbol completion.
+     */
+    public enum AttributionKind {
+        /**
+         * Attribution of superclass (i.e. @{code extends} clause).
+         */
+        EXTENDS {
+            @Override
+            String format(JCTree tree) {
+                return "extends " + super.format(tree);
+            }
+        },
+        /**
+         * Attribution of superinterface (i.e. an type in the @{code interface} clause).
+         */
+        IMPLEMENTS {
+            @Override
+            String format(JCTree tree) {
+                return "implements " + super.format(tree);
+            }
+        },
+        /**
+         * Attribution of an import statement
+         */
+        IMPORT,
+        /**
+         * Attribution of type-variable bound
+         */
+        TVAR {
+            @Override
+            String format(JCTree tree) {
+                return "<" + super.format(tree) + ">";
+            }
+        };
+
+        String format(JCTree tree) {
+            return tree.toString();
+        }
+    }
+
+    /**
+     * Push a new completion node on the stack.
+     */
+    abstract public void push(ClassSymbol s);
+
+    /**
+     * Push a new attribution node on the stack.
+     */
+    abstract public void push(AttributionKind ak, JCTree t);
+
+    /**
+     * Remove current dependency node from the stack.
+     */
+    abstract public void pop();
+
+    /**
+     * This class creates a graph of all dependencies as symbols are completed;
+     * when compilation finishes, the resulting dependecy graph is then dumped
+     * onto a dot file. Several options are provided to customise the output of the graph.
+     */
+    public static class GraphDependencies extends Dependencies implements Closeable, Completer {
+
+        /**
+         * set of enabled dependencies modes
+         */
+        private EnumSet<DependenciesMode> dependenciesModes;
+
+        /**
+         * file in which the dependency graph should be written
+         */
+        private String dependenciesFile;
+
+        /**
+         * Register a Context.Factory to create a Dependencies.
+         */
+        public static void preRegister(final Context context) {
+            context.put(dependenciesKey, new Context.Factory<Dependencies>() {
+                public Dependencies make(Context c) {
+                    Dependencies deps = new GraphDependencies(context);
+                    return deps;
+                }
+            });
+        }
+
+        /**
+         * Build a Dependencies instance.
+         */
+        GraphDependencies(Context context) {
+            super(context);
+            Options options = Options.instance(context);
+            //fetch filename
+            String[] modes = options.get("completionDeps").split(",");
+            for (String mode : modes) {
+                if (mode.startsWith("file=")) {
+                    dependenciesFile = mode.substring(5);
+                }
+            }
+            //parse modes
+            dependenciesModes = DependenciesMode.getDependenciesModes(modes);
+            //add to closeables
+            JavaCompiler compiler = JavaCompiler.instance(context);
+            compiler.closeables = compiler.closeables.prepend(this);
+        }
+
+        enum DependenciesMode {
+            SOURCE("source"),
+            CLASS("class"),
+            REDUNDANT("redundant"),
+            SIDE_EFFECTS("side-effects");
+
+            final String opt;
+
+            private DependenciesMode(String opt) {
+                this.opt = opt;
+            }
+
+            /**
+             * This method is used to parse the {@code completionDeps} option.
+             * Possible modes are separated by colon; a mode can be excluded by
+             * prepending '-' to its name. Finally, the special mode 'all' can be used to
+             * add all modes to the resulting enum.
+             */
+            static EnumSet<DependenciesMode> getDependenciesModes(String[] modes) {
+                EnumSet<DependenciesMode> res = EnumSet.noneOf(DependenciesMode.class);
+                Collection<String> args = Arrays.asList(modes);
+                if (args.contains("all")) {
+                    res = EnumSet.allOf(DependenciesMode.class);
+                }
+                for (DependenciesMode mode : values()) {
+                    if (args.contains(mode.opt)) {
+                        res.add(mode);
+                    } else if (args.contains("-" + mode.opt)) {
+                        res.remove(mode);
+                    }
+                }
+                return res;
+            }
+        }
+
+        /**
+         * Class representing a node in the dependency graph. Nodes are of two main
+         * kinds: (i) symbol nodes, corresponding to symbol completion requests
+         * (either from source or classfile); (ii) attribution nodes, corresponding to
+         * attribution actions triggered during (source) completion.
+         */
+        static abstract class Node extends GraphUtils.AbstractNode<String, Node>
+                implements GraphUtils.DottableNode<String, Node> {
+
+            /**
+             * Model the dependencies between nodes.
+             */
+            enum DependencyKind implements GraphUtils.DependencyKind {
+                /**
+                 * standard dependency - i.e. completion of the source node depends
+                 * on completion of the sink node.
+                 */
+                REQUIRES("solid"),
+                /**
+                 * soft dependencies - i.e. completion of the source node depends
+                 * on side-effects of the source node. These dependencies are meant
+                 * to capture the order in which javac processes all dependants of a given node.
+                 */
+                SIDE_EFFECTS("dashed");
+
+                final String dotStyle;
+
+                DependencyKind(String dotStyle) {
+                    this.dotStyle = dotStyle;
+                }
+            }
+
+            /**
+             * dependant nodes grouped by kind
+             */
+            EnumMap<DependencyKind, List<Node>> depsByKind;
+
+            Node(String value) {
+                super(value);
+                this.depsByKind = new EnumMap<>(DependencyKind.class);
+                for (DependencyKind depKind : DependencyKind.values()) {
+                    depsByKind.put(depKind, new ArrayList<Node>());
+                }
+            }
+
+            void addDependency(DependencyKind depKind, Node dep) {
+                List<Node> deps = depsByKind.get(depKind);
+                if (!deps.contains(dep)) {
+                    deps.add(dep);
+                }
+            }
+
+            @Override
+            public boolean equals(Object obj) {
+                return obj instanceof Node &&
+                        data.equals(((Node) obj).data);
+            }
+
+            @Override
+            public int hashCode() {
+                return data.hashCode();
+            }
+
+            @Override
+            public GraphUtils.DependencyKind[] getSupportedDependencyKinds() {
+                return DependencyKind.values();
+            }
+
+            @Override
+            public java.util.Collection<? extends Node> getDependenciesByKind(GraphUtils.DependencyKind dk) {
+                List<Node> deps = depsByKind.get(dk);
+                if (dk == DependencyKind.REQUIRES) {
+                    return deps;
+                } else {
+                    Set<Node> temp = new HashSet<>(deps);
+                    temp.removeAll(depsByKind.get(DependencyKind.REQUIRES));
+                    return temp;
+                }
+            }
+
+            @Override
+            public Properties nodeAttributes() {
+                Properties p = new Properties();
+                p.put("label", DotVisitor.wrap(toString()));
+                return p;
+            }
+
+            @Override
+            public Properties dependencyAttributes(Node to, GraphUtils.DependencyKind dk) {
+                Properties p = new Properties();
+                p.put("style", ((DependencyKind) dk).dotStyle);
+                return p;
+            }
+        }
+
+        /**
+         * This is a dependency node used to model symbol completion requests.
+         * Completion requests can come from either source or class.
+         */
+        static class CompletionNode extends Node {
+
+            /**
+             * Completion kind (source vs. classfile)
+             */
+            enum Kind {
+                /**
+                 * Source completion request
+                 */
+                SOURCE("solid"),
+                /**
+                 * Classfile completion request
+                 */
+                CLASS("dotted");
+
+                final String dotStyle;
+
+                Kind(String dotStyle) {
+                    this.dotStyle = dotStyle;
+                }
+            }
+
+            final Kind ck;
+
+            CompletionNode(ClassSymbol sym) {
+                super(sym.getQualifiedName().toString());
+                //infer completion kind by looking at the symbol fields
+                boolean fromClass = (sym.classfile == null && sym.sourcefile == null) ||
+                        (sym.classfile != null && sym.classfile.getKind() == JavaFileObject.Kind.CLASS);
+                ck = fromClass ?
+                        CompletionNode.Kind.CLASS :
+                        CompletionNode.Kind.SOURCE;
+            }
+
+            @Override
+            public Properties nodeAttributes() {
+                Properties p = super.nodeAttributes();
+                p.put("style", ck.dotStyle);
+                p.put("shape", "ellipse");
+                return p;
+            }
+        }
+
+        /**
+         * This is a dependency node used to model attribution actions triggered during
+         * source symbol completion. The possible kinds of attribution actions are
+         * captured in {@link AttributionNode}.
+         */
+        static class AttributionNode extends Node {
+
+            AttributionNode(AttributionKind ak, JCTree tree) {
+                super(ak.format(tree));
+            }
+
+            @Override
+            public Properties nodeAttributes() {
+                Properties p = super.nodeAttributes();
+                p.put("shape", "box");
+                p.put("style", "solid");
+                return p;
+            }
+        }
+
+        /**
+         * stack of dependency nodes currently being processed
+         */
+        Stack<Node> nodeStack = new Stack<>();
+
+        /**
+         * map containing all dependency nodes seen so far
+         */
+        Map<String, Node> dependencyNodeMap = new LinkedHashMap<>();
+
+        @Override
+        public void push(ClassSymbol s) {
+            Node n = new CompletionNode(s);
+            if (n == push(n)) {
+                s.completer = this;
+            }
+        }
+
+        @Override
+        public void push(AttributionKind ak, JCTree t) {
+            push(new AttributionNode(ak, t));
+        }
+
+        /**
+         * Push a new dependency on the stack.
+         */
+        protected Node push(Node newNode) {
+            Node cachedNode = dependencyNodeMap.get(newNode.data);
+            if (cachedNode == null) {
+                dependencyNodeMap.put(newNode.data, newNode);
+            } else {
+                newNode = cachedNode;
+            }
+            if (!nodeStack.isEmpty()) {
+                Node currentNode = nodeStack.peek();
+                currentNode.addDependency(Node.DependencyKind.REQUIRES, newNode);
+            }
+            nodeStack.push(newNode);
+            return newNode;
+        }
+
+        @Override
+        public void pop() {
+            nodeStack.pop();
+        }
+
+        @Override
+        public void close() throws IOException {
+            if (dependenciesFile != null) {
+                if (!dependenciesModes.contains(DependenciesMode.REDUNDANT)) {
+                    //prune spurious edges
+                    new PruneVisitor().visit(dependencyNodeMap.values(), null);
+                }
+                if (!dependenciesModes.contains(DependenciesMode.CLASS)) {
+                    //filter class completions
+                    new FilterVisitor(CompletionNode.Kind.SOURCE).visit(dependencyNodeMap.values(), null);
+                }
+                if (!dependenciesModes.contains(DependenciesMode.SOURCE)) {
+                    //filter source completions
+                    new FilterVisitor(CompletionNode.Kind.CLASS).visit(dependencyNodeMap.values(), null);
+                }
+                if (dependenciesModes.contains(DependenciesMode.SIDE_EFFECTS)) {
+                    //add side-effects edges
+                    new SideEffectVisitor().visit(dependencyNodeMap.values(), null);
+                }
+                //write to file
+                try (FileWriter fw = new FileWriter(dependenciesFile)) {
+                    fw.append(GraphUtils.toDot(dependencyNodeMap.values(), "CompletionDeps", ""));
+                }
+            }
+        }
+
+        @Override
+        public void complete(Symbol sym) throws CompletionFailure {
+            push((ClassSymbol) sym);
+            pop();
+            sym.completer = this;
+        }
+
+        /**
+         * This visitor is used to generate the special side-effect dependencies
+         * given a graph containing only standard dependencies.
+         */
+        private static class SideEffectVisitor extends NodeVisitor<String, Node, Void> {
+            @Override
+            public void visitNode(Node node, Void arg) {
+                //do nothing
+            }
+
+            @Override
+            public void visitDependency(GraphUtils.DependencyKind dk, Node from, Node to, Void arg) {
+                //if we are adding multiple dependencies to same node
+                //make order explicit via special 'side-effect' dependencies
+                List<Node> deps = from.depsByKind.get(dk);
+                int pos = deps.indexOf(to);
+                if (dk == Node.DependencyKind.REQUIRES && pos > 0) {
+                    to.addDependency(Node.DependencyKind.SIDE_EFFECTS, deps.get(pos - 1));
+                }
+            }
+        }
+
+        /**
+         * This visitor is used to prune the graph from spurious edges using some heuristics.
+         */
+        private static class PruneVisitor extends NodeVisitor<String, Node, Void> {
+            @Override
+            public void visitNode(Node node, Void arg) {
+                //do nothing
+            }
+
+            @Override
+            public void visitDependency(GraphUtils.DependencyKind dk, Node from, Node to, Void arg) {
+                //heuristic - skips dependencies that are likely to be fake
+                if (from.equals(to) ||
+                        from.depsByKind.get(Node.DependencyKind.REQUIRES).contains(to)) {
+                    to.depsByKind.get(dk).remove(from);
+                }
+            }
+        }
+
+        /**
+         * This visitor is used to retain only completion nodes with given kind.
+         */
+        private class FilterVisitor extends NodeVisitor<String, Node, Void> {
+
+            CompletionNode.Kind ck;
+
+            private FilterVisitor(CompletionNode.Kind ck) {
+                this.ck = ck;
+            }
+
+            @Override
+            public void visitNode(Node node, Void arg) {
+                if (node instanceof CompletionNode) {
+                    if (((CompletionNode) node).ck != ck) {
+                        dependencyNodeMap.remove(node.data);
+                    }
+                }
+            }
+
+            @Override
+            public void visitDependency(GraphUtils.DependencyKind dk, Node from, Node to, Void arg) {
+                if (to instanceof CompletionNode) {
+                    if (((CompletionNode) to).ck != ck) {
+                        from.depsByKind.get(dk).remove(to);
+                    }
+                }
+            }
+        }
+    }
+
+    /**
+     * Dummy class to be used when dependencies options are not set. This keeps
+     * performance cost of calling push/pop methods during completion marginally low.
+     */
+    private static class DummyDependencies extends Dependencies {
+
+        private DummyDependencies(Context context) {
+            super(context);
+        }
+
+        @Override
+        public void push(ClassSymbol s) {
+            //do nothing
+        }
+
+        @Override
+        public void push(AttributionKind ak, JCTree t) {
+            //do nothing
+        }
+
+        @Override
+        public void pop() {
+            //do nothing
+        }
+    }
+}
--- a/langtools/src/share/classes/com/sun/tools/javac/util/GraphUtils.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/GraphUtils.java	Wed Jul 05 19:53:51 2017 +0200
@@ -25,6 +25,10 @@
 
 package com.sun.tools.javac.util;
 
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Properties;
+
 /** <p><b>This is NOT part of any supported API.
  *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
@@ -33,25 +37,65 @@
 public class GraphUtils {
 
     /**
-     * Basic interface for defining various dependency kinds. All dependency kinds
-     * must at least support basic capabilities to tell the DOT engine how to render them.
+     * Basic interface for defining various dependency kinds.
+     */
+    public interface DependencyKind { }
+
+    /**
+     * Common superinterfaces to all graph nodes.
      */
-    public interface DependencyKind {
+    public interface Node<D, N extends Node<D, N>> {
+        /**
+         * visitor method.
+         */
+        <A> void accept(NodeVisitor<D, N, A> visitor, A arg);
+    }
+
+    /**
+     * Visitor for graph nodes.
+     */
+    static abstract class NodeVisitor<D, N extends Node<D, N>, A> {
+        /**
+         * Visitor action for nodes.
+         */
+        public abstract void visitNode(N node, A arg);
         /**
-         * Returns the DOT representation (to be used in a {@code style} attribute
-         * that's most suited for this dependency kind.
+         * Visitor action for a dependency between 'from' and 'to' with given kind.
+         */
+        public abstract void visitDependency(DependencyKind dk, N from, N to, A arg);
+
+        /**
+         * Visitor entry point.
          */
-        String getDotStyle();
+        public void visit(Collection<? extends N> nodes, A arg) {
+            for (N n : new ArrayList<>(nodes)) {
+                n.accept(this, arg);
+            }
+        }
+    }
+
+    /**
+     * Optional interface for nodes supporting dot-based representation.
+     */
+    public interface DottableNode<D, N extends DottableNode<D, N>> extends Node<D, N> {
+        /**
+         * Retrieves the set of dot attributes associated with the node.
+         */
+        Properties nodeAttributes();
+        /**
+         * Retrieves the set of dot attributes associated with a given dependency.
+         */
+        Properties dependencyAttributes(N to, DependencyKind dk);
     }
 
     /**
      * This class is a basic abstract class for representing a node.
      * A node is associated with a given data.
      */
-    public static abstract class Node<D> {
+    public static abstract class AbstractNode<D, N extends AbstractNode<D, N>> implements Node<D, N> {
         public final D data;
 
-        public Node(D data) {
+        public AbstractNode(D data) {
             this.data = data;
         }
 
@@ -61,26 +105,32 @@
         public abstract DependencyKind[] getSupportedDependencyKinds();
 
         /**
-         * Get all dependencies, regardless of their kind.
+         * Get all dependencies of a given kind
          */
-        public abstract Iterable<? extends Node<D>> getAllDependencies();
-
-        /**
-         * Get a name for the dependency (of given kind) linking this node to a given node
-         */
-        public abstract String getDependencyName(Node<D> to, DependencyKind dk);
+        public abstract Collection<? extends N> getDependenciesByKind(DependencyKind dk);
 
         @Override
         public String toString() {
             return data.toString();
         }
+
+        @SuppressWarnings("unchecked")
+        public <A> void accept(NodeVisitor<D, N, A> visitor, A arg) {
+            visitor.visitNode((N)this, arg);
+            for (DependencyKind dk : getSupportedDependencyKinds()) {
+                for (N dep : new ArrayList<>(getDependenciesByKind(dk))) {
+                    visitor.visitDependency(dk, (N)this, dep, arg);
+                }
+            }
+        }
     }
 
     /**
      * This class specialized Node, by adding elements that are required in order
      * to perform Tarjan computation of strongly connected components.
      */
-    public static abstract class TarjanNode<D> extends Node<D> implements Comparable<TarjanNode<D>> {
+    public static abstract class TarjanNode<D, N extends TarjanNode<D, N>> extends AbstractNode<D, N>
+            implements Comparable<N> {
         int index = -1;
         int lowlink;
         boolean active;
@@ -89,11 +139,9 @@
             super(data);
         }
 
-        public abstract Iterable<? extends TarjanNode<D>> getAllDependencies();
+        public abstract Iterable<? extends N> getAllDependencies();
 
-        public abstract Iterable<? extends TarjanNode<D>> getDependenciesByKind(DependencyKind dk);
-
-        public int compareTo(TarjanNode<D> o) {
+        public int compareTo(N o) {
             return (index < o.index) ? -1 : (index == o.index) ? 0 : 1;
         }
     }
@@ -102,7 +150,7 @@
      * Tarjan's algorithm to determine strongly connected components of a
      * directed graph in linear time. Works on TarjanNode.
      */
-    public static <D, N extends TarjanNode<D>> List<? extends List<? extends N>> tarjan(Iterable<? extends N> nodes) {
+    public static <D, N extends TarjanNode<D, N>> List<? extends List<? extends N>> tarjan(Iterable<? extends N> nodes) {
         ListBuffer<List<N>> cycles = new ListBuffer<>();
         ListBuffer<N> stack = new ListBuffer<>();
         int index = 0;
@@ -114,15 +162,13 @@
         return cycles.toList();
     }
 
-    private static <D, N extends TarjanNode<D>> int tarjan(N v, int index, ListBuffer<N> stack, ListBuffer<List<N>> cycles) {
+    private static <D, N extends TarjanNode<D, N>> int tarjan(N v, int index, ListBuffer<N> stack, ListBuffer<List<N>> cycles) {
         v.index = index;
         v.lowlink = index;
         index++;
         stack.prepend(v);
         v.active = true;
-        for (TarjanNode<D> nd: v.getAllDependencies()) {
-            @SuppressWarnings("unchecked")
-            N n = (N)nd;
+        for (N n: v.getAllDependencies()) {
             if (n.index == -1) {
                 tarjan(n, index, stack, cycles);
                 v.lowlink = Math.min(v.lowlink, n.lowlink);
@@ -149,24 +195,45 @@
      * and {@code Node.printDependency} to display edge labels. The resulting
      * representation is also customizable with a graph name and a header.
      */
-    public static <D> String toDot(Iterable<? extends TarjanNode<D>> nodes, String name, String header) {
+    public static <D, N extends DottableNode<D, N>> String toDot(Collection<? extends N> nodes, String name, String header) {
         StringBuilder buf = new StringBuilder();
         buf.append(String.format("digraph %s {\n", name));
-        buf.append(String.format("label = \"%s\";\n", header));
-        //dump nodes
-        for (TarjanNode<D> n : nodes) {
-            buf.append(String.format("%s [label = \"%s\"];\n", n.hashCode(), n.toString()));
-        }
-        //dump arcs
-        for (TarjanNode<D> from : nodes) {
-            for (DependencyKind dk : from.getSupportedDependencyKinds()) {
-                for (TarjanNode<D> to : from.getDependenciesByKind(dk)) {
-                    buf.append(String.format("%s -> %s [label = \" %s \" style = %s ];\n",
-                            from.hashCode(), to.hashCode(), from.getDependencyName(to, dk), dk.getDotStyle()));
-                }
-            }
-        }
+        buf.append(String.format("label = %s;\n", DotVisitor.wrap(header)));
+        DotVisitor<D, N> dotVisitor = new DotVisitor<>();
+        dotVisitor.visit(nodes, buf);
         buf.append("}\n");
         return buf.toString();
     }
+
+    /**
+     * This visitor is used to dump the contents of a set of nodes of type {@link DottableNode}
+     * onto a string builder.
+     */
+    public static class DotVisitor<D, N extends DottableNode<D, N>> extends NodeVisitor<D, N, StringBuilder> {
+
+        @Override
+        public void visitDependency(DependencyKind dk, N from, N to, StringBuilder buf) {
+            buf.append(String.format("%s -> %s", from.hashCode(), to.hashCode()));
+            buf.append(formatProperties(from.dependencyAttributes(to, dk)));
+            buf.append('\n');
+        }
+
+        @Override
+        public void visitNode(N node, StringBuilder buf) {
+            buf.append(String.format("%s ", node.hashCode()));
+            buf.append(formatProperties(node.nodeAttributes()));
+            buf.append('\n');
+        }
+
+        protected String formatProperties(Properties p) {
+            return p.toString().replaceAll(",", " ")
+                .replaceAll("\\{", "[")
+                .replaceAll("\\}", "]");
+        }
+
+        protected static String wrap(String s) {
+            String res = "\"" + s + "\"";
+            return res.replaceAll("\n", "");
+        }
+    }
 }
--- a/langtools/src/share/classes/com/sun/tools/javap/JavapTask.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/langtools/src/share/classes/com/sun/tools/javap/JavapTask.java	Wed Jul 05 19:53:51 2017 +0200
@@ -575,6 +575,9 @@
                 }
                 reportError("err.ioerror", className, msg);
                 result = EXIT_ERROR;
+            } catch (OutOfMemoryError e) {
+                reportError("err.nomem");
+                result = EXIT_ERROR;
             } catch (Throwable t) {
                 StringWriter sw = new StringWriter();
                 PrintWriter pw = new PrintWriter(sw);
--- a/langtools/src/share/classes/com/sun/tools/javap/resources/javap.properties	Wed Jul 05 19:52:35 2017 +0200
+++ b/langtools/src/share/classes/com/sun/tools/javap/resources/javap.properties	Wed Jul 05 19:53:51 2017 +0200
@@ -18,6 +18,7 @@
 err.no.SourceFile.attribute=no SourceFile attribute
 err.source.file.not.found=source file not found
 err.bad.innerclasses.attribute=bad InnerClasses attribute for {0}
+err.nomem=Insufficient memory. To increase memory use -J-Xmx option.
 
 main.usage.summary=\
 Usage: {0} <options> <classes>\n\
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/all/RunCodingRules.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,111 @@
+/*
+ * Copyright (c) 2014, 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 8043643
+ * @summary Run the langtools coding rules over the langtools source code.
+ */
+
+
+import java.io.*;
+import java.nio.file.Files;
+import java.util.*;
+import java.util.stream.Collectors;
+
+import javax.tools.Diagnostic;
+import javax.tools.DiagnosticListener;
+import javax.tools.JavaCompiler;
+import javax.tools.JavaFileObject;
+import javax.tools.StandardJavaFileManager;
+import javax.tools.ToolProvider;
+
+import com.sun.tools.javac.util.Assert;
+
+public class RunCodingRules {
+    public static void main(String... args) throws Exception {
+        new RunCodingRules().run();
+    }
+
+    public void run() throws Exception {
+        File testSrc = new File(System.getProperty("test.src", "."));
+        File targetDir = new File(System.getProperty("test.classes", "."));
+        File sourceDir = null;
+        File crulesDir = null;
+        for (File d = testSrc; d != null; d = d.getParentFile()) {
+            if (new File(d, "TEST.ROOT").exists()) {
+                d = d.getParentFile();
+                File f = new File(d, "src/share/classes");
+                if (f.exists()) {
+                    sourceDir = f;
+                    f = new File(d, "make/tools");
+                    if (f.exists())
+                        crulesDir = f;
+                    break;
+                }
+            }
+        }
+
+        if (sourceDir == null || crulesDir == null) {
+            System.err.println("Warning: sources not found, test skipped.");
+            return ;
+        }
+
+        JavaCompiler javaCompiler = ToolProvider.getSystemJavaCompiler();
+        StandardJavaFileManager fm = javaCompiler.getStandardFileManager(null, null, null);
+        DiagnosticListener<JavaFileObject> noErrors = diagnostic -> {
+            Assert.check(diagnostic.getKind() != Diagnostic.Kind.ERROR, diagnostic.toString());
+        };
+
+        List<File> crulesFiles = Files.walk(crulesDir.toPath())
+                                      .map(entry -> entry.toFile())
+                                      .filter(entry -> entry.getName().endsWith(".java"))
+                                      .filter(entry -> entry.getParentFile().getName().equals("crules"))
+                                      .collect(Collectors.toList());
+
+        File crulesTarget = new File(targetDir, "crules");
+        crulesTarget.mkdirs();
+        List<String> crulesOptions = Arrays.asList("-d", crulesTarget.getAbsolutePath());
+        javaCompiler.getTask(null, fm, noErrors, crulesOptions, null,
+                fm.getJavaFileObjectsFromFiles(crulesFiles)).call();
+        File registration = new File(crulesTarget, "META-INF/services/com.sun.source.util.Plugin");
+        registration.getParentFile().mkdirs();
+        try (Writer metaInfServices = new FileWriter(registration)) {
+            metaInfServices.write("crules.CodingRulesAnalyzerPlugin\n");
+        }
+
+        List<File> sources = Files.walk(sourceDir.toPath())
+                                  .map(entry -> entry.toFile())
+                                  .filter(entry -> entry.getName().endsWith(".java"))
+                                  .collect(Collectors.toList());
+
+        File sourceTarget = new File(targetDir, "classes");
+        sourceTarget.mkdirs();
+        String processorPath = crulesTarget.getAbsolutePath() + File.pathSeparator +
+                crulesDir.getAbsolutePath();
+        List<String> options = Arrays.asList("-d", sourceTarget.getAbsolutePath(),
+                "-processorpath", processorPath, "-Xplugin:coding_rules");
+        javaCompiler.getTask(null, fm, noErrors, options, null,
+                fm.getJavaFileObjectsFromFiles(sources)).call();
+    }
+}
--- a/langtools/test/tools/javac/classfiles/attributes/LocalVariableTable/LocalVariableTestBase.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/langtools/test/tools/javac/classfiles/attributes/LocalVariableTable/LocalVariableTestBase.java	Wed Jul 05 19:53:51 2017 +0200
@@ -36,14 +36,26 @@
 import static java.lang.String.format;
 import static java.util.stream.Collectors.*;
 
-
+/**
+ * Base class for LocalVariableTable and LocalVariableTypeTable attributes tests.
+ * To add tests cases you should extend this class.
+ * Then implement {@link #getVariableTables} to get LocalVariableTable or LocalVariableTypeTable attribute.
+ * Then add method with local variables.
+ * Finally, annotate method with information about expected variables and their types
+ * by several {@link LocalVariableTestBase.ExpectedLocals} annotations.
+ * To run test invoke {@link #test()} method.
+ * If there are variables with the same name, set different scopes for them.
+ *
+ * @see #test()
+ */
 public abstract class LocalVariableTestBase extends TestBase {
     public static final int DEFAULT_SCOPE = 0;
     private final ClassFile classFile;
     private final Class<?> clazz;
 
-    protected abstract List<VariableTable> getVariableTables(Code_attribute codeAttribute);
-
+    /**
+     * @param clazz class to test. Must contains annotated methods with expected results.
+     */
     public LocalVariableTestBase(Class<?> clazz) {
         this.clazz = clazz;
         try {
@@ -53,8 +65,12 @@
         }
     }
 
+    protected abstract List<VariableTable> getVariableTables(Code_attribute codeAttribute);
 
-    //info in the LocalVariableTable attribute is compared against expected info stored in annotations
+    /**
+     * Finds expected variables with their type in VariableTable.
+     * Also does consistency checks, like variables from the same scope must point to different indexes.
+     */
     public void test() throws IOException {
         List<java.lang.reflect.Method> testMethods = Stream.of(clazz.getDeclaredMethods())
                 .filter(m -> m.getAnnotationsByType(ExpectedLocals.class).length > 0)
@@ -198,7 +214,10 @@
         }
     }
 
-
+    /**
+     * LocalVariableTable and LocalVariableTypeTable are similar.
+     * VariableTable interface is introduced to test this attributes in the same way without code duplication.
+     */
     interface VariableTable {
 
         int localVariableTableLength();
@@ -231,14 +250,23 @@
         }
     }
 
+    /**
+     * Used to store expected results in sources
+     */
     @Retention(RetentionPolicy.RUNTIME)
     @Repeatable(Container.class)
     @interface ExpectedLocals {
+        /**
+         * @return name of a local variable
+         */
         String name();
 
+        /**
+         * @return type of local variable in the internal format.
+         */
         String type();
 
-        //variables from different scopes can share local variable table index and/or name.
+        //variables from different scopes can share the local variable table index and/or name.
         int scope() default DEFAULT_SCOPE;
     }
 
--- a/langtools/test/tools/javac/classfiles/attributes/SourceFile/SourceFileTestBase.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/langtools/test/tools/javac/classfiles/attributes/SourceFile/SourceFileTestBase.java	Wed Jul 05 19:53:51 2017 +0200
@@ -30,18 +30,41 @@
 import java.util.Map;
 import javax.tools.JavaFileObject;
 
+/**
+ * Base class for Source file attribute tests. Checks expected file name for specified classes in the SourceFile attribute.
+ * To add new tests you should extend the SourceFileTestBase class and invoke {@link #test} for static sources
+ * or {@link #compileAndTest} for generated sources. For more information see corresponding methods.
+ *
+ * @see #test
+ * @see #compileAndTest
+ */
 public class SourceFileTestBase extends TestBase {
-
+    /**
+     * Checks expected fileName for the specified class in the SourceFile attribute.
+     *
+     * @param classToTest class to check its SourceFile attribute
+     * @param fileName    expected name of the file from which the test file is compiled.
+     */
     protected void test(Class<?> classToTest, String fileName) throws Exception {
         assertAttributePresent(ClassFile.read(getClassFile(classToTest)), fileName);
     }
 
+    /**
+     * Checks expected fileName for the specified class in the SourceFile attribute.
+     *
+     * @param classToTest class name to check its SourceFile attribute
+     * @param fileName    expected name of the file from which the test file is compiled.
+     */
     protected void test(String classToTest, String fileName) throws Exception {
         assertAttributePresent(ClassFile.read(getClassFile(classToTest + ".class")), fileName);
     }
 
     /**
-     * Compile sourceCode and for all "classesToTest" checks SourceFile attribute.
+     * Compiles sourceCode and for each specified class name checks the SourceFile attribute.
+     * The file name is extracted from source code.
+     *
+     * @param sourceCode    source code to compile
+     * @param classesToTest class names to check their SourceFile attribute.
      */
     protected void compileAndTest(String sourceCode, String... classesToTest) throws Exception {
 
--- a/langtools/test/tools/javac/classfiles/attributes/lib/TestBase.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/langtools/test/tools/javac/classfiles/attributes/lib/TestBase.java	Wed Jul 05 19:53:51 2017 +0200
@@ -23,11 +23,14 @@
 
 import java.io.File;
 import java.io.IOException;
-import java.io.PrintStream;
-import java.util.*;
+import java.util.List;
+import java.util.Objects;
 import java.util.function.Function;
 import java.util.stream.Stream;
-import javax.tools.*;
+import javax.tools.DiagnosticCollector;
+import javax.tools.JavaCompiler;
+import javax.tools.JavaFileObject;
+import javax.tools.ToolProvider;
 
 import static java.lang.String.format;
 import static java.lang.System.lineSeparator;
@@ -36,6 +39,11 @@
 import static java.util.stream.Collectors.joining;
 import static java.util.stream.Collectors.toList;
 
+/**
+ * Base class for class file attribute tests.
+ * Contains methods for compiling generated sources in memory,
+ * for reading files from disk and a lot of assert* methods.
+ */
 public class TestBase {
 
     public static final String LINE_SEPARATOR = lineSeparator();
@@ -66,35 +74,48 @@
         }
     }
 
+    /**
+     * Compiles sources in memory.
+     *
+     * @param sources to compile.
+     * @return memory file manager which contains class files and class loader.
+     */
     public InMemoryFileManager compile(String... sources)
             throws IOException, CompilationException {
         return compile(emptyList(), sources);
     }
 
     /**
-     * @param options - compiler options
-     * @param sources
+     * Compiles sources in memory.
+     *
+     * @param options compiler options.
+     * @param sources sources to compile.
      * @return map where key is className, value is corresponding ClassFile.
-     * @throws IOException
      */
-    public InMemoryFileManager compile(List<String> options, String...sources)
+    public InMemoryFileManager compile(List<String> options, String... sources)
             throws IOException, CompilationException {
         return compile(options, ToolBox.JavaSource::new, asList(sources));
     }
 
+    /**
+     * Compiles sources in memory.
+     *
+     * @param sources sources[i][0] - name of file, sources[i][1] - sources.
+     * @return map where key is className, value is corresponding ClassFile.
+     */
     public InMemoryFileManager compile(String[]... sources) throws IOException,
             CompilationException {
         return compile(emptyList(), sources);
     }
 
     /**
-     * @param options -  compiler options
-     * @param sources - sources[i][0] - name of file, sources[i][1] - sources
+     * Compiles sources in memory.
+     *
+     * @param options compiler options
+     * @param sources sources[i][0] - name of file, sources[i][1] - sources.
      * @return map where key is className, value is corresponding ClassFile.
-     * @throws IOException
-     * @throws CompilationException
      */
-    public InMemoryFileManager compile(List<String> options, String[]...sources)
+    public InMemoryFileManager compile(List<String> options, String[]... sources)
             throws IOException, CompilationException {
         return compile(options, src -> new ToolBox.JavaSource(src[0], src[1]), asList(sources));
     }
@@ -142,11 +163,22 @@
         return getClassFile(clazz.getName().replace(".", "/") + ".class");
     }
 
+    /**
+     * Prints message to standard error. New lines are converted to system dependent NL.
+     *
+     * @param message string to print.
+     */
     public void echo(String message) {
         System.err.println(message.replace("\n", LINE_SEPARATOR));
     }
 
-    public void printf(String template, Object...args) {
+    /**
+     * Substitutes args in template and prints result to standard error. New lines are converted to system dependent NL.
+     *
+     * @param template template in standard String.format(...) format.
+     * @param args arguments to substitute in template.
+     */
+    public void printf(String template, Object... args) {
         System.err.printf(template, Stream.of(args)
                 .map(Objects::toString)
                 .map(m -> m.replace("\n", LINE_SEPARATOR))
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/lambda/8051958/T8051958.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) 2014, 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.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * 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 8051958
+ * @summary Cannot assign a value to final variable in lambda
+ * @compile T8051958.java
+ */
+
+class T8051958 {
+    Runnable inst_r = ()-> {
+        final int x;
+        x = 1;
+    };
+
+    Runnable static_r = ()-> {
+        final int x;
+        x = 1;
+    };
+
+    {
+        Runnable inst_r = ()-> {
+            final int x;
+            x = 1;
+        };
+    }
+
+    static {
+        Runnable static_r = ()-> {
+            final int x;
+            x = 1;
+        };
+    }
+
+    void instTest() {
+        Runnable static_r = ()-> {
+            final int x;
+            x = 1;
+        };
+    }
+
+    static void staticTest() {
+        Runnable static_r = ()-> {
+            final int x;
+            x = 1;
+        };
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javap/BadAttributeLength.java	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,169 @@
+/*
+ * Copyright (c) 2014, 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 8047072
+ * @summary javap OOM on fuzzed classfile
+ * @run main BadAttributeLength
+ */
+
+
+import java.io.*;
+
+public class BadAttributeLength {
+
+    public static String source = "public class Test {\n" +
+                                  "    public static void main(String[] args) {}\n" +
+                                  "}";
+
+    public static void main(String[] args) throws Exception {
+        final File sourceFile = new File("Test.java");
+        if (sourceFile.exists()) {
+            if (!sourceFile.delete()) {
+                throw new IOException("Can't override the Test.java file. " +
+                        "Check permissions.");
+            }
+        }
+        try (FileWriter fw = new FileWriter(sourceFile)) {
+            fw.write(source);
+        }
+
+        final String[] javacOpts = {"Test.java"};
+
+        if (com.sun.tools.javac.Main.compile(javacOpts) != 0) {
+            throw new Exception("Can't compile embedded test.");
+        }
+
+        RandomAccessFile raf = new RandomAccessFile("Test.class", "rw");
+        long attPos = getFirstAttributePos(raf);
+        if (attPos < 0) {
+            throw new Exception("The class file contains no attributes at all.");
+        }
+        raf.seek(attPos + 2); // Jump to the attribute length
+        raf.writeInt(Integer.MAX_VALUE - 1);
+        raf.close();
+
+        String[] opts = { "-v", "Test.class" };
+        StringWriter sw = new StringWriter();
+        PrintWriter pout = new PrintWriter(sw);
+
+        com.sun.tools.javap.Main.run(opts, pout);
+        pout.flush();
+
+        if (sw.getBuffer().indexOf("OutOfMemoryError") != -1) {
+            throw new Exception("javap exited with OutOfMemoryError " +
+                    "instead of giving the proper error message.");
+        }
+    }
+
+    private static long getFirstAttributePos(RandomAccessFile cfile) throws Exception {
+        cfile.seek(0);
+        int v1, v2;
+        v1 = cfile.readInt();
+        // System.out.println("Magic: " + String.format("%X", v1));
+
+        v1 = cfile.readUnsignedShort();
+        v2 = cfile.readUnsignedShort();
+        // System.out.println("Version: " + String.format("%d.%d", v1, v2));
+
+        v1 = cfile.readUnsignedShort();
+        // System.out.println("CPool size: " + v1);
+        // Exhaust the constant pool
+        for (; v1 > 1; v1--) {
+            // System.out.print(".");
+            byte tag = cfile.readByte();
+            switch (tag) {
+                case 7  : // Class
+                case 8  : // String
+                    // Data is 2 bytes long
+                    cfile.skipBytes(2);
+                    break;
+                case 3  : // Integer
+                case 4  : // Float
+                case 9  : // FieldRef
+                case 10 : // MethodRef
+                case 11 : // InterfaceMethodRef
+                case 12 : // Name and Type
+                    // Data is 4 bytes long
+                    cfile.skipBytes(4);
+                    break;
+                case 5  : // Long
+                case 6  : // Double
+                    // Data is 8 bytes long
+                    cfile.skipBytes(8);
+                    break;
+                case 1  : // Utf8
+                    v2 = cfile.readUnsignedShort(); // Read buffer size
+                    cfile.skipBytes(v2); // Skip buffer
+                    break;
+                default :
+                    throw new Exception("Unexpected tag in CPool: [" + tag + "] at "
+                            + Long.toHexString(cfile.getFilePointer()));
+            }
+        }
+        // System.out.println();
+
+        cfile.skipBytes(6); // Access flags, this_class and super_class
+        v1 = cfile.readUnsignedShort(); // Number of interfaces
+        // System.out.println("Interfaces: " + v1);
+        cfile.skipBytes(3 * v1); // Each interface_info record is 3 bytes long
+        v1 = cfile.readUnsignedShort(); // Number of fields
+        // System.out.println("Fields: " + v1);
+        // Exhaust the fields table
+        for (; v1 > 0; v1--) {
+            // System.out.print(".");
+            cfile.skipBytes(6); // Skip access_flags, name_index and descriptor_index
+            v2 = cfile.readUnsignedShort(); // Field attributes count
+            if (v2 > 0) {
+                // This field has some attributes - suits our needs
+                // System.out.println();
+                return cfile.getFilePointer();
+            }
+        }
+        // System.out.println();
+        v1 = cfile.readUnsignedShort(); // Number of methods
+        // System.out.println("Methods: " + v1);
+        // Exhaust the methods table
+        for (; v1 > 0; v1--) {
+            // System.out.print(".");
+            cfile.skipBytes(6); // Skip access_flags, name_index and descriptor_index
+            v2 = cfile.readUnsignedShort(); // Method attributes count
+            if (v2 > 0) {
+                // This method got attributes - Ok with us,
+                // return position of the first one
+                // System.out.println();
+                return cfile.getFilePointer();
+            }
+        }
+        // System.out.println();
+        // Class attributes section
+        v1 = cfile.readUnsignedShort(); // Counts of attributes in class
+        if (v1 > 0) {
+            // Class has some attributes, return position of the first one
+            return cfile.getFilePointer();
+        }
+        // Bummer! No attributes in the entire class file. Not fair!
+        return -1L;
+    }
+}
--- a/make/Jprt.gmk	Wed Jul 05 19:52:35 2017 +0200
+++ b/make/Jprt.gmk	Wed Jul 05 19:53:51 2017 +0200
@@ -46,6 +46,10 @@
   JPRT_ARCHIVE_INSTALL_BUNDLE=/tmp/jprt_bundles/product-install.zip
 endif
 
+ifeq ($(SKIP_BOOT_CYCLE), false)
+  jprt_bundle: bootcycle-images
+endif
+
 # This target must be called in the context of a SPEC file
 jprt_bundle: $(JPRT_ARCHIVE_BUNDLE)
 	@$(call CheckIfMakeAtEnd)
--- a/make/jprt.properties	Wed Jul 05 19:52:35 2017 +0200
+++ b/make/jprt.properties	Wed Jul 05 19:53:51 2017 +0200
@@ -249,7 +249,7 @@
     solaris_sparcv9_5.11-{product|fastdebug}-c2-jvm98,			\
     solaris_sparcv9_5.11-{product|fastdebug}-c2-jvm98_nontiered,	\
     solaris_sparcv9_5.11-{product|fastdebug}-c2-scimark,		\
-    solaris_sparcv9_5.11-product-c2-runThese,				\
+    solaris_sparcv9_5.11-product-c2-runThese8,				\
     solaris_sparcv9_5.11-{product|fastdebug}-c2-GCBasher_SerialGC,	\
     solaris_sparcv9_5.11-{product|fastdebug}-c2-GCBasher_ParallelGC,	\
     solaris_sparcv9_5.11-{product|fastdebug}-c2-GCBasher_ParNewGC,	\
@@ -273,8 +273,9 @@
     solaris_x64_5.11-{product|fastdebug}-c2-jvm98,			\
     solaris_x64_5.11-{product|fastdebug}-c2-jvm98_nontiered,		\
     solaris_x64_5.11-{product|fastdebug}-c2-scimark,			\
-    solaris_x64_5.11-product-c2-runThese,				\
-    solaris_x64_5.11-product-c2-runThese_Xcomp,				\
+    solaris_x64_5.11-product-c2-runThese8,				\
+    solaris_x64_5.11-product-c2-runThese8_Xcomp_lang,			\
+    solaris_x64_5.11-product-c2-runThese8_Xcomp_vm,			\
     solaris_x64_5.11-{product|fastdebug}-c2-GCBasher_SerialGC,		\
     solaris_x64_5.11-{product|fastdebug}-c2-GCBasher_ParallelGC,	\
     solaris_x64_5.11-{product|fastdebug}-c2-GCBasher_ParNewGC,		\
@@ -298,9 +299,11 @@
     linux_i586_2.6-{product|fastdebug}-{c1|c2}-jvm98,			\
     linux_i586_2.6-{product|fastdebug}-c2-jvm98_nontiered,		\
     linux_i586_2.6-{product|fastdebug}-{c1|c2}-scimark,			\
-    linux_i586_2.6-product-c1-runThese_Xcomp,				\
-    linux_i586_2.6-fastdebug-c1-runThese_Xshare,			\
-    linux_i586_2.6-fastdebug-c2-runThese_Xcomp,				\
+    linux_i586_2.6-product-c1-runThese8_Xcomp_lang,			\
+    linux_i586_2.6-product-c1-runThese8_Xcomp_vm,			\
+    linux_i586_2.6-fastdebug-c1-runThese8_Xshare,			\
+    linux_i586_2.6-fastdebug-c2-runThese8_Xcomp_lang,			\
+    linux_i586_2.6-fastdebug-c2-runThese8_Xcomp_vm,			\
     linux_i586_2.6-{product|fastdebug}-{c1|c2}-GCBasher_SerialGC,	\
     linux_i586_2.6-{product|fastdebug}-{c1|c2}-GCBasher_ParallelGC,	\
     linux_i586_2.6-{product|fastdebug}-{c1|c2}-GCBasher_ParNewGC,	\
@@ -366,9 +369,10 @@
     windows_i586_6.1-{product|fastdebug}-{c1|c2}-jvm98,			\
     windows_i586_6.1-{product|fastdebug}-c2-jvm98_nontiered,		\
     windows_i586_6.1-{product|fastdebug}-{c1|c2}-scimark,		\
-    windows_i586_6.1-product-{c1|c2}-runThese,				\
-    windows_i586_6.1-product-{c1|c2}-runThese_Xcomp,			\
-    windows_i586_6.1-fastdebug-c1-runThese_Xshare,			\
+    windows_i586_6.1-product-{c1|c2}-runThese8,				\
+    windows_i586_6.1-product-{c1|c2}-runThese8_Xcomp_lang,		\
+    windows_i586_6.1-product-{c1|c2}-runThese8_Xcomp_vm,		\
+    windows_i586_6.1-fastdebug-c1-runThese8_Xshare,			\
     windows_i586_6.1-{product|fastdebug}-{c1|c2}-GCBasher_SerialGC,	\
     windows_i586_6.1-{product|fastdebug}-{c1|c2}-GCBasher_ParallelGC,	\
     windows_i586_6.1-{product|fastdebug}-{c1|c2}-GCBasher_ParNewGC,	\
@@ -392,8 +396,9 @@
     windows_x64_6.1-{product|fastdebug}-c2-jvm98,			\
     windows_x64_6.1-{product|fastdebug}-c2-jvm98_nontiered,		\
     windows_x64_6.1-{product|fastdebug}-c2-scimark,			\
-    windows_x64_6.1-product-c2-runThese,				\
-    windows_x64_6.1-product-c2-runThese_Xcomp,				\
+    windows_x64_6.1-product-c2-runThese8,				\
+    windows_x64_6.1-product-c2-runThese8_Xcomp_lang,			\
+    windows_x64_6.1-product-c2-runThese8_Xcomp_vm,			\
     windows_x64_6.1-{product|fastdebug}-c2-GCBasher_SerialGC,		\
     windows_x64_6.1-{product|fastdebug}-c2-GCBasher_ParallelGC,		\
     windows_x64_6.1-{product|fastdebug}-c2-GCBasher_ParNewGC,		\
--- a/nashorn/.hgtags	Wed Jul 05 19:52:35 2017 +0200
+++ b/nashorn/.hgtags	Wed Jul 05 19:53:51 2017 +0200
@@ -258,3 +258,4 @@
 a9d39bcfeb1bb3f7de929c56a2ecbea10a554ca1 jdk9-b22
 aa3fda2d2967847dbd264aa962d624c07fc6c29f jdk9-b23
 49d7a2a66ae6b70fee367e2ceb29d0c20f8be01b jdk9-b24
+b33633fc10c5bffd39d3492ed2602dadd8d44642 jdk9-b25
--- a/nashorn/src/jdk/internal/dynalink/linker/GuardedInvocation.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/nashorn/src/jdk/internal/dynalink/linker/GuardedInvocation.java	Wed Jul 05 19:53:51 2017 +0200
@@ -193,7 +193,7 @@
         invocation.getClass(); // NPE check
         this.invocation = invocation;
         this.guard = guard;
-        this.switchPoints = switchPoints;
+        this.switchPoints = switchPoints == null ? null : switchPoints.clone();
         this.exception = exception;
     }
 
--- a/nashorn/src/jdk/internal/dynalink/support/CompositeTypeBasedGuardingDynamicLinker.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/nashorn/src/jdk/internal/dynalink/support/CompositeTypeBasedGuardingDynamicLinker.java	Wed Jul 05 19:53:51 2017 +0200
@@ -111,7 +111,7 @@
         private final TypeBasedGuardingDynamicLinker[] linkers;
         private final List<TypeBasedGuardingDynamicLinker>[] singletonLinkers;
 
-        @SuppressWarnings(value={"unchecked", "rawtypes"})
+        @SuppressWarnings({"unchecked", "rawtypes"})
         ClassToLinker(final TypeBasedGuardingDynamicLinker[] linkers) {
             this.linkers = linkers;
             singletonLinkers = new List[linkers.length];
@@ -135,7 +135,6 @@
                         case 1: {
                             list = new LinkedList<>(list);
                         }
-                        //$FALL-THROUGH$
                         default: {
                             list.add(linker);
                         }
--- a/nashorn/src/jdk/nashorn/api/scripting/NashornScriptEngine.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/nashorn/src/jdk/nashorn/api/scripting/NashornScriptEngine.java	Wed Jul 05 19:53:51 2017 +0200
@@ -40,6 +40,7 @@
 import java.text.MessageFormat;
 import java.util.Locale;
 import java.util.ResourceBundle;
+
 import javax.script.AbstractScriptEngine;
 import javax.script.Bindings;
 import javax.script.Compilable;
@@ -50,6 +51,7 @@
 import javax.script.ScriptEngineFactory;
 import javax.script.ScriptException;
 import javax.script.SimpleBindings;
+
 import jdk.nashorn.internal.objects.Global;
 import jdk.nashorn.internal.runtime.Context;
 import jdk.nashorn.internal.runtime.ErrorManager;
@@ -429,7 +431,7 @@
         return evalImpl(script, ctxt, getNashornGlobalFrom(ctxt));
     }
 
-    private Object evalImpl(final Context.MultiGlobalCompiledScript mgcs, final ScriptContext ctxt, final Global ctxtGlobal) throws ScriptException {
+    private static Object evalImpl(final Context.MultiGlobalCompiledScript mgcs, final ScriptContext ctxt, final Global ctxtGlobal) throws ScriptException {
         final Global oldGlobal = Context.getGlobal();
         final boolean globalChanged = (oldGlobal != ctxtGlobal);
         try {
@@ -450,7 +452,7 @@
         }
     }
 
-    private Object evalImpl(final ScriptFunction script, final ScriptContext ctxt, final Global ctxtGlobal) throws ScriptException {
+    private static Object evalImpl(final ScriptFunction script, final ScriptContext ctxt, final Global ctxtGlobal) throws ScriptException {
         if (script == null) {
             return null;
         }
--- a/nashorn/src/jdk/nashorn/internal/codegen/CodeGenerator.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/nashorn/src/jdk/nashorn/internal/codegen/CodeGenerator.java	Wed Jul 05 19:53:51 2017 +0200
@@ -314,7 +314,7 @@
         if (!symbol.isScope()) {
             final Type type = identNode.getType();
             if(type == Type.UNDEFINED) {
-                return method.loadUndefined(Type.OBJECT);
+                return method.loadUndefined(resultBounds.widest);
             }
 
             assert symbol.hasSlot() || symbol.isParam();
@@ -1097,7 +1097,11 @@
 
         closeBlockVariables(block);
         lc.releaseSlots();
-        assert !method.isReachable() || (lc.isFunctionBody() ? 0 : lc.getUsedSlotCount()) == method.getFirstTemp();
+        assert !method.isReachable() || (lc.isFunctionBody() ? 0 : lc.getUsedSlotCount()) == method.getFirstTemp() :
+            "reachable="+method.isReachable() +
+            " isFunctionBody=" + lc.isFunctionBody() +
+            " usedSlotCount=" + lc.getUsedSlotCount() +
+            " firstTemp=" + method.getFirstTemp();
 
         return block;
     }
@@ -4738,7 +4742,7 @@
          */
         private void replaceCompileTimeProperty(final Object propertyValue) {
             assert method.peekType().isObject();
-            if(propertyValue instanceof String) {
+            if(propertyValue instanceof String || propertyValue == null) {
                 method.load((String)propertyValue);
             } else if(propertyValue instanceof Integer) {
                 method.load(((Integer)propertyValue).intValue());
--- a/nashorn/src/jdk/nashorn/internal/codegen/CompilationPhase.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/nashorn/src/jdk/nashorn/internal/codegen/CompilationPhase.java	Wed Jul 05 19:53:51 2017 +0200
@@ -43,7 +43,6 @@
 import java.util.ArrayList;
 import java.util.EnumSet;
 import java.util.HashMap;
-import java.util.IdentityHashMap;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
@@ -334,15 +333,15 @@
                     sb.append("$restOf");
                 }
                 newUnit = compiler.createCompileUnit(sb.toString(), oldUnit.getWeight());
-                log.info("Creating new compile unit ", oldUnit, " => ", newUnit);
+                log.fine("Creating new compile unit ", oldUnit, " => ", newUnit);
                 map.put(oldUnit, newUnit);
                 assert newUnit != null;
                 newUnits.add(newUnit);
             }
 
-            log.info("Replacing compile units in Compiler...");
+            log.fine("Replacing compile units in Compiler...");
             compiler.replaceCompileUnits(newUnits);
-            log.info("Done");
+            log.fine("Done");
 
             //replace old compile units in function nodes, if any are assigned,
             //for example by running the splitter on this function node in a previous
@@ -564,7 +563,7 @@
                     append(compiler.getCompileUnits().size()).
                     append(" compile unit(s)]");
 
-                log.info(sb.toString());
+                log.fine(sb.toString());
             }
 
             return setStates(fn.setRootClass(null, rootClass), BYTECODE_INSTALLED);
--- a/nashorn/src/jdk/nashorn/internal/codegen/Compiler.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/nashorn/src/jdk/nashorn/internal/codegen/Compiler.java	Wed Jul 05 19:53:51 2017 +0200
@@ -50,6 +50,7 @@
 import java.util.concurrent.atomic.AtomicInteger;
 import java.util.function.Consumer;
 import java.util.logging.Level;
+
 import jdk.internal.dynalink.support.NameCodec;
 import jdk.nashorn.internal.codegen.ClassEmitter.Flag;
 import jdk.nashorn.internal.codegen.types.Type;
@@ -502,7 +503,7 @@
      */
     public FunctionNode compile(final FunctionNode functionNode, final CompilationPhases phases) throws CompilationException {
 
-        log.info("Starting compile job for ", DebugLogger.quote(functionNode.getName()), " phases=", quote(phases.getDesc()));
+        log.finest("Starting compile job for ", DebugLogger.quote(functionNode.getName()), " phases=", quote(phases.getDesc()));
         log.indent();
 
         final String name = DebugLogger.quote(functionNode.getName());
@@ -531,7 +532,7 @@
             time += (env.isTimingEnabled() ? phase.getEndTime() - phase.getStartTime() : 0L);
         }
 
-        if(typeInformationFile != null && !phases.isRestOfCompilation()) {
+        if (typeInformationFile != null && !phases.isRestOfCompilation()) {
             OptimisticTypesPersistence.store(typeInformationFile, invalidatedProgramPoints);
         }
 
--- a/nashorn/src/jdk/nashorn/internal/codegen/LocalVariableTypesCalculator.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/nashorn/src/jdk/nashorn/internal/codegen/LocalVariableTypesCalculator.java	Wed Jul 05 19:53:51 2017 +0200
@@ -1196,9 +1196,7 @@
                 } else if(binaryNode.isOptimisticUndecidedType()) {
                     // At this point, we can assign a static type to the optimistic binary ADD operator as now we know
                     // the types of its operands.
-                    final Type type = Type.widest(binaryNode.lhs().getType(), binaryNode.rhs().getType());
-                    // Use Type.CHARSEQUENCE instead of Type.STRING to avoid conversion of ConsStrings to Strings.
-                    return binaryNode.setType(type.equals(Type.STRING) ? Type.CHARSEQUENCE : type);
+                    return binaryNode.decideType();
                 }
                 return binaryNode;
             }
--- a/nashorn/src/jdk/nashorn/internal/codegen/Lower.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/nashorn/src/jdk/nashorn/internal/codegen/Lower.java	Wed Jul 05 19:53:51 2017 +0200
@@ -34,6 +34,7 @@
 import java.util.Collections;
 import java.util.List;
 import java.util.ListIterator;
+
 import jdk.nashorn.internal.ir.BaseNode;
 import jdk.nashorn.internal.ir.BinaryNode;
 import jdk.nashorn.internal.ir.Block;
--- a/nashorn/src/jdk/nashorn/internal/codegen/OptimisticTypesPersistence.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/nashorn/src/jdk/nashorn/internal/codegen/OptimisticTypesPersistence.java	Wed Jul 05 19:53:51 2017 +0200
@@ -41,6 +41,7 @@
 import java.util.Date;
 import java.util.Map;
 import java.util.TreeMap;
+
 import jdk.nashorn.internal.codegen.types.Type;
 import jdk.nashorn.internal.runtime.Context;
 import jdk.nashorn.internal.runtime.RecompilableScriptFunctionData;
@@ -111,6 +112,7 @@
             return;
         }
         final File file = ((LocationDescriptor)locationDescriptor).file;
+
         AccessController.doPrivileged(new PrivilegedAction<Void>() {
             @Override
             public Void run() {
@@ -119,7 +121,7 @@
                         out.getChannel().lock(); // lock exclusive
                         final DataOutputStream dout = new DataOutputStream(new BufferedOutputStream(out));
                         dout.writeInt(optimisticTypes.size());
-                        for(Map.Entry<Integer, Type> e: optimisticTypes.entrySet()) {
+                        for(final Map.Entry<Integer, Type> e: optimisticTypes.entrySet()) {
                             dout.writeInt(e.getKey());
                             final byte typeChar;
                             final Type type = e.getValue();
@@ -156,7 +158,6 @@
             return null;
         }
         final File file = ((LocationDescriptor)locationDescriptor).file;
-
         return AccessController.doPrivileged(new PrivilegedAction<Map<Integer, Type>>() {
             @Override
             public Map<Integer, Type> run() {
@@ -229,7 +230,7 @@
                 final String versionDirName;
                 try {
                     versionDirName = getVersionDirName();
-                } catch(Exception e) {
+                } catch(final Exception e) {
                     getLogger().warning("Failed to calculate version dir name", e);
                     return null;
                 }
@@ -306,7 +307,7 @@
 
     private static long getLastModifiedClassFile(final File dir, final long max) {
         long currentMax = max;
-        for(File f: dir.listFiles()) {
+        for(final File f: dir.listFiles()) {
             if(f.getName().endsWith(".class")) {
                 final long lastModified = f.lastModified();
                 if(lastModified > currentMax) {
--- a/nashorn/src/jdk/nashorn/internal/ir/BinaryNode.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/nashorn/src/jdk/nashorn/internal/ir/BinaryNode.java	Wed Jul 05 19:53:51 2017 +0200
@@ -183,17 +183,31 @@
         switch (tokenType()) {
         case ADD:
         case ASSIGN_ADD: {
+            // Compare this logic to decideType(Type, Type); it's similar, but it handles the optimistic type
+            // calculation case while this handles the conservative case.
             final Type lhsType = lhs.getType(localVariableTypes);
             final Type rhsType = rhs.getType(localVariableTypes);
             if(lhsType == Type.BOOLEAN && rhsType == Type.BOOLEAN) {
+                // Will always fit in an int, as the value range is [0, 1, 2]. If we didn't treat them specially here,
+                // they'd end up being treated as generic INT operands and their sum would be conservatively considered
+                // to be a LONG in the generic case below; we can do better here.
                 return Type.INT;
+            } else if(isString(lhsType) || isString(rhsType)) {
+                // We can statically figure out that this is a string if either operand is a string. In this case, use
+                // CHARSEQUENCE to prevent it from being proactively flattened.
+                return Type.CHARSEQUENCE;
             }
-            final Type widestOperandType = Type.widest(lhs.getType(localVariableTypes), rhs.getType(localVariableTypes));
+            final Type widestOperandType = Type.widest(undefinedToNumber(booleanToInt(lhsType)), undefinedToNumber(booleanToInt(rhsType)));
             if(widestOperandType == Type.INT) {
                 return Type.LONG;
             } else if (widestOperandType.isNumeric()) {
                 return Type.NUMBER;
             }
+            // We pretty much can't know what it will be statically. Must presume OBJECT conservatively, as we can end
+            // up getting either a string or an object when adding something + object, e.g.:
+            // 1 + {} == "1[object Object]", but
+            // 1 + {valueOf: function() { return 2 }} == 3. Also:
+            // 1 + {valueOf: function() { return "2" }} == "12".
             return Type.OBJECT;
         }
         case SHR:
@@ -256,10 +270,18 @@
         }
     }
 
+    private static boolean isString(final Type type) {
+        return type == Type.STRING || type == Type.CHARSEQUENCE;
+    }
+
     private static Type booleanToInt(final Type type) {
         return type == Type.BOOLEAN ? Type.INT : type;
     }
 
+    private static Type undefinedToNumber(final Type type) {
+        return type == Type.UNDEFINED ? Type.NUMBER : type;
+    }
+
     /**
      * Check if this node is an assignment
      *
@@ -527,7 +549,7 @@
 
     private Type getTypeUncached(final Function<Symbol, Type> localVariableTypes) {
         if(type == OPTIMISTIC_UNDECIDED_TYPE) {
-            return Type.widest(lhs.getType(localVariableTypes), rhs.getType(localVariableTypes));
+            return decideType(lhs.getType(localVariableTypes), rhs.getType(localVariableTypes));
         }
         final Type widest = getWidestOperationType(localVariableTypes);
         if(type == null) {
@@ -536,6 +558,32 @@
         return Type.narrowest(widest, Type.widest(type, Type.widest(lhs.getType(localVariableTypes), rhs.getType(localVariableTypes))));
     }
 
+    private static Type decideType(final Type lhsType, final Type rhsType) {
+        // Compare this to getWidestOperationType() for ADD and ASSIGN_ADD cases. There's some similar logic, but these
+        // are optimistic decisions, meaning that we don't have to treat boolean addition separately (as it'll become
+        // int addition in the general case anyway), and that we also don't conservatively widen sums of ints to
+        // longs, or sums of longs to doubles.
+        if(isString(lhsType) || isString(rhsType)) {
+            return Type.CHARSEQUENCE;
+        }
+        // NOTE: We don't have optimistic object-to-(int, long) conversions. Therefore, if any operand is an Object, we
+        // bail out of optimism here and presume a conservative Object return value, as the object's ToPrimitive() can
+        // end up returning either a number or a string, and their common supertype is Object, for better or worse.
+        final Type widest = Type.widest(undefinedToNumber(booleanToInt(lhsType)), undefinedToNumber(booleanToInt(rhsType)));
+        return widest.isObject() ? Type.OBJECT : widest;
+    }
+
+    /**
+     * If the node is a node representing an add operation and has {@link #isOptimisticUndecidedType() optimistic
+     * undecided type}, decides its type. Should be invoked after its operands types have been finalized.
+     * @return returns a new node similar to this node, but with its type set to the type decided from the type of its
+     * operands.
+     */
+    public BinaryNode decideType() {
+        assert type == OPTIMISTIC_UNDECIDED_TYPE;
+        return setType(decideType(lhs.getType(), rhs.getType()));
+    }
+
     @Override
     public BinaryNode setType(final Type type) {
         if (this.type == type) {
--- a/nashorn/src/jdk/nashorn/internal/ir/Block.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/nashorn/src/jdk/nashorn/internal/ir/Block.java	Wed Jul 05 19:53:51 2017 +0200
@@ -149,7 +149,7 @@
     @Override
     public Node accept(final LexicalContext lc, final NodeVisitor<? extends LexicalContext> visitor) {
         if (visitor.enterBlock(this)) {
-            return visitor.leaveBlock(setStatements(lc, Node.accept(visitor, Statement.class, statements)));
+            return visitor.leaveBlock(setStatements(lc, Node.accept(visitor, statements)));
         }
 
         return this;
--- a/nashorn/src/jdk/nashorn/internal/ir/CallNode.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/nashorn/src/jdk/nashorn/internal/ir/CallNode.java	Wed Jul 05 19:53:51 2017 +0200
@@ -30,6 +30,7 @@
 import java.util.Collections;
 import java.util.List;
 import java.util.function.Function;
+
 import jdk.nashorn.internal.codegen.types.Type;
 import jdk.nashorn.internal.ir.annotations.Ignore;
 import jdk.nashorn.internal.ir.annotations.Immutable;
@@ -175,10 +176,10 @@
         if (visitor.enterCallNode(this)) {
             final CallNode newCallNode = (CallNode)visitor.leaveCallNode(
                     setFunction((Expression)function.accept(visitor)).
-                    setArgs(Node.accept(visitor, Expression.class, args)).
+                    setArgs(Node.accept(visitor, args)).
                     setEvalArgs(evalArgs == null ?
                             null :
-                            evalArgs.setArgs(Node.accept(visitor, Expression.class, evalArgs.getArgs()))));
+                            evalArgs.setArgs(Node.accept(visitor, evalArgs.getArgs()))));
             // Theoretically, we'd need to instead pass lc to every setter and do a replacement on each. In practice,
             // setType from TypeOverride can't accept a lc, and we don't necessarily want to go there now.
             if (this != newCallNode) {
--- a/nashorn/src/jdk/nashorn/internal/ir/FunctionNode.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/nashorn/src/jdk/nashorn/internal/ir/FunctionNode.java	Wed Jul 05 19:53:51 2017 +0200
@@ -359,7 +359,7 @@
      * @return a list of parameter nodes, potentially modified from original ones by the visitor.
      */
     public List<IdentNode> visitParameters(final NodeVisitor<? extends LexicalContext> visitor) {
-        return Node.accept(visitor, IdentNode.class, parameters);
+        return Node.accept(visitor, parameters);
     }
 
     /**
--- a/nashorn/src/jdk/nashorn/internal/ir/LexicalContext.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/nashorn/src/jdk/nashorn/internal/ir/LexicalContext.java	Wed Jul 05 19:53:51 2017 +0200
@@ -27,6 +27,7 @@
 import java.io.File;
 import java.util.Iterator;
 import java.util.NoSuchElementException;
+
 import jdk.nashorn.internal.runtime.Debug;
 import jdk.nashorn.internal.runtime.Source;
 
@@ -652,6 +653,7 @@
             return lnext;
         }
 
+        @SuppressWarnings("unchecked")
         private T findNext() {
             for (int i = index; i >= 0; i--) {
                 final Object node = stack[i];
@@ -660,7 +662,7 @@
                 }
                 if (clazz.isAssignableFrom(node.getClass())) {
                     index = i - 1;
-                    return clazz.cast(node);
+                    return (T)node;
                 }
             }
             return null;
--- a/nashorn/src/jdk/nashorn/internal/ir/LiteralNode.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/nashorn/src/jdk/nashorn/internal/ir/LiteralNode.java	Wed Jul 05 19:53:51 2017 +0200
@@ -934,7 +934,7 @@
         public Node accept(final LexicalContext lc, final NodeVisitor<? extends LexicalContext> visitor) {
             if (visitor.enterLiteralNode(this)) {
                 final List<Expression> oldValue = Arrays.asList(value);
-                final List<Expression> newValue = Node.accept(visitor, Expression.class, oldValue);
+                final List<Expression> newValue = Node.accept(visitor, oldValue);
                 return visitor.leaveLiteralNode(oldValue != newValue ? setValue(lc, newValue) : this);
             }
             return this;
--- a/nashorn/src/jdk/nashorn/internal/ir/Node.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/nashorn/src/jdk/nashorn/internal/ir/Node.java	Wed Jul 05 19:53:51 2017 +0200
@@ -27,6 +27,7 @@
 
 import java.util.ArrayList;
 import java.util.List;
+
 import jdk.nashorn.internal.ir.visitor.NodeVisitor;
 import jdk.nashorn.internal.parser.Token;
 import jdk.nashorn.internal.parser.TokenType;
@@ -232,19 +233,34 @@
     }
 
     //on change, we have to replace the entire list, that's we can't simple do ListIterator.set
-    static <T extends Node> List<T> accept(final NodeVisitor<? extends LexicalContext> visitor, final Class<T> clazz, final List<T> list) {
-        boolean changed = false;
-        final List<T> newList = new ArrayList<>();
-
-        for (final Node node : list) {
-            final T newNode = node == null ? null : clazz.cast(node.accept(visitor));
-            if (newNode != node) {
-                changed = true;
-            }
-            newList.add(newNode);
+    static <T extends Node> List<T> accept(final NodeVisitor<? extends LexicalContext> visitor, final List<T> list) {
+        final int size = list.size();
+        if (size == 0) {
+            return list;
         }
 
-        return changed ? newList : list;
+         List<T> newList = null;
+
+        for (int i = 0; i < size; i++) {
+            final T node = list.get(i);
+            @SuppressWarnings("unchecked")
+            final T newNode = node == null ? null : (T)node.accept(visitor);
+            if (newNode != node) {
+                if (newList == null) {
+                    newList = new ArrayList<>(size);
+                    for (int j = 0; j < i; j++) {
+                        newList.add(list.get(j));
+                    }
+                }
+                newList.add(newNode);
+            } else {
+                if (newList != null) {
+                    newList.add(node);
+                }
+            }
+        }
+
+        return newList == null ? list : newList;
     }
 
     static <T extends LexicalContextNode> T replaceInLexicalContext(final LexicalContext lc, final T oldNode, final T newNode) {
--- a/nashorn/src/jdk/nashorn/internal/ir/ObjectNode.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/nashorn/src/jdk/nashorn/internal/ir/ObjectNode.java	Wed Jul 05 19:53:51 2017 +0200
@@ -61,7 +61,7 @@
     @Override
     public Node accept(final NodeVisitor<? extends LexicalContext> visitor) {
         if (visitor.enterObjectNode(this)) {
-            return visitor.leaveObjectNode(setElements(Node.accept(visitor, PropertyNode.class, elements)));
+            return visitor.leaveObjectNode(setElements(Node.accept(visitor, elements)));
         }
 
         return this;
--- a/nashorn/src/jdk/nashorn/internal/ir/SwitchNode.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/nashorn/src/jdk/nashorn/internal/ir/SwitchNode.java	Wed Jul 05 19:53:51 2017 +0200
@@ -104,7 +104,7 @@
         if (visitor.enterSwitchNode(this)) {
             return visitor.leaveSwitchNode(
                 setExpression(lc, (Expression)expression.accept(visitor)).
-                setCases(lc, Node.accept(visitor, CaseNode.class, cases), defaultCaseIndex));
+                setCases(lc, Node.accept(visitor, cases), defaultCaseIndex));
         }
 
         return this;
--- a/nashorn/src/jdk/nashorn/internal/ir/TryNode.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/nashorn/src/jdk/nashorn/internal/ir/TryNode.java	Wed Jul 05 19:53:51 2017 +0200
@@ -112,7 +112,7 @@
             return visitor.leaveTryNode(
                 setBody(newBody).
                 setFinallyBody(newFinallyBody).
-                setCatchBlocks(Node.accept(visitor, Block.class, catchBlocks)).
+                setCatchBlocks(Node.accept(visitor, catchBlocks)).
                 setFinallyCatchAll(finallyCatchAll));
         }
 
--- a/nashorn/src/jdk/nashorn/internal/ir/debug/ClassHistogramElement.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/nashorn/src/jdk/nashorn/internal/ir/debug/ClassHistogramElement.java	Wed Jul 05 19:53:51 2017 +0200
@@ -30,7 +30,7 @@
 /**
  * Class histogram element for IR / Java object instrumentation
  */
-public class ClassHistogramElement {
+public final class ClassHistogramElement {
     /**
      * Instance comparator
      */
--- a/nashorn/src/jdk/nashorn/internal/ir/debug/NashornTextifier.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/nashorn/src/jdk/nashorn/internal/ir/debug/NashornTextifier.java	Wed Jul 05 19:53:51 2017 +0200
@@ -39,6 +39,7 @@
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
+
 import jdk.internal.org.objectweb.asm.Attribute;
 import jdk.internal.org.objectweb.asm.Handle;
 import jdk.internal.org.objectweb.asm.Label;
@@ -1082,11 +1083,15 @@
             contents.put(node, sb);
         }
 
+        private static String dottyFriendly(final String name) {
+            return name.replace(':', '_');
+        }
+
         @Override
         public String toString() {
 
             final StringBuilder sb = new StringBuilder();
-            sb.append("digraph " + name + " {");
+            sb.append("digraph " + dottyFriendly(name) + " {");
             sb.append("\n");
             sb.append("\tgraph [fontname=courier]\n");
             sb.append("\tnode [style=filled,color="+COLOR_DEFAULT+",fontname=courier]\n");
--- a/nashorn/src/jdk/nashorn/internal/ir/debug/ObjectSizeCalculator.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/nashorn/src/jdk/nashorn/internal/ir/debug/ObjectSizeCalculator.java	Wed Jul 05 19:53:51 2017 +0200
@@ -52,7 +52,7 @@
  * this fact and will report incorrect sizes, as it will presume the default JVM
  * behavior.
  */
-public class ObjectSizeCalculator {
+public final class ObjectSizeCalculator {
 
     /**
      * Describes constant memory overheads for various constructs in a JVM implementation.
--- a/nashorn/src/jdk/nashorn/internal/lookup/MethodHandleFactory.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/nashorn/src/jdk/nashorn/internal/lookup/MethodHandleFactory.java	Wed Jul 05 19:53:51 2017 +0200
@@ -124,11 +124,13 @@
      * @return return value unmodified
      */
     static Object traceReturn(final DebugLogger logger, final Object value) {
-        final String str = "    return" +
-                (VOID_TAG.equals(value) ?
-                    ";" :
-                    " " + stripName(value) + "; // [type=" + (value == null ? "null]" : stripName(value.getClass()) + ']'));
-        logger.log(TRACE_LEVEL, str);
+        if (logger.isEnabled()) {
+            final String str = "    return" +
+                    (VOID_TAG.equals(value) ?
+                        ";" :
+                        " " + stripName(value) + "; // [type=" + (value == null ? "null]" : stripName(value.getClass()) + ']'));
+            logger.log(TRACE_LEVEL, str);
+        }
         return value;
     }
 
--- a/nashorn/src/jdk/nashorn/internal/objects/Global.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/nashorn/src/jdk/nashorn/internal/objects/Global.java	Wed Jul 05 19:53:51 2017 +0200
@@ -46,8 +46,10 @@
 import java.util.concurrent.Callable;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.atomic.AtomicReference;
+
 import javax.script.ScriptContext;
 import javax.script.ScriptEngine;
+
 import jdk.internal.dynalink.linker.GuardedInvocation;
 import jdk.internal.dynalink.linker.LinkRequest;
 import jdk.nashorn.api.scripting.ScriptObjectMirror;
@@ -563,6 +565,8 @@
      * Initialize standard builtin objects like "Object", "Array", "Function" etc.
      * as well as our extension builtin objects like "Java", "JSAdapter" as properties
      * of the global scope object.
+     *
+     * @param engine ScriptEngine to initialize
      */
     public void initBuiltinObjects(final ScriptEngine engine) {
         if (this.builtinObject != null) {
@@ -1936,15 +1940,16 @@
     }
 
     private Object printImpl(final boolean newLine, final Object... objects) {
+        @SuppressWarnings("resource")
         final PrintWriter out = scontext != null? new PrintWriter(scontext.getWriter()) : getContext().getEnv().getOut();
         final StringBuilder sb = new StringBuilder();
 
-        for (final Object object : objects) {
+        for (final Object obj : objects) {
             if (sb.length() != 0) {
                 sb.append(' ');
             }
 
-            sb.append(JSType.toString(object));
+            sb.append(JSType.toString(obj));
         }
 
         // Print all at once to ensure thread friendly result.
--- a/nashorn/src/jdk/nashorn/internal/objects/NativeDate.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/nashorn/src/jdk/nashorn/internal/objects/NativeDate.java	Wed Jul 05 19:53:51 2017 +0200
@@ -935,7 +935,6 @@
                     }
                     sb.append(' ');
 
-                    //$FALL-THROUGH$
                 case FORMAT_TIME:
                     final TimeZone tz = nd.getTimeZone();
                     final double utcTime = nd.getTime();
--- a/nashorn/src/jdk/nashorn/internal/objects/NativeObject.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/nashorn/src/jdk/nashorn/internal/objects/NativeObject.java	Wed Jul 05 19:53:51 2017 +0200
@@ -39,6 +39,7 @@
 import java.util.List;
 import java.util.Set;
 import java.util.concurrent.Callable;
+
 import jdk.internal.dynalink.beans.BeansLinker;
 import jdk.internal.dynalink.beans.StaticClass;
 import jdk.internal.dynalink.linker.GuardedInvocation;
@@ -716,7 +717,7 @@
         return target;
     }
 
-    /*
+    /**
      * Binds the source mirror object's properties to the target object. Binding
      * properties allows two-way read/write for the properties of the source object.
      * All inherited, enumerable properties are also bound. This method is used to
@@ -731,7 +732,7 @@
         // make accessor properties using dynamic invoker getters and setters
         final AccessorProperty[] props = new AccessorProperty[keys.size()];
         int idx = 0;
-        for (String name : keys) {
+        for (final String name : keys) {
             final MethodHandle getter = Bootstrap.createDynamicInvoker("dyn:getMethod|getProp|getElem:" + name, MIRROR_GETTER_TYPE);
             final MethodHandle setter = Bootstrap.createDynamicInvoker("dyn:setProp|setElem:" + name, MIRROR_SETTER_TYPE);
             props[idx] = AccessorProperty.create(name, 0, getter, setter);
--- a/nashorn/src/jdk/nashorn/internal/objects/NativeUint8ClampedArray.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/nashorn/src/jdk/nashorn/internal/objects/NativeUint8ClampedArray.java	Wed Jul 05 19:53:51 2017 +0200
@@ -80,7 +80,8 @@
 
         private static final MethodHandle GET_ELEM = specialCall(MethodHandles.lookup(), Uint8ClampedArrayData.class, "getElem", int.class, int.class).methodHandle();
         private static final MethodHandle SET_ELEM = specialCall(MethodHandles.lookup(), Uint8ClampedArrayData.class, "setElem", void.class, int.class, int.class).methodHandle();
-        private static final MethodHandle RINT     = staticCall(MethodHandles.lookup(), Uint8ClampedArrayData.class, "rint", double.class, double.class).methodHandle();
+        private static final MethodHandle RINT_D   = staticCall(MethodHandles.lookup(), Uint8ClampedArrayData.class, "rint", double.class, double.class).methodHandle();
+        private static final MethodHandle RINT_O   = staticCall(MethodHandles.lookup(), Uint8ClampedArrayData.class, "rint", Object.class, Object.class).methodHandle();
         private static final MethodHandle CLAMP_LONG = staticCall(MethodHandles.lookup(), Uint8ClampedArrayData.class, "clampLong", long.class, long.class).methodHandle();
 
         private Uint8ClampedArrayData(final ByteBuffer nb, final int start, final int end) {
@@ -109,8 +110,10 @@
         public MethodHandle getElementSetter(final Class<?> elementType) {
             final MethodHandle setter = super.getElementSetter(elementType); //getContinuousElementSetter(getClass(), setElem(), elementType);
             if (setter != null) {
-                if (elementType == double.class) {
-                    return MH.filterArguments(setter, 2, RINT);
+                if (elementType == Object.class) {
+                    return MH.filterArguments(setter, 2, RINT_O);
+                } else if (elementType == double.class) {
+                    return MH.filterArguments(setter, 2, RINT_D);
                 } else if (elementType == long.class) {
                     return MH.filterArguments(setter, 2, CLAMP_LONG);
                 }
@@ -191,6 +194,11 @@
         }
 
         @SuppressWarnings("unused")
+        private static Object rint(final Object rint) {
+            return rint(JSType.toNumber(rint));
+        }
+
+        @SuppressWarnings("unused")
         private static long clampLong(final long l) {
             if(l < 0L) {
                 return 0L;
--- a/nashorn/src/jdk/nashorn/internal/runtime/ECMAErrors.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/nashorn/src/jdk/nashorn/internal/runtime/ECMAErrors.java	Wed Jul 05 19:53:51 2017 +0200
@@ -28,7 +28,7 @@
 import java.text.MessageFormat;
 import java.util.Locale;
 import java.util.ResourceBundle;
-import jdk.nashorn.api.scripting.NashornException;
+
 import jdk.nashorn.internal.codegen.CompilerConstants;
 import jdk.nashorn.internal.objects.Global;
 import jdk.nashorn.internal.scripts.JS;
--- a/nashorn/src/jdk/nashorn/internal/runtime/RecompilableScriptFunctionData.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/nashorn/src/jdk/nashorn/internal/runtime/RecompilableScriptFunctionData.java	Wed Jul 05 19:53:51 2017 +0200
@@ -36,6 +36,7 @@
 import java.util.Map;
 import java.util.Set;
 import java.util.TreeMap;
+
 import jdk.internal.dynalink.support.NameCodec;
 import jdk.nashorn.internal.codegen.CompileUnit;
 import jdk.nashorn.internal.codegen.Compiler;
@@ -236,14 +237,14 @@
     /**
      * Initialize transient fields on deserialized instances
      *
-     * @param source source
-     * @param installer code installer
+     * @param src source
+     * @param inst code installer
      */
-    public void initTransients(final Source source, final CodeInstaller<ScriptEnvironment> installer) {
+    public void initTransients(final Source src, final CodeInstaller<ScriptEnvironment> inst) {
         if (this.source == null && this.installer == null) {
-            this.source = source;
-            this.installer = installer;
-        } else if (this.source != source || this.installer != installer) {
+            this.source    = src;
+            this.installer = inst;
+        } else if (this.source != src || this.installer != inst) {
             // Existing values must be same as those passed as parameters
             throw new IllegalArgumentException();
         }
--- a/nashorn/src/jdk/nashorn/internal/runtime/ScriptObject.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/nashorn/src/jdk/nashorn/internal/runtime/ScriptObject.java	Wed Jul 05 19:53:51 2017 +0200
@@ -3626,7 +3626,6 @@
         return MH.insertArguments(KNOWNFUNCPROPGUARDPROTO, 1, map, getter, depth, func);
     }
 
-    @SuppressWarnings("unused")
     private static ScriptObject getProto(final ScriptObject self, final int depth) {
         ScriptObject proto = self;
         for (int d = 0; d < depth; d++) {
--- a/nashorn/src/jdk/nashorn/internal/runtime/ScriptRuntime.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/nashorn/src/jdk/nashorn/internal/runtime/ScriptRuntime.java	Wed Jul 05 19:53:51 2017 +0200
@@ -484,17 +484,16 @@
             final Object unwrapped = ScriptObjectMirror.unwrap(expression, global);
             if (unwrapped instanceof ScriptObject) {
                 return new WithObject(scope, (ScriptObject)unwrapped);
-            } else {
-                // foreign ScriptObjectMirror
-                ScriptObject exprObj = global.newObject();
-                NativeObject.bindAllProperties(exprObj, (ScriptObjectMirror)expression);
-                return new WithObject(scope, exprObj);
             }
-        } else {
-            final Object wrappedExpr = JSType.toScriptObject(global, expression);
-            if (wrappedExpr instanceof ScriptObject) {
-                return new WithObject(scope, (ScriptObject)wrappedExpr);
-            }
+            // foreign ScriptObjectMirror
+            final ScriptObject exprObj = global.newObject();
+            NativeObject.bindAllProperties(exprObj, (ScriptObjectMirror)expression);
+            return new WithObject(scope, exprObj);
+        }
+
+        final Object wrappedExpr = JSType.toScriptObject(global, expression);
+        if (wrappedExpr instanceof ScriptObject) {
+            return new WithObject(scope, (ScriptObject)wrappedExpr);
         }
 
         throw typeError(global, "cant.apply.with.to.non.scriptobject");
@@ -819,9 +818,8 @@
 
     /** ECMA 11.9.6 The Strict Equality Comparison Algorithm */
     private static boolean strictEquals(final Object x, final Object y) {
-        if(x == y) {
-            return true;
-        }
+        // NOTE: you might be tempted to do a quick x == y comparison. Remember, though, that any Double object having
+        // NaN value is not equal to itself by value even though it is referentially.
 
         final JSType xType = JSType.ofNoFunction(x);
         final JSType yType = JSType.ofNoFunction(y);
--- a/nashorn/src/jdk/nashorn/internal/runtime/WithObject.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/nashorn/src/jdk/nashorn/internal/runtime/WithObject.java	Wed Jul 05 19:53:51 2017 +0200
@@ -31,12 +31,13 @@
 import java.lang.invoke.MethodHandles;
 import java.lang.invoke.MethodType;
 import java.lang.invoke.SwitchPoint;
-import jdk.nashorn.api.scripting.AbstractJSObject;
-import jdk.nashorn.api.scripting.ScriptObjectMirror;
+
 import jdk.internal.dynalink.CallSiteDescriptor;
 import jdk.internal.dynalink.linker.GuardedInvocation;
 import jdk.internal.dynalink.linker.LinkRequest;
 import jdk.internal.dynalink.support.CallSiteDescriptorFactory;
+import jdk.nashorn.api.scripting.AbstractJSObject;
+import jdk.nashorn.api.scripting.ScriptObjectMirror;
 import jdk.nashorn.internal.runtime.linker.NashornCallSiteDescriptor;
 import jdk.nashorn.internal.runtime.linker.NashornGuards;
 
@@ -322,6 +323,7 @@
                 // We need to make sure correct 'this' is used for calls with Ident call
                 // expressions. We do so here using an AbstractJSObject instance.
                 return new AbstractJSObject() {
+                    @Override
                     public Object call(final Object thiz, final Object... args) {
                         return mirror.call(withFilterExpression(receiver), args);
                     }
--- a/nashorn/src/jdk/nashorn/internal/runtime/options/Options.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/nashorn/src/jdk/nashorn/internal/runtime/options/Options.java	Wed Jul 05 19:53:51 2017 +0200
@@ -78,7 +78,10 @@
     /** The options map of enabled options */
     private final TreeMap<String, Option<?>> options;
 
-    /** System property that can be used for command line option propagation */
+    /** System property that can be used to prepend options to the explicitly specified command line. */
+    private static final String NASHORN_ARGS_PREPEND_PROPERTY = "nashorn.args.prepend";
+
+    /** System property that can be used to append options to the explicitly specified command line. */
     private static final String NASHORN_ARGS_PROPERTY = "nashorn.args";
 
     /**
@@ -419,15 +422,9 @@
      */
     public void process(final String[] args) {
         final LinkedList<String> argList = new LinkedList<>();
+        addSystemProperties(NASHORN_ARGS_PREPEND_PROPERTY, argList);
         Collections.addAll(argList, args);
-
-        final String extra = getStringProperty(NASHORN_ARGS_PROPERTY, null);
-        if (extra != null) {
-            final StringTokenizer st = new StringTokenizer(extra);
-            while (st.hasMoreTokens()) {
-                argList.add(st.nextToken());
-            }
-        }
+        addSystemProperties(NASHORN_ARGS_PROPERTY, argList);
 
         while (!argList.isEmpty()) {
             final String arg = argList.remove(0);
@@ -509,6 +506,16 @@
         }
     }
 
+    private static void addSystemProperties(final String sysPropName, final List<String> argList) {
+        final String sysArgs = getStringProperty(sysPropName, null);
+        if (sysArgs != null) {
+            final StringTokenizer st = new StringTokenizer(sysArgs);
+            while (st.hasMoreTokens()) {
+                argList.add(st.nextToken());
+            }
+        }
+    }
+
     private static OptionTemplate getOptionTemplate(final String key) {
         for (final OptionTemplate t : Options.validOptions) {
             if (t.matches(key)) {
--- a/nashorn/test/script/basic/JDK-8030182_2.js	Wed Jul 05 19:52:35 2017 +0200
+++ b/nashorn/test/script/basic/JDK-8030182_2.js	Wed Jul 05 19:53:51 2017 +0200
@@ -41,6 +41,6 @@
 try {
     eval(str);
 } catch (e) {
-    print(e.stack.replace(/\\/g, '/'));
+    print(e.stack.replace(/\\/g, '/').replace(/<eval>@[0-9]+/, '<eval>@<id>'));
 }
 
--- a/nashorn/test/script/basic/JDK-8030182_2.js.EXPECTED	Wed Jul 05 19:52:35 2017 +0200
+++ b/nashorn/test/script/basic/JDK-8030182_2.js.EXPECTED	Wed Jul 05 19:53:51 2017 +0200
@@ -1,3 +1,3 @@
 ReferenceError: "g" is not defined
-	at <program> (test/script/basic/JDK-8030182_2.js#42:4<eval>@1:-1)
+	at <program> (test/script/basic/JDK-8030182_2.js#42:4<eval>@<id>:-1)
 	at <program> (test/script/basic/JDK-8030182_2.js:42)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8051439.js	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2010, 2014, 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.
+ */
+
+/**
+ * JDK-8051439: Wrong type calculated for ADD operator with undefined operand
+ *
+ * @test
+ * @run
+ */
+
+// Test + operator
+function f1() { 
+    var x; 
+    for (var i = 0;i < 3; i++) { 
+        x = x + i; 
+    }
+    x = x + "test"; 
+    return x; 
+} 
+
+// Test += operator
+function f2() { 
+    var x; 
+    for (var i = 0;i < 3; i++) { 
+        x += i; 
+    }
+    x += "test"; 
+    return x; 
+} 
+
+print(f1());
+print(f2());
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8051439.js.EXPECTED	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,2 @@
+NaNtest
+NaNtest
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/compile-octane-normal.js	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2010, 2013, 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.
+ */
+
+/**
+ * Make sure that we run with the class cache off to so that every
+ * run produces compile time and with optimistic type info caching
+ * and persistent code store off, for the same reasons. These last two
+ * are currently default, but this is not guaranteed to be the case
+ * forever, so make this test future safe, we specify them explicitly
+ *
+ * @test
+ * @runif external.octane
+ * @option -scripting
+ * @option -Dnashorn.typeInfo.disabled=true
+ * @option --class-cache-size=0
+ * @option --persistent-code-cache=false
+ */
+
+var fn  = __DIR__ + 'compile-octane.js';
+var url = "file://" + fn; 
+loadWithNewGlobal(new java.net.URL(url));
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/compile-octane-normal.js.EXPECTED	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,30 @@
+Compiling 'box2d'...
+Done.
+Compiling 'code-load'...
+Done.
+Compiling 'crypto'...
+Done.
+Compiling 'deltablue'...
+Done.
+Compiling 'earley-boyer'...
+Done.
+Compiling 'gbemu'... (2 files)
+Done.
+Compiling 'mandreel'...
+Done.
+Compiling 'navier-stokes'...
+Done.
+Compiling 'pdfjs'...
+Done.
+Compiling 'raytrace'...
+Done.
+Compiling 'regexp'...
+Done.
+Compiling 'richards'...
+Done.
+Compiling 'splay'...
+Done.
+Compiling 'typescript'... (3 files)
+Done.
+Compiling 'zlib'... (2 files)
+Done.
--- a/nashorn/test/script/basic/compile-octane-splitter.js	Wed Jul 05 19:52:35 2017 +0200
+++ b/nashorn/test/script/basic/compile-octane-splitter.js	Wed Jul 05 19:53:51 2017 +0200
@@ -22,12 +22,22 @@
  */
 
 /**
+ * Make sure that we run with the class cache off to so that every
+ * run produces compile time and with optimistic type info caching
+ * and persistent code store off, for the same reasons. These last two
+ * are currently default, but this is not guaranteed to be the case
+ * forever, so make this test future safe, we specify them explicitly
+ *
  * @test
  * @option -Dnashorn.compiler.splitter.threshold=1000
  * @fork
  * @runif external.octane
  * @option -scripting
+ * @option -Dnashorn.typeInfo.disabled=true
+ * @option --class-cache-size=0
+ * @option --persistent-code-cache=false
  */
 
-compile_only = true;
-load(__DIR__ + 'run-octane.js');
+var fn  = __DIR__ + 'compile-octane.js';
+var url = "file://" + fn; 
+loadWithNewGlobal(new java.net.URL(url));
--- a/nashorn/test/script/basic/compile-octane-splitter.js.EXPECTED	Wed Jul 05 19:52:35 2017 +0200
+++ b/nashorn/test/script/basic/compile-octane-splitter.js.EXPECTED	Wed Jul 05 19:53:51 2017 +0200
@@ -1,15 +1,30 @@
-[box2d] Compiled OK
-[code-load] Compiled OK
-[crypto] Compiled OK
-[deltablue] Compiled OK
-[earley-boyer] Compiled OK
-[gbemu] Compiled OK
-[mandreel] Compiled OK
-[navier-stokes] Compiled OK
-[pdfjs] Compiled OK
-[raytrace] Compiled OK
-[regexp] Compiled OK
-[richards] Compiled OK
-[splay] Compiled OK
-[typescript] Compiled OK
-[zlib] Compiled OK
+Compiling 'box2d'...
+Done.
+Compiling 'code-load'...
+Done.
+Compiling 'crypto'...
+Done.
+Compiling 'deltablue'...
+Done.
+Compiling 'earley-boyer'...
+Done.
+Compiling 'gbemu'... (2 files)
+Done.
+Compiling 'mandreel'...
+Done.
+Compiling 'navier-stokes'...
+Done.
+Compiling 'pdfjs'...
+Done.
+Compiling 'raytrace'...
+Done.
+Compiling 'regexp'...
+Done.
+Compiling 'richards'...
+Done.
+Compiling 'splay'...
+Done.
+Compiling 'typescript'... (3 files)
+Done.
+Compiling 'zlib'... (2 files)
+Done.
--- a/nashorn/test/script/basic/compile-octane.js	Wed Jul 05 19:52:35 2017 +0200
+++ b/nashorn/test/script/basic/compile-octane.js	Wed Jul 05 19:53:51 2017 +0200
@@ -22,10 +22,122 @@
  */
 
 /**
- * @test
- * @runif external.octane
- * @option -scripting
+ * Make sure that we run with the class cache off to so that every
+ * run produces compile time and with optimistic type info caching
+ * and persistent code store off, for the same reasons. These last two
+ * are currently default, but this is not guaranteed to be the case
+ * forever, so make this test future safe, we specify them explicitly
+ *
+ * This means that if you use this subtest as a compilation test
+ * harness, pass the arguments:
+ *
+ * -scripting -Dnashorn.typeInfo.disabled=true --class-cache-size=0 
+ * --persistent-code-cache=false
+ *
+ * @subtest
  */
 
-compile_only = true;
-load(__DIR__ + 'run-octane.js');
+load(__DIR__ + 'octane-payload.js');
+
+var DEFAULT_ITERS = 1; //default is one iteration through each benchmark
+var iters = DEFAULT_ITERS; 
+var args = [];
+
+if (typeof $ARGS !== 'undefined') {
+    args = $ARGS;
+} else if (typeof arguments !== 'undefined' && arguments.length != 0) {
+    args = arguments;
+}
+
+var onlyTheseTests = [];
+var verbose = false;
+
+for (var i = 0; i < args.length; ) {
+    var arg = args[i];
+    if (arg === '--iterations') {
+	iters = +args[++i];
+    } else if (arg === '--verbose') {
+	verbose = true;
+    } else {
+	onlyTheseTests.push(arg);
+    }
+    i++;
+}
+
+if (isNaN(iters)) {
+    iters = DEFAULT_ITERS;
+}
+
+if (iters != DEFAULT_ITERS) {
+    print("Running " + iters + " iterations of each compilation.");
+}
+
+function print_if_verbose(x) {
+    if (verbose) {
+	print(x);
+    }
+}
+
+function contains(a, obj) {
+    for (var i = 0; i < a.length; i++) {
+        if (a[i] === obj) {
+            return true;
+        }
+    }
+    return false;
+}
+
+var testsCompiled = [];
+
+for (var j in tests) {
+    var test_name = tests[j].name;
+    var files = tests[j].files;
+
+    if (onlyTheseTests.length > 0 && !contains(onlyTheseTests, test_name)) {
+	print_if_verbose("Skipping " + test_name);
+	continue;
+    }
+
+    if (!contains(testsCompiled, test_name)) {
+	testsCompiled.push(test_name);
+    }
+
+    var str = "Compiling '" + test_name + "'...";
+    if (files.length > 1) {
+	str += " (" + files.length + " files)";
+    }
+    if (iters != 1) {
+	str += " (" + iters + " times)";
+    }
+    str + "...";
+    print(str);
+
+    for (var iteration = 0; iteration < iters; iteration++) {
+
+	//get a new global to avoid symbol pollution and reloads of base
+	//in the same namespace
+	var newGlobal = loadWithNewGlobal({script:'this', name:'test'});
+
+	//load base into the new global so we get BenchmarkSuite etc
+	newGlobal.load(base); 
+
+	//load all files in the single benchmark
+	for (var k in files) {	    
+	    var file = files[k];
+	    if (iteration >= 0) { //only display message on first iteration
+		var str2 = "\t";
+		if (iters > 1) {
+		    str2 += " [iteration " + (iteration + 1) + "]";
+		}
+		str2 += " processing file: " + file + "...";
+		print_if_verbose(str2);
+	    }
+	    newGlobal.load("file://" + path + file);
+	}
+    }
+    print("Done.");
+}
+
+if (testsCompiled.length == 0) {
+    print("Error: no tests given to compile");
+}
--- a/nashorn/test/script/basic/compile-octane.js.EXPECTED	Wed Jul 05 19:52:35 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,15 +0,0 @@
-[box2d] Compiled OK
-[code-load] Compiled OK
-[crypto] Compiled OK
-[deltablue] Compiled OK
-[earley-boyer] Compiled OK
-[gbemu] Compiled OK
-[mandreel] Compiled OK
-[navier-stokes] Compiled OK
-[pdfjs] Compiled OK
-[raytrace] Compiled OK
-[regexp] Compiled OK
-[richards] Compiled OK
-[splay] Compiled OK
-[typescript] Compiled OK
-[zlib] Compiled OK
--- a/nashorn/test/script/basic/hideLocationProperties.js	Wed Jul 05 19:52:35 2017 +0200
+++ b/nashorn/test/script/basic/hideLocationProperties.js	Wed Jul 05 19:53:51 2017 +0200
@@ -46,7 +46,7 @@
     (function() { print(__FILE__) })()
 }
 
-print(__FILE__)
+print(__FILE__.replace(/\\/g, "/"))
 
 var o = { __FILE__: "woot" }
 with(o) { print(__FILE__) }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/octane-payload.js	Wed Jul 05 19:53:51 2017 +0200
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2010, 2014, 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.
+ */
+
+/**
+ * @subtest
+ */
+
+function initZlib() {
+    zlib = new BenchmarkSuite('zlib', [152815148], [
+                            new Benchmark('zlib', false, true, 10,
+                                  runZlib, undefined, tearDownZlib, null, 3)]);
+}
+
+var tests = [
+    {name:"box2d",         files:["box2d.js"],                         suite:"Box2DBenchmark"},
+    {name:"code-load",     files:["code-load.js"],                     suite:"CodeLoad"},
+    {name:"crypto",        files:["crypto.js"],                        suite:"Crypto"},
+    {name:"deltablue",     files:["deltablue.js"],                     suite:"DeltaBlue"},
+    {name:"earley-boyer",  files:["earley-boyer.js"],                  suite:"EarleyBoyer"},
+    {name:"gbemu",         files:["gbemu-part1.js", "gbemu-part2.js"], suite:"GameboyBenchmark"},
+    {name:"mandreel",      files:["mandreel.js"],                      suite:"MandreelBenchmark"},
+    {name:"navier-stokes", files:["navier-stokes.js"],                 suite:"NavierStokes"},
+    {name:"pdfjs",         files:["pdfjs.js"],                         suite:"PdfJS"},
+    {name:"raytrace",      files:["raytrace.js"],                      suite:"RayTrace"},
+    {name:"regexp",        files:["regexp.js"],                        suite:"RegExpSuite"},
+    {name:"richards",      files:["richards.js"],                      suite:"Richards"},
+    {name:"splay",         files:["splay.js"],                         suite:"Splay"},
+    {name:"typescript",    files:["typescript.js", "typescript-input.js", "typescript-compiler.js"], suite:"typescript"},
+    //zlib currently disabled - requires read
+    {name:"zlib",          files:["zlib.js", "zlib-data.js"], suite:"zlib", before:initZlib}
+];
+
+var dir = (typeof(__DIR__) == 'undefined') ? "test/script/basic/" : __DIR__;
+
+// TODO: why is this path hard coded when it's defined in project properties?
+var path = dir + "../external/octane/";
+var base = path + "base.js";
+
--- a/nashorn/test/script/basic/optimistic_arithmetic_check_type.js	Wed Jul 05 19:52:35 2017 +0200
+++ b/nashorn/test/script/basic/optimistic_arithmetic_check_type.js	Wed Jul 05 19:53:51 2017 +0200
@@ -25,6 +25,7 @@
  * @test
  * @bug 8036987, 8037572
  * @summary Implement tests that checks static types in the compiled code
+ * @option --optimistic-types=true
  * @run
  */
 
--- a/nashorn/test/script/basic/optimistic_assignment_check_type.js	Wed Jul 05 19:52:35 2017 +0200
+++ b/nashorn/test/script/basic/optimistic_assignment_check_type.js	Wed Jul 05 19:53:51 2017 +0200
@@ -25,6 +25,7 @@
  * @test
  * @bug 8036987, 8037572
  * @summary Implement tests that checks static types in the compiled code
+ * @option --optimistic-types=true
  * @run
  */
 
--- a/nashorn/test/script/basic/optimistic_check_type.js	Wed Jul 05 19:52:35 2017 +0200
+++ b/nashorn/test/script/basic/optimistic_check_type.js	Wed Jul 05 19:53:51 2017 +0200
@@ -25,6 +25,7 @@
  * @test
  * @bug 8036987, 8037572
  * @summary Implement tests that checks static types in the compiled code
+ * @option --optimistic-types=true
  * @run
  */
 
--- a/nashorn/test/script/basic/run-octane.js	Wed Jul 05 19:52:35 2017 +0200
+++ b/nashorn/test/script/basic/run-octane.js	Wed Jul 05 19:53:51 2017 +0200
@@ -24,36 +24,8 @@
 /**
  * @subtest
  */
-
-
-function initZlib() {
-    zlib = new BenchmarkSuite('zlib', [152815148], [
-                            new Benchmark('zlib', false, true, 10,
-                                  runZlib, undefined, tearDownZlib, null, 3)]);
-}
-
-var tests = [
-    {name:"box2d",         files:["box2d.js"],                         suite:"Box2DBenchmark"},
-    {name:"code-load",     files:["code-load.js"],                     suite:"CodeLoad"},
-    {name:"crypto",        files:["crypto.js"],                        suite:"Crypto"},
-    {name:"deltablue",     files:["deltablue.js"],                     suite:"DeltaBlue"},
-    {name:"earley-boyer",  files:["earley-boyer.js"],                  suite:"EarleyBoyer"},
-    {name:"gbemu",         files:["gbemu-part1.js", "gbemu-part2.js"], suite:"GameboyBenchmark"},
-    {name:"mandreel",      files:["mandreel.js"],                      suite:"MandreelBenchmark"},
-    {name:"navier-stokes", files:["navier-stokes.js"],                 suite:"NavierStokes"},
-    {name:"pdfjs",         files:["pdfjs.js"],                         suite:"PdfJS"},
-    {name:"raytrace",      files:["raytrace.js"],                      suite:"RayTrace"},
-    {name:"regexp",        files:["regexp.js"],                        suite:"RegExpSuite"},
-    {name:"richards",      files:["richards.js"],                      suite:"Richards"},
-    {name:"splay",         files:["splay.js"],                         suite:"Splay"},
-    {name:"typescript",    files:["typescript.js", "typescript-input.js", "typescript-compiler.js"], suite:"typescript"},
-    //zlib currently disabled - requires read
-    {name:"zlib",          files:["zlib.js", "zlib-data.js"], suite:"zlib", before:initZlib}
-];
-var dir = (typeof(__DIR__) == 'undefined') ? "test/script/basic/" : __DIR__;
-
-// TODO: why is this path hard coded when it's defined in project properties?
-var path = dir + "../external/octane/";
+var payload = __DIR__ + "octane-payload.js";
+load(payload);
 
 var runtime = undefined;
 var verbose = false;
--- a/nashorn/test/script/nosecurity/JDK-8050964.js	Wed Jul 05 19:52:35 2017 +0200
+++ b/nashorn/test/script/nosecurity/JDK-8050964.js	Wed Jul 05 19:53:51 2017 +0200
@@ -46,8 +46,11 @@
     nashornJar = new File(".", nashornJar);
 }
 
+var javahome = System.getProperty("java.home");
+var jdepsPath = javahome + "/../bin/jdeps".replaceAll(/\//g, File.separater);
+
 // run jdep on nashorn.jar - only summary but print profile info
-`jdeps -s -P ${nashornJar.absolutePath}`
+`${jdepsPath} -s -P ${nashornJar.absolutePath}`
 
 // check for "(compact1)" in output from jdep tool
 if (! /(compact1)/.test($OUT)) {
--- a/nashorn/test/script/trusted/event_queue.js	Wed Jul 05 19:52:35 2017 +0200
+++ b/nashorn/test/script/trusted/event_queue.js	Wed Jul 05 19:53:51 2017 +0200
@@ -29,6 +29,7 @@
  * @fork
  * @option -Dnashorn.debug=true
  * @option --log=recompile:quiet
+ * @option --optimistic-types=true
  */
 
 print(Debug);
--- a/nashorn/test/script/trusted/optimistic_recompilation.js	Wed Jul 05 19:52:35 2017 +0200
+++ b/nashorn/test/script/trusted/optimistic_recompilation.js	Wed Jul 05 19:53:51 2017 +0200
@@ -28,6 +28,7 @@
  * @fork
  * @option -Dnashorn.debug=true
  * @option --log=recompile:quiet
+ * @option --optimistic-types=true
  */
 
 var forName       = java.lang.Class["forName(String)"];
--- a/nashorn/test/src/jdk/nashorn/api/scripting/ScriptEngineTest.java	Wed Jul 05 19:52:35 2017 +0200
+++ b/nashorn/test/src/jdk/nashorn/api/scripting/ScriptEngineTest.java	Wed Jul 05 19:53:51 2017 +0200
@@ -607,6 +607,14 @@
         assertEquals(res, "hello");
     }
 
+    // @bug 8054223: Nashorn: AssertionError when use __DIR__ and ScriptEngine.eval()
+    @Test
+    public void check__DIR__Test() throws ScriptException {
+        final ScriptEngineManager m = new ScriptEngineManager();
+        final ScriptEngine e = m.getEngineByName("nashorn");
+        e.eval("__DIR__");
+    }
+
     // @bug 8050432:javax.script.filename variable should not be enumerable
     // with nashorn engine's ENGINE_SCOPE bindings
     @Test