Merge
authorduke
Wed, 05 Jul 2017 19:53:19 +0200
changeset 25819 1066175d41ab
parent 25818 30a18bb9b88d (current diff)
parent 25817 b293b0e3fbaa (diff)
child 25831 3fce8370cad4
Merge
hotspot/test/compiler/5091921/Test6890943.sh
jdk/src/macosx/bundle/JavaAppLauncher/JavaAppLauncher.xcodeproj/project.pbxproj
jdk/src/macosx/bundle/JavaAppLauncher/resources/English.lproj/InfoPlist.strings
jdk/src/macosx/bundle/JavaAppLauncher/resources/JavaAppLauncher-Info.plist
jdk/src/macosx/bundle/JavaAppLauncher/src/JVMArgs.h
jdk/src/macosx/bundle/JavaAppLauncher/src/JVMArgs.m
jdk/src/macosx/bundle/JavaAppLauncher/src/JavaAppLauncher.h
jdk/src/macosx/bundle/JavaAppLauncher/src/JavaAppLauncher.m
jdk/src/macosx/bundle/JavaAppLauncher/src/JavaAppLauncher_Prefix.pch
jdk/src/macosx/bundle/JavaAppLauncher/src/main.m
jdk/src/macosx/classes/apple/launcher/JavaAppLauncher.java
jdk/src/macosx/classes/apple/launcher/appLauncherErrors.properties
jdk/src/macosx/lib/flavormap.properties
jdk/src/macosx/native/apple/launcher/JavaAppLauncher.m
jdk/src/share/classes/com/sun/jndi/ldap/VersionHelper12.java
jdk/src/share/classes/com/sun/naming/internal/VersionHelper12.java
jdk/src/share/classes/sun/audio/AudioData.java
jdk/src/share/classes/sun/audio/AudioDataStream.java
jdk/src/share/classes/sun/audio/AudioDevice.java
jdk/src/share/classes/sun/audio/AudioPlayer.java
jdk/src/share/classes/sun/audio/AudioSecurityAction.java
jdk/src/share/classes/sun/audio/AudioSecurityExceptionAction.java
jdk/src/share/classes/sun/audio/AudioStream.java
jdk/src/share/classes/sun/audio/AudioStreamSequence.java
jdk/src/share/classes/sun/audio/AudioTranslatorStream.java
jdk/src/share/classes/sun/audio/ContinuousAudioDataStream.java
jdk/src/share/classes/sun/audio/InvalidAudioFormatException.java
jdk/src/share/classes/sun/audio/NativeAudioStream.java
jdk/src/solaris/lib/flavormap.properties
jdk/src/windows/lib/flavormap.properties
--- a/.hgtags-top-repo	Fri Aug 01 14:09:06 2014 -0700
+++ b/.hgtags-top-repo	Wed Jul 05 19:53:19 2017 +0200
@@ -267,3 +267,4 @@
 8e4bdab4c362aadde2d321f968cd503a2f779e2f jdk9-b22
 88567461a2cd9b7fb431fee6440005a694df1f47 jdk9-b23
 1d4a293fbec19dc2d5790bbb2c7dd0ed8f265484 jdk9-b24
+aefd8899a8d6615fb34ba99b2e38996a7145baa8 jdk9-b25
--- a/hotspot/.hgtags	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/.hgtags	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Klass.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/make/jprt.properties	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/cpu/ppc/vm/frame_ppc.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/cpu/ppc/vm/frame_ppc.inline.hpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/cpu/ppc/vm/icache_ppc.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/cpu/ppc/vm/interpreterRT_ppc.hpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/cpu/ppc/vm/interpreter_ppc.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/cpu/ppc/vm/ppc.ad	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/cpu/ppc/vm/register_ppc.hpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/cpu/ppc/vm/runtime_ppc.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/cpu/ppc/vm/sharedRuntime_ppc.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/cpu/ppc/vm/templateTable_ppc_64.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/cpu/ppc/vm/vmreg_ppc.hpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/cpu/ppc/vm/vmreg_ppc.inline.hpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/cpu/sparc/vm/c1_Runtime1_sparc.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/cpu/sparc/vm/frame_sparc.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/cpu/sparc/vm/frame_sparc.hpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/cpu/sparc/vm/frame_sparc.inline.hpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/cpu/sparc/vm/interpreterRT_sparc.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/cpu/sparc/vm/interpreter_sparc.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.hpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/cpu/sparc/vm/methodHandles_sparc.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/cpu/sparc/vm/register_sparc.hpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/cpu/sparc/vm/sparc.ad	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/cpu/sparc/vm/vmreg_sparc.hpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/cpu/sparc/vm/vmreg_sparc.inline.hpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/cpu/x86/vm/frame_x86.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/cpu/x86/vm/frame_x86.hpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/cpu/x86/vm/frame_x86.inline.hpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/cpu/x86/vm/interp_masm_x86.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/cpu/x86/vm/interp_masm_x86_32.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/cpu/x86/vm/interp_masm_x86_32.hpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/cpu/x86/vm/interp_masm_x86_64.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/cpu/x86/vm/interp_masm_x86_64.hpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/cpu/x86/vm/interpreter_x86_32.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/cpu/x86/vm/interpreter_x86_64.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/cpu/x86/vm/register_x86.hpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/cpu/x86/vm/templateInterpreter_x86_32.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/cpu/x86/vm/templateInterpreter_x86_64.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/cpu/x86/vm/templateTable_x86_32.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/cpu/x86/vm/vmreg_x86.hpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/cpu/x86/vm/vmreg_x86.inline.hpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/cpu/x86/vm/x86.ad	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/cpu/zero/vm/frame_zero.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/cpu/zero/vm/frame_zero.inline.hpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/os/aix/vm/os_aix.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/os/aix/vm/os_aix.inline.hpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/os/bsd/dtrace/generateJvmOffsets.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/os/bsd/dtrace/libjvm_db.c	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/os/solaris/dtrace/generateJvmOffsets.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/os/solaris/dtrace/libjvm_db.c	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/os/solaris/vm/os_solaris.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/os/windows/vm/os_windows.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/os_cpu/aix_ppc/vm/atomic_aix_ppc.inline.hpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/os_cpu/aix_ppc/vm/orderAccess_aix_ppc.inline.hpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/os_cpu/bsd_x86/vm/atomic_bsd_x86.inline.hpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/os_cpu/bsd_x86/vm/orderAccess_bsd_x86.inline.hpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/os_cpu/bsd_zero/vm/atomic_bsd_zero.inline.hpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/os_cpu/bsd_zero/vm/orderAccess_bsd_zero.inline.hpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/os_cpu/linux_ppc/vm/atomic_linux_ppc.inline.hpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/os_cpu/linux_ppc/vm/orderAccess_linux_ppc.inline.hpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/os_cpu/linux_sparc/vm/atomic_linux_sparc.inline.hpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/os_cpu/linux_sparc/vm/orderAccess_linux_sparc.inline.hpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/os_cpu/linux_sparc/vm/os_linux_sparc.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/os_cpu/linux_x86/vm/atomic_linux_x86.inline.hpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/os_cpu/linux_x86/vm/orderAccess_linux_x86.inline.hpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/os_cpu/linux_zero/vm/atomic_linux_zero.inline.hpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/os_cpu/linux_zero/vm/orderAccess_linux_zero.inline.hpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/os_cpu/solaris_sparc/vm/atomic_solaris_sparc.inline.hpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/os_cpu/solaris_sparc/vm/orderAccess_solaris_sparc.inline.hpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/os_cpu/solaris_x86/vm/atomic_solaris_x86.inline.hpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/os_cpu/solaris_x86/vm/orderAccess_solaris_x86.inline.hpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/os_cpu/windows_x86/vm/atomic_windows_x86.inline.hpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/os_cpu/windows_x86/vm/orderAccess_windows_x86.inline.hpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/adlc/main.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/asm/assembler.hpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/asm/codeBuffer.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/c1/c1_CodeStubs.hpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/c1/c1_Defs.hpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/c1/c1_FrameMap.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/c1/c1_LinearScan.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/c1/c1_Runtime1.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/ci/ciField.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/classfile/bytecodeAssembler.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/classfile/classFileStream.hpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/classfile/javaClasses.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/classfile/stackMapTable.hpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/classfile/verifier.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/code/codeBlob.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/code/compiledIC.hpp	Wed Jul 05 19:53:19 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:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/code/nmethod.hpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/code/vmreg.hpp	Wed Jul 05 19:53:19 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:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/compiler/compileLog.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/compiler/oopMap.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.hpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentMarkThread.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegionSet.hpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/interpreter/bytecode.hpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/interpreter/bytecodeInterpreter.hpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/interpreter/bytecodeStream.hpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/interpreter/bytecodes.cpp	Wed Jul 05 19:53:19 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:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/interpreter/interpreter.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/interpreter/interpreter.hpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/interpreter/templateInterpreter.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/interpreter/templateInterpreter.hpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/interpreter/templateTable.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/interpreter/templateTable.hpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/memory/filemap.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/memory/genCollectedHeap.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/memory/genMarkSweep.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/memory/space.hpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/memory/threadLocalAllocBuffer.hpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/oops/constantPool.hpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/oops/method.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/oops/method.hpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/oops/methodData.hpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/oops/oop.inline.hpp	Wed Jul 05 19:53:19 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:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/opto/buildOopMap.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/opto/c2compiler.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/opto/compile.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/opto/gcm.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/opto/lcm.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/opto/library_call.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/opto/locknode.hpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/opto/matcher.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/opto/optoreg.hpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/opto/output.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/opto/output.hpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/opto/phaseX.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/opto/regmask.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/opto/regmask.hpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/opto/runtime.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/opto/runtime.hpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/precompiled/precompiled.hpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/prims/forte.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/prims/jniCheck.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/prims/jvm.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/prims/jvmtiClassFileReconstituter.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/prims/jvmtiTagMap.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/prims/unsafe.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/prims/whitebox.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/runtime/advancedThresholdPolicy.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/runtime/arguments.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/runtime/deoptimization.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/runtime/dtraceJSDT.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/runtime/dtraceJSDT.hpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/runtime/fprofiler.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/runtime/frame.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/runtime/frame.hpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/runtime/frame.inline.hpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/runtime/java.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/runtime/os.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/runtime/registerMap.hpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/runtime/relocator.hpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/runtime/rframe.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/runtime/safepoint.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/runtime/sharedRuntime.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/runtime/stackValueCollection.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/runtime/statSampler.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/runtime/stubRoutines.hpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/runtime/thread.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/runtime/thread.hpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/runtime/vframe.hpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/runtime/vframeArray.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/runtime/vmStructs.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/runtime/vm_operations.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/runtime/vm_version.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/runtime/vm_version.hpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/services/diagnosticCommand.hpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/services/diagnosticFramework.hpp	Wed Jul 05 19:53:19 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:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/utilities/debug.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/utilities/ostream.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/src/share/vm/utilities/vmError.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/test/TEST.groups	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/test/compiler/5091921/Test6890943.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ /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:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/test/compiler/6589834/Test_ia32.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/test/compiler/8004051/Test8004051.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/test/compiler/ciReplay/TestSA.sh	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/test/compiler/ciReplay/TestVM.sh	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/test/compiler/ciReplay/TestVM_no_comp_level.sh	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/test/compiler/ciReplay/common.sh	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/test/compiler/intrinsics/bmi/verifycode/BmiIntrinsicBase.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/test/compiler/intrinsics/bmi/verifycode/LZcntTestI.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/test/compiler/intrinsics/bmi/verifycode/LZcntTestL.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/test/compiler/intrinsics/bmi/verifycode/TZcntTestI.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/test/compiler/intrinsics/bmi/verifycode/TZcntTestL.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/test/compiler/tiered/NonTieredLevelsTest.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/test/compiler/tiered/TieredLevelsTest.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/test/compiler/whitebox/ClearMethodStateTest.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/test/compiler/whitebox/CompilerWhiteBoxTest.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/test/compiler/whitebox/DeoptimizeAllTest.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/test/compiler/whitebox/DeoptimizeMethodTest.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/test/compiler/whitebox/EnqueueMethodForCompilationTest.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/test/compiler/whitebox/GetNMethodTest.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/test/compiler/whitebox/MakeMethodNotCompilableTest.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/test/runtime/whitebox/WBStackSize.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/test/testlibrary/whitebox/sun/hotspot/WhiteBox.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/hotspot/test/testlibrary_tests/whitebox/vm_flags/VmFlagTest.java	Wed Jul 05 19:53:19 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/jdk/.hgtags	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/.hgtags	Wed Jul 05 19:53:19 2017 +0200
@@ -267,3 +267,4 @@
 85bcf0f99edc08873614afbe5a5563e13ce13c83 jdk9-b22
 9febf9dbc0a4b15323f2dbd29931cfbf086332b4 jdk9-b23
 875450e7ef8dde8f59db662ec1351ea30b8cb35d jdk9-b24
+a31efe49556a7c12f9ea2c9ee8b4fae8aa67723a jdk9-b25
--- a/jdk/make/CopyFiles.gmk	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/make/CopyFiles.gmk	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/make/CopyIntoClasses.gmk	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/make/Setup.gmk	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/make/data/swingbeaninfo/SwingBeanInfo.template	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/make/data/swingbeaninfo/javax/swing/SwingBeanInfoBase.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/make/data/swingbeaninfo/sun/swing/BeanInfoUtils.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/make/lib/PlatformLibraries.gmk	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/make/mapfiles/libawt/mapfile-mawt-vers	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/make/mapfiles/libawt_headless/mapfile-vers	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/make/mapfiles/libawt_xawt/mapfile-vers	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/make/profile-includes.txt	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ /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	Fri Aug 01 14:09:06 2014 -0700
+++ /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	Fri Aug 01 14:09:06 2014 -0700
+++ /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	Fri Aug 01 14:09:06 2014 -0700
+++ /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	Fri Aug 01 14:09:06 2014 -0700
+++ /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	Fri Aug 01 14:09:06 2014 -0700
+++ /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	Fri Aug 01 14:09:06 2014 -0700
+++ /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	Fri Aug 01 14:09:06 2014 -0700
+++ /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	Fri Aug 01 14:09:06 2014 -0700
+++ /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	Fri Aug 01 14:09:06 2014 -0700
+++ /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	Fri Aug 01 14:09:06 2014 -0700
+++ /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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/macosx/classes/apple/security/KeychainStore.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/macosx/classes/com/apple/eawt/_AppDockIconHandler.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/macosx/classes/com/apple/laf/AquaBorder.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxButton.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxPopup.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxRenderer.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxRendererInternal.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxUI.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/macosx/classes/com/apple/laf/AquaFileChooserUI.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/macosx/classes/com/apple/laf/AquaFocusHandler.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/macosx/classes/com/apple/laf/AquaListUI.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/macosx/classes/com/apple/laf/AquaTabbedPaneCopyFromBasicUI.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/macosx/classes/com/apple/laf/AquaTableHeaderUI.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/macosx/classes/com/apple/laf/AquaUtilControlSize.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/macosx/classes/com/apple/laf/AquaUtils.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/macosx/classes/com/apple/laf/ClientPropertyApplicator.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/macosx/classes/com/apple/laf/ScreenMenuBar.java	Wed Jul 05 19:53:19 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:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CDragSourceContextPeer.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CInputMethod.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CInputMethodDescriptor.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ /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	Fri Aug 01 14:09:06 2014 -0700
+++ /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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/macosx/native/sun/awt/splashscreen/splashscreen_sys.m	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/bin/java.c	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/bin/jli_util.h	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/com/sun/imageio/plugins/bmp/BMPMetadata.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGMetadata.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/com/sun/imageio/plugins/png/PNGImageReader.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/com/sun/imageio/plugins/png/PNGMetadata.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/com/sun/imageio/plugins/wbmp/WBMPMetadata.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKLookAndFeel.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/com/sun/java/swing/plaf/motif/MotifLookAndFeel.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/cosnaming/CNCtx.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/dns/DnsClient.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/AbstractLdapNamingEnumeration.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/ClientId.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/EventQueue.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/EventSupport.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/LdapAttribute.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/LdapCtx.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/LdapName.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/LdapReferralContext.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/LdapRequest.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/LdapSchemaParser.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/LdapSearchEnumeration.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/LdapURL.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/ServiceLocator.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/VersionHelper.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ /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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/pool/Connections.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/pool/Pool.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/toolkit/corba/CorbaUtils.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/AtomicContext.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/ComponentContext.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/Continuation.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/toolkit/dir/ContextEnumerator.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/toolkit/dir/HierMemDirCtx.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/toolkit/dir/LazySearchEnumerationImpl.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/toolkit/dir/SearchFilter.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/toolkit/url/GenericURLContext.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/url/ldap/ldapURLContext.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/com/sun/management/GcInfo.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/com/sun/naming/internal/ResourceManager.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/com/sun/naming/internal/VersionHelper.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ /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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/com/sun/tools/example/debug/expr/ExpressionParser.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/model/JavaClass.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/model/JavaHeapObject.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/model/ReachableExcludesImpl.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/model/ReachableObjects.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/model/Snapshot.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/oql/OQLEngine.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/server/AllClassesQuery.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/server/ClassQuery.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/server/FinalizerObjectsQuery.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/server/FinalizerSummaryQuery.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/server/InstancesCountQuery.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/server/InstancesQuery.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/server/RefsByTypeQuery.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/util/CompositeEnumeration.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/com/sun/tools/jdi/EventRequestManagerImpl.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/java/awt/Color.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/java/awt/Font.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/java/awt/Graphics.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/java/awt/MenuComponent.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/java/awt/Polygon.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/java/awt/Rectangle.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/java/awt/Toolkit.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/java/awt/color/ColorSpace.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/java/awt/color/ICC_ColorSpace.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/java/awt/datatransfer/SystemFlavorMap.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/java/awt/font/TextAttribute.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/java/awt/geom/Arc2D.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/java/awt/image/AffineTransformOp.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/java/awt/image/BufferedImageFilter.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/java/awt/image/ImageFilter.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/java/awt/image/WritableRaster.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/java/awt/image/renderable/ParameterBlock.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/java/awt/print/PrinterJob.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/java/beans/EventHandler.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/java/beans/MetaData.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/java/beans/NameGenerator.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/java/lang/reflect/Modifier.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/java/time/chrono/JapaneseEra.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/java/util/Collections.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/java/util/DoubleSummaryStatistics.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/java/util/stream/DoubleStream.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/imageio/package.html	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/imageio/spi/PartiallyOrderedSet.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/naming/Context.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/naming/InitialContext.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/naming/directory/DirContext.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/naming/ldap/LdapContext.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/naming/ldap/Rdn.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/naming/ldap/SortControl.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/naming/spi/NamingManager.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/Doc.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/DocFlavor.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/PrintService.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/PrintServiceLookup.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/ServiceUI.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/ServiceUIFactory.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/SimpleDoc.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/StreamPrintServiceFactory.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/attribute/Attribute.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/attribute/DateTimeSyntax.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/attribute/DocAttribute.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/attribute/DocAttributeSet.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/attribute/EnumSyntax.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/attribute/HashAttributeSet.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/attribute/HashDocAttributeSet.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/attribute/HashPrintJobAttributeSet.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/attribute/HashPrintRequestAttributeSet.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/attribute/HashPrintServiceAttributeSet.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/attribute/IntegerSyntax.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/attribute/PrintJobAttribute.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/attribute/PrintJobAttributeSet.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/attribute/PrintRequestAttribute.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/attribute/PrintRequestAttributeSet.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/attribute/PrintServiceAttribute.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/attribute/PrintServiceAttributeSet.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/attribute/ResolutionSyntax.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/attribute/SetOfIntegerSyntax.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/attribute/Size2DSyntax.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/attribute/SupportedValuesAttribute.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/attribute/TextSyntax.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/attribute/URISyntax.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/attribute/package.html	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/attribute/standard/ColorSupported.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/attribute/standard/Compression.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/attribute/standard/CopiesSupported.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/attribute/standard/DateTimeAtCompleted.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/attribute/standard/DateTimeAtCreation.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/attribute/standard/DateTimeAtProcessing.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/attribute/standard/Destination.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/attribute/standard/DialogTypeSelection.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/attribute/standard/DocumentName.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/attribute/standard/JobHoldUntil.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/attribute/standard/JobImpressions.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/attribute/standard/JobImpressionsCompleted.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/attribute/standard/JobImpressionsSupported.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/attribute/standard/JobKOctets.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/attribute/standard/JobKOctetsProcessed.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/attribute/standard/JobKOctetsSupported.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/attribute/standard/JobMediaSheets.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/attribute/standard/JobMediaSheetsCompleted.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/attribute/standard/JobMediaSheetsSupported.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/attribute/standard/JobMessageFromOperator.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/attribute/standard/JobName.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/attribute/standard/JobOriginatingUserName.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/attribute/standard/JobPriority.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/attribute/standard/JobPrioritySupported.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/attribute/standard/JobSheets.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/attribute/standard/JobState.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/attribute/standard/JobStateReason.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/attribute/standard/JobStateReasons.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/attribute/standard/Media.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/attribute/standard/MediaSize.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/attribute/standard/NumberOfDocuments.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/attribute/standard/NumberOfInterveningJobs.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/attribute/standard/NumberUpSupported.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/attribute/standard/OrientationRequested.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/attribute/standard/OutputDeviceAssigned.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/attribute/standard/PDLOverrideSupported.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/attribute/standard/PagesPerMinute.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/attribute/standard/PagesPerMinuteColor.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/attribute/standard/PresentationDirection.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/attribute/standard/PrintQuality.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/attribute/standard/PrinterInfo.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/attribute/standard/PrinterIsAcceptingJobs.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/attribute/standard/PrinterLocation.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/attribute/standard/PrinterMakeAndModel.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/attribute/standard/PrinterMessageFromOperator.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/attribute/standard/PrinterMoreInfo.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/attribute/standard/PrinterMoreInfoManufacturer.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/attribute/standard/PrinterName.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/attribute/standard/PrinterResolution.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/attribute/standard/PrinterState.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/attribute/standard/PrinterStateReason.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/attribute/standard/PrinterStateReasons.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/attribute/standard/PrinterURI.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/attribute/standard/QueuedJobCount.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/attribute/standard/ReferenceUriSchemesSupported.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/attribute/standard/RequestingUserName.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/attribute/standard/Severity.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/attribute/standard/SheetCollate.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/attribute/standard/package.html	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/event/package.html	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/print/package.html	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/sound/midi/MidiSystem.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/AbstractAction.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/CellRendererPane.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/DebugGraphics.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/DefaultBoundedRangeModel.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/DefaultDesktopManager.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/DefaultSingleSelectionModel.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/DesktopManager.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/GrayFilter.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/Icon.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/JApplet.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/JComponent.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/JDesktopPane.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/JDialog.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/JEditorPane.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/JInternalFrame.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/JLabel.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/JLayeredPane.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/JPopupMenu.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/JScrollBar.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/JScrollPane.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/JSpinner.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/JTextField.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/JWindow.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/LookAndFeel.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/ProgressMonitor.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/SortingFocusTraversalPolicy.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/SpinnerModel.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/Timer.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/filechooser/FileSystemView.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicArrowButton.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicBorders.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicButtonListener.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicButtonUI.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicCheckBoxMenuItemUI.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicCheckBoxUI.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicColorChooserUI.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboBoxEditor.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboBoxRenderer.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboBoxUI.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboPopup.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicDesktopIconUI.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicDesktopPaneUI.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicDirectoryModel.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicGraphicsUtils.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicHTML.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicIconFactory.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicInternalFrameTitlePane.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicLabelUI.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicListUI.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicLookAndFeel.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicMenuBarUI.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicMenuItemUI.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicMenuUI.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicOptionPaneUI.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicPanelUI.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicPopupMenuSeparatorUI.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicPopupMenuUI.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicProgressBarUI.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicRadioButtonMenuItemUI.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicRadioButtonUI.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicRootPaneUI.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicScrollPaneUI.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicSeparatorUI.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicSpinnerUI.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicSplitPaneDivider.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicSplitPaneUI.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicTableHeaderUI.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicTableUI.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicTextUI.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicToggleButtonUI.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicToolBarSeparatorUI.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicToolBarUI.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicToolTipUI.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicTreeUI.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicViewportUI.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/ComboPopup.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/DefaultMenuLayout.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/metal/MetalLookAndFeel.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/nimbus/Defaults.template	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/nimbus/StateImpl.template	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthParser.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthStyle.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/text/JTextComponent.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/text/html/CSS.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/text/html/HTMLDocument.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/text/rtf/RTFGenerator.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/jdk/nio/zipfs/ZipFileAttributeView.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/jdk/nio/zipfs/ZipFileSystemProvider.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/applet/AppletClassLoader.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/applet/AppletImageRef.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/applet/AppletObjectInputStream.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/applet/AppletPanel.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/applet/AppletProps.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/applet/AppletSecurity.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/applet/AppletViewer.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/applet/AppletViewerFactory.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/applet/AppletViewerPanel.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/applet/Main.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ /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	Fri Aug 01 14:09:06 2014 -0700
+++ /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	Fri Aug 01 14:09:06 2014 -0700
+++ /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	Fri Aug 01 14:09:06 2014 -0700
+++ /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	Fri Aug 01 14:09:06 2014 -0700
+++ /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	Fri Aug 01 14:09:06 2014 -0700
+++ /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	Fri Aug 01 14:09:06 2014 -0700
+++ /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	Fri Aug 01 14:09:06 2014 -0700
+++ /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	Fri Aug 01 14:09:06 2014 -0700
+++ /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	Fri Aug 01 14:09:06 2014 -0700
+++ /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	Fri Aug 01 14:09:06 2014 -0700
+++ /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	Fri Aug 01 14:09:06 2014 -0700
+++ /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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/awt/AWTAccessor.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/java2d/SunGraphics2D.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/java2d/cmm/lcms/LCMSImageLayout.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/net/www/protocol/ftp/FtpURLConnection.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/print/CustomMediaSizeName.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/print/PSPrinterJob.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/print/RasterPrinterJob.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/print/ServiceDialog.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/security/provider/SecureRandom.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/security/ssl/DHCrypt.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/security/ssl/ECDHCrypt.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/security/ssl/Handshaker.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/swing/PrintingStatus.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/swing/SwingUtilities2.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/tools/asm/Assembler.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/tools/asm/ConstantPool.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/tools/asm/SwitchData.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/tools/java/BinaryClass.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/tools/java/BinaryConstantPool.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/tools/java/BinaryMember.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/tools/java/ClassDefinition.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/tools/java/ClassPath.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/tools/java/Identifier.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/tools/java/Imports.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/tools/java/MemberDefinition.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/tools/java/MethodSet.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/tools/java/Package.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/tools/java/Parser.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/tools/java/Type.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/tools/javac/BatchEnvironment.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/tools/javac/BatchParser.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/tools/javac/CompilerMember.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/tools/javac/Main.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/tools/javac/SourceClass.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/tools/javac/SourceMember.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/tools/tree/AndExpression.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/tools/tree/ArrayAccessExpression.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/tools/tree/ArrayExpression.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/tools/tree/AssignExpression.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/tools/tree/AssignOpExpression.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/tools/tree/BinaryAssignExpression.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/tools/tree/BinaryExpression.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/tools/tree/BinaryLogicalExpression.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/tools/tree/BooleanExpression.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/tools/tree/BreakStatement.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/tools/tree/CaseStatement.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/tools/tree/CastExpression.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/tools/tree/CatchStatement.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/tools/tree/CommaExpression.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/tools/tree/CompoundStatement.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/tools/tree/ConditionalExpression.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/tools/tree/ContinueStatement.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/tools/tree/ConvertExpression.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/tools/tree/DeclarationStatement.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/tools/tree/DoStatement.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/tools/tree/ExprExpression.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/tools/tree/Expression.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/tools/tree/ExpressionStatement.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/tools/tree/FieldExpression.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/tools/tree/FinallyStatement.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/tools/tree/ForStatement.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/tools/tree/IdentifierExpression.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/tools/tree/IfStatement.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/tools/tree/IncDecExpression.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/tools/tree/InstanceOfExpression.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/tools/tree/LengthExpression.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/tools/tree/LocalMember.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/tools/tree/MethodExpression.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/tools/tree/NewArrayExpression.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/tools/tree/NewInstanceExpression.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/tools/tree/NotExpression.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/tools/tree/OrExpression.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/tools/tree/ReturnStatement.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/tools/tree/Statement.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/tools/tree/SuperExpression.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/tools/tree/SwitchStatement.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/tools/tree/SynchronizedStatement.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/tools/tree/ThisExpression.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/tools/tree/ThrowStatement.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/tools/tree/TryStatement.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/tools/tree/TypeExpression.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/tools/tree/UnaryExpression.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/tools/tree/VarDeclarationStatement.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/tools/tree/WhileStatement.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/classes/sun/tools/util/CommandLine.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/native/sun/awt/image/awt_parseImage.c	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/native/sun/java2d/opengl/OGLBufImgOps.c	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/share/native/sun/tracing/dtrace/JVM.c	Wed Jul 05 19:53:19 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:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/solaris/classes/sun/nio/ch/InheritedChannel.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/solaris/classes/sun/print/CUPSPrinter.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/solaris/classes/sun/print/IPPPrintService.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ /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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/solaris/native/sun/awt/CUPSfuncs.c	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/solaris/native/sun/awt/gtk2_interface.c	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/solaris/native/sun/java2d/x11/X11PMBlitLoops.c	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/solaris/native/sun/java2d/x11/X11SurfaceData.c	Wed Jul 05 19:53:19 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:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ /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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/windows/native/sun/java2d/d3d/D3DBufImgOps.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/windows/native/sun/nio/ch/FileDispatcherImpl.c	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/windows/native/sun/security/mscapi/security.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/windows/native/sun/windows/awt_Component.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/src/windows/native/sun/windows/awt_List.cpp	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/test/ProblemList.txt	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/test/com/sun/jdi/ExclusiveBind.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/test/com/sun/org/apache/xml/internal/security/transforms/ClassLoaderTest.java	Wed Jul 05 19:53:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/test/java/awt/Modal/helpers/TestDialog.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/test/java/awt/Modal/helpers/TestFrame.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/test/java/awt/Modal/helpers/TestWindow.java	Wed Jul 05 19:53:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/test/java/lang/ProcessBuilder/Basic.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/test/java/lang/reflect/Modifier/toStringTest.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/test/java/util/Collections/CheckedListReplaceAll.java	Wed Jul 05 19:53:19 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:19 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:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/test/javax/management/monitor/StartStopTest.java	Wed Jul 05 19:53:19 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:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/test/javax/naming/InitialContext/NoApplet.java	Wed Jul 05 19:53:19 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:19 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:19 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:19 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:19 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:19 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:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/test/lib/testlibrary/jdk/testlibrary/ProcessThread.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/test/lib/testlibrary/jdk/testlibrary/ProcessTools.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/test/lib/testlibrary/jdk/testlibrary/Utils.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/test/sun/awt/image/bug8038000.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/test/sun/net/ftp/FtpURL.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/test/sun/security/pkcs11/ec/ReadCertificates.java	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/jdk/test/tools/launcher/TestSpecialArgs.java	Wed Jul 05 19:53:19 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/make/Jprt.gmk	Fri Aug 01 14:09:06 2014 -0700
+++ b/make/Jprt.gmk	Wed Jul 05 19:53:19 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	Fri Aug 01 14:09:06 2014 -0700
+++ b/make/jprt.properties	Wed Jul 05 19:53:19 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,		\